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

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • kdecore
  • auth
kauthaction.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 ACTION_H
22 #define ACTION_H
23 
24 #include <QtCore/QString>
25 #include <QtCore/QVariant>
26 #include <QtCore/QHash>
27 
28 #include <kdecore_export.h>
29 
30 #include "kauthactionreply.h"
31 
32 namespace KAuth
33 {
34 
35 class ActionWatcher;
36 
69 class KDECORE_EXPORT Action
70 {
71  class Private;
72  Private * const d;
73 
74 public:
78  enum AuthStatus {
79  Denied,
80  Error,
81  Invalid,
82  Authorized,
83  AuthRequired,
84  UserCancelled
85  };
86 
94  Action();
95 
97  Action(const Action &action);
98 
103  Action(const QString &name);
104 
112  Action(const QString &name, const QString &details);
113 
115  ~Action();
116 
118  Action &operator=(const Action &action);
119 
131  bool operator==(const Action &action) const;
132 
140  bool operator!=(const Action &action) const;
141 
151  QString name() const;
152 
161  void setName(const QString &name);
162 
170  void setDetails(const QString &details);
171 
180  QString details() const;
181 
206  bool isValid() const;
207 
220  QString helperID() const;
221 
237  void setHelperID(const QString &id);
238 
252  bool hasHelper() const;
253 
265  ActionWatcher *watcher();
266 
275  void setArguments(const QVariantMap &arguments);
276 
285  QVariantMap arguments() const;
286 
299  void addArgument(const QString &key, const QVariant &value);
300 
320  AuthStatus authorize() const;
321 
346  AuthStatus earlyAuthorize() const;
347 
363  AuthStatus status() const;
364 
395  ActionReply execute() const;
396 
406  ActionReply execute(const QString &helperID) const;
407 
408  void setExecutesAsync(bool async);
409  bool executesAsync() const;
410 
440  static bool executeActions(const QList<Action> &actions, QList<Action> *deniedActions, const QString &helperId);
441 
451  static bool executeActions(const QList<Action> &actions, QList<Action> *deniedActions, const QString &helperId,
452  QWidget *parent);
453 
465  void stop();
466 
476  void stop(const QString &helperID);
477 
492  void setParentWidget(QWidget *parent);
493 
501  QWidget *parentWidget() const;
502 };
503 
504 } // namespace Auth
505 
506 #endif
QWidget
KAuth::Action::AuthRequired
The user could obtain the authorization after authentication.
Definition: kauthaction.h:83
kdecore_export.h
KAuth::Action::Error
An error occurred.
Definition: kauthaction.h:80
operator!=
bool operator!=(const KEntry &k1, const KEntry &k2)
Definition: kconfigdata.h:79
KAuth::Action::Invalid
An invalid action cannot be authorized.
Definition: kauthaction.h:81
operator==
bool operator==(const KEntry &k1, const KEntry &k2)
Definition: kconfigdata.h:72
KAuth::ActionWatcher
Class used to receive notifications about the status of an action execution.
Definition: kauthactionwatcher.h:50
KAuth::Action::Denied
The authorization has been denied by the authorization backend.
Definition: kauthaction.h:79
Kuit::Rol::Action
Definition: kuitsemantics.cpp:102
KAuth::Action::Authorized
The authorization has been granted by the authorization backend.
Definition: kauthaction.h:82
QString
QList
Definition: kaboutdata.h:33
KAuth::Action::AuthStatus
AuthStatus
The three values returned by authorization methods.
Definition: kauthaction.h:78
kauthactionreply.h
KAuth::ActionReply
Class that encapsulates a reply coming from the helper after executing an action. ...
Definition: kauthactionreply.h:370
KAuthorized::authorize
bool authorize(const QString &genericAction)
Returns whether a certain action is authorized.
Definition: kauthorized.cpp:215
KAuth::Action
Class to access, authorize and execute actions.
Definition: kauthaction.h:69
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:10 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • 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