Jump to content

Plasma/libplasma2/API Review/Service

From KDE Community Wiki
Revision as of 11:15, 29 April 2013 by Notmart (talk | contribs) (Created page with "{| cellspacing="0" cellpadding="5" border="1" style="border: 1px solid gray; border-collapse: collapse; text-align: left; width: 100%;" class="sortable" |- style="background: ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
as
Status Action Method
TO DO Remove {{{2}}} <{{{3}}}>
TO DO Remove Q_INVOKABLE void setDestination(const QString &destination); <{{{3}}}>
TO DO Remove Q_INVOKABLE QString destination() const; <{{{3}}}>
TO DO Keep Q_INVOKABLE QStringList operationNames() const; <{{{3}}}>
TO DO Rename Q_INVOKABLE KConfigGroup operationDescription(const QString &operationName); -> QVariantMap operationDescription(const QString &operationName); <{{{3}}}>

Q_INVOKABLE ServiceJob *startOperationCall(const KConfigGroup->QVariantMap &description, QObject *parent = 0);

   Q_INVOKABLE bool isOperationEnabled(const QString &operation) const;
   Q_INVOKABLE QString name() const;
   Q_INVOKABLE void associateItem(QQuickItem->QObject *item, const QString &operation);
   Q_INVOKABLE void disassociateItem(QQuickItem *widget);
   Q_INVOKABLE QHash<QString, QVariant> parametersFromDescription(const KConfigGroup &description);

Q_SIGNALS:

   void operationsChanged();
   void serviceReady(Plasma::Service *service);
   void operationEnabled(const QString &operation, bool enabled);

New class in QML bindings: ServiceOperationStatus {

   property bool enabled
   property Service service
   property string operation

}

protected:

   explicit Service(QObject *parent = 0);
   Service(QObject *parent, const QVariantList &args);
   virtual ServiceJob *createJob(const QString &operation,
                                 QHash<QString, QVariant> ->QVariantMap &parameters) = 0;
   virtual void registerOperationsScheme();
   void setOperationsScheme(QIODevice *xml);
   void setName(const QString &name);
   void setOperationEnabled(const QString &operation, bool enable);

use a QRunnable here

private:

   Q_PRIVATE_SLOT(d, void associatedWidgetDestroyed(QObject *))
   Q_PRIVATE_SLOT(d, void associatedItemDestroyed(QObject *))