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

KDECore

  • kdecore
  • auth
  • backends
  • polkit-1
Polkit1Backend.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2008 Nicola Gigante <nicola.gigante@gmail.com>
3 * Copyright (C) 2009 Radek Novacek <rnovacek@redhat.com>
4 * Copyright (C) 2009-2010 Dario Freddi <drf@kde.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the
18 * Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA .
20 */
21 
22 #ifndef POLKIT1BACKEND_H
23 #define POLKIT1BACKEND_H
24 
25 #include "AuthBackend.h"
26 
27 #include <QtCore/QHash>
28 #include <QtCore/QEventLoop>
29 #include <QtCore/QStringList>
30 
31 #include <PolkitQt1/Authority>
32 
33 class QByteArray;
34 
35 namespace KAuth
36 {
37 
38 class Polkit1Backend : public AuthBackend
39 {
40  Q_OBJECT
41  Q_INTERFACES(KAuth::AuthBackend)
42 
43 public:
44  Polkit1Backend();
45  virtual ~Polkit1Backend();
46  virtual void setupAction(const QString&);
47  virtual void preAuthAction(const QString& action, QWidget* parent);
48  virtual Action::AuthStatus authorizeAction(const QString&);
49  virtual Action::AuthStatus actionStatus(const QString&);
50  virtual QByteArray callerID() const;
51  virtual bool isCallerAuthorized(const QString &action, QByteArray callerID);
52  virtual bool actionExists(const QString& action);
53 
54 private Q_SLOTS:
55  void checkForResultChanged();
56  void updateCachedActions(const PolkitQt1::ActionDescription::List &actions);
57 
58 private:
59  QHash<QString, Action::AuthStatus> m_cachedResults;
60  QStringList m_knownActions;
61  bool m_flyingActions;
62 };
63 
64 class PolkitResultEventLoop : public QEventLoop
65 {
66  Q_OBJECT
67 public:
68  PolkitResultEventLoop(QObject* parent = 0);
69  virtual ~PolkitResultEventLoop();
70 
71  PolkitQt1::Authority::Result result() const;
72 
73 public Q_SLOTS:
74  void requestQuit(const PolkitQt1::Authority::Result &result);
75 
76 private:
77  PolkitQt1::Authority::Result m_result;
78 };
79 
80 } // namespace Auth
81 
82 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 20:18:01 by doxygen 1.8.3.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.4 API Reference

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