• 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
  • lib
  • marble
RenderPlugin.h
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 2008 Torsten Rahn <tackat@kde.org>
9 // Copyright 2008 Inge Wallin <inge@lysator.liu.se>
10 // Copyright 2011,2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
11 // Copyright 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
12 //
13 
14 #ifndef MARBLE_RENDERPLUGIN_H
15 #define MARBLE_RENDERPLUGIN_H
16 
17 #include <QObject>
18 #include <QString>
19 #include <Qt>
20 
21 #include "RenderPluginInterface.h"
22 #include "marble_export.h"
23 
24 
25 class QAction;
26 class QActionGroup;
27 class QStandardItem;
28 
29 namespace Marble
30 {
31 
32 class MarbleModel;
33 class RenderPluginModel;
34 
43 class MARBLE_EXPORT RenderPlugin : public QObject, public RenderPluginInterface
44 {
45  Q_OBJECT
46 
47  Q_PROPERTY ( QString name READ name CONSTANT )
48  Q_PROPERTY ( QString nameId READ nameId CONSTANT )
49  Q_PROPERTY ( QString version READ version CONSTANT )
50  Q_PROPERTY ( QString description READ description CONSTANT )
51  Q_PROPERTY ( bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged )
52  Q_PROPERTY ( bool visible READ visible WRITE setVisible NOTIFY visibilityChanged )
53  Q_PROPERTY ( bool userCheckable READ isUserCheckable WRITE setUserCheckable NOTIFY userCheckableChanged )
54 
55  public:
59  enum RenderType {
60  UnknownRenderType,
61  TopLevelRenderType,
62  PanelRenderType,
63  OnlineRenderType,
64  ThemeRenderType
65  };
66 
67  explicit RenderPlugin( const MarbleModel *marbleModel );
68  virtual ~RenderPlugin();
69 
79  virtual QString guiString() const = 0;
80 
91  virtual RenderPlugin *newInstance( const MarbleModel *marbleModel ) const = 0;
92 
102  const MarbleModel* marbleModel() const;
103 
114  virtual const QList<QActionGroup*>* actionGroups() const;
115 
126  virtual const QList<QActionGroup*>* toolbarActionGroups() const;
127 
139  bool enabled() const;
140 
151  bool visible() const;
152 
166  bool isUserCheckable() const;
167 
178  virtual QHash<QString,QVariant> settings() const;
179 
188  virtual void setSettings( const QHash<QString,QVariant> &settings );
189 
199  virtual RenderType renderType() const;
200  virtual QString runtimeTrace() const;
201 
202  public Q_SLOTS:
214  void setEnabled( bool enabled );
215 
224  void setVisible( bool visible );
225 
235  void setUserCheckable(bool isUserCheckable);
236 
243  void restoreDefaultSettings();
244 
253  QStringList settingKeys();
254 
264  bool setSetting( const QString & key, const QVariant & value );
265 
275  QVariant setting( const QString & key );
276 
284  QAction *action() const;
285 
286  Q_SIGNALS:
290  void visibilityChanged( bool visible, const QString &nameId );
291 
295  void enabledChanged( bool enable );
296 
300  void userCheckableChanged(bool isUserCheckable);
301 
305  void settingsChanged( QString nameId );
306 
311  void actionGroupsChanged();
312 
318  void repaintNeeded( QRegion dirtyRegion = QRegion() );
319 
320  protected:
321  bool eventFilter( QObject *, QEvent * );
322 
323  private:
324  friend class RenderPluginModel;
325 
326  QStandardItem *item();
327 
328  void applyItemState();
329  void retrieveItemState();
330 
331  private:
332  Q_DISABLE_COPY( RenderPlugin )
333  class Private;
334  Private * const d;
335 };
336 
337 #define MARBLE_PLUGIN(T) public:\
338  virtual RenderPlugin* newInstance( const MarbleModel *marbleModel ) const { return new T( marbleModel ); }
339 }
340 
341 #endif
Marble::RenderPluginModel
Provides common access to various kinds of plugins without having to know about their details...
Definition: RenderPluginModel.h:30
Marble::RenderPlugin::TopLevelRenderType
Definition: RenderPlugin.h:61
Marble::RenderPluginInterface
The class that specifies the Marble layer interface of a plugin.
Definition: RenderPluginInterface.h:30
RenderPluginInterface.h
Marble::RenderPlugin::UnknownRenderType
Definition: RenderPlugin.h:60
QObject
Marble::RenderPlugin::PanelRenderType
Definition: RenderPlugin.h:62
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
Marble::RenderPlugin::OnlineRenderType
Definition: RenderPlugin.h:63
marble_export.h
Marble::RenderPlugin::RenderType
RenderType
A Type of plugin.
Definition: RenderPlugin.h:59
Marble::RenderPlugin
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:52 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