• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 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 <QDBusContext>
25#include <QVariant>
26#include "HelperProxy.h"
27#include "kauthactionreply.h"
28
29namespace KAuth
30{
31
32class DBusHelperProxy : public HelperProxy, protected QDBusContext
33{
34 Q_OBJECT
35 Q_INTERFACES(KAuth::HelperProxy)
36
37 QObject *responder;
38 QString m_name;
39 QString m_currentAction;
40 bool m_stopRequest;
41 QList<QString> m_actionsInProgress;
42
43 enum SignalType {
44 ActionStarted, // The blob argument is empty
45 ActionPerformed, // The blob argument contains the ActionReply
46 DebugMessage, // The blob argument contains the debug level and the message (in this order)
47 ProgressStepIndicator, // The blob argument contains the step indicator
48 ProgressStepData // The blob argument contains the QVariantMap
49 };
50
51public:
52 DBusHelperProxy() : responder(0), m_stopRequest(false) {}
53
54 virtual bool executeActions(const QList<QPair<QString, QVariantMap> > &list, const QString &helperID);
55 virtual ActionReply executeAction(const QString &action, const QString &helperID, const QVariantMap &arguments);
56 virtual Action::AuthStatus authorizeAction(const QString& action, const QString& helperID);
57 virtual void stopAction(const QString &action, const QString &helperID);
58
59 virtual bool initHelper(const QString &name);
60 virtual void setHelperResponder(QObject *o);
61 virtual bool hasToStopAction();
62 virtual void sendDebugMessage(int level, const char *msg);
63 virtual void sendProgressStep(int step);
64 virtual void sendProgressStep(const QVariantMap &data);
65
66public slots:
67 void stopAction(const QString &action);
68 void performActions(QByteArray blob, const QByteArray &callerID);
69 QByteArray performAction(const QString &action, const QByteArray &callerID, QByteArray arguments);
70 uint authorizeAction(const QString &action, const QByteArray &callerID);
71
72signals:
73 void remoteSignal(int type, const QString &action, const QByteArray &blob); // This signal is sent from the helper to the app
74
75private slots:
76 void remoteSignalReceived(int type, const QString &action, QByteArray blob);
77
78private:
79 bool isCallerAuthorized(const QString &action, const QByteArray &callerID);
80};
81
82} // namespace Auth
83
84#endif
HelperProxy.h
KAuth::ActionReply
Class that encapsulates a reply coming from the helper after executing an action.
Definition: kauthactionreply.h:371
KAuth::Action::AuthStatus
AuthStatus
The three values returned by authorization methods.
Definition: kauthaction.h:78
KAuth::DBusHelperProxy
Definition: DBusHelperProxy.h:33
KAuth::DBusHelperProxy::executeActions
virtual bool executeActions(const QList< QPair< QString, QVariantMap > > &list, const QString &helperID)
Definition: DBusHelperProxy.cpp:57
KAuth::DBusHelperProxy::performAction
QByteArray performAction(const QString &action, const QByteArray &callerID, QByteArray arguments)
Definition: DBusHelperProxy.cpp:297
KAuth::DBusHelperProxy::sendProgressStep
virtual void sendProgressStep(int step)
Definition: DBusHelperProxy.cpp:387
KAuth::DBusHelperProxy::performActions
void performActions(QByteArray blob, const QByteArray &callerID)
Definition: DBusHelperProxy.cpp:254
KAuth::DBusHelperProxy::sendDebugMessage
virtual void sendDebugMessage(int level, const char *msg)
Definition: DBusHelperProxy.cpp:377
KAuth::DBusHelperProxy::authorizeAction
uint authorizeAction(const QString &action, const QByteArray &callerID)
Definition: DBusHelperProxy.cpp:351
KAuth::DBusHelperProxy::executeAction
virtual ActionReply executeAction(const QString &action, const QString &helperID, const QVariantMap &arguments)
Definition: DBusHelperProxy.cpp:85
KAuth::DBusHelperProxy::initHelper
virtual bool initHelper(const QString &name)
Definition: DBusHelperProxy.cpp:183
KAuth::DBusHelperProxy::DBusHelperProxy
DBusHelperProxy()
Definition: DBusHelperProxy.h:52
KAuth::DBusHelperProxy::hasToStopAction
virtual bool hasToStopAction()
Definition: DBusHelperProxy.cpp:246
KAuth::DBusHelperProxy::setHelperResponder
virtual void setHelperResponder(QObject *o)
Definition: DBusHelperProxy.cpp:200
KAuth::DBusHelperProxy::remoteSignal
void remoteSignal(int type, const QString &action, const QByteArray &blob)
KAuth::DBusHelperProxy::stopAction
void stopAction(const QString &action)
Definition: DBusHelperProxy.cpp:237
KAuth::HelperProxy
Definition: HelperProxy.h:36
QDBusContext
QList
Definition: kaboutdata.h:33
QObject
QPair
QString
kauthactionreply.h
KAuth
Definition: AuthBackend.cpp:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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.14.38 API Reference

Skip menu "kdelibs-4.14.38 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