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 RasterContrastMenuWidget;
64  class AuxiliaryMapDisplayDockWidget;
65  }
66 
67  namespace af
68  {
69  namespace evt
70  {
71  // Forward declaration
72  struct Event;
73  }
74 
75  class ApplicationController;
76  class ApplicationDockerConnector;
77  class ApplicationDockerController;
78  class DataSetTableDockWidget;
79  class InternalSettingsDialog;
80  class MapDisplay;
81  class LayerExplorer;
82  class StyleExplorer;
83  class InfoExplorer;
84 
85  class TEQTAFEXPORT BaseApplication : public QMainWindow
86  {
87  Q_OBJECT
88 
89  public:
90 
91  BaseApplication(QWidget* parent = 0);
92 
93  virtual ~BaseApplication();
94 
95  virtual void init(const QString& cfgFile);
96 
97  te::qt::widgets::LayerItemView* getLayerExplorer();
98 
99  te::qt::widgets::MapDisplay* getMapDisplay();
100 
101  te::qt::af::DataSetTableDockWidget* getLayerDock(const te::map::AbstractLayer* layer, const std::vector<te::qt::af::DataSetTableDockWidget*>& docs);
102 
103  QDockWidget* getLayerExplorerDock();
104 
105  static void prepareQtEnvironment(const QString& cfgFile, const QString& splashImg);
106 
107  public slots:
108 
109  virtual void onApplicationTriggered(te::qt::af::evt::Event* e);
110 
111  virtual void onLayerShowTableTriggered();
112 
113  void onDrawTriggered();
114 
115  void onZoomInToggled(bool checked);
116 
117  void onZoomOutToggled(bool checked);
118 
119  void onPreviousExtentTriggered();
120 
121  void onNextExtentTriggered();
122 
123  void onPanToggled(bool checked);
124 
125  void onZoomExtentTriggered();
126 
127  void onInfoToggled(bool checked);
128 
129  void onMapRemoveSelectionTriggered();
130 
131  void onSelectionToggled(bool checked);
132 
133  void onMapSRIDTriggered();
134 
135  void onMapSetUnknwonSRIDTriggered();
136 
137  void onMapShowGeographicGridToggled(bool check);
138 
139  void onMeasureDistanceToggled(bool checked);
140 
141  void onMeasureAreaToggled(bool checked);
142 
143  void onMeasureAngleToggled(bool checked);
144 
145  void onMapCoordinateFinderTriggered();
146 
147  void onStopDrawTriggered();
148 
149  void onScaleComboBoxActivated();
150 
151  void onScaleDisplayChanged();
152 
153  virtual void onInternalSettingsTriggered();
154 
155  void onInternalSettingsDestroyed();
156 
157  void onLayerRemoveTriggered();
158 
159  void onLayerRenameTriggered();
160 
161  void onCheckSelectedLayerTriggered();
162 
163  void onClearSelectedLayerTriggered();
164 
165  void onLayerPropertiesTriggered();
166 
167  void onLayerInvertSelectionTriggered();
168 
169  void onLayerRemoveSelectionTriggered();
170 
171  void onLayerSRSTriggered();
172 
173  void onLayerRemoveItemTriggered();
174 
175  void onLayerFitOnMapDisplayTriggered();
176 
177  void onLayerFitSelectedOnMapDisplayTriggered();
178 
179  void onLayerPanToSelectedOnMapDisplayTriggered();
180 
181  void onLayerSaveSelectedObjectsTriggered();
182 
183  void onLayerCharEncodingHovered();
184 
185  void onLayerEditStyleTriggered();
186 
187  void onLayerEditSelectionStyleTriggered();
188 
189  void onLayerRasterAutoContrastHovered();
190 
191  void onLayerFolderOrderTriggered();
192 
193  void onFullScreenToggled(bool checked);
194 
195  virtual void onViewNightModeChanged(bool activated);
196 
197  void onDisplayDataTableChanged(bool visible);
198 
199  void onLayerTableClose(te::qt::af::DataSetTableDockWidget* wid);
200 
201  void onChartDisplayCreated(te::qt::widgets::ChartDisplayWidget* chartDisplay, te::map::AbstractLayer* layer);
202 
203  void onShowGraphicScaleTriggered(bool checked);
204 
205  void onEditGraphicScaleTriggered();
206 
207  void onEditGridTriggered();
208 
209  void onAddLayers(const std::list<te::map::AbstractLayerPtr>& layers);
210 
211  void onEncodingChanged(te::map::AbstractLayerPtr layer);
212 
213  protected slots:
214 
215  void onLayerSelectionChanged(const te::map::AbstractLayerPtr& layer);
216 
217  void onLayerSelectedObjectsChanged(const te::map::AbstractLayerPtr& layer);
218 
219  signals:
220 
221  void triggered(te::qt::af::evt::Event* e);
222 
223  protected:
224 
225  virtual void makeDialog();
226 
227  virtual void initFramework(const QString& cfgFile);
228 
229  virtual void initStatusBar();
230 
231  virtual void initActions();
232 
233  virtual void initMenus();
234 
235  virtual void initToolbars();
236 
237  virtual void initSlotsConnections();
238 
239  virtual void createDefaultSettings() = 0;
240 
241  virtual void initAction(QAction*& act, const QString& icon, const QString& name,
242  const QString& text, const QString& tooltip,
243  bool iconVisibleInMenu, bool isCheckable, bool enabled, QObject* parent);
244 
245  void setMapSRIDLineEdit(const int srid);
246 
247  QMenuBar* m_menubar;
248 
250 
251  //default actions
252  QAction* m_mapDraw;
253  QAction* m_mapZoomIn;
254  QAction* m_mapZoomOut;
255  QAction* m_mapZoomArea;
256  QAction* m_mapPan;
257  QAction* m_mapZoomExtent;
259  QAction* m_mapNextExtent;
260  QAction* m_mapInfo;
262  QAction* m_mapSelection;
265  QAction* m_mapEditGrid;
272  QAction* m_layerRemove;
273  QAction* m_layerRename;
278  QAction* m_layerSRS;
290 
291  QAction* m_viewDataTable;
293  QAction* m_viewNightMode;
294 
295  //main widgets
303  std::vector<DataSetTableDockWidget*> m_tables;
305 
313 
314  //status bar widgets
316  QStatusBar* m_statusbar;
317  QLabel* m_selected;
318  QAction* m_mapSRID;
322  QLineEdit* m_mapSRIDLineEdit;
323  QComboBox* m_scaleCmbBox;
324 
325  private:
326  Ui::BaseApplicationForm* m_ui;
327  };
328  }
329  }
330 }
331 
332 #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
This class is widget that provides a menu for raster contrast.
Configuration flags for the TerraLib Application Framework.
A dock widget for DataSetTableView objects.
te::qt::widgets::RasterContrastMenuWidget * m_rasterContrastMenu
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