• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • kde-4.x
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • declarative
MarbleDeclarativePlugin.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2010 Dennis Nienhüser <[email protected]>
9 //
10 
11 #include "MarbleDeclarativePlugin.h"
12 
13 #include "Coordinate.h"
14 #include "DeclarativeMapThemeManager.h"
15 #include "MarbleDeclarativeObject.h"
16 #include "PositionSource.h"
17 #include "Bookmarks.h"
18 #include "Tracking.h"
19 #include "Routing.h"
20 #include "Navigation.h"
21 #include "RouteRequestModel.h"
22 #include "Settings.h"
23 #include "MapThemeModel.h"
24 #include "NewstuffModel.h"
25 #include "OfflineDataModel.h"
26 #include "Placemark.h"
27 #include "routing/SpeakersModel.h"
28 #include "routing/VoiceNavigationModel.h"
29 #include "routing/RoutingModel.h"
30 #include "AbstractFloatItem.h"
31 #include "RenderPlugin.h"
32 #include "MarblePlacemarkModel.h"
33 #include "SearchBackend.h"
34 #include "MarbleQuickItem.h"
35 #include "GeoItem.h"
36 #include "GeoPolyline.h"
37 
38 #include <QQmlEngine>
39 #include <QQmlContext>
40 
41 void MarbleDeclarativePlugin::registerTypes( const char *uri )
42 {
43  qRegisterMetaType<Marble::MarbleMap*>("MarbleMap*");
44 
45  //@uri org.kde.marble
46  qmlRegisterType<Coordinate>( uri, 0, 20, "Coordinate" );
47  qmlRegisterType<Marble::Placemark>( uri, 0, 20, "Placemark" );
48  qmlRegisterType<Marble::PositionSource>( uri, 0, 20, "PositionSource" );
49  qmlRegisterType<Marble::Bookmarks>( uri, 0, 20, "Bookmarks" );
50  qmlRegisterType<Marble::Tracking>( uri, 0, 20, "Tracking" );
51  qmlRegisterType<Marble::Routing>( uri, 0, 20, "Routing" );
52  qmlRegisterType<Marble::Navigation>( uri, 0, 20, "Navigation" );
53  qmlRegisterType<RouteRequestModel>( uri, 0, 20, "RouteRequestModel" );
54  qmlRegisterType<Settings>( uri, 0, 20, "Settings" );
55 
56  qmlRegisterType<MapThemeManager>( uri, 0, 20, "MapThemeManager" );
57  qmlRegisterType<Marble::SpeakersModel>( uri, 0, 20, "SpeakersModel" );
58  qmlRegisterType<Marble::VoiceNavigationModel>( uri, 0, 20, "VoiceNavigation" );
59  qmlRegisterType<Marble::NewstuffModel>( uri, 0, 20, "NewstuffModel" );
60  qmlRegisterType<OfflineDataModel>( uri, 0, 20, "OfflineDataModel" );
61  qmlRegisterType<MapThemeModel>( uri, 0, 20, "MapThemeModel" );
62 
63  qmlRegisterType<Marble::SearchBackend>(uri, 0, 20, "SearchBackend");
64  qRegisterMetaType<Marble::MarblePlacemarkModel*>("MarblePlacemarkModel*");
65  qmlRegisterType<Marble::MarbleQuickItem>(uri, 0, 20, "MarbleItem");
66  qmlRegisterType<Marble::GeoItem>(uri, 0, 20, "GeoItem");
67  qmlRegisterType<Marble::GeoPolyline>(uri, 0, 20, "GeoPolyline");
68 
69 
70  qmlRegisterUncreatableType<Marble::MarblePlacemarkModel>(uri, 1, 0, "MarblePlacemarkModel",
71  QStringLiteral("MarblePlacemarkModel is not instantiable"));
72  qmlRegisterUncreatableType<Marble::RoutingModel>(uri, 0, 20, "RoutingModel",
73  QStringLiteral("RoutingModel is not instantiable"));
74  qmlRegisterUncreatableType<Marble::RouteRelationModel>(uri, 0, 20, "RouteRelationModel",
75  QStringLiteral("RouteRelationModel is not instantiable"));
76  qmlRegisterUncreatableType<Marble::BookmarksModel>(uri, 0, 20, "BookmarksModel",
77  QStringLiteral("Do not create"));
78  qmlRegisterUncreatableType<Marble::AbstractFloatItem>(uri, 0, 20, "FloatItem",
79  QStringLiteral("Do not create"));
80  qmlRegisterUncreatableType<Marble::RenderPlugin>(uri, 0, 20, "RenderPlugin",
81  QStringLiteral("Do not create"));
82  qmlRegisterUncreatableType<Marble::MarbleMap>(uri, 0, 20, "MarbleMap",
83  QStringLiteral("Do not create"));
84 }
85 
86 void MarbleDeclarativePlugin::initializeEngine( QQmlEngine *engine, const char *)
87 {
88  engine->addImageProvider(QStringLiteral("maptheme"), new MapThemeImageProvider );
89  // Register the global Marble object. Can be used in .qml files for requests like Marble.resolvePath("some/icon.png")
90  const QString marbleObjectName = QStringLiteral("Marble");
91  if (!engine->rootContext()->contextProperty(marbleObjectName).isValid()) {
92  engine->rootContext()->setContextProperty(marbleObjectName, new MarbleDeclarativeObject(this));
93  }
94 }
95 
96 #include "moc_MarbleDeclarativePlugin.cpp"
MarbleDeclarativeObject.h
PositionSource.h
RoutingModel.h
VoiceNavigationModel.h
OfflineDataModel.h
MarbleDeclarativePlugin.h
MapThemeImageProvider
Definition: DeclarativeMapThemeManager.h:18
MapThemeModel.h
MarbleDeclarativePlugin::registerTypes
void registerTypes(const char *uri) override
Overriding QQmlExtensionPlugin to register types.
Definition: MarbleDeclarativePlugin.cpp:41
GeoItem.h
MarbleDeclarativePlugin::initializeEngine
void initializeEngine(QQmlEngine *engine, const char *) override
Definition: MarbleDeclarativePlugin.cpp:86
AbstractFloatItem.h
Navigation.h
Bookmarks.h
NewstuffModel.h
GeoPolyline.h
MarbleQuickItem.h
Routing.h
RouteRequestModel.h
SpeakersModel.h
Tracking.h
QString
MarblePlacemarkModel.h
Settings.h
DeclarativeMapThemeManager.h
Placemark.h
SearchBackend.h
RenderPlugin.h
Coordinate.h
MarbleDeclarativeObject
Provides access to global Marble related properties and methods to QML (intended to be registered as ...
Definition: MarbleDeclarativeObject.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Dec 16 2019 00:26:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  •   KmPlot
  • libkeduvocdocument
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   src
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal