All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BaseApplication.h
Go to the documentation of this file.
1 /* Copyright (C) 2008-2013 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 terralib/qt/af/BaseApplication.h
22 
23  \brief A QMainWindow to be used as the basis for TerraLib applications.
24 */
25 
26 #ifndef __TERRALIB_QT_AF_INTERNAL_BASEAPPLICATION_H
27 #define __TERRALIB_QT_AF_INTERNAL_BASEAPPLICATION_H
28 
29 // TerraLib
30 #include "../../maptools/AbstractLayer.h"
31 #include "Config.h"
32 
33 // STL
34 #include <map>
35 
36 // Boost
37 #include <boost/noncopyable.hpp>
38 
39 // Qt
40 #include <QtGui/QColor>
41 #include <QtGui/QLineEdit>
42 #include <QtGui/QMainWindow>
43 
44 namespace te
45 {
46 // Forward declaration
47  namespace da
48  {
49  class DataSet;
50  }
51 
52  namespace qt
53  {
54  namespace af
55  {
56 // Forward declarations
57  class ApplicationController;
58  class LayerExplorer;
59  class MapDisplay;
60  class Project;
61  class DataSetTableDockWidget;
62  class StyleExplorer;
63 
64  namespace evt
65  {
66  struct Event;
67  }
68 
69  /*!
70  \class BaseApplication
71 
72  \brief A QMainWindow to be used as the basis for TerraLib applications.
73 
74  \ingroup af
75  */
76  class TEQTAFEXPORT BaseApplication : public QMainWindow, public boost::noncopyable
77  {
78  Q_OBJECT
79 
80  public:
81 
82  BaseApplication(QWidget* parent = 0);
83 
84  virtual ~BaseApplication();
85 
86  virtual void init();
87 
88  virtual void init(const std::string& configFile);
89 
90  virtual void resetState();
91 
92  protected slots:
93 
94  void onApplicationTriggered(te::qt::af::evt::Event* evt);
95 
96  void onAddDataSetLayerTriggered();
97 
98  void onAddQueryLayerTriggered();
99 
100  void onAddTabularLayerTriggered();
101 
102  void onRemoveLayerTriggered();
103 
104  void onLayerRemoveItemTriggered();
105 
106  void onRenameLayerTriggered();
107 
108  void onPluginsManagerTriggered();
109 
110  void onRecentProjectsTriggered(QAction* proj);
111 
112  void onNewProjectTriggered();
113 
114  void onOpenProjectTriggered();
115 
116  void onSaveProjectTriggered();
117 
118  void onSaveProjectAsTriggered();
119 
120  void onToolsCustomizeTriggered();
121 
122  void onToolsDataExchangerTriggered();
123 
124  void onToolsDataExchangerDirectTriggered();
125 
126  void onToolsDataExchangerDirectPopUpTriggered();
127 
128  void onProjectPropertiesTriggered();
129 
130  void onAddFolderLayerTriggered();
131 
132  void onLayerPropertiesTriggered();
133 
134  void onLayerRemoveSelectionTriggered();
135 
136  void onLayerSRSTriggered();
137 
138  void onLayerShowTableTriggered();
139 
140  void onLayerHistogramTriggered();
141 
142  void onLayerScatterTriggered();
143 
144  void onLayerChartTriggered();
145 
146  void onLayerGroupingTriggered();
147 
148  void onLayerFitOnMapDisplayTriggered();
149 
150  void onLayerFitSelectedOnMapDisplayTriggered();
151 
152  void onLayerPanToSelectedOnMapDisplayTriggered();
153 
154  void onQueryLayerTriggered();
155 
156  void onMapSRIDTriggered();
157 
158  void onMapSetUnknwonSRIDTriggered();
159 
160  void onDrawTriggered();
161 
162  void onZoomInToggled(bool checked);
163 
164  void onZoomOutToggled(bool checked);
165 
166  void onPreviousExtentTriggered();
167 
168  void onNextExtentTriggered();
169 
170  void onPanToggled(bool checked);
171 
172  void onZoomExtentTriggered();
173 
174  void onInfoToggled(bool checked);
175 
176  void onMapRemoveSelectionTriggered();
177 
178  void onSelectionToggled(bool checked);
179 
180  void onMeasureDistanceToggled(bool checked);
181 
182  void onMeasureAreaToggled(bool checked);
183 
184  void onMeasureAngleToggled(bool checked);
185 
186  void onStopDrawTriggered();
187 
188  void showProgressDockWidget();
189 
190  void onLayerTableClose(te::qt::af::DataSetTableDockWidget* wid);
191 
192  void onFullScreenToggled(bool checked);
193 
194  void onLayerSelectedObjectsChanged(const te::map::AbstractLayerPtr& layer);
195 
196  void onHighlightLayerObjects(const te::map::AbstractLayerPtr& layer, te::da::DataSet* dataset, const QColor& color);
197 
198  void onLayerExplorerVisibilityChanged(bool visible);
199 
200  void onDisplayVisibilityChanged(bool visible);
201 
202  void onDisplayDataTableChanged(bool visible);
203 
204  void onStyleExplorerVisibilityChanged(bool visible);
205 
206  void onDataSourceExplorerTriggered();
207 
208  protected:
209 
210  virtual void openProject(const QString& projectFileName);
211 
212  virtual void checkProjectSave();
213 
214  virtual void newProject();
215 
216  virtual void makeDialog();
217 
218  virtual void closeEvent(QCloseEvent* e);
219 
220  virtual void initAction(QAction*& act, const QString& icon, const QString& name,
221  const QString& text, const QString& tooltip,
222  bool iconVisibleInMenu, bool isCheckable, bool enabled, QObject* parent);
223 
224  virtual void initActions();
225 
226  virtual void initMenus();
227 
228  virtual void initToolbars();
229 
230  virtual void initStatusBar();
231 
232  virtual void initSlotsConnections();
233 
234  protected:
235 
236  //! Qt components
239  QAction* m_viewDataTable;
241  //QAction* m_editUndo;
242  //QAction* m_editRedo;
243  //QAction* m_editCut;
244  //QAction* m_editCopy;
245  //QAction* m_editPaste;
246  //QAction* m_editSelectAll;
247  //QAction* m_editClear;
248  //QAction* m_editFind;
249  //QAction* m_editReplace;
251  QAction* m_viewRefresh;
258  QAction* m_helpContents;
259  QAction* m_helpUpdate;
260  QAction* m_viewGrid;
269  QAction* m_layerEdit;
271  QAction* m_layerExport;
273  QAction* m_layerSRS;
275  QAction* m_layerRaise;
276  QAction* m_layerLower;
277  QAction* m_layerToTop;
278  QAction* m_layerToBottom;
281  QAction* m_layerChart;
287  QAction* m_queryLayer;
289  QAction* m_helpAbout;
294  QAction* m_fileExit;
295  QAction* m_filePrint;
297  QAction* m_mapSRID;
299  QAction* m_mapDraw;
300  QAction* m_mapZoomIn;
301  QAction* m_mapZoomOut;
302  QAction* m_mapZoomArea;
303  QAction* m_mapPan;
304  QAction* m_mapZoomExtent;
306  QAction* m_mapNextExtent;
307  QAction* m_mapInfo;
309  QAction* m_mapSelection;
315 
316  QWidget* m_centralwidget;
317 
318  QLineEdit* m_mapSRIDLineEdit;
320 
321  QMenuBar* m_menubar;
322  //QMenu* m_editMenu;
323  QMenu* m_viewMenu;
325  QMenu* m_toolsMenu;
328  QMenu* m_helpMenu;
331  QMenu* m_layerMenu;
332  QMenu* m_fileMenu;
334  QMenu* m_mapMenu;
335 
336  QStatusBar* m_statusbar;
337  QToolBar* m_fileToolBar;
338  //QToolBar* m_editToolBar;
339  QToolBar* m_mapToolBar;
340 
341  // Well known Widgets
342  LayerExplorer* m_explorer; //!< A dockable tree view for the layers in the application project.
345 
346  std::vector<DataSetTableDockWidget*> m_tableDocks;
347 
348  // Project
350 
351  QDockWidget* m_progressDockWidget; //!< Dock widget used to show progress information
352  QDockWidget* m_zoomInDisplaysDockWidget; //!< Dock widget used to show zoom in display
353  QDockWidget* m_eyeBirdDisplaysDockWidget; //!< Dock widget used to show eye bird display
354 
356  };
357  } // end namespace af
358  } // end namespace qt
359 } // end namespace te
360 
361 #endif // __TERRALIB_QT_AF_INTERNAL_BASEAPPLICATION_H
te::qt::af::ApplicationController * m_controller
std::vector< DataSetTableDockWidget * > m_tableDocks
A QMainWindow to be used as the basis for TerraLib applications.
A connector for the te::qt::widgets::StyleDockWidget class to the Application Framework.
Definition: StyleExplorer.h:61
LayerExplorer * m_explorer
A dockable tree view for the layers in the application project.
The base API for TerraLib applications.
QDockWidget * m_zoomInDisplaysDockWidget
Dock widget used to show zoom in display.
This class models the concept of a project for the TerraLib Application Framework.
Definition: Project.h:50
A dock widget for DataSetTableView objects.
Configuration flags for the TerraLib Application Framework.
QDockWidget * m_progressDockWidget
Dock widget used to show progress information.
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:108
QDockWidget * m_eyeBirdDisplaysDockWidget
Dock widget used to show eye bird display.
A base class for application events.
Definition: Event.h:59
A connector of the te::qt::widgets::MapDisplay class to the Application Framework.
Definition: MapDisplay.h:75
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
Definition: LayerExplorer.h:70
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:111
QAction * m_viewLayerExplorer
Qt components.