/* * Copyright (C) 2013 Canonical, Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Author: Nick Dedekind */ // Self #include "fake_unity_plugin.h" // local #include "fake_scopes.h" #include "fake_categories.h" #include "fake_filters.h" #include "fake_navigation.h" #include "fake_optionselectoroptions.h" #include "fake_previewmodel.h" #include "fake_previewwidgetmodel.h" #include "fake_resultsmodel.h" #include "fake_settingsmodel.h" #include "fake_valueslidervalues.h" // External #include #include void FakeUnityPlugin::registerTypes(const char *uri) { #ifndef GLIB_VERSION_2_36 g_type_init(); #endif Q_ASSERT(uri == QLatin1String("Unity")); qmlRegisterType(uri, 0, 2, "Scopes"); qmlRegisterType(uri, 0, 2, "MockScope"); qmlRegisterUncreatableType(uri, 0, 2, "Scope", "Can't create Scope object in QML."); qmlRegisterUncreatableType(uri, 0, 2, "SettingsModel", "Can't create SettingsModel object in QML."); qmlRegisterUncreatableType(uri, 0, 2, "Navigation", "Can't create Navigation object in QML."); qmlRegisterUncreatableType(uri, 0, 2, "Categories", "Can't create Categories object in QML."); qmlRegisterUncreatableType(uri, 0, 2, "PreviewModel", "Can't create new PreviewModel in QML. Get them from Scope instance."); qmlRegisterUncreatableType(uri, 0, 2, "ResultsModel", "Can't create ResultsModel object in QML."); qmlRegisterType(uri, 0, 2, "FakeResultsModel"); qmlRegisterType(uri, 0, 2, "FakePreviewModel"); qmlRegisterUncreatableType(uri, 0, 2, "PreviewWidgetModel", "Can't create new PreviewWidgetModel in QML. Get them from PreviewModel instance."); qmlRegisterUncreatableType(uri, 0, 2, "Filters", "Can't create Filters object in QML. Get them from Scope instance."); qmlRegisterUncreatableType(uri, 0, 2, "Filter", "Can't create Filter object in QML. Get them from Scope instance."); qmlRegisterUncreatableType(uri, 0, 2, "OptionSelectorOptions", "Can't create OptionSelectorOptions object in QML"); qmlRegisterUncreatableType(uri, 0, 2, "ValueSliderValues", "Can't create ValueSliderValuesInterface object in QML"); }