20 #ifndef PLASMA_SERVICE_H
21 #define PLASMA_SERVICE_H
23 #include <QtCore/QMap>
24 #include <QtCore/QObject>
25 #include <QtCore/QVariant>
27 #include <kconfiggroup.h>
33 class QGraphicsObject;
95 Q_PROPERTY(QString destination READ destination WRITE setDestination)
96 Q_PROPERTY(QStringList operationNames READ operationNames)
97 Q_PROPERTY(QString name READ name)
115 static Service *load(const QString &name, const QVariantList &args,
QObject *parent = 0);
125 static Service *load(const QString &name,
QObject *parent = 0);
131 static Service *access(const KUrl &url,
QObject *parent = 0);
139 Q_INVOKABLE
void setDestination(const QString &destination);
144 Q_INVOKABLE QString destination() const;
149 Q_INVOKABLE QStringList operationNames() const;
157 Q_INVOKABLE KConfigGroup operationDescription(const QString &operationName);
166 Q_INVOKABLE
ServiceJob *startOperationCall(const KConfigGroup &description,
QObject *parent = 0);
174 Q_INVOKABLE
bool isOperationEnabled(const QString &operation) const;
179 Q_INVOKABLE QString name() const;
191 Q_INVOKABLE
void associateWidget(
QWidget *widget, const QString &operation);
201 Q_INVOKABLE
void disassociateWidget(
QWidget *widget);
208 Q_INVOKABLE
void associateWidget(
QGraphicsWidget *widget, const QString &operation);
227 Q_INVOKABLE
void associateItem(QGraphicsObject *item, const QString &operation);
237 Q_INVOKABLE
void disassociateItem(QGraphicsObject *widget);
244 Q_INVOKABLE QMap<QString, QVariant> parametersFromDescription(const KConfigGroup &description);
257 void operationsChanged();
262 void serviceReady(Plasma::Service *service);
270 explicit Service(
QObject *parent = 0);
275 Service(
QObject *parent, const QVariantList &args);
284 virtual
ServiceJob *createJob(const QString &operation,
285 QMap<QString, QVariant> ¶meters) = 0;
293 virtual
void registerOperationsScheme();
299 void setOperationsScheme(QIODevice *xml);
307 void setName(const QString &name);
315 void setOperationEnabled(const QString &operation,
bool enable);
318 Q_PRIVATE_SLOT(d,
void jobFinished(
KJob *))
319 Q_PRIVATE_SLOT(d,
void associatedWidgetDestroyed(
QObject *))
320 Q_PRIVATE_SLOT(d,
void associatedGraphicsWidgetDestroyed(
QObject *))
322 ServicePrivate * const d;
325 friend class DataEnginePrivate;
326 friend class GetSource;
327 friend class PackagePrivate;
328 friend class ServiceProvider;
329 friend class RemoveService;
335 Q_DECLARE_METATYPE(Plasma::Service *)
340 #define K_EXPORT_PLASMA_SERVICE(libname, classname) \
341 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
342 K_EXPORT_PLUGIN(factory("plasma_service_" #libname)) \
343 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
345 #endif // multiple inclusion guard
This class provides jobs for use with Plasma::Service.
This class provides a generic API for write access to settings or services.
This is an abstract base class which defines an interface to which Plasma's Applet Loading logic can ...