GridPropertyWidget.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9 
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14 
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19 
20 /*!
21  * \file widgets/canvas/GridPropertyWidget.h
22  *
23  * \brief Defines a class that presents a widget with the grid properties to be edited.
24  */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_GRIDPROPERTYWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_GRIDPROPERTYWIDGET_H
28 
29 //TerraLib
30 #include "../Config.h"
31 #include "../propertybrowser/AbstractPropertyItem.h"
32 
33 // Qt
34 #include <QDockWidget>
35 
36 //Forward declarations
37 class QAction;
38 
39 namespace te
40 {
41  namespace qt
42  {
43  namespace widgets
44  {
45  // Forward declaration
46  class Grid;
47 
48  /*!
49  * \class GridPropertyWidget
50  *
51  * \brief a QDockWidget that contains a property browser object with grid properties.
52  *
53  * \ingroup widgets
54  */
55  class TEQTWIDGETSEXPORT GridPropertyWidget : public QDockWidget
56  {
57  Q_OBJECT
58 
59  public:
60  /** @name Constructor and destructor methods.
61  * Methods related to instantiation and destruction.
62  */
63  //@{
64 
65  /*!
66  * \brief Constructor.
67  *
68  * \param wid A pointer to a graphic scale object.
69  *
70  * \param editAction The action used to show edit widget.
71  */
72  GridPropertyWidget(Grid* wid, QAction* editAction);
73 
74  /*!
75  * \brief Destructor.
76  */
78  //@}
79 
80  /** @name Public slots.
81  * Methods to update the internal attributes of the class, using the signal-slot mechanism of QT.
82  */
83  //@{
84 
85  protected slots:
86 
87  /*!
88  * \brief This function must be called when the Grid related to it was closed.
89  */
90  void gridClosed();
91  //@}
92 
93  protected:
94 
95  QAction* m_editAction; //!< Action used to show the widget.
96  bool m_gridStatus; //!< Grid widget enabling status.
97  };
98 
99 
100  /*!
101  * \class GridPropertyBrowser
102  *
103  * \brief Widget with propeties of a Grid for the users to change the presentation of the grid on the display.
104  *
105  * \ingroup widgets
106  */
108  {
109  Q_OBJECT
110 
111  public:
112 
113  /** @name Constructor and destructor methods.
114  * Methods related to instantiation and destruction.
115  */
116  //@{
117 
118  /*!
119  * \brief Constructor.
120  *
121  * \param pb Property browser.
122  *
123  * \param wid ScaleWidget object to be used.
124  */
125  GridPropertyBrowser(QtTreePropertyBrowser* pb, Grid* wid);
126 
127  /*!
128  * \brief Destructor.
129  */
131  //@}
132 
133  protected slots:
134 
135  /** @name Protected slots.
136  * Methods to update the internal attributes of the class, using the signal-slot mechanism of QT.
137  */
138  //@{
139 
140  /*!
141  * \brief Called when a property of color type changed.
142  *
143  * \param p The property that was changed.
144  *
145  * \param value The new value.
146  */
147  void valueChanged(QtProperty* p, const QColor& value);
148 
149  /*!
150  * \brief Called when a property of font type changed.
151  *
152  * \param p The property that was changed.
153  *
154  * \param value The new value.
155  */
156  void valueChanged(QtProperty* p, const QFont& value);
157 
158  /*!
159  * \brief Called when a property of int type changed.
160  *
161  * \param p The property that was changed.
162  *
163  * \param value The new value.
164  */
165  void valueChanged(QtProperty* p, int value);
166  //@}
167 
168  Q_SIGNALS :
169 
170  /** @name Signals.
171  * Emmited to the grid to sinalizes the attributes that was changed.
172  */
173  //@{
174 
175  /*!
176  * \brief Emmited when the color was changed.
177  */
178  void colorChanged(const QColor&);
179 
180  /*!
181  * \brief Emmited when the font was changed.
182  */
183  void fontChanged(const QFont&);
184 
185  /*!
186  * \brief Emmited when the type was changed.
187  */
188  void gridTypeChanged(const int&);
189  //@}
190  };
191  }
192  }
193 }
194 
195 #endif //__TERRALIB_QT_WIDGETS_INTERNAL_GRIDPROPERTYWIDGET_H
#define slots
A widget used to define the main property items that can be used to describe a se object...
GridPropertyBrowser(QtTreePropertyBrowser *pb, Grid *wid)
Constructor.
void fontChanged(const QFont &)
Emmited when the font was changed.
bool m_gridStatus
Grid widget enabling status.
Widget with propeties of a Grid for the users to change the presentation of the grid on the display...
void gridTypeChanged(const int &)
Emmited when the type was changed.
TerraLib.
This class implements the grid, planar or geographic, to be used with the MapDisplay.
Definition: Grid.h:74
void colorChanged(const QColor &)
Emmited when the color was changed.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
a QDockWidget that contains a property browser object with grid properties.
void valueChanged(QtProperty *p, const QColor &value)
Called when a property of color type changed.
QAction * m_editAction
Action used to show the widget.