~ubuntu-branches/ubuntu/trusty/polkit-qt-1/trusty

« back to all changes in this revision

Viewing changes to examples/agent/klistener.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-13 09:08:07 UTC
  • Revision ID: james.westby@ubuntu.com-20091213090807-ibl3mdtee5964009
Tags: upstream-0.95.0~svn1057107
ImportĀ upstreamĀ versionĀ 0.95.0~svn1057107

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 POLKIT_QT_AGENT_KDE_LISTENER_H
 
22
#define POLKIT_QT_AGENT_KDE_LISTENER_H
 
23
 
 
24
#include <QtCore/QObject>
 
25
#include <QtCore/QString>
 
26
 
 
27
#include "agent/listener.h"
 
28
#include "core/identity.h"
 
29
#include "core/details.h"
 
30
#include "agent/session.h"
 
31
 
 
32
class KListener : public PolkitQtAgent::Listener
 
33
{
 
34
    Q_OBJECT
 
35
    Q_DISABLE_COPY(KListener)
 
36
public:
 
37
    KListener(QObject *parent = 0);
 
38
    ~KListener() {};
 
39
public slots:
 
40
    void initiateAuthentication(const QString &actionId,
 
41
                                const QString &message,
 
42
                                const QString &iconName,
 
43
                                PolkitQt::Details *details,
 
44
                                const QString &cookie,
 
45
                                QList<PolkitQt::Identity *> identities,
 
46
                                PolkitQtAgent::AsyncResult *result);
 
47
    bool initiateAuthenticationFinish();
 
48
    void cancelAuthentication();
 
49
    
 
50
    void request(const QString &request, bool echo);
 
51
    void completed(bool gainedAuthorization);
 
52
    void showError(const QString &text);
 
53
    void showInfo(const QString &text);    
 
54
};
 
55
 
 
56
#endif