• 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
  • 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  explicit MapScaleFloatItem( const MarbleModel *marbleModel = 0 );
41  ~MapScaleFloatItem();
42 
43  QStringList backendTypes() const;
44 
45  QString name() const;
46 
47  QString guiString() const;
48 
49  QString nameId() const;
50 
51  QString version() const;
52 
53  QString description() const;
54 
55  QString copyrightYears() const;
56 
57  QList<PluginAuthor> pluginAuthors() const;
58 
59  QIcon icon () const;
60 
61  void initialize ();
62 
63  bool isInitialized () const;
64 
65  void setProjection( const ViewportParams *viewport );
66 
67  void paintContent( QPainter *painter );
68 
69 
70  QDialog *configDialog();
71 
72  protected:
73  virtual void contextMenuEvent( QWidget *w, QContextMenuEvent *e );
74  virtual void toolTipEvent( QHelpEvent *e );
75 
76  private Q_SLOTS:
77  void readSettings();
78  void writeSettings();
79  void toggleRatioScaleVisibility();
80  void toggleMinimized();
81 
82 private:
83  void calcScaleBar();
84 
85  private:
86  QDialog *m_configDialog;
87  Ui::MapScaleConfigWidget *ui_configWidget;
88 
89  int m_radius;
90 
91  QString m_target;
92 
93  int m_leftBarMargin;
94  int m_rightBarMargin;
95  int m_scaleBarWidth;
96  int m_viewportWidth;
97  int m_scaleBarHeight;
98  qreal m_scaleBarDistance;
99 
100  qreal m_pixel2Length;
101  int m_bestDivisor;
102  int m_pixelInterval;
103  int m_valueInterval;
104 
105  QString m_ratioString;
106 
107  bool m_scaleInitDone;
108 
109  bool m_showRatioScale;
110 
111  QMenu* m_contextMenu;
112 
113  QAction *m_minimizeAction;
114  bool m_minimized;
115  int m_widthScaleFactor;
116 };
117 
118 }
119 
120 #endif // MAPSCALEFLOATITEM_H
Marble::MapScaleFloatItem::setProjection
void setProjection(const ViewportParams *viewport)
Definition: MapScaleFloatItem.cpp:128
Marble::RenderPluginInterface
The class that specifies the Marble layer interface of a plugin.
Definition: RenderPluginInterface.h:30
QWidget
Marble::DialogConfigurationInterface
This interface allows a plugin to provide a QWidget-based configuration dialog which is accessible wi...
Definition: DialogConfigurationInterface.h:31
Marble::MapScaleFloatItem::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: MapScaleFloatItem.cpp:85
Marble::MapScaleFloatItem::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: MapScaleFloatItem.cpp:105
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:70
AbstractFloatItem.h
Marble::MapScaleFloatItem::name
QString name() const
Returns the user-visible name of the plugin.
Definition: MapScaleFloatItem.cpp:75
Marble::MapScaleFloatItem::copyrightYears
QString copyrightYears() const
Definition: MapScaleFloatItem.cpp:100
Marble::MapScaleFloatItem::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: MapScaleFloatItem.cpp:357
Marble::MapScaleFloatItem::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: MapScaleFloatItem.cpp:80
Marble::MapScaleFloatItem::~MapScaleFloatItem
~MapScaleFloatItem()
Definition: MapScaleFloatItem.cpp:66
Marble::MapScaleFloatItem::toolTipEvent
virtual void toolTipEvent(QHelpEvent *e)
Definition: MapScaleFloatItem.cpp:403
Marble::MapScaleFloatItem::MapScaleFloatItem
MapScaleFloatItem(const MarbleModel *marbleModel=0)
Definition: MapScaleFloatItem.cpp:36
QContextMenuEvent
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:45
QPainter
Marble::MapScaleFloatItem
The class that creates a map scale.
Definition: MapScaleFloatItem.h:32
Marble::MapScaleFloatItem::version
QString version() const
Definition: MapScaleFloatItem.cpp:90
DialogConfigurationInterface.h
QString
QList
Marble::MapScaleFloatItem::isInitialized
bool isInitialized() const
Definition: MapScaleFloatItem.cpp:123
QStringList
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:119
QMenu
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
Marble::MapScaleFloatItem::contextMenuEvent
virtual void contextMenuEvent(QWidget *w, QContextMenuEvent *e)
Definition: MapScaleFloatItem.cpp:379
Marble::MapScaleFloatItem::description
QString description() const
Returns a user description of the plugin.
Definition: MapScaleFloatItem.cpp:95
QAction
QDialog
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:83
QHelpEvent
Marble::MapScaleFloatItem::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: MapScaleFloatItem.cpp:113
QIcon
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:40 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