not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kcontrol / kfontinst / kio / PolicyKitMechanism.h
blob673766436ece7f92d500df1a1fd3b4e2f43a205c
1 #ifndef __POLICYKIT_MECHANISM_H__
2 #define __POLICYKIT_MECHANISM_H__
4 /*
5 * KFontInst - KDE Font Installer
7 * Copyright 2003-2008 Craig Drummond <craig@kde.org>
9 * ----
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; see the file COPYING. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
27 #include <QtCore/QObject>
28 #include <polkit/polkit.h>
30 class PolicyKitMechanismPrivate;
32 class PolicyKitMechanism : public QObject
34 Q_OBJECT
36 public:
38 static PolicyKitMechanism * instance();
40 PolicyKitMechanism();
41 virtual ~PolicyKitMechanism();
43 PolKitResult canDoAction(const QString &action, unsigned int pid);
44 PolKitResult canDoAction(const QString &action, const QString &dbusName);
45 void removeAction(const QString &action);
47 /* @internal */
48 void addWatch(int fd);
49 /* @internal */
50 void removeWatch(int fd);
52 private Q_SLOTS:
54 void contextWatchActivated(int fd);
56 private:
58 PolicyKitMechanism(const PolicyKitMechanism &o);
60 PolKitAction * getAction(const QString &action);
62 private:
64 PolicyKitMechanismPrivate * const d_ptr;
65 Q_DECLARE_PRIVATE(PolicyKitMechanism)
68 #endif