Jump to content

Plasma/libplasma2/API Review/Service: Difference between revisions

From KDE Community Wiki
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: ..."
 
Notmart (talk | contribs)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
=New class in QML bindings=
Needed to access wether an operation is enable or not (like in the nowPlaying service
  ServiceOperationStatus {
   property bool enabled
   property Service service
   property string operation
}
=Class API=
{| cellspacing="0" cellpadding="5" border="1" style="border: 1px solid gray; border-collapse: collapse; text-align: left; width: 100%;" class="sortable"
{| cellspacing="0" cellpadding="5" border="1" style="border: 1px solid gray; border-collapse: collapse; text-align: left; width: 100%;" class="sortable"
|- style="background: rgb(236, 236, 236) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; white-space: nowrap;"
|- style="background: rgb(236, 236, 236) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; white-space: nowrap;"
as
 
! Status  
! Status  
! Action  
! Action  
! Method  
! Method  


{{FeatureTodo|Remove| static Service *access(const QUrl &url, QObject *parent = 0);}}
{{FeatureDone|Remove| static Service *access(const QUrl &url, QObject *parent);}}
{{FeatureTodo|Remove| Q_INVOKABLE void setDestination(const QString &destination);}}
{{FeatureTodo|Remove| Q_INVOKABLE void setDestination(const QString &destination);}}
{{FeatureTodo|Remove| Q_INVOKABLE QString destination() const;}}
{{FeatureTodo|Remove| Q_INVOKABLE QString destination() const;}}
{{FeatureTodo|Keep | Q_INVOKABLE QStringList operationNames() const;}}
{{FeatureDone|Keep | Q_INVOKABLE QStringList operationNames() const;}}
{{FeatureTodo|Rename|Q_INVOKABLE KConfigGroup operationDescription(const QString &operationName); -> QVariantMap operationDescription(const QString &operationName); }}
{{FeatureDone|Rename|Q_INVOKABLE KConfigGroup operationDescription(const QString &operationName); -> QVariantMap operationDescription(const QString &operationName); }}
Q_INVOKABLE ServiceJob *startOperationCall(const KConfigGroup->QVariantMap &description, QObject *parent = 0);
{{FeatureDone|Rename|Q_INVOKABLE ServiceJob *startOperationCall(const KConfigGroup->QVariantMap &description, QObject *parent );}}
   Q_INVOKABLE bool isOperationEnabled(const QString &operation) const;
{{FeatureDone|Keep | Q_INVOKABLE bool isOperationEnabled(const QString &operation) const;}}
   Q_INVOKABLE QString name() const;
{{FeatureDone|Keep | Q_INVOKABLE QString name() const;}}
   Q_INVOKABLE void associateItem(QQuickItem->QObject *item, const QString &operation);
{{FeatureDone|Remove| Q_INVOKABLE void associateItem(QQuickItem->QObject *item, const QString &operation);}}
   Q_INVOKABLE void disassociateItem(QQuickItem *widget);
{{FeatureDone|Remove| Q_INVOKABLE void disassociateItem(QQuickItem *widget);}}
   Q_INVOKABLE QHash<QString, QVariant> parametersFromDescription(const KConfigGroup &description);
{{FeatureDone|Remove| Q_INVOKABLE QHash<QString, QVariant> parametersFromDescription(const KConfigGroup &description);}}


Q_SIGNALS:
{{FeatureDone|Remove| SIGNAL void operationsChanged();}}
   void operationsChanged();
{{FeatureDone|Keep |SIGNAL void serviceReady(Plasma::Service *service);}}
   void serviceReady(Plasma::Service *service);
{{FeatureDone|Add |SIGNAL void operationEnabledChanged(const QString &operation, bool enabled);}}
   void operationEnabled(const QString &operation, bool enabled);
 
New class in QML bindings: ServiceOperationStatus {
   property bool enabled
   property Service service
   property string operation
}


protected:
{{FeatureDone|Keep | protected explicit Service(QObject *parent );}}
   explicit Service(QObject *parent = 0);
{{FeatureTodo|Remove| protected Service(QObject *parent, const QVariantList &args);}}
   Service(QObject *parent, const QVariantList &args);
{{FeatureDone|Parameters |protected virtual ServiceJob *createJob(const QString &operation, QHash<QString, QVariant> ->QVariantMap &parameters)}}
   virtual ServiceJob *createJob(const QString &operation,
                                 QHash<QString, QVariant> ->QVariantMap &parameters) = 0;


   virtual void registerOperationsScheme();
{{FeatureDone|Keep | protected virtual void registerOperationsScheme();}}
   void setOperationsScheme(QIODevice *xml);
{{FeatureDone|Keep | protected void setOperationsScheme(QIODevice *xml);}}
   void setName(const QString &name);
{{FeatureDone|Keep | protected void setName(const QString &name);}}
   void setOperationEnabled(const QString &operation, bool enable);
{{FeatureTodo|Multithread | protected void setOperationEnabled(const QString &operation, bool enable); -> use a QRunnable here}}
use a QRunnable here


private:
{{FeatureDone|Remove| private  Q_PRIVATE_SLOT(d, void associatedWidgetDestroyed(QObject *))}}
   Q_PRIVATE_SLOT(d, void associatedWidgetDestroyed(QObject *))
{{FeatureDone|Remove| private  Q_PRIVATE_SLOT(d, void associatedItemDestroyed(QObject *))}}
   Q_PRIVATE_SLOT(d, void associatedItemDestroyed(QObject *))
|}
|}

Latest revision as of 17:04, 2 May 2013

New class in QML bindings

Needed to access wether an operation is enable or not (like in the nowPlaying service

 ServiceOperationStatus {
   property bool enabled
   property Service service
   property string operation
}

Class API

Status Action Method
DONE Remove static Service *access(const QUrl &url, QObject *parent);
TO DO Remove Q_INVOKABLE void setDestination(const QString &destination); <{{{3}}}>
TO DO Remove Q_INVOKABLE QString destination() const; <{{{3}}}>
DONE Keep Q_INVOKABLE QStringList operationNames() const;
DONE Rename Q_INVOKABLE KConfigGroup operationDescription(const QString &operationName); -> QVariantMap operationDescription(const QString &operationName);
DONE Rename Q_INVOKABLE ServiceJob *startOperationCall(const KConfigGroup->QVariantMap &description, QObject *parent );
DONE Keep Q_INVOKABLE bool isOperationEnabled(const QString &operation) const;
DONE Keep Q_INVOKABLE QString name() const;
DONE Remove Q_INVOKABLE void associateItem(QQuickItem->QObject *item, const QString &operation);
DONE Remove Q_INVOKABLE void disassociateItem(QQuickItem *widget);
DONE Remove Q_INVOKABLE QHash<QString, QVariant> parametersFromDescription(const KConfigGroup &description);


DONE Remove SIGNAL void operationsChanged();
DONE Keep SIGNAL void serviceReady(Plasma::Service *service);
DONE Add SIGNAL void operationEnabledChanged(const QString &operation, bool enabled);


DONE Keep protected explicit Service(QObject *parent );
TO DO Remove protected Service(QObject *parent, const QVariantList &args); <{{{3}}}>
DONE Parameters protected virtual ServiceJob *createJob(const QString &operation, QHash<QString, QVariant> ->QVariantMap &parameters)


DONE Keep protected virtual void registerOperationsScheme();
DONE Keep protected void setOperationsScheme(QIODevice *xml);
DONE Keep protected void setName(const QString &name);
TO DO Multithread protected void setOperationEnabled(const QString &operation, bool enable); -> use a QRunnable here <{{{3}}}>


DONE Remove private  Q_PRIVATE_SLOT(d, void associatedWidgetDestroyed(QObject *))
DONE Remove private  Q_PRIVATE_SLOT(d, void associatedItemDestroyed(QObject *))