BaseApplication.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 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 #include "Config.h"
30 
31 // TerraLib
32 #ifndef Q_MOC_RUN
33 #include "../../maptools/AbstractLayer.h"
34 #endif
35 #include <QComboBox>
36 #include <QLabel>
37 #include <QLineEdit>
38 #include <QMainWindow>
39 #include <QTextEdit>
40 #include <QToolButton>
41 #include <QStatusBar>
42 
43 
44 //#include "ui/ui_BaseApplicationForm.h"
45 
46 namespace Ui {
47  class BaseApplicationForm;
48 }
49 
50 namespace te
51 {
52  namespace qt
53  {
54  namespace widgets
55  {
56  class ChartDisplayWidget;
57  class CharEncodingMenuWidget;
58  class CoordInfoWidget;
59  class DataSourceExplorer;
60  class LayerItemView;
61  class MapDisplay;
62  class StyleDockWidget;
63  class AuxiliaryMapDisplayDockWidget;
64  }
65 
66  namespace af
67  {
68  namespace evt
69  {
70  // Forward declaration
71  struct Event;
72  }
73 
74  class ApplicationController;
75  class ApplicationDockerConnector;
76  class ApplicationDockerController;
77  class DataSetTableDockWidget;
78  class InternalSettingsDialog;
79  class MapDisplay;
80  class LayerExplorer;
81  class StyleExplorer;
82  class InfoExplorer;
83 
84  class TEQTAFEXPORT BaseApplication : public QMainWindow
85  {
86  Q_OBJECT
87 
88  public:
89 
90  BaseApplication(QWidget* parent = 0);
91 
92  virtual ~BaseApplication();
93 
94  virtual void init(const QString& cfgFile);
95 
96  te::qt::widgets::LayerItemView* getLayerExplorer();
97 
98  te::qt::widgets::MapDisplay* getMapDisplay();
99 
100  te::qt::af::DataSetTableDockWidget* getLayerDock(const te::map::AbstractLayer* layer, const std::vector<te::qt::af::DataSetTableDockWidget*>& docs);
101 
102  QDockWidget* getLayerExplorerDock();
103 
104  static void prepareQtEnvironment(const QString& cfgFile, const QString& splashImg);
105 
106  public slots:
107 
108  virtual void onApplicationTriggered(te::qt::af::evt::Event* e);
109 
110  virtual void onLayerShowTableTriggered();
111 
112  void onDrawTriggered();
113 
114  void onZoomInToggled(bool checked);
115 
116  void onZoomOutToggled(bool checked);
117 
118  void onPreviousExtentTriggered();
119 
120  void onNextExtentTriggered();
121 
122  void onPanToggled(bool checked);
123 
124  void onZoomExtentTriggered();
125 
126  void onInfoToggled(bool checked);
127 
128  void onMapRemoveSelectionTriggered();
129 
130  void onSelectionToggled(bool checked);
131 
132  void onMapSRIDTriggered();
133 
134  void onMapSetUnknwonSRIDTriggered();
135 
136  void onMapShowGeographicGridToggled(bool check);
137 
138  void onMeasureDistanceToggled(bool checked);
139 
140  void onMeasureAreaToggled(bool checked);
141 
142  void onMeasureAngleToggled(bool checked);
143 
144  void onMapCoordinateFinderTriggered();
145 
146  void onStopDrawTriggered();
147 
148  void onScaleComboBoxActivated();
149 
150  void onScaleDisplayChanged();
151 
152  virtual void onInternalSettingsTriggered();
153 
154  void onInternalSettingsDestroyed();
155 
156  void onLayerRemoveTriggered();
157 
158  void onLayerRenameTriggered();
159 
160  void onCheckSelectedLayerTriggered();
161 
162  void onClearSelectedLayerTriggered();
163 
164  void onLayerPropertiesTriggered();
165 
166  void onLayerInvertSelectionTriggered();
167 
168  void onLayerRemoveSelectionTriggered();
169 
170  void onLayerSRSTriggered();
171 
172  void onLayerRemoveItemTriggered();
173 
174  void onLayerFitOnMapDisplayTriggered();
175 
176  void onLayerFitSelectedOnMapDisplayTriggered();
177 
178  void onLayerPanToSelectedOnMapDisplayTriggered();
179 
180  void onLayerSaveSelectedObjectsTriggered();
181 
182  void onLayerCharEncodingHovered();
183 
184  void onLayerEditStyleTriggered();
185 
186  void onLayerEditSelectionStyleTriggered();
187 
188  void onLayerRasterAutoContrastTriggered(bool checked);
189 
190  void onFullScreenToggled(bool checked);
191 
192  virtual void onViewNightModeChanged(bool activated);
193 
194  void onDisplayDataTableChanged(bool visible);
195 
196  void onLayerTableClose(te::qt::af::DataSetTableDockWidget* wid);
197 
198  void onChartDisplayCreated(te::qt::widgets::ChartDisplayWidget* chartDisplay, te::map::AbstractLayer* layer);
199 
200  void onShowGraphicScaleTriggered(bool checked);
201 
202  void onEditGraphicScaleTriggered();
203 
204  void onEditGridTriggered();
205 
206  void onAddLayers(const std::list<te::map::AbstractLayerPtr>& layers);
207 
208  protected slots:
209 
210  void onLayerSelectionChanged(const te::map::AbstractLayerPtr& layer);
211 
212  void onLayerSelectedObjectsChanged(const te::map::AbstractLayerPtr& layer);
213 
214  signals:
215 
216  void triggered(te::qt::af::evt::Event* e);
217 
218  protected:
219 
220  virtual void makeDialog();
221 
222  virtual void initFramework(const QString& cfgFile);
223 
224  virtual void initStatusBar();
225 
226  virtual void initActions();
227 
228  virtual void initMenus();
229 
230  virtual void initToolbars();
231 
232  virtual void initSlotsConnections();
233 
234  virtual void createDefaultSettings() = 0;
235 
236  virtual void initAction(QAction*& act, const QString& icon, const QString& name,
237  const QString& text, const QString& tooltip,
238  bool iconVisibleInMenu, bool isCheckable, bool enabled, QObject* parent);
239 
240  void setMapSRIDLineEdit(const int srid);
241 
242  QMenuBar* m_menubar;
243 
245 
246  //default actions
247  QAction* m_mapDraw;
248  QAction* m_mapZoomIn;
249  QAction* m_mapZoomOut;
250  QAction* m_mapZoomArea;
251  QAction* m_mapPan;
252  QAction* m_mapZoomExtent;
254  QAction* m_mapNextExtent;
255  QAction* m_mapInfo;
257  QAction* m_mapSelection;
260  QAction* m_mapEditGrid;
267  QAction* m_layerRemove;
268  QAction* m_layerRename;
273  QAction* m_layerSRS;
284 
285  QAction* m_viewDataTable;
287  QAction* m_viewNightMode;
288 
289  //main widgets
297  std::vector<DataSetTableDockWidget*> m_tables;
299 
306 
307  //status bar widgets
309  QStatusBar* m_statusbar;
310  QLabel* m_selected;
311  QAction* m_mapSRID;
315  QLineEdit* m_mapSRIDLineEdit;
316  QComboBox* m_scaleCmbBox;
317 
318  private:
319  Ui::BaseApplicationForm* m_ui;
320  };
321  }
322  }
323 }
324 
325 #endif // __TERRALIB_QT_AF_INTERNAL_BASEAPPLICATION_H
A widget designed to explore the data sources of an application.
A connector for the te::qt::af::ApplicationDockerController class to the Application Framework...
ApplicationController * m_app
#define slots
This is the base class for layers.
Definition: AbstractLayer.h:77
te::qt::widgets::CoordInfoWidget * m_coordInfoWidget
QDockWidget * m_layerExplorerDockWidget
A base class for application events.
Definition: Event.h:59
This class is widget that provides a menu for char encoding selection.
A connector for the te::qt::widgets::StyleDockWidget class to the Application Framework.
Definition: StyleExplorer.h:63
A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
Definition: LayerExplorer.h:75
The base API for TerraLib applications.
A connector of the te::qt::widgets::MapDisplay class to the Application Framework.
Definition: MapDisplay.h:83
std::vector< DataSetTableDockWidget * > m_tables
A widget to control the display of a set of layers.
Definition: MapDisplay.h:71
Configuration flags for the TerraLib Application Framework.
A dock widget for DataSetTableView objects.
TerraLib.
A specialization of QTreeView for manipulate layers.
Definition: LayerItemView.h:78
ApplicationDockerConnector * m_dockerConnector
Ui::BaseApplicationForm * m_ui
te::qt::widgets::CharEncodingMenuWidget * m_encodingMenu
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:71
This class defines a dock widget with map display ZoomIn and eye bird to help the display viewer...
A wdiget used to display a chart.
te::qt::widgets::StyleDockWidget * m_styleDockWidget
A dock widget used control the geographic data style using SE elements and a property browser to show...
te::qt::af::ApplicationDockerController * m_appDockerController
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
te::qt::widgets::LayerItemView * m_layerItemView
The base API for docker controllers of TerraLib applications.
te::qt::widgets::AuxiliaryMapDisplayDockWidget * m_auxMapDisplayDock
te::qt::widgets::DataSourceExplorer * m_dataSourceExplorer
InternalSettingsDialog * m_internalSettingsDlg