Polkit-Qt-1  0.95.0
polkitqt1-temporaryauthorization.h
1 /*
2  * This file is part of the PolKit1-qt project
3  * Copyright (C) 2009 Radek Novacek <rnovacek@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_TEMPORARYAUTHORIZATION_H
22 #define POLKITQT1_TEMPORARYAUTHORIZATION_H
23 
24 #include "polkitqt1-subject.h"
25 
26 #include <QtCore/QObject>
27 #include <QtCore/QDateTime>
28 #include <QtCore/QMetaType>
29 #include <QtCore/QSharedData>
30 
31 typedef struct _PolkitTemporaryAuthorization PolkitTemporaryAuthorization;
32 
40 namespace PolkitQt1
41 {
42 
51 class POLKITQT1_EXPORT TemporaryAuthorization
52 {
53 public:
54  typedef QList< TemporaryAuthorization > List;
64  explicit TemporaryAuthorization(PolkitTemporaryAuthorization *pkTemporaryAuthorization);
66 
68 
69  TemporaryAuthorization &operator=(const TemporaryAuthorization &other);
70 
78  QString id() const;
79 
85  QString actionId() const;
86 
92  Subject subject() const;
93 
99  QDateTime obtainedAt() const;
100 
106  QDateTime expirationTime() const;
107 
114  bool revoke();
115 
116 private:
117  class Data;
118  QSharedDataPointer< Data > d;
119 };
120 }
121 
122 Q_DECLARE_METATYPE(PolkitQt1::TemporaryAuthorization::List)
123 
124 #endif // TEMPORARYAUTHORIZATION_H
This class represents PolicyKit temporary authorization.
Definition: polkitqt1-temporaryauthorization.h:51
This class represents PolicyKit subjects.
Definition: polkitqt1-subject.h:55
Namespace wrapping Polkit-Qt classes.
Definition: listeneradapter.cpp:26