• 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
  • render
  • mapscale
MapScaleFloatItem.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 //
10 
11 #ifndef MAPSCALEFLOATITEM_H
12 #define MAPSCALEFLOATITEM_H
13 
14 #include <QObject>
15 
16 #include "AbstractFloatItem.h"
17 #include "DialogConfigurationInterface.h"
18 
19 namespace Ui
20 {
21  class MapScaleConfigWidget;
22 }
23 
24 namespace Marble
25 {
26 
32 class MapScaleFloatItem : public AbstractFloatItem, public DialogConfigurationInterface
33 {
34  Q_OBJECT
35  Q_PLUGIN_METADATA( IID "org.kde.edu.marble.MapScaleFloatItem" )
36  Q_INTERFACES( Marble::RenderPluginInterface )
37  Q_INTERFACES( Marble::DialogConfigurationInterface )
38  MARBLE_PLUGIN( MapScaleFloatItem )
39  public:
40  MapScaleFloatItem();
41  explicit MapScaleFloatItem( const MarbleModel *marbleModel );
42  ~MapScaleFloatItem();
43 
44  QStringList backendTypes() const;
45 
46  QString name() const;
47 
48  QString guiString() const;
49 
50  QString nameId() const;
51 
52  QString version() const;
53 
54  QString description() const;
55 
56  QString copyrightYears() const;
57 
58  QList<PluginAuthor> pluginAuthors() const;
59 
60  QIcon icon () const;
61 
62  void initialize ();
63 
64  bool isInitialized () const;
65 
66  void changeViewport( ViewportParams *viewport );
67 
68  void paintContent( QPainter *painter );
69 
70 
71  QDialog *configDialog();
72 
73  protected:
74  virtual void contextMenuEvent( QWidget *w, QContextMenuEvent *e );
75  virtual void toolTipEvent( QHelpEvent *e );
76 
77  private Q_SLOTS:
78  void readSettings();
79  void writeSettings();
80  void toggleRatioScaleVisibility();
81  void toggleMinimized();
82 
83 private:
84  void calcScaleBar();
85 
86  private:
87  QDialog *m_configDialog;
88  Ui::MapScaleConfigWidget *ui_configWidget;
89 
90  int m_radius;
91 
92  QString m_target;
93 
94  int m_leftBarMargin;
95  int m_rightBarMargin;
96  int m_scaleBarWidth;
97  int m_viewportWidth;
98  int m_scaleBarHeight;
99  qreal m_scaleBarDistance;
100 
101  qreal m_pixel2Length;
102  int m_bestDivisor;
103  int m_pixelInterval;
104  int m_valueInterval;
105 
106  QString m_ratioString;
107 
108  bool m_scaleInitDone;
109 
110  bool m_showRatioScale;
111 
112  QMenu* m_contextMenu;
113 
114  QAction *m_minimizeAction;
115  bool m_minimized;
116  int m_widthScaleFactor;
117 };
118 
119 }
120 
121 #endif // MAPSCALEFLOATITEM_H
QPainter
Marble::RenderPluginInterface
The class that specifies the Marble layer interface of a plugin.
Definition: RenderPluginInterface.h:30
Marble::DialogConfigurationInterface
This interface allows a plugin to provide a QWidget-based configuration dialog which is accessible wi...
Definition: DialogConfigurationInterface.h:31
QDialog
Marble::MapScaleFloatItem::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: MapScaleFloatItem.cpp:90
Marble::MapScaleFloatItem::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: MapScaleFloatItem.cpp:110
Marble::MapScaleFloatItem::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: MapScaleFloatItem.cpp:75
AbstractFloatItem.h
QWidget
Marble::MapScaleFloatItem::name
QString name() const
Returns the user-visible name of the plugin.
Definition: MapScaleFloatItem.cpp:80
Marble::MapScaleFloatItem::copyrightYears
QString copyrightYears() const
Definition: MapScaleFloatItem.cpp:105
Marble::MapScaleFloatItem::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: MapScaleFloatItem.cpp:347
Marble::MapScaleFloatItem::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: MapScaleFloatItem.cpp:85
Marble::MapScaleFloatItem::~MapScaleFloatItem
~MapScaleFloatItem()
Definition: MapScaleFloatItem.cpp:71
Marble::MapScaleFloatItem::toolTipEvent
virtual void toolTipEvent(QHelpEvent *e)
Definition: MapScaleFloatItem.cpp:393
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:48
Marble::MapScaleFloatItem
The class that creates a map scale.
Definition: MapScaleFloatItem.h:32
Marble::MapScaleFloatItem::version
QString version() const
Definition: MapScaleFloatItem.cpp:95
Marble::MapScaleFloatItem::MapScaleFloatItem
MapScaleFloatItem()
Definition: MapScaleFloatItem.cpp:34
DialogConfigurationInterface.h
Marble::MapScaleFloatItem::isInitialized
bool isInitialized() const
Definition: MapScaleFloatItem.cpp:128
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::MapScaleFloatItem::initialize
void initialize()
Definition: MapScaleFloatItem.cpp:124
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
Marble::MapScaleFloatItem::contextMenuEvent
virtual void contextMenuEvent(QWidget *w, QContextMenuEvent *e)
Definition: MapScaleFloatItem.cpp:369
Marble::MapScaleFloatItem::description
QString description() const
Returns a user description of the plugin.
Definition: MapScaleFloatItem.cpp:100
Marble::MapScaleFloatItem::changeViewport
void changeViewport(ViewportParams *viewport)
Definition: MapScaleFloatItem.cpp:133
Marble::MapScaleFloatItem::paintContent
void paintContent(QPainter *painter)
Here the items paint their content.
Definition: MapScaleFloatItem.cpp:187
Marble::RenderPlugin::marbleModel
const MarbleModel * marbleModel() const
Access to the MarbleModel.
Definition: RenderPlugin.cpp:81
Marble::MapScaleFloatItem::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: MapScaleFloatItem.cpp:118
MARBLE_PLUGIN
#define MARBLE_PLUGIN(T)
Definition: RenderPlugin.h:337
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