Changeset View
Changeset View
Standalone View
Standalone View
test/testpolkitauthbackend.h
- This file was added.
1 | /************************************************************************* | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2019 by Shubham <aryan100jangid@gmail.com> * | ||||
3 | * * | ||||
4 | * This program is free software; you can redistribute it and/or * | ||||
5 | * modify it under the terms of the GNU General Public License as * | ||||
6 | * published by the Free Software Foundation; either version 3 of * | ||||
7 | * the License, or (at your option) any later version. * | ||||
8 | * * | ||||
9 | * This program is distributed in the hope that it will be useful, * | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||||
12 | * GNU General Public License for more details. * | ||||
13 | * * | ||||
14 | * You should have received a copy of the GNU General Public License * | ||||
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>.* | ||||
16 | **************************************************************************/ | ||||
17 | | ||||
18 | // SPDX-License-Identifier: GPL-3.0+ | ||||
19 | | ||||
20 | #ifndef TESTPOLKITAUTHBACKEND_H | ||||
21 | #define TESTPOLKITAUTHBACKEND_H | ||||
22 | | ||||
23 | #include <QObject> | ||||
24 | | ||||
25 | #include <PolkitQt1/Authority> | ||||
26 | | ||||
27 | class QByteArray; | ||||
28 | class QString; | ||||
29 | | ||||
30 | using namespace PolkitQt1; | ||||
31 | | ||||
32 | class TestPolkitAuthBackend : public QObject | ||||
33 | { | ||||
34 | Q_OBJECT | ||||
35 | | ||||
36 | public: | ||||
37 | TestPolkitAuthBackend(); | ||||
38 | ~TestPolkitAuthBackend(); | ||||
39 | | ||||
40 | private Q_SLOTS: | ||||
41 | void startHelper(const QString &action, const QString &helperID) const; | ||||
42 | void initAgent(const QString &action, QWidget *parent = nullptr) const; | ||||
43 | QByteArray callerID() const; | ||||
44 | Authority::Result actionStatus(const QString &action, const QByteArray &callerID) const; | ||||
45 | bool authorizeAction(const QString &action, const QByteArray &caller) const; | ||||
46 | bool revokeAuthorization(const QString &action, const QByteArray &callerID) const; | ||||
47 | }; | ||||
48 | | ||||
49 | #endif // TESTPOLKITAUTHBACKEND_H | ||||
50 | |