16
16
* (at your option) any later version. *
18
18
***************************************************************************/
19
/* $Id: plugin.h 5450 2006-05-14 04:54:03Z g_j_m $ */
20
20
#ifndef QGSNORTHARROWPLUGIN
21
21
#define QGSNORTHARROWPLUGIN
23
23
#include "../qgisplugin.h"
26
#include <QStringList>
29
33
* \brief North Arrow plugin for QGIS
32
class QgsNorthArrowPlugin:public QObject, public QgisPlugin
36
class QgsNorthArrowPlugin: public QObject, public QgisPlugin
36
* Constructor for a plugin. The QgisApp and QgisIface pointers are passed by
37
* QGIS when it attempts to instantiate the plugin.
38
* @param qgis Pointer to the QgisApp object
39
* @param qI Pointer to the QgisIface object.
41
QgsNorthArrowPlugin(QgisApp * , QgisIface * );
43
virtual ~QgsNorthArrowPlugin();
40
* Constructor for a plugin. The QgisInterface pointer is passed by
41
* QGIS when it attempts to instantiate the plugin.
42
* @param qI Pointer to the QgisInterface object.
44
QgsNorthArrowPlugin( QgisInterface * );
46
virtual ~QgsNorthArrowPlugin();
46
virtual void initGui();
47
//!set values on the gui when a project is read or the gui first loaded
49
//! Show the dialog box
51
// draw some arbitary text to the screen
52
void renderNorthArrow(QPainter *);
53
//! Run when the user has set a new rotation
54
void rotationChanged(int);
55
//! Refresh the map display using the mapcanvas exported via the plugin interface
59
//! show the help document
61
//! set north arrow placement
62
void setPlacement(int);
63
//! enable or disable north arrow
64
void setEnabled(bool);
65
//! enable or disable the automatic setting of the arrow direction
66
void setAutomatic(bool);
67
//! try to calculate the direction for the north arrow. Sets the
68
// private class rotation variable. If unable to calculate the
69
// direction, the function returns false and leaves the rotation
71
bool calculateNorthDirection();
75
static const double PI;
76
// static const double DEG2RAD;
77
static const double TOL;
79
// The amount of rotation for the north arrow
82
// enable or disable north arrow
84
//! enable or disable the automatic setting of the arrow direction
86
// The placement index and translated text
88
QStringList mPlacementLabels;
89
//! Pointer to our toolbar
90
QToolBar *toolBarPointer;
91
//! Pionter to QGIS main application object
92
QgisApp *qgisMainWindowPointer;
93
//! Pointer to the QGIS interface object
94
QgisIface *qGisInterface;
95
//! Pointer to the QAction object used in the menu and toolbar
96
QAction *myQActionPointer;
49
virtual void initGui();
50
//!set values on the gui when a project is read or the gui first loaded
52
//! Show the dialog box
54
// draw some arbitary text to the screen
55
void renderNorthArrow( QPainter * );
56
//! Run when the user has set a new rotation
57
void rotationChanged( int );
58
//! Refresh the map display using the mapcanvas exported via the plugin interface
62
//! show the help document
64
//! set north arrow placement
65
void setPlacement( int );
66
//! enable or disable north arrow
67
void setEnabled( bool );
68
//! enable or disable the automatic setting of the arrow direction
69
void setAutomatic( bool );
70
//! try to calculate the direction for the north arrow. Sets the
71
// private class rotation variable. If unable to calculate the
72
// direction, the function returns false and leaves the rotation
74
bool calculateNorthDirection();
75
//! update the plugins theme when the app tells us its theme is changed
76
void setCurrentTheme( QString theThemeName );
80
static const double PI;
81
// static const double DEG2RAD;
82
static const double TOL;
84
// The amount of rotation for the north arrow
87
// enable or disable north arrow
89
//! enable or disable the automatic setting of the arrow direction
91
// The placement index and translated text
93
QStringList mPlacementLabels;
94
//! Pointer to the QGIS interface object
95
QgisInterface *qGisInterface;
96
//! Pointer to the QAction object used in the menu and toolbar
97
QAction *myQActionPointer;