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