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

KDECore

  • 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sun Apr 28 2013 14:23:50 by doxygen 1.8.1.1 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-4.10.2 API Reference

Skip menu "kdelibs-4.10.2 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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