00001 /* 00002 * This file is part of Soprano Project. 00003 * 00004 * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef _SOPRANO_PLUGIN_MANAGER_H_ 00023 #define _SOPRANO_PLUGIN_MANAGER_H_ 00024 00025 #include "sopranotypes.h" 00026 #include "soprano_export.h" 00027 00028 #include <QtCore/QObject> 00029 #include <QtCore/QStringList> 00030 00031 00032 namespace Soprano 00033 { 00034 class Backend; 00035 class Parser; 00036 class Serializer; 00037 00038 namespace Query { 00039 class Parser; 00040 class Serializer; 00041 } 00042 00055 class SOPRANO_EXPORT PluginManager : public QObject 00056 { 00057 Q_OBJECT 00058 00059 public: 00060 ~PluginManager(); 00061 00063 00075 void setPluginSearchPath( const QStringList& path, bool useDefaults = true ); 00077 00079 00085 const Backend* discoverBackendByName( const QString& name ); 00086 00095 const Backend* discoverBackendByFeatures( BackendFeatures features, const QStringList& userFeatures = QStringList() ); 00096 00097 QList<const Backend*> allBackends(); 00099 00101 00107 const Parser* discoverParserByName( const QString& name ); 00108 00121 const Parser* discoverParserForSerialization( RdfSerialization serialization, const QString& userSerialization = QString() ); 00122 00123 QList<const Parser*> allParsers(); 00125 00127 00133 const Serializer* discoverSerializerByName( const QString& name ); 00134 00147 const Serializer* discoverSerializerForSerialization( RdfSerialization serialization, const QString& userSerialization = QString() ); 00148 00149 QList<const Serializer*> allSerializers(); 00151 00161 // const Query::Parser* discoverQueryParserByName( const QString& name ); 00162 00173 // const Query::Parser* discoverQueryParserForQueryLanguage( Query::QueryLanguage lang, const QString& userQueryLanguage = QString() ); 00174 00175 // QList<const Query::Parser*> allQueryParsers(); 00177 00179 00185 // const Query::Serializer* discoverQuerySerializerByName( const QString& name ); 00186 00197 // const Query::Serializer* discoverQuerySerializerForQueryLanguage( Query::QueryLanguage lang, const QString& userQueryLanguage = QString() ); 00198 00199 // QList<const Query::Serializer*> allQuerySerializers(); 00201 00207 static PluginManager* instance(); 00208 00209 private: 00210 PluginManager( QObject* parent = 0 ); 00211 void loadAllPlugins(); 00212 void loadPlugin( const QString& path ); 00213 void loadPlugins( const QString& path ); 00214 00215 class Private; 00216 Private* const d; 00217 }; 00218 } 00219 00220 #endif