on 09fa1a3 help sign in
unity8/tests/mocks/Wizard/mockplugin.cpp
49 lines 1.6 kB history raw
1/*
2 * Copyright (C) 2012,2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17#include "mockplugin.h"
18#include "MockSystem.h"
19#include "PageList.h"
20#include "timezonemodel.h"
21#include "LocalePlugin.h"
22#include "Status.h"
24#include <QtQml/qqml.h>
26static QObject *system_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
28 Q_UNUSED(engine)
29 Q_UNUSED(scriptEngine)
30 return new MockSystem();
33static QObject *status_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
35 Q_UNUSED(engine)
36 Q_UNUSED(scriptEngine)
37 return new Status();
40void MockWizardPlugin::registerTypes(const char *uri)
42 Q_ASSERT(uri == QLatin1String("Wizard"));
43 qmlRegisterType<PageList>(uri, 0, 1, "PageList");
44 qmlRegisterSingletonType<MockSystem>(uri, 0, 1, "System", system_provider);
45 qmlRegisterSingletonType<Status>(uri, 0, 1, "Status", status_provider);
46 qmlRegisterType<TimeZoneModel>(uri, 0, 1, "TimeZoneModel");
47 qmlRegisterType<TimeZoneFilterModel>(uri, 0, 1, "TimeZoneFilterModel");
48 qmlRegisterType<LocalePlugin>(uri, 0, 1, "LocalePlugin");