Debian Codegraph @

Dekko/backend/settings/quick/SettingsPlugin.cpp

raw symbols SCIP
1 /* Copyright (C) 2016 - 2017 Dan Chapman <[email protected]>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program 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
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include "SettingsPlugin.h"
19 #include <QtQml/QtQml>
20 #include <QtQml/QQmlContext>
21 #include <SettingsPolicies.h>
22 #include <PolicyManager.h>
23
24 void SettingsPlugin::registerTypes(const char *uri)
25 {
26 Q_ASSERT(uri == QLatin1String("Dekko.Mail.Settings"));
27 // @uri Dekko.Mail.Settings
28 qmlRegisterSingletonType<PolicyManager>(uri, 1, 0, "PolicyManager", PolicyManager::factory);
29 qmlRegisterType<MailPolicy>(uri, 1, 0, "MailPolicy");
30 qmlRegisterType<PrivacyPolicy>(uri, 1, 0, "PrivacyPolicy");
31 qmlRegisterType<ViewPolicy>(uri, 1, 0, "ViewPolicy");
32 qmlRegisterUncreatableType<AccountPolicy>(uri, 1, 0, "AccountPolicy", "Cannot be created in qml");
33 qmlRegisterUncreatableType<GlobalPolicy>(uri, 1, 0, "GlobalPolicy", "Cannot be created in qml");
34 qmlRegisterInterface<PolicyInterface>("PolicyInterface");
35 }
36
37 void SettingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
38 {
39 QQmlExtensionPlugin::initializeEngine(engine, uri);
40 }