2
* This file is part of the Polkit-qt project
3
* Copyright (C) 2009 Jaroslav Reznik <jreznik@redhat.com>
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.
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.
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.
21
#ifndef POLKIT_QT_AGENT_LISTENER_ADAPTER_H
22
#define POLKIT_QT_AGENT_LISTENER_ADAPTER_H
24
#include <QtCore/QObject>
27
#include <PolkitQt/Identity>
28
#include <PolkitQt/Details>
30
typedef struct _GList GList;
31
typedef struct _GCancellable GCancellable;
32
typedef struct _GAsyncResult GAsyncResult;
33
typedef struct _GSimpleAsyncResult GSimpleAsyncResult;
34
typedef struct _GError GError;
39
* \namespace PolkitQtAgent PolkitQtAgent
41
* \brief Namespace wrapping Polkit-Qt Agent classes
43
* This namespace wraps all Polkit-Qt Agent classes.
45
namespace PolkitQtAgent
49
class ListenerAdapter : public QObject
52
Q_DISABLE_COPY(ListenerAdapter)
54
static ListenerAdapter* instance();
57
void polkit_qt_listener_initiate_authentication(PolkitAgentListener *listener,
58
const gchar *action_id,
60
const gchar *icon_name,
61
PolkitDetails *details,
64
GCancellable *cancellable,
65
GSimpleAsyncResult *result);
67
gboolean polkit_qt_listener_initiate_authentication_finish(PolkitAgentListener *listener,
70
void cancelled_cb(PolkitAgentListener *listener);
72
void addListener(Listener *listener);
73
void removeListener(Listener *listener);
74
Listener* findListener(PolkitAgentListener *listener);
76
explicit ListenerAdapter(QObject *parent = 0);
77
QList<Listener *> m_listeners;
79
friend class Listener;