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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • plugins
  • 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 <earthwings@gentoo.org>
9 //
10 
11 #include "MarbleDeclarativePlugin.h"
12 
13 #include "Coordinate.h"
14 #include "DeclarativeMapThemeManager.h"
15 #include "MarbleDeclarativeObject.h"
16 #include "MarbleDeclarativeWidget.h"
17 #include "PositionSource.h"
18 #include "Bookmarks.h"
19 #include "CloudSync.h"
20 #include "cloudsync/MergeItem.h"
21 #include "Tracking.h"
22 #include "Routing.h"
23 #include "Navigation.h"
24 #include "Search.h"
25 #include "RouteRequestModel.h"
26 #include "Settings.h"
27 #include "MapThemeModel.h"
28 #include "NewstuffModel.h"
29 #include "OfflineDataModel.h"
30 #include "Placemark.h"
31 #include "routing/SpeakersModel.h"
32 #include "routing/VoiceNavigationModel.h"
33 #include "AbstractFloatItem.h"
34 #include "RenderPlugin.h"
35 #include "DeclarativeDataPlugin.h"
36 
37 #if QT_VERSION < 0x050000
38  #include <qdeclarative.h>
39  #include <QDeclarativeEngine>
40  typedef QDeclarativeEngine QQmlEngine;
41  typedef QDeclarativeComponent QQmlComponent;
42 #else
43  #include <QtQml/qqml.h>
44  #include <QQmlEngine>
45  #include <QQmlContext>
46 #endif
47 
48 void MarbleDeclarativePlugin::registerTypes( const char * )
49 {
50  const char* uri = "org.kde.edu.marble";
51 
52  //@uri org.kde.edu.marble
53  qmlRegisterType<Coordinate>( uri, 0, 11, "Coordinate" );
54  qmlRegisterType<Placemark>( uri, 0, 11, "Placemark" );
55  qmlRegisterType<PositionSource>( uri, 0, 11, "PositionSource" );
56  qmlRegisterType<Bookmarks>( uri, 0, 11, "Bookmarks" );
57  qmlRegisterType<Tracking>( uri, 0, 11, "Tracking" );
58  qmlRegisterType<Routing>( uri, 0, 11, "Routing" );
59  qmlRegisterType<Navigation>( uri, 0, 11, "Navigation" );
60  qmlRegisterType<Search>( uri, 0, 11, "Search" );
61  qmlRegisterType<CloudSync>( uri, 0, 11, "CloudSync" );
62  qmlRegisterType<Marble::MergeItem>( uri, 0, 11, "MergeItem" );
63  qmlRegisterType<RouteRequestModel>( uri, 0, 11, "RouteRequestModel" );
64  qmlRegisterType<Settings>( uri, 0, 11, "Settings" );
65 
66  qmlRegisterType<MarbleWidget>( uri, 0, 11, "MarbleWidget" );
67  qmlRegisterType<MapThemeManager>( uri, 0, 11, "MapThemeManager" );
68  qmlRegisterType<Marble::SpeakersModel>( uri, 0, 11, "SpeakersModel" );
69  qmlRegisterType<Marble::VoiceNavigationModel>( uri, 0, 11, "VoiceNavigation" );
70  qmlRegisterType<Marble::NewstuffModel>( uri, 0, 11, "NewstuffModel" );
71  qmlRegisterType<OfflineDataModel>( uri, 0, 11, "OfflineDataModel" );
72  qmlRegisterType<MapThemeModel>( uri, 0, 11, "MapThemeModel" );
73  qmlRegisterType<DeclarativeDataPlugin>( uri, 0, 11, "DataLayer" );
74 
75  qmlRegisterUncreatableType<BookmarksModel>( uri, 0, 11, "BookmarksModel", "Do not create" );
76  qmlRegisterUncreatableType<Marble::AbstractFloatItem>( uri, 0, 11, "FloatItem", "Do not create" );
77  qmlRegisterUncreatableType<Marble::RenderPlugin>( uri, 0, 11, "RenderPlugin", "Do not create" );
78 }
79 
80 void MarbleDeclarativePlugin::initializeEngine( QQmlEngine *engine, const char *)
81 {
82  engine->addImageProvider( "maptheme", new MapThemeImageProvider );
83  // Register the global Marble object. Can be used in .qml files for requests like Marble.resolvePath("some/icon.png")
84  if ( !engine->rootContext()->contextProperty( "Marble").isValid() ) {
85  engine->rootContext()->setContextProperty( "Marble", new MarbleDeclarativeObject( this ) );
86  }
87 }
88 
89 #include "MarbleDeclarativePlugin.moc"
90 
91 Q_EXPORT_PLUGIN2( MarbleDeclarativePlugin, MarbleDeclarativePlugin )
MarbleDeclarativeObject.h
PositionSource.h
MarbleDeclarativePlugin
Registers MarbleWidget, MarbleRunnerManager and MarbleThemeManager as QQml extensions for use in QML...
Definition: MarbleDeclarativePlugin.h:27
VoiceNavigationModel.h
CloudSync.h
QQmlEngine
QDeclarativeEngine QQmlEngine
Definition: MarbleDeclarativePlugin.cpp:40
OfflineDataModel.h
MarbleDeclarativePlugin.h
MapThemeImageProvider
Definition: DeclarativeMapThemeManager.h:23
MarbleDeclarativeWidget.h
Search.h
MapThemeModel.h
AbstractFloatItem.h
Navigation.h
Bookmarks.h
DeclarativeDataPlugin.h
NewstuffModel.h
MarbleDeclarativePlugin::initializeEngine
void initializeEngine(QDeclarativeEngine *engine, const char *)
Overriding QQmlExtensionPlugin to register image provider.
Definition: MarbleDeclarativePlugin.cpp:80
Routing.h
RouteRequestModel.h
SpeakersModel.h
Tracking.h
Q_EXPORT_PLUGIN2
#define Q_EXPORT_PLUGIN2(a, b)
Definition: marble_export.h:34
Settings.h
DeclarativeMapThemeManager.h
Placemark.h
RenderPlugin.h
Coordinate.h
MergeItem.h
MarbleDeclarativeObject
Provides access to global Marble related properties and methods to QML (intended to be registered as ...
Definition: MarbleDeclarativeObject.h:22
QQmlComponent
QDeclarativeComponent QQmlComponent
Definition: MarbleDeclarativePlugin.cpp:41
MarbleDeclarativePlugin::registerTypes
virtual void registerTypes(const char *uri)
Overriding QQmlExtensionPlugin to register types.
Definition: MarbleDeclarativePlugin.cpp:48
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:51 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   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