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 namespace te
37 {
38  namespace qt
39  {
40  namespace widgets
41  {
42  // Forward declaration
43  class Grid;
44 
45  /*!
46  * \class GridPropertyWidget
47  *
48  * \brief a QDockWidget that contains a property browser object with grid properties.
49  *
50  * \ingroup widgets
51  */
52  class TEQTWIDGETSEXPORT GridPropertyWidget : public QDockWidget
53  {
54  Q_OBJECT
55 
56  public:
57  /** @name Constructor and destructor methods.
58  * Methods related to instantiation and destruction.
59  */
60  //@{
61 
62  /*!
63  * \brief Constructor.
64  *
65  * \param wid A pointer to a graphic scale object.
66  *
67  * \param parent The parent widget (Used by Qt to control the life cicle of the object).
68  */
69  GridPropertyWidget(Grid* wid, QWidget* parent = 0);
70 
71  /*!
72  * \brief Destructor.
73  */
75  //@}
76 
77  /** @name Public slots.
78  * Methods to update the internal attributes of the class, using the signal-slot mechanism of QT.
79  */
80  //@{
81 
82  protected slots:
83 
84  /*!
85  * \brief This function must be called when the Grid related to it was closed.
86  */
87  void gridClosed();
88  //@}
89  };
90 
91 
92  /*!
93  * \class GridPropertyBrowser
94  *
95  * \brief Widget with propeties of a Grid for the users to change the presentation of the grid on the display.
96  *
97  * \ingroup widgets
98  */
100  {
101  Q_OBJECT
102 
103  public:
104 
105  /** @name Constructor and destructor methods.
106  * Methods related to instantiation and destruction.
107  */
108  //@{
109 
110  /*!
111  * \brief Constructor.
112  *
113  * \param pb Property browser.
114  *
115  * \param wid ScaleWidget object to be used.
116  */
117  GridPropertyBrowser(QtTreePropertyBrowser* pb, Grid* wid);
118 
119  /*!
120  * \brief Destructor.
121  */
123  //@}
124 
125  protected slots:
126 
127  /** @name Protected slots.
128  * Methods to update the internal attributes of the class, using the signal-slot mechanism of QT.
129  */
130  //@{
131 
132  /*!
133  * \brief Called when a property of color type changed.
134  *
135  * \param p The property that was changed.
136  *
137  * \param value The new value.
138  */
139  void valueChanged(QtProperty* p, const QColor& value);
140 
141  /*!
142  * \brief Called when a property of font type changed.
143  *
144  * \param p The property that was changed.
145  *
146  * \param value The new value.
147  */
148  void valueChanged(QtProperty* p, const QFont& value);
149 
150  /*!
151  * \brief Called when a property of int type changed.
152  *
153  * \param p The property that was changed.
154  *
155  * \param value The new value.
156  */
157  void valueChanged(QtProperty* p, int value);
158  //@}
159 
160  Q_SIGNALS :
161 
162  /** @name Signals.
163  * Emmited to the grid to sinalizes the attributes that was changed.
164  */
165  //@{
166 
167  /*!
168  * \brief Emmited when the color was changed.
169  */
170  void colorChanged(const QColor&);
171 
172  /*!
173  * \brief Emmited when the font was changed.
174  */
175  void fontChanged(const QFont&);
176 
177  /*!
178  * \brief Emmited when the type was changed.
179  */
180  void gridTypeChanged(const int&);
181  //@}
182  };
183  }
184  }
185 }
186 
187 #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...
Widget with propeties of a Grid for the users to change the presentation of the grid on the display...
URI C++ Library.
This class implements the grid, planar or geographic, to be used with the MapDisplay.
Definition: Grid.h:74
#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.