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

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • render
  • eclipses
EclipsesPlugin.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 2012 Rene Kuettner <rene@bitkanal.net>
9 //
10 
11 #ifndef MARBLE_ECLIPSESPLUGIN_H
12 #define MARBLE_ECLIPSESPLUGIN_H
13 
14 #include "RenderPlugin.h"
15 #include "DialogConfigurationInterface.h"
16 
17 #include <QtCore/QObject>
18 #include <QMenu>
19 #include <QActionGroup>
20 
21 namespace Ui {
22  class EclipsesConfigDialog;
23  class EclipsesReminderDialog;
24 }
25 
26 namespace Marble
27 {
28 
29 class MarbleWidget;
30 class EclipsesModel;
31 class EclipsesItem;
32 class EclipsesBrowserDialog;
33 
40 class EclipsesPlugin : public RenderPlugin,
41  public DialogConfigurationInterface
42 {
43  Q_OBJECT
44  Q_PLUGIN_METADATA( IID "org.kde.edu.marble.EclipsesPlugin" )
45 
46  Q_INTERFACES( Marble::RenderPluginInterface )
47  Q_INTERFACES( Marble::DialogConfigurationInterface )
48  MARBLE_PLUGIN( EclipsesPlugin )
49 
50 public:
51  EclipsesPlugin();
52  explicit EclipsesPlugin( const MarbleModel *marbleModel );
53  virtual ~EclipsesPlugin();
54 
55  // this is the implementation of the RenderPlugin interface
56  // see RenderPlugin.h for a description
57 
58  QStringList backendTypes() const;
59  QString renderPolicy() const;
60  QStringList renderPosition() const;
61  QString name() const;
62  QString nameId() const;
63  QString guiString() const;
64  QString version() const;
65  QString description() const;
66  QString copyrightYears() const;
67  QList<PluginAuthor> pluginAuthors() const;
68  QIcon icon() const;
69  RenderPlugin::RenderType renderType() const;
70  QList<QActionGroup*>* actionGroups() const;
71  QDialog *configDialog();
72 
73  void initialize();
74  bool isInitialized() const;
75 
76  bool render( GeoPainter *painter,
77  ViewportParams *viewport,
78  const QString &renderPos,
79  GeoSceneLayer *layer );
80 
81  QHash<QString, QVariant> settings() const;
82  void setSettings( const QHash<QString, QVariant> &settings );
83 
84 protected:
85  bool eventFilter( QObject *object, QEvent *e );
86 
87 private Q_SLOTS:
88  void readSettings();
89  void writeSettings();
90  void updateSettings();
91 
98  void updateEclipses();
99 
109  void showEclipse( int year, int index );
110 
120  void showEclipseFromMenu( QAction *action );
121 
128  void updateMenuItemState();
129 
130 private:
131  bool renderItem( GeoPainter *painter, EclipsesItem *item ) const;
132 
133 private:
134  bool m_isInitialized;
135 
136  MarbleWidget *m_marbleWidget;
137 
138  EclipsesModel *m_model;
139  QList<QActionGroup*> m_actionGroups;
140  QActionGroup *m_eclipsesActionGroup;
141  QHash<QString, QVariant> m_settings;
142  QAction *m_eclipsesMenuAction;
143  QMenu *m_eclipsesListMenu;
144  int m_menuYear;
145 
146  // dialogs
147  QDialog *m_configDialog;
148  Ui::EclipsesConfigDialog *m_configWidget;
149  EclipsesBrowserDialog *m_browserDialog;
150  QDialog *m_reminderDialog;
151  Ui::EclipsesReminderDialog *m_reminderWidget;
152 };
153 
154 }
155 
156 #endif // MARBLE_ECLIPSESPLUGIN_H
QEvent
Marble::RenderPluginInterface
The class that specifies the Marble layer interface of a plugin.
Definition: RenderPluginInterface.h:30
Marble::EclipsesPlugin::copyrightYears
QString copyrightYears() const
Definition: EclipsesPlugin.cpp:122
QActionGroup
Marble::EclipsesBrowserDialog
The eclipse browser dialog.
Definition: EclipsesBrowserDialog.h:33
Marble::EclipsesPlugin::setSettings
void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: EclipsesPlugin.cpp:358
Marble::DialogConfigurationInterface
This interface allows a plugin to provide a QWidget-based configuration dialog which is accessible wi...
Definition: DialogConfigurationInterface.h:31
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::EclipsesPlugin::renderPolicy
QString renderPolicy() const
Return how the plugin settings should be used.
Definition: EclipsesPlugin.cpp:87
Marble::EclipsesPlugin::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: EclipsesPlugin.cpp:102
Marble::EclipsesPlugin::description
QString description() const
Returns a user description of the plugin.
Definition: EclipsesPlugin.cpp:117
Marble::EclipsesPlugin::initialize
void initialize()
Definition: EclipsesPlugin.cpp:156
Marble::EclipsesPlugin::actionGroups
QList< QActionGroup * > * actionGroups() const
Getting all actions.
Definition: EclipsesPlugin.cpp:145
Marble::EclipsesPlugin::eventFilter
bool eventFilter(QObject *object, QEvent *e)
Definition: EclipsesPlugin.cpp:223
Marble::RenderPlugin::action
QAction * action() const
Plugin's menu action.
Definition: RenderPlugin.cpp:88
Marble::EclipsesPlugin::renderPosition
QStringList renderPosition() const
Preferred level in the layer stack for the rendering.
Definition: EclipsesPlugin.cpp:92
Marble::EclipsesPlugin::version
QString version() const
Definition: EclipsesPlugin.cpp:112
Marble::EclipsesPlugin::backendTypes
QStringList backendTypes() const
Returns the name(s) of the backend that the plugin can render This method should return the name of t...
Definition: EclipsesPlugin.cpp:82
Marble::EclipsesPlugin::isInitialized
bool isInitialized() const
Definition: EclipsesPlugin.cpp:218
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
QHash< QString, QVariant >
Marble::EclipsesPlugin::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: EclipsesPlugin.cpp:150
QObject
DialogConfigurationInterface.h
Marble::EclipsesPlugin::render
bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer)
Renders the content provided by the layer on the viewport.
Definition: EclipsesPlugin.cpp:236
Marble::EclipsesPlugin::renderType
RenderPlugin::RenderType renderType() const
Render type of the plugin.
Definition: EclipsesPlugin.cpp:139
Marble::EclipsesPlugin::name
QString name() const
Returns the user-visible name of the plugin.
Definition: EclipsesPlugin.cpp:97
QString
QList
Marble::EclipsesPlugin::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: EclipsesPlugin.cpp:127
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::EclipsesPlugin
This plugin displays solar eclipses.
Definition: EclipsesPlugin.h:40
Marble::EclipsesPlugin::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: EclipsesPlugin.cpp:107
QMenu
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
RenderPlugin.h
QAction
QDialog
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
Marble::RenderPlugin::marbleModel
const MarbleModel * marbleModel() const
Access to the MarbleModel.
Definition: RenderPlugin.cpp:83
Marble::EclipsesPlugin::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: EclipsesPlugin.cpp:134
Marble::RenderPlugin::RenderType
RenderType
A Type of plugin.
Definition: RenderPlugin.h:59
Marble::EclipsesPlugin::~EclipsesPlugin
virtual ~EclipsesPlugin()
Definition: EclipsesPlugin.cpp:70
Marble::RenderPlugin
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
Marble::EclipsesItem
The representation of an eclipse event.
Definition: EclipsesItem.h:37
Marble::EclipsesPlugin::EclipsesPlugin
EclipsesPlugin()
Definition: EclipsesPlugin.cpp:34
QIcon
Marble::EclipsesModel
The model for eclipses.
Definition: EclipsesModel.h:36
Marble::EclipsesPlugin::settings
QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: EclipsesPlugin.cpp:353
MARBLE_PLUGIN
#define MARBLE_PLUGIN(T)
Definition: RenderPlugin.h:340
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 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
  • 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