Marble

MarbleDeclarativePlugin.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#include "MarbleDeclarativePlugin.h"
7
8#include "Coordinate.h"
9#include "MapTheme.h"
10#include "DeclarativeMapThemeManager.h"
11#include "MarbleDeclarativeObject.h"
12#include "PositionSource.h"
13#include "Bookmarks.h"
14#include "Tracking.h"
15#include "Routing.h"
16#include "Navigation.h"
17#include "RouteRequestModel.h"
18#include "Settings.h"
19#include "MapThemeModel.h"
20#include "NewstuffModel.h"
21#include "OfflineDataModel.h"
22#include "Placemark.h"
23#include "routing/SpeakersModel.h"
24#include "routing/VoiceNavigationModel.h"
25#include "routing/RoutingModel.h"
26#include "AbstractFloatItem.h"
27#include "RenderPlugin.h"
28#include "MarblePlacemarkModel.h"
29#include "SearchBackend.h"
30#include "MarbleQuickItem.h"
31#include "GeoItem.h"
32#include "GeoPolyline.h"
33
34#include <QQmlEngine>
35#include <QQmlContext>
36
38{
40
41 //@uri org.kde.marble
42 qmlRegisterType<Coordinate>( uri, 0, 20, "Coordinate" );
45
46 qmlRegisterType<Marble::Placemark>( uri, 0, 20, "Placemark" );
47 qmlRegisterType<Marble::PositionSource>( uri, 0, 20, "PositionSource" );
48 qmlRegisterType<Marble::Bookmarks>( uri, 0, 20, "Bookmarks" );
49 qmlRegisterType<Marble::Tracking>( uri, 0, 20, "Tracking" );
50 qmlRegisterType<Marble::Routing>( uri, 0, 20, "Routing" );
51 qmlRegisterType<Marble::Navigation>( uri, 0, 20, "Navigation" );
52 qmlRegisterType<RouteRequestModel>( uri, 0, 20, "RouteRequestModel" );
53 qmlRegisterType<Settings>( uri, 0, 20, "Settings" );
54
55 qmlRegisterType<MapThemeManager>( uri, 0, 20, "MapThemeManager" );
56 qmlRegisterType<Marble::SpeakersModel>( uri, 0, 20, "SpeakersModel" );
57 qmlRegisterType<Marble::VoiceNavigationModel>( uri, 0, 20, "VoiceNavigation" );
58 qmlRegisterType<Marble::NewstuffModel>( uri, 0, 20, "NewstuffModel" );
59 qmlRegisterType<OfflineDataModel>( uri, 0, 20, "OfflineDataModel" );
60 qmlRegisterType<MapThemeModel>( uri, 0, 20, "MapThemeModel" );
61
62 qmlRegisterType<Marble::SearchBackend>(uri, 0, 20, "SearchBackend");
64 qmlRegisterType<Marble::MarbleQuickItem>(uri, 0, 20, "MarbleItem");
65 qmlRegisterType<Marble::GeoItem>(uri, 0, 20, "GeoItem");
66 qmlRegisterType<Marble::GeoPolyline>(uri, 0, 20, "GeoPolyline");
67
68 qmlRegisterUncreatableType<Marble::MarblePlacemarkModel>(uri, 1, 0, "MarblePlacemarkModel",
69 QStringLiteral("MarblePlacemarkModel is not instantiable"));
70 qmlRegisterUncreatableType<Marble::RoutingModel>(uri, 0, 20, "RoutingModel",
71 QStringLiteral("RoutingModel is not instantiable"));
72 qmlRegisterUncreatableType<Marble::RouteRelationModel>(uri, 0, 20, "RouteRelationModel",
73 QStringLiteral("RouteRelationModel is not instantiable"));
74 qmlRegisterUncreatableType<Marble::BookmarksModel>(uri, 0, 20, "BookmarksModel",
75 QStringLiteral("Do not create"));
77 QStringLiteral("Do not create"));
78 qmlRegisterUncreatableType<Marble::RenderPlugin>(uri, 0, 20, "RenderPlugin",
79 QStringLiteral("Do not create"));
81 QStringLiteral("Do not create"));
82}
83
84void MarbleDeclarativePlugin::initializeEngine( QQmlEngine *engine, const char *)
85{
86 engine->addImageProvider(QStringLiteral("maptheme"), new MapThemeImageProvider );
87 // Register the global Marble object. Can be used in .qml files for requests like Marble.resolvePath("some/icon.png")
88 const QString marbleObjectName = QStringLiteral("Marble");
91 }
92}
93
94#include "moc_MarbleDeclarativePlugin.cpp"
Provides access to global Marble related properties and methods to QML (intended to be registered as ...
void registerTypes(const char *uri) override
Overriding QQmlExtensionPlugin to register types.
T qobject_cast(QObject *object)
QVariant contextProperty(const QString &name) const const
void setContextProperty(const QString &name, QObject *value)
void addImageProvider(const QString &providerId, QQmlImageProviderBase *provider)
QQmlContext * rootContext() const const
bool isValid() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.