Soprano  2.9.4
pluginmanager.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _SOPRANO_PLUGIN_MANAGER_H_
23 #define _SOPRANO_PLUGIN_MANAGER_H_
24 
25 #include "sopranotypes.h"
26 #include "soprano_export.h"
27 
28 #include <QtCore/QObject>
29 #include <QtCore/QStringList>
30 
31 
32 namespace Soprano
33 {
34  class Backend;
35  class Parser;
36  class Serializer;
37 
38  namespace Query {
39  class Parser;
40  class Serializer;
41  }
42 
56  {
57  Q_OBJECT
58 
59  public:
60  ~PluginManager();
61 
63 
75  void setPluginSearchPath( const QStringList& path, bool useDefaults = true );
76 
91  bool loadCustomPlugin( const QString& path );
92 
106  const Backend* loadCustomBackend( const QString& path );
107 
121  const Parser* loadCustomParser( const QString& path );
122 
136  const Serializer* loadCustomSerializer( const QString& path );
138 
140 
146  const Backend* discoverBackendByName( const QString& name );
147 
156  const Backend* discoverBackendByFeatures( BackendFeatures features, const QStringList& userFeatures = QStringList() );
157 
158  QList<const Backend*> allBackends();
160 
162 
168  const Parser* discoverParserByName( const QString& name );
169 
182  const Parser* discoverParserForSerialization( RdfSerialization serialization, const QString& userSerialization = QString() );
183 
184  QList<const Parser*> allParsers();
186 
188 
194  const Serializer* discoverSerializerByName( const QString& name );
195 
208  const Serializer* discoverSerializerForSerialization( RdfSerialization serialization, const QString& userSerialization = QString() );
209 
210  QList<const Serializer*> allSerializers();
212 
222 // const Query::Parser* discoverQueryParserByName( const QString& name );
223 
234 // const Query::Parser* discoverQueryParserForQueryLanguage( Query::QueryLanguage lang, const QString& userQueryLanguage = QString() );
235 
236 // QList<const Query::Parser*> allQueryParsers();
238 
240 
246 // const Query::Serializer* discoverQuerySerializerByName( const QString& name );
247 
258 // const Query::Serializer* discoverQuerySerializerForQueryLanguage( Query::QueryLanguage lang, const QString& userQueryLanguage = QString() );
259 
260 // QList<const Query::Serializer*> allQuerySerializers();
262 
268  static PluginManager* instance();
269 
270  private:
271  PluginManager( QObject* parent = 0 );
272  void loadAllPlugins();
273  void loadPlugin( const QString& path );
274  void loadPlugins( const QString& path );
275 
276  class Private;
277  Private* const d;
278 
279  friend class PluginManagerFactory;
280  };
281 }
282 
283 #endif