• 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
kauthactionreply.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_REPLY_H
22 #define ACTION_REPLY_H
23 
24 #include <QtCore/QString>
25 #include <QtCore/QVariant>
26 #include <QtCore/QMap>
27 #include <QtCore/QDataStream>
28 
29 #include <kdecore_export.h>
332 namespace KAuth
333 {
334 
370 class KDECORE_EXPORT ActionReply
371 {
372  class Private;
373  Private * const d;
374 
375 public:
379  enum Type {
380  KAuthError,
381  HelperError,
382  Success
383  };
384 
385  static const ActionReply SuccessReply;
386  static const ActionReply HelperErrorReply;
387 
388  static const ActionReply NoResponderReply;
389  static const ActionReply NoSuchActionReply;
390  static const ActionReply InvalidActionReply;
391  static const ActionReply AuthorizationDeniedReply;
392  static const ActionReply UserCancelledReply;
393  static const ActionReply HelperBusyReply;
394  static const ActionReply DBusErrorReply;
395 
399  enum Error {
400  NoError = 0,
401  NoResponder,
402  NoSuchAction,
403  InvalidAction,
404  AuthorizationDenied,
405  UserCancelled,
406  HelperBusy,
407  DBusError
408  };
409 
411  ActionReply();
412 
424  ActionReply(Type type);
425 
435  ActionReply(int errorCode);
436 
438  ActionReply(const ActionReply &reply);
439 
441  virtual ~ActionReply();
442 
451  void setData(const QVariantMap &data);
452 
462  QVariantMap data() const;
463 
476  void addData(const QString &key, const QVariant &value);
477 
479  Type type() const;
480 
496  void setType(Type type);
497 
499  bool succeeded() const;
500 
502  bool failed() const;
503 
513  int errorCode() const;
514 
527  void setErrorCode(int errorCode);
528 
539  QString errorDescription() const;
540 
549  void setErrorDescription(const QString &error);
550 
559  QByteArray serialized() const;
560 
569  static ActionReply deserialize(const QByteArray &data);
570 
572  ActionReply &operator=(const ActionReply &reply);
573 
589  bool operator==(const ActionReply &reply) const;
590 
596  bool operator!=(const ActionReply &reply) const;
597 
599  friend QDataStream &operator<<(QDataStream &, const ActionReply &);
600 
602  friend QDataStream &operator>>(QDataStream &, ActionReply &);
603 
604 };
605 
606 } // namespace Auth
607 
608 #endif
KAuth::ActionReply::InvalidActionReply
static const ActionReply InvalidActionReply
errorCode() == InvalidAction
Definition: kauthactionreply.h:390
KFileSystemType::Type
Type
Definition: kfilesystemtype_p.h:28
KAuth::ActionReply::InvalidAction
You tried to execute an invalid action object.
Definition: kauthactionreply.h:403
kdecore_export.h
QByteArray
KAuth::ActionReply::KAuthError
An error reply generated by the library itself.
Definition: kauthactionreply.h:380
QDataStream
KAuth::ActionReply::HelperBusyReply
static const ActionReply HelperBusyReply
errorCode() == HelperBusy
Definition: kauthactionreply.h:393
KAuth::ActionReply::SuccessReply
static const ActionReply SuccessReply
An empty successful reply. Same as using the default constructor.
Definition: kauthactionreply.h:385
operator!=
bool operator!=(const KEntry &k1, const KEntry &k2)
Definition: kconfigdata.h:79
KAuth::ActionReply::HelperErrorReply
static const ActionReply HelperErrorReply
An empty reply with type() == HelperError.
Definition: kauthactionreply.h:386
KAuth::ActionReply::NoResponderReply
static const ActionReply NoResponderReply
errorCode() == NoResponder
Definition: kauthactionreply.h:388
KAuth::ActionReply::AuthorizationDenied
You don't have the authorization to execute the action.
Definition: kauthactionreply.h:404
KAuth::ActionReply::AuthorizationDeniedReply
static const ActionReply AuthorizationDeniedReply
errorCode() == AuthorizationDenied
Definition: kauthactionreply.h:391
operator==
bool operator==(const KEntry &k1, const KEntry &k2)
Definition: kconfigdata.h:72
KAuth::ActionReply::Error
Error
The enumeration of the possible values of errorCode() when type() is ActionReply::KAuthError.
Definition: kauthactionreply.h:399
KAuth::ActionReply::UserCancelled
Action execution has been cancelled by the user.
Definition: kauthactionreply.h:405
KAuth::ActionReply::HelperError
An error reply generated by the helper.
Definition: kauthactionreply.h:381
QString
KAuth::ActionReply::Type
Type
Enumeration of the different kinds of replies.
Definition: kauthactionreply.h:379
KAuth::ActionReply::UserCancelledReply
static const ActionReply UserCancelledReply
errorCode() == UserCancelled
Definition: kauthactionreply.h:392
KAuth::ActionReply::DBusErrorReply
static const ActionReply DBusErrorReply
errorCode() == DBusError
Definition: kauthactionreply.h:394
KAuth::ActionReply::NoSuchActionReply
static const ActionReply NoSuchActionReply
errorCode() == NoSuchAction
Definition: kauthactionreply.h:389
KAuth::ActionReply::NoResponder
The helper responder object hasn't been set. This shouldn't happen if you use the KDE4_AUTH_HELPER ma...
Definition: kauthactionreply.h:401
KAuth::ActionReply::HelperBusy
The helper is busy executing another action (or group of actions). Try later.
Definition: kauthactionreply.h:406
KShell::NoError
Success.
Definition: kshell.h:89
KAuth::operator>>
QDataStream & operator>>(QDataStream &stream, ActionReply &reply)
Definition: kauthactionreply.cpp:186
KAuth::ActionReply
Class that encapsulates a reply coming from the helper after executing an action. ...
Definition: kauthactionreply.h:370
KAuth::ActionReply::NoSuchAction
The action you tried to execute doesn't exist.
Definition: kauthactionreply.h:402
KAuth::operator<<
QDataStream & operator<<(QDataStream &d, const ActionReply &reply)
Definition: kauthactionreply.cpp:181
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