KDECore
DBusHelperProxy.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DBUS_HELPER_PROXY_H
00021 #define DBUS_HELPER_PROXY_H
00022
00023 #include <QObject>
00024 #include <QVariant>
00025 #include "HelperProxy.h"
00026 #include "kauthactionreply.h"
00027
00028 namespace KAuth
00029 {
00030
00031 class DBusHelperProxy : public HelperProxy
00032 {
00033 Q_OBJECT
00034 Q_INTERFACES(KAuth::HelperProxy)
00035
00036 QObject *responder;
00037 QString m_name;
00038 QString m_currentAction;
00039 bool m_stopRequest;
00040 QList<QString> m_actionsInProgress;
00041
00042 enum SignalType {
00043 ActionStarted,
00044 ActionPerformed,
00045 DebugMessage,
00046 ProgressStepIndicator,
00047 ProgressStepData
00048 };
00049
00050 public:
00051 DBusHelperProxy() : responder(NULL), m_stopRequest(false) {}
00052
00053 virtual bool executeActions(const QList<QPair<QString, QVariantMap> > &list, const QString &helperID);
00054 virtual ActionReply executeAction(const QString &action, const QString &helperID, const QVariantMap &arguments);
00055 virtual void stopAction(const QString &action, const QString &helperID);
00056
00057 virtual bool initHelper(const QString &name);
00058 virtual void setHelperResponder(QObject *o);
00059 virtual bool hasToStopAction();
00060 virtual void sendDebugMessage(int level, const char *msg);
00061 virtual void sendProgressStep(int step);
00062 virtual void sendProgressStep(const QVariantMap &data);
00063
00064 public slots:
00065 void stopAction(const QString &action);
00066 void performActions(QByteArray blob, const QByteArray &callerID);
00067 QByteArray performAction(const QString &action, const QByteArray &callerID, QByteArray arguments);
00068
00069 signals:
00070 void remoteSignal(int type, const QString &action, const QByteArray &blob);
00071
00072 private slots:
00073 void remoteSignalReceived(int type, const QString &action, QByteArray blob);
00074 };
00075
00076 }
00077
00078 #endif