| 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 "ComponentsPlugin.h" |
| 19 | |
| 20 | #include <QtQml/QtQml> |
| 21 | #include <QtQml/QQmlContext> |
| 22 | #include "ImageHelper.h" |
| 23 | #include "StretchColumn.h" |
| 24 | #include "StretchRow.h" |
| 25 | #include "Stretcher.h" |
| 26 | #include "LogRecorder.h" |
| 27 | #include "Introspector.h" |
| 28 | #include "PixelPerfectItem.h" |
| 29 | #include <Paths.h> |
| 30 | |
| 31 | void ComponentsPlugin::registerTypes(const char *uri) |
| 32 | { |
| 33 | Q_ASSERT(uri == QLatin1String("Dekko.Components")); |
| 34 | // @uri Dekko.Components |
| 35 | qmlRegisterType<ImageHelper>(uri, 1, 0, "ImageHelper"); |
| 36 | qmlRegisterType<StretchColumn>(uri, 1, 0, "StretchColumn"); |
| 37 | qmlRegisterType<StretchRow>(uri, 1, 0, "StretchRow"); |
| 38 | qmlRegisterType<Stretcher>(uri, 1, 0, "Stretcher"); |
| 39 | qmlRegisterType<PixelPerfectItem>(uri, 1, 0, "PixelPerfectItem"); |
| 40 | qmlRegisterUncreatableType<Paths>(uri, 1, 0, "Icons", "Cannot be created in QML. THis is just for access the Icons enums"); |
| 41 | qmlRegisterSingletonType<Paths>(uri, 1, 0, "Paths", Paths::factory); |
| 42 | qmlRegisterSingletonType<LogRecorder>(uri, 1, 0, "LogRecorder", LogRecorder::factory); |
| 43 | qmlRegisterSingletonType<Introspector>(uri, 1, 0, "Introspector", Introspector::qmlSingletonProvider); |
| 44 | } |
| 45 | |
| 46 | void ComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *uri) |
| 47 | { |
| 48 | QQmlExtensionPlugin::initializeEngine(engine, uri); |
| 49 | } |