00001 /* 00002 * This file is part of Soprano Project. 00003 * 00004 * Copyright (C) 2007 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 00069 const Backend* discoverBackendByName( const QString& name ); 00070 00079 const Backend* discoverBackendByFeatures( BackendFeatures features, const QStringList& userFeatures = QStringList() ); 00080 00081 QList<const Backend*> allBackends(); 00083 00085 00091 const Parser* discoverParserByName( const QString& name ); 00092 00105 const Parser* discoverParserForSerialization( RdfSerialization serialization, const QString& userSerialization = QString() ); 00106 00107 QList<const Parser*> allParsers(); 00109 00111 00117 const Serializer* discoverSerializerByName( const QString& name ); 00118 00131 const Serializer* discoverSerializerForSerialization( RdfSerialization serialization, const QString& userSerialization = QString() ); 00132 00133 QList<const Serializer*> allSerializers(); 00135 00145 // const Query::Parser* discoverQueryParserByName( const QString& name ); 00146 00157 // const Query::Parser* discoverQueryParserForQueryLanguage( Query::QueryLanguage lang, const QString& userQueryLanguage = QString() ); 00158 00159 // QList<const Query::Parser*> allQueryParsers(); 00161 00163 00169 // const Query::Serializer* discoverQuerySerializerByName( const QString& name ); 00170 00181 // const Query::Serializer* discoverQuerySerializerForQueryLanguage( Query::QueryLanguage lang, const QString& userQueryLanguage = QString() ); 00182 00183 // QList<const Query::Serializer*> allQuerySerializers(); 00185 00191 static PluginManager* instance(); 00192 00193 private: 00194 PluginManager( QObject* parent = 0 ); 00195 void loadAllPlugins(); 00196 void loadPlugin( const QString& path ); 00197 void loadPlugins( const QString& path ); 00198 00199 class Private; 00200 Private* const d; 00201 }; 00202 } 00203 00204 #endif