add more spacing
[personal-kdebase.git] / workspace / kcontrol / kfontinst / kcmfontinst / PolicyKitAuthenticator.h
blobfb61ea09d2509926f8e038be92d3ac8d9883543a
1 /*
2 * KFontInst - KDE Font Installer
4 * Copyright 2003-2008 Craig Drummond <craig@kde.org>
6 * ----
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; see the file COPYING. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
24 #ifndef __POLICYKIT_AUTHENTICATOR_H__
25 #define __POLICYKIT_AUTHENTICATOR_H__
27 #include <QtCore/QObject>
29 class QDBusMessage;
30 class QDBusError;
31 class QWidget;
32 class PolicyKitAuthenticatorPrivate;
34 class PolicyKitAuthenticator : public QObject
36 Q_OBJECT
38 public:
40 static PolicyKitAuthenticator * instance();
42 PolicyKitAuthenticator();
43 virtual ~PolicyKitAuthenticator();
45 bool authenticate(const QString &action, QWidget *widet, bool gui);
46 bool authenticate(const QString &action, uint winId, uint pid, bool gui);
48 Q_SIGNALS:
50 void quitLoop();
52 private Q_SLOTS:
54 void reply(const QDBusMessage &msg);
55 void error(const QDBusError &er, const QDBusMessage &msg);
57 private:
59 bool isAuthenticated(const QDBusMessage &msg);
61 PolicyKitAuthenticator(const PolicyKitAuthenticator &o);
63 private:
65 PolicyKitAuthenticatorPrivate * const d_ptr;
66 Q_DECLARE_PRIVATE(PolicyKitAuthenticator)
69 #endif