ApplicationEvents.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 ApplicationEvents.h
22 
23  \brief Contains the list of the application events.
24 */
25 
26 #ifndef __TERRALIB_QT_AF_EVENTS_INTERNAL_APPLICATIONREVENTS_H
27 #define __TERRALIB_QT_AF_EVENTS_INTERNAL_APPLICATIONREVENTS_H
28 
29 #include "Event.h"
30 #include "Enums.h"
31 
32 // Qt
33 #include <QSize>
34 #include <QList>
35 
36 // Forward declarations
37 class QToolBar;
38 class QAction;
39 
40 namespace te
41 {
42  namespace qt
43  {
44  namespace widgets
45  {
46  // Forward declarations
47  class MapDisplay;
48  class LayerItemView;
49  }
50 
51  namespace af
52  {
53  namespace evt
54  {
55  /*!
56  \struct AppClosed
57 
58  \brief This event signals that the application is about to close.
59  */
60  struct AppClosed : public Event
61  {
62  /*!
63  \brief Constructor.
64  */
65  AppClosed() :
67  {
68  }
69  };
70 
71  /*!
72  \struct DisplayResized
73 
74  \brief This event signals that a display was resized.
75  */
76  struct DisplayResized : public Event
77  {
78  /*!
79  \brief Constructor.
80 
81  \param display The pointer to the display resized.
82 
83  \param newSize The new size of the display.
84 
85  \param oldSize The old size if the display.
86  */
87  DisplayResized(te::qt::widgets::MapDisplay* display, const QSize& newSize, const QSize& oldSize) :
89  m_display(display),
90  m_newSize(newSize),
91  m_oldSize(oldSize)
92  {
93  }
94 
95  te::qt::widgets::MapDisplay* m_display; //!< Pointer to associated te::qt::widgets::MapDisplay.
96  QSize m_newSize; //!< New size of the display.
97  QSize m_oldSize; //!< Old size of the display.
98  };
99 
100  /*!
101  \struct ToolBarAdded
102 
103  \brief This event signals that a new toolbar was added.
104  */
105 
106  struct ToolBarAdded : public Event
107  {
108  /*!
109  \brief Constructor.
110 
111  \param toolbar Pointer to the new tool bar.
112  */
113  ToolBarAdded(QToolBar* toolbar) :
115  m_toolbar(toolbar)
116  {
117  }
118 
119  QToolBar* m_toolbar; //!< Pointer to the new QToolBar.
120  };
121 
122  /*!
123  \struct Draw Button Clicked
124 
125  \brief This event signals that the draw button clicked
126  */
127 
128  struct DrawButtonClicked : public Event
129  {
130  /*!
131  \brief Constructor.
132  */
135  {
136  }
137  };
138 
139  /*!
140  \struct Zoom In Button Toggled
141 
142  \brief This event signals that the zoom in button toggled
143  */
144 
145  struct ZoomInButtonToggled : public Event
146  {
147  /*!
148  \brief Constructor.
149  */
152  {
153  }
154  };
155 
156  /*!
157  \struct Zoom Out Button Toggled
158 
159  \brief This event signals that the zoom out button toggled
160  */
161 
162  struct ZoomOutButtonToggled : public Event
163  {
164  /*!
165  \brief Constructor.
166  */
169  {
170  }
171  };
172 
173  /*!
174  \struct Pan Button Toggled
175 
176  \brief This event signals that the pan button toggled
177  */
178 
179  struct PanButtonToggled : public Event
180  {
181  /*!
182  \brief Constructor.
183  */
186  {
187  }
188  };
189 
190  /*!
191  \struct Selection Button Toggled
192 
193  \brief This event signals that the selection button toggled
194  */
195 
197  {
198  /*!
199  \brief Constructor.
200  */
203  {
204  }
205  };
206 
207  struct NewActionsAvailable : public Event
208  {
211  m_toolbar(0)
212  {
213 
214  }
215 
216  std::string m_plgName;
217  std::string m_category;
218  QToolBar* m_toolbar;
219  QList<QAction*> m_actions;
220  };
221 
222  struct GetLayerExplorer : public Event
223  {
226  m_layerExplorer(0)
227  {
228 
229  }
230 
232  };
233  }
234  }
235  }
236 }
237 
238 #endif //__TERRALIB_QT_AF_EVENTS_INTERNAL_APPLICATIONREVENTS_H
te::qt::af::evt::AppClosed::AppClosed
AppClosed()
Constructor.
Definition: ApplicationEvents.h:65
te::qt::af::evt::DisplayResized::m_oldSize
QSize m_oldSize
Old size of the display.
Definition: ApplicationEvents.h:97
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::qt::af::evt::ZoomInButtonToggled
Definition: ApplicationEvents.h:146
te::qt::af::evt::ZoomOutButtonToggled
Definition: ApplicationEvents.h:163
te::qt::widgets::MapDisplay
A widget to control the display of a set of layers.
Definition: MapDisplay.h:72
te::qt::af::evt::DisplayResized::m_newSize
QSize m_newSize
New size of the display.
Definition: ApplicationEvents.h:96
te::qt::af::evt::PanButtonToggled::PanButtonToggled
PanButtonToggled()
Constructor.
Definition: ApplicationEvents.h:184
te::qt::af::evt::DrawButtonClicked
Definition: ApplicationEvents.h:129
te::qt::af::evt::NewActionsAvailable::m_plgName
std::string m_plgName
Definition: ApplicationEvents.h:216
te::qt::af::evt::ZOOM_IN_BUTTON_TOGGLED
@ ZOOM_IN_BUTTON_TOGGLED
Definition: Enums.h:71
te::qt::af::evt::ZOOM_OUT_BUTTON_TOGGLED
@ ZOOM_OUT_BUTTON_TOGGLED
Definition: Enums.h:72
te::qt::af::evt::NEW_ACTIONS_AVAILABLE
@ NEW_ACTIONS_AVAILABLE
Definition: Enums.h:77
te::qt::af::evt::DisplayResized
This event signals that a display was resized.
Definition: ApplicationEvents.h:77
te::qt::af::evt::GetLayerExplorer::GetLayerExplorer
GetLayerExplorer()
Definition: ApplicationEvents.h:224
te::qt::af::evt::DisplayResized::m_display
te::qt::widgets::MapDisplay * m_display
Pointer to associated te::qt::widgets::MapDisplay.
Definition: ApplicationEvents.h:95
te::qt::af::evt::GetLayerExplorer::m_layerExplorer
te::qt::widgets::LayerItemView * m_layerExplorer
Definition: ApplicationEvents.h:231
te::qt::af::evt::GET_LAYERS_VIEW
@ GET_LAYERS_VIEW
Definition: Enums.h:79
te::qt::widgets::LayerItemView
A specialization of QTreeView for manipulate layers.
Definition: LayerItemView.h:79
Event.h
This file contains a class to represent an event.
te::qt::af::evt::DisplayResized::DisplayResized
DisplayResized(te::qt::widgets::MapDisplay *display, const QSize &newSize, const QSize &oldSize)
Constructor.
Definition: ApplicationEvents.h:87
te::qt::af::evt::TOOLBAR_ADDED
@ TOOLBAR_ADDED
Definition: Enums.h:43
Enums.h
Enumerations of XML module.
te::qt::af::evt::ZoomOutButtonToggled::ZoomOutButtonToggled
ZoomOutButtonToggled()
Constructor.
Definition: ApplicationEvents.h:167
te::qt::af::evt::PanButtonToggled
Definition: ApplicationEvents.h:180
te::qt::af::evt::Event
A base class for application events.
Definition: Event.h:60
te::qt::af::evt::ToolBarAdded
This event signals that a new toolbar was added.
Definition: ApplicationEvents.h:107
te::qt::af::evt::ZoomInButtonToggled::ZoomInButtonToggled
ZoomInButtonToggled()
Constructor.
Definition: ApplicationEvents.h:150
te::qt::af::evt::NewActionsAvailable
Definition: ApplicationEvents.h:208
te::qt::af::evt::NewActionsAvailable::m_category
std::string m_category
Definition: ApplicationEvents.h:217
te::qt::af::evt::ToolBarAdded::ToolBarAdded
ToolBarAdded(QToolBar *toolbar)
Constructor.
Definition: ApplicationEvents.h:113
te::qt::af::evt::PAN_BUTTON_TOGGLED
@ PAN_BUTTON_TOGGLED
Definition: Enums.h:73
te::qt::af::evt::NewActionsAvailable::m_toolbar
QToolBar * m_toolbar
Definition: ApplicationEvents.h:218
te::qt::af::evt::APP_CLOSED
@ APP_CLOSED
Definition: Enums.h:42
te::qt::af::evt::AppClosed
This event signals that the application is about to close.
Definition: ApplicationEvents.h:61
te::qt::af::evt::DRAW_BUTTON_CLICKED
@ DRAW_BUTTON_CLICKED
Definition: Enums.h:70
te::qt::af::evt::GetLayerExplorer
Definition: ApplicationEvents.h:223
te::qt::af::evt::DISPLAY_RESIZED
@ DISPLAY_RESIZED
Definition: Enums.h:44
te::qt::af::evt::NewActionsAvailable::m_actions
QList< QAction * > m_actions
Definition: ApplicationEvents.h:219
te::qt::af::evt::SELECTION_BUTTON_TOGGLED
@ SELECTION_BUTTON_TOGGLED
Definition: Enums.h:74
te::qt::af::evt::SelectionButtonToggled
Definition: ApplicationEvents.h:197
te::qt::af::evt::NewActionsAvailable::NewActionsAvailable
NewActionsAvailable()
Definition: ApplicationEvents.h:209
te::qt::af::evt::SelectionButtonToggled::SelectionButtonToggled
SelectionButtonToggled()
Constructor.
Definition: ApplicationEvents.h:201
te::qt::af::evt::ToolBarAdded::m_toolbar
QToolBar * m_toolbar
Pointer to the new QToolBar.
Definition: ApplicationEvents.h:119
te::qt::af::evt::DrawButtonClicked::DrawButtonClicked
DrawButtonClicked()
Constructor.
Definition: ApplicationEvents.h:133