/usr/include/soprano/pluginmanager.h is in libsoprano-dev 2.9.4+dfsg-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | /*
* This file is part of Soprano Project.
*
* Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _SOPRANO_PLUGIN_MANAGER_H_
#define _SOPRANO_PLUGIN_MANAGER_H_
#include "sopranotypes.h"
#include "soprano_export.h"
#include <QtCore/QObject>
#include <QtCore/QStringList>
namespace Soprano
{
class Backend;
class Parser;
class Serializer;
namespace Query {
class Parser;
class Serializer;
}
/**
* \class PluginManager pluginmanager.h Soprano/PluginManager
*
* \brief The PluginManager loads and maintains all %Soprano plugins.
*
* Normally there is no need to use this class as all important methods have
* global counterparts in the Soprano namespace.
*
* \sa \ref soprano_writing_plugins
*
* \author Sebastian Trueg <trueg@kde.org>
*/
class SOPRANO_EXPORT PluginManager : public QObject
{
Q_OBJECT
public:
~PluginManager();
//@{
/**
* Set the plugin search path. The PluginManager searches a set of folders for installed
* plugins. Here a plugin consists of a desktop file describing it and the actual plugin
* library file. For loading custom plugins manually see loadCustomPlugin.
*
* \param path The folders that PluginManager should search for plugin description files.
* \param useDefaults If true PluginManager will also search the default plugin paths
*
* \sa \ref soprano_writing_plugins
*
* \since 2.3
*/
void setPluginSearchPath( const QStringList& path, bool useDefaults = true );
/**
* Load a custom plugin from a library at the specified path.
*
* \param path The path to the library file that contains the plugin. Be aware that
* plugins loaded via this method do not need a desktop file as described
*
* PluginManager uses the name the plugin provides (Plugin::pluginName)
* to manage the plugin.
*
* \return \p true if the plugin could be loaded successfully, \p false
* if no suported plugin could be found at path.
*
* \since 2.3
*/
bool loadCustomPlugin( const QString& path );
/**
* Load a custom Backend plugin from a library at the specified path.
*
* \param path The path to the library file that contains the plugin.
*
* PluginManager uses the name the plugin provides (Plugin::pluginName)
* to manage the plugin.
*
* \return The loaded Backend plugin or 0 in case no suported plugin could
* be found at path or the found plugin is not a backend.
*
* \since 2.3
*/
const Backend* loadCustomBackend( const QString& path );
/**
* Load a custom Parser plugin from a library at the specified path.
*
* \param path The path to the library file that contains the plugin.
*
* PluginManager uses the name the plugin provides (Plugin::pluginName)
* to manage the plugin.
*
* \return The loaded Parser plugin or 0 in case no suported plugin could
* be found at path or the found plugin is not a backend.
*
* \since 2.3
*/
const Parser* loadCustomParser( const QString& path );
/**
* Load a custom Serializer plugin from a library at the specified path.
*
* \param path The path to the library file that contains the plugin.
*
* PluginManager uses the name the plugin provides (Plugin::pluginName)
* to manage the plugin.
*
* \return The loaded Serializer plugin or 0 in case no suported plugin could
* be found at path or the found plugin is not a backend.
*
* \since 2.3
*/
const Serializer* loadCustomSerializer( const QString& path );
//@}
//@{
/**
* Find a backend plugin by its name.
*
* \return the backend specified by \a name or null if could not
* be found.
*/
const Backend* discoverBackendByName( const QString& name );
/**
* Find a backend plugin by its features.
*
* \param features The features that are requested, a combination of Soprano::BackendFeature flags.
* \param userFeatures If features contain Backend::BackendFeatureUser this paramter states the additionally requested user features.
*
* \return a Backend that supports the features defined in \a features.
*/
const Backend* discoverBackendByFeatures( BackendFeatures features, const QStringList& userFeatures = QStringList() );
QList<const Backend*> allBackends();
//@}
//@{
/**
* Find a parser plugin by its name.
*
* \return the parser specified by \a name or null if could not
* be found.
*/
const Parser* discoverParserByName( const QString& name );
/**
* Find a Parser instance that is able to parse RDF data serialized as
* serialization.
*
* \param serialization The requested serialization.
* \param userSerialization If serialization is set to Soprano::SerializationUser this parameter specifies the
* serialization to use. It allows the extension of the %Soprano Parser interface with new
* RDF serializations that are not officially supported by %Soprano.
*
* \return A Parser plugin that can parse RDF data encoded in the requested
* serialization or 0 if no such plugin could be found.
*/
const Parser* discoverParserForSerialization( RdfSerialization serialization, const QString& userSerialization = QString() );
QList<const Parser*> allParsers();
//@}
//@{
/**
* Find a serializer plugin by its name.
*
* \return the serializer specified by \a name or null if could not
* be found.
*/
const Serializer* discoverSerializerByName( const QString& name );
/**
* Find a Serializer instance that is able to encode RDF data using
* serialization.
*
* \param serialization The requested serialization.
* \param userSerialization If serialization is set to Soprano::SerializationUser this parameter specifies the
* serialization to use. It allows the extension of the %Soprano Serializer interface with new
* RDF serializations that are not officially supported by %Soprano.
*
* \return A Serializer plugin that can serialize RDF data encoded in the requested
* serialization or 0 if no such plugin could be found.
*/
const Serializer* discoverSerializerForSerialization( RdfSerialization serialization, const QString& userSerialization = QString() );
QList<const Serializer*> allSerializers();
//@}
/** \cond query_api_disabled */
//@{
/**
* Find a query parser plugin by its name.
*
* \return the query parser specified by \a name or null if could not
* be found.
*/
// const Query::Parser* discoverQueryParserByName( const QString& name );
/**
* Find a Query::Parser instance that is able to parse the specified query language.
*
* \param lang The language the plugin is supposed to support.
* \param userQueryLanguage If lang is set to Query::QueryLanguageUser this parameter specifies the
* query language to use. It allows the extension of the %Soprano Query interface with new
* query languages that are not officially supported by %Soprano.
*
* \return A Query::Parser plugin that can parse query language lang or 0 if no such plugin could be found.
*/
// const Query::Parser* discoverQueryParserForQueryLanguage( Query::QueryLanguage lang, const QString& userQueryLanguage = QString() );
// QList<const Query::Parser*> allQueryParsers();
//@}
//@{
/**
* Find a query serializer plugin by its name.
*
* \return the query serializer specified by \a name or null if could not
* be found.
*/
// const Query::Serializer* discoverQuerySerializerByName( const QString& name );
/**
* Find a Query::Serializer instance that is able to serialize the specified query language.
*
* \param lang The language the plugin is supposed to support.
* \param userQueryLanguage If lang is set to Query::QueryLanguageUser this parameter specifies the
* query language to use. It allows the extension of the %Soprano Query interface with new
* query languages that are not officially supported by %Soprano.
*
* \return A Query::Serializer plugin that can parse query language lang or 0 if no such plugin could be found.
*/
// const Query::Serializer* discoverQuerySerializerForQueryLanguage( Query::QueryLanguage lang, const QString& userQueryLanguage = QString() );
// QList<const Query::Serializer*> allQuerySerializers();
//@}
/** \endcond query_api_disabled */
/**
* Get the singleton instance of the PluginManager
*/
static PluginManager* instance();
private:
PluginManager( QObject* parent = 0 );
void loadAllPlugins();
void loadPlugin( const QString& path );
void loadPlugins( const QString& path );
class Private;
Private* const d;
friend class PluginManagerFactory;
};
}
#endif
|