/
ssud.h
97 lines (83 loc) · 2.42 KB
/
ssud.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* @file ssud.h
* @copyright 2013-2019 Jolla Ltd.
* @copyright 2019 Open Mobile Platform LLC.
* @copyright LGPLv2+
* @date 2013 - 2019
*/
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _SSUD_H
#define _SSUD_H
#include <QObject>
#include <QString>
#include <QTimer>
#include "libssu/ssu.h"
#include "ssud_dbus.h"
class Ssud: public QObject
{
Q_OBJECT
public:
Ssud(QObject *parent = NULL);
virtual ~Ssud();
public slots:
/* device info */
QString deviceModel();
QString deviceFamily();
QString deviceUid();
QString deviceVariant();
QString displayName(int type);
/* credential management */
bool isRegistered();
void registerDevice(const QString &username, const QString &password);
void unregisterDevice();
QString domain();
/* repository management */
QString brand();
int deviceMode();
void setDeviceMode(int mode);
void setDeviceMode(int mode, int editMode);
QString flavour();
void setFlavour(const QString &release);
QString release(bool rnd);
void setRelease(const QString &release, bool rnd);
void modifyRepo(int action, const QString &repo);
void addRepo(const QString &repo, const QString &url);
void updateRepos();
QList<SsuRepo> listRepos(bool rnd);
QStringList listDomains();
void setDomainConfig(const QString &domain, QVariantMap config);
QVariantMap getDomainConfig(const QString &domain);
bool error();
QString lastError();
void quit();
signals:
void done();
void credentialsChanged();
void registrationStatusChanged();
private:
Ssu ssu;
static const char *SERVICE_NAME;
static const char *OBJECT_PATH;
QTimer autoclose;
enum Actions {
Remove = 0,
Add = 1,
Disable = 2,
Enable = 3,
};
};
#endif