/usr/include/nepomuk/nepomukservice.h is in kdelibs5-dev 4:4.8.4-4+deb7u1.
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 | /* This file is part of the KDE Project
Copyright (c) 2008 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 version 2 as published by the Free Software Foundation.
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 _NEPOMUK_SERVICE_H_
#define _NEPOMUK_SERVICE_H_
#include <QtCore/QObject>
#include "nepomuk_export.h"
namespace Soprano {
class Model;
}
namespace Nepomuk {
/**
* \class Service nepomukservice.h Nepomuk/Service
*
* \brief Base class for all Nepomuk services.
*
* A %Nepomuk service is intended to perform some kind of
* operation on the %Nepomuk data storage. This can include
* data gathering, data enrichment, or enhanced data query.
*
* %Nepomuk services are started and managed by the %Nepomuk
* server. Very much like KDED modules a %Nepomuk service
* has autostart and start-on-demand properties. In addition
* a %Nepomuk service can define an arbitrary number of
* dependencies which are necessary to run the service. These
* dependencies name other services.
*
* To create a new %Nepomuk service one derives a new class from
* Nepomuk::Service and exports it as a standard KDE module, i.e.
* plugin.
*
* \code
* class MyService : public Nepomuk::Service
* {
* // do fancy stuff
* };
* \endcode
*
* Export it as a %Nepomuk service plugin:
*
* \code
* NEPOMUK_EXPORT_SERVICE(MyService, "mynepomukservice")
* \endcode
*
* A desktop file describes the service's properties:
*
* \code
* [Desktop Entry]
* Type=Service
* X-KDE-ServiceTypes=NepomukService
* X-KDE-Library=mynepomukservice
* X-KDE-Nepomuk-autostart=true
* X-KDE-Nepomuk-start-on-demand=false
* # Dependencies default to 'nepomukstorage'
* X-KDE-Nepomuk-dependencies=nepomukfoobar
* Name=My fancy Nepomuk Service
* Comment=A Nepomuk service that does fancy things
* \endcode
*
* The %Nepomuk server will automatically export all D-Bus
* interfaces defined on the service instance. Thus, the
* simplest way to export methods via D-Bus is by marking
* them with Q_SCRIPTABLE.
*
* \author Sebastian Trueg <trueg@kde.org>
*
* \since 4.1
*/
class NEPOMUK_EXPORT Service : public QObject
{
Q_OBJECT
public:
/**
* Create a new Service.
*
* \param parent The parent object
* \param delayedInitialization If \p true the service will not
* be usable until setServiceInitialized has been called.
* This allows to design services that need to perform
* long initialization tasks.
*/
Service( QObject* parent = 0, bool delayedInitialization = false );
/**
* Destructor
*/
virtual ~Service();
protected:
/**
* \return A wrapper model which provides
* a connection to the %Nepomuk server.
*/
Soprano::Model* mainModel();
/**
* A %Nepomuk service can make use of a warmup phase in which
* it is not usable yet. Call this method once your service
* is fully initialized.
*
* Most services do not need to call this method.
*
* \param success Set to \c true if initialization was
* successful, \c false otherwise.
*
* \sa Service::Service
*/
void setServiceInitialized( bool success );
private:
class Private;
Private* const d;
};
}
/**
* Export a %Nepomuk service.
*
* \param classname The name of the Nepomuk::Service subclass to export.
* \param libname The name of the library which should export the service.
*/
#define NEPOMUK_EXPORT_SERVICE( classname, libname ) \
K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
K_EXPORT_PLUGIN(factory(#libname))
#endif
|