• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.12
  • kdelibs
  • kdecore
  • auth
  • backends
  • dbus
DBusHelperProxy.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2008 Nicola Gigante <nicola.gigante@gmail.com>
3 * Copyright (C) 2009 Dario Freddi <drf@kde.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 2.1 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA .
19 */
20 
21 #ifndef DBUS_HELPER_PROXY_H
22 #define DBUS_HELPER_PROXY_H
23 
24 #include <QVariant>
25 #include "HelperProxy.h"
26 #include "kauthactionreply.h"
27 
28 namespace KAuth
29 {
30 
31 class DBusHelperProxy : public HelperProxy
32 {
33  Q_OBJECT
34  Q_INTERFACES(KAuth::HelperProxy)
35 
36  QObject *responder;
37  QString m_name;
38  QString m_currentAction;
39  bool m_stopRequest;
40  QList<QString> m_actionsInProgress;
41 
42  enum SignalType {
43  ActionStarted, // The blob argument is empty
44  ActionPerformed, // The blob argument contains the ActionReply
45  DebugMessage, // The blob argument contains the debug level and the message (in this order)
46  ProgressStepIndicator, // The blob argument contains the step indicator
47  ProgressStepData // The blob argument contains the QVariantMap
48  };
49 
50 public:
51  DBusHelperProxy() : responder(0), m_stopRequest(false) {}
52 
53  virtual bool executeActions(const QList<QPair<QString, QVariantMap> > &list, const QString &helperID);
54  virtual ActionReply executeAction(const QString &action, const QString &helperID, const QVariantMap &arguments);
55  virtual Action::AuthStatus authorizeAction(const QString& action, const QString& helperID);
56  virtual void stopAction(const QString &action, const QString &helperID);
57 
58  virtual bool initHelper(const QString &name);
59  virtual void setHelperResponder(QObject *o);
60  virtual bool hasToStopAction();
61  virtual void sendDebugMessage(int level, const char *msg);
62  virtual void sendProgressStep(int step);
63  virtual void sendProgressStep(const QVariantMap &data);
64 
65 public slots:
66  void stopAction(const QString &action);
67  void performActions(QByteArray blob, const QByteArray &callerID);
68  QByteArray performAction(const QString &action, const QByteArray &callerID, QByteArray arguments);
69  uint authorizeAction(const QString &action, const QByteArray &callerID);
70 
71 signals:
72  void remoteSignal(int type, const QString &action, const QByteArray &blob); // This signal is sent from the helper to the app
73 
74 private slots:
75  void remoteSignalReceived(int type, const QString &action, QByteArray blob);
76 };
77 
78 } // namespace Auth
79 
80 #endif
KAuth::HelperProxy
Definition: HelperProxy.h:35
KAuth::DBusHelperProxy::setHelperResponder
virtual void setHelperResponder(QObject *o)
Definition: DBusHelperProxy.cpp:200
KAuth::DBusHelperProxy::hasToStopAction
virtual bool hasToStopAction()
Definition: DBusHelperProxy.cpp:246
QString
KAuth::DBusHelperProxy::executeActions
virtual bool executeActions(const QList< QPair< QString, QVariantMap > > &list, const QString &helperID)
Definition: DBusHelperProxy.cpp:57
QObject
KAuth::DBusHelperProxy::executeAction
virtual ActionReply executeAction(const QString &action, const QString &helperID, const QVariantMap &arguments)
Definition: DBusHelperProxy.cpp:85
KAuth::DBusHelperProxy::sendProgressStep
virtual void sendProgressStep(int step)
Definition: DBusHelperProxy.cpp:364
KAuth::DBusHelperProxy::sendDebugMessage
virtual void sendDebugMessage(int level, const char *msg)
Definition: DBusHelperProxy.cpp:354
KAuth::DBusHelperProxy::authorizeAction
virtual Action::AuthStatus authorizeAction(const QString &action, const QString &helperID)
Definition: DBusHelperProxy.cpp:149
KAuth::Action::AuthStatus
AuthStatus
The three values returned by authorization methods.
Definition: kauthaction.h:78
HelperProxy.h
KAuth::DBusHelperProxy::stopAction
virtual void stopAction(const QString &action, const QString &helperID)
Definition: DBusHelperProxy.cpp:45
KAuth::DBusHelperProxy
Definition: DBusHelperProxy.h:31
kauthactionreply.h
KAuth::ActionReply
Class that encapsulates a reply coming from the helper after executing an action. ...
Definition: kauthactionreply.h:370
QPair
KAuth::DBusHelperProxy::DBusHelperProxy
DBusHelperProxy()
Definition: DBusHelperProxy.h:51
KAuth::DBusHelperProxy::performAction
QByteArray performAction(const QString &action, const QByteArray &callerID, QByteArray arguments)
Definition: DBusHelperProxy.cpp:274
KAuth::DBusHelperProxy::initHelper
virtual bool initHelper(const QString &name)
Definition: DBusHelperProxy.cpp:183
KAuth::DBusHelperProxy::remoteSignal
void remoteSignal(int type, const QString &action, const QByteArray &blob)
QList< QString >
KAuth::DBusHelperProxy::performActions
void performActions(QByteArray blob, const QByteArray &callerID)
Definition: DBusHelperProxy.cpp:254
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal