Polkit-Qt-1  0.95.0
polkitqt1-agent-listener.h
1 /*
2  * This file is part of the Polkit-qt project
3  * Copyright (C) 2009 Jaroslav Reznik <jreznik@redhat.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef POLKITQT1_AGENT_LISTENER_H
22 #define POLKITQT1_AGENT_LISTENER_H
23 
24 #include "polkitqt1-export.h"
25 
26 #include <QtCore/QObject>
27 
28 #include "polkitqt1-agent-session.h"
29 
30 #define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE 1
31 
32 typedef struct _PolkitAgentListener PolkitAgentListener;
33 
34 namespace PolkitQt1
35 {
36 class Subject;
37 class Identity;
38 class Details;
39 }
40 
41 namespace PolkitQt1
42 {
43 
44 namespace Agent
45 {
46 
47 class ListenerPrivate;
61 class POLKITQT1_EXPORT Listener : public QObject
62 {
63  Q_OBJECT
64  Q_DISABLE_COPY(Listener)
65 public:
69  Listener(QObject *parent = 0);
70 
79  explicit Listener(PolkitAgentListener *listener, QObject *parent = 0);
80 
81  virtual ~Listener();
82 
96  bool registerListener(const PolkitQt1::Subject &subject, const QString &objectPath);
97 
105  const PolkitAgentListener *listener();
106 
107 public Q_SLOTS:
126  virtual void initiateAuthentication(const QString &actionId,
127  const QString &message,
128  const QString &iconName,
129  const PolkitQt1::Details &details,
130  const QString &cookie,
131  const PolkitQt1::Identity::List &identities,
132  AsyncResult *result) = 0;
133 
142  virtual bool initiateAuthenticationFinish() = 0;
143 
152  virtual void cancelAuthentication() = 0;
153 
154 private:
155  ListenerPrivate * const d;
156 };
157 }
158 
159 }
160 
161 #endif
Listener is abstract class used for implementing authentication agents.
Definition: polkitqt1-agent-listener.h:61
Class used for passing details around.
Definition: polkitqt1-details.h:47
This class represents PolicyKit subjects.
Definition: polkitqt1-subject.h:55
Contains Macros for exporting symbols.
Namespace wrapping Polkit-Qt classes.
Definition: listeneradapter.cpp:26
Namespace wrapping Polkit-Qt Agent classes.