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 <QStatusBar>
40 
41 
42 //#include <ui_BaseApplicationForm.h>
43 
44 namespace Ui {
45  class BaseApplicationForm;
46 }
47 
48 namespace te
49 {
50  namespace qt
51  {
52  namespace widgets
53  {
54  class ChartDisplayWidget;
55  class LayerItemView;
56  class MapDisplay;
57  }
58 
59  namespace af
60  {
61  namespace evt
62  {
63  // Forward declaration
64  struct Event;
65  }
66 
67  class ApplicationController;
68  class DataSetTableDockWidget;
69  class MapDisplay;
70  class LayerExplorer;
71  class StyleExplorer;
72 
73  class TEQTAFEXPORT BaseApplication : public QMainWindow
74  {
75  Q_OBJECT
76 
77  public:
78 
79  BaseApplication(QWidget* parent = 0);
80 
81  virtual ~BaseApplication();
82 
83  virtual void init(const QString& cfgFile);
84 
85  te::qt::widgets::LayerItemView* getLayerExplorer();
86 
87  te::qt::widgets::MapDisplay* getMapDisplay();
88 
89  te::qt::af::DataSetTableDockWidget* getLayerDock(const te::map::AbstractLayer* layer, const std::vector<te::qt::af::DataSetTableDockWidget*>& docs);
90 
91  QDockWidget* getLayerExplorerDock();
92 
93  public slots:
94 
95  virtual void onApplicationTriggered(te::qt::af::evt::Event* e);
96 
97  void onDrawTriggered();
98 
99  void onZoomInToggled(bool checked);
100 
101  void onZoomOutToggled(bool checked);
102 
103  void onPreviousExtentTriggered();
104 
105  void onNextExtentTriggered();
106 
107  void onPanToggled(bool checked);
108 
109  void onZoomExtentTriggered();
110 
111  void onInfoToggled(bool checked);
112 
113  void onMapRemoveSelectionTriggered();
114 
115  void onSelectionToggled(bool checked);
116 
117  void onMapSRIDTriggered();
118 
119  void onMapSetUnknwonSRIDTriggered();
120 
121  void onStopDrawTriggered();
122 
123  void onScaleComboBoxActivated();
124 
125  void onScaleDisplayChanged();
126 
127  void onInternalSettingsTriggered();
128 
129  void onLayerRemoveTriggered();
130 
131  void onLayerRenameTriggered();
132 
133  void onLayerPropertiesTriggered();
134 
135  void onLayerRemoveSelectionTriggered();
136 
137  void onLayerSRSTriggered();
138 
139  void onLayerRemoveItemTriggered();
140 
141  void onLayerFitOnMapDisplayTriggered();
142 
143  void onLayerFitSelectedOnMapDisplayTriggered();
144 
145  void onLayerPanToSelectedOnMapDisplayTriggered();
146 
147  void onLayerSaveSelectedObjectsTriggered();
148 
149  void onFullScreenToggled(bool checked);
150 
151  void onLayerExplorerVisibilityChanged(bool visible);
152 
153  void onStyleExplorerVisibilityChanged(bool visible);
154 
155  void onDisplayDataTableChanged(bool visible);
156 
157  void onLayerShowTableTriggered();
158 
159  void onLayerTableClose(te::qt::af::DataSetTableDockWidget* wid);
160 
161  void onChartDisplayCreated(te::qt::widgets::ChartDisplayWidget* chartDisplay, te::map::AbstractLayer* layer);
162 
163  protected slots:
164 
165  void onLayerSelectionChanged(const te::map::AbstractLayerPtr& layer);
166 
167  void onLayerSelectedObjectsChanged(const te::map::AbstractLayerPtr& layer);
168 
169  signals:
170 
171  void triggered(te::qt::af::evt::Event* e);
172 
173  protected:
174 
175  virtual void makeDialog();
176 
177  virtual void initFramework(const QString& cfgFile);
178 
179  virtual void initStatusBar();
180 
181  virtual void initActions();
182 
183  virtual void initMenus();
184 
185  virtual void initSlotsConnections();
186 
187  virtual void initAction(QAction*& act, const QString& icon, const QString& name,
188  const QString& text, const QString& tooltip,
189  bool iconVisibleInMenu, bool isCheckable, bool enabled, QObject* parent);
190 
191  QMenuBar* m_menubar;
192 
194 
195  //default actions
196  QAction* m_mapDraw;
197  QAction* m_mapZoomIn;
198  QAction* m_mapZoomOut;
199  QAction* m_mapZoomArea;
200  QAction* m_mapPan;
201  QAction* m_mapZoomExtent;
203  QAction* m_mapNextExtent;
204  QAction* m_mapInfo;
206  QAction* m_mapSelection;
207 
209  QAction* m_layerRemove;
210  QAction* m_layerRename;
214  QAction* m_layerSRS;
219 
220  QAction* m_viewDataTable;
224 
225  //main widgets
230  std::vector<te::qt::af::DataSetTableDockWidget*> m_tables;
231 
232  //status bar widgets
233  QStatusBar* m_statusbar;
234  QLabel* m_selected;
235  QAction* m_mapSRID;
239  QLineEdit* m_mapSRIDLineEdit;
241  QComboBox* m_scaleCmbBox;
242 
243  private:
244  Ui::BaseApplicationForm* m_ui;
245  };
246  }
247  }
248 }
249 
250 #endif // __TERRALIB_QT_AF_INTERNAL_BASEAPPLICATION_H
ApplicationController * m_app
This is the base class for layers.
Definition: AbstractLayer.h:76
A base class for application events.
Definition: Event.h:59
A connector for the te::qt::widgets::StyleDockWidget class to the Application Framework.
Definition: StyleExplorer.h:61
A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
Definition: LayerExplorer.h:70
The base API for TerraLib applications.
A connector of the te::qt::widgets::MapDisplay class to the Application Framework.
Definition: MapDisplay.h:81
A widget to control the display of a set of layers.
Definition: MapDisplay.h:68
Configuration flags for the TerraLib Application Framework.
A dock widget for DataSetTableView objects.
URI C++ Library.
A specialization of QTreeView for manipulate layers.
Definition: LayerItemView.h:73
Ui::BaseApplicationForm * m_ui
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:71
A wdiget used to display a chart.
std::vector< te::qt::af::DataSetTableDockWidget * > m_tables
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr