TerraView.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 TerraView - A Free and Open Source GIS Application.
4 
5  TerraView is free software: you can redistribute it and/or modify
6  it under the terms of the GNU 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  TerraView 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 General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with TerraLib Code Editor. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@dpi.inpe.br>.
18  */
19 
20 /*!
21  \file terraview/TerraView.h
22 
23  \brief The main class of TerraView.
24 */
25 
26 #ifndef __TERRAVIEW_INTERNAL_TERRAVIEW_H
27 #define __TERRAVIEW_INTERNAL_TERRAVIEW_H
28 
29 // TerraLib
30 #include "TerraViewController.h"
32 
33 // STL
34 #include <string>
35 
36 // Forward declarations
37 class QWidget;
38 class QMenu;
39 
40 struct ProjectMetadata;
41 
42 namespace te
43 {
44  namespace qt
45  {
46  namespace af
47  {
48  class InterfaceController;
49  }
50  namespace widgets
51  {
52  class ChartDisplayWidget;
53  class CompositionModeMenuWidget;
54  class HelpManagerImpl;
55  class QueryDialog;
56  class ProgressViewerBar;
57  class ProgressViewerWidget;
58  }
59  }
60 }
61 
62 /*!
63  \brief The main class of TerraView.
64 
65  \sa te::qt::af::BaseApplication
66 */
68 {
69  Q_OBJECT
70 
71  public:
72 
73  TerraView(QWidget* parent = 0);
74 
75  ~TerraView();
76 
77  void init();
78 
79  void startProject(const QString& projectFileName);
80 
81  protected:
82 
83  virtual void makeDialog();
84 
85  virtual void initActions();
86 
87  virtual void initMenus();
88 
89  virtual void initToolbars();
90 
91  virtual void initSlotsConnections();
92 
93  virtual void createDefaultSettings();
94 
95  void addMenusActions();
96 
97  void addPopUpMenu();
98 
99  protected slots:
100 
101  void showAboutDialog();
102 
103 
104  void onApplicationTriggered(te::qt::af::evt::Event* e);
105 
106 
107  void onRestartSystemTriggered();
108 
109  void onNewProjectTriggered();
110 
111  void onOpenProjectTriggered();
112 
113  void onSaveProjectTriggered(bool save_as = false);
114 
115  void onSaveProjectAsTriggered();
116 
117 
118  void onHelpTriggered();
119 
120 
121  void onLinkTriggered();
122 
123  void onLayerHistogramTriggered();
124 
125  void onLayerScatterTriggered();
126 
127  void onLayerChartTriggered();
128 
129  void onLayerGroupingTriggered();
130 
131  void onLayerCompositionModeTriggered();
132 
133  void onQueryLayerTriggered();
134 
135 
136  void onAddDataSetLayerTriggered();
137 
138  void onAddQueryLayerTriggered();
139 
140  void onAddTabularLayerTriggered();
141 
142  void onAddFolderLayerTriggered();
143 
144  void onProjectPropertiesTriggered();
145 
146  void onUpdateLayerDataSourceTriggered();
147 
148  void onRecentProjectsTriggered(QAction* proj);
149 
150 
151  void onPluginsManagerTriggered();
152 
153  void onToolsCustomizeTriggered();
154 
155  void onToolsDataExchangerTriggered();
156 
157  void onToolsDataExchangerDirectTriggered();
158 
159  void onToolsDataExchangerDirectPopUpTriggered();
160 
161  void onToolsQueryDataSourceTriggered();
162 
163  void onToolsRasterMultiResolutionTriggered();
164 
165  void onDataSourceExplorerTriggered();
166 
167 
168  void showProgressDockWidget();
169 
170  void onHighlightLayerObjects(const te::map::AbstractLayerPtr& layer, te::da::DataSet* dataset, const QColor& color);
171 
172  void onCreateNewLayer(te::map::AbstractLayerPtr layer);
173 
174  protected:
175 
176  void projectChanged();
177 
178  bool checkAndSaveProject();
179 
180  void openProject(const QString& prjFileName);
181 
182  void resetComponents();
183 
184  void closeEvent(QCloseEvent * event);
185 
186  void addActions(const QString& name, const QString& category, const QList<QAction*>& acts);
187 
192  QAction* m_fileExit;
193  QAction* m_filePrint;
196 
197  QAction* m_helpAbout;
198  QAction* m_helpContents;
199  QAction* m_helpUpdate;
200 
203  QAction* m_layerChart;
207  QAction* m_layerQuery;
208 
210 
218 
227 
228  QMenu* m_fileMenu;
229  QMenu* m_helpMenu;
230  QMenu* m_layerMenu;
231  QMenu* m_mapMenu;
236  QMenu* m_toolsMenu;
238  QMenu* m_viewMenu;
240 
241 
242  QDockWidget* m_progressDockWidget; //!< Dock widget used to show progress information
243 
245 
247 
249 
251 
253 
255 
257 
259 };
260 
261 #endif // __TERRAVIEW_INTERNAL_TERRAVIEW_H
QAction * m_projectAddLayerTabularDataSet
Definition: TerraView.h:213
QAction * m_layerChartsScatter
Definition: TerraView.h:202
QAction * m_projectAddLayerQueryDataSet
Definition: TerraView.h:212
#define slots
QAction * m_layerCompositionMode
Definition: TerraView.h:206
QAction * m_fileRestartSystem
Definition: TerraView.h:195
QAction * m_toolsCustomize
Definition: TerraView.h:219
QDockWidget * m_progressDockWidget
Dock widget used to show progress information.
Definition: TerraView.h:242
A class that defines the interface of a qt widget to group a set of ProgressWidgetItem.
The main class of TerraView.
Definition: TerraView.h:67
QAction * m_toolsQueryDataSource
Definition: TerraView.h:225
te::qt::widgets::CompositionModeMenuWidget * m_compModeMenu
Definition: TerraView.h:250
A base class for application events.
Definition: Event.h:59
QMenu * m_projectMenu
Definition: TerraView.h:233
QAction * m_projectAddLayerGraph
Definition: TerraView.h:214
QAction * m_filePrintPreview
Definition: TerraView.h:194
QAction * m_helpUpdate
Definition: TerraView.h:199
QAction * m_fileExit
Definition: TerraView.h:192
QAction * m_layerChartsHistogram
Definition: TerraView.h:201
QAction * m_fileSaveProject
Definition: TerraView.h:189
QAction * m_toolsDataExchangerDirect
Definition: TerraView.h:221
The API for controller of TerraView application.
QMenu * m_toolsMenu
Definition: TerraView.h:236
QMenu * m_projectAddLayerMenu
Definition: TerraView.h:234
QMenu * m_viewMenu
Definition: TerraView.h:238
QMenu * m_toolsExchangerMenu
Definition: TerraView.h:237
QAction * m_layerChart
Definition: TerraView.h:203
QAction * m_toolsDataSourceExplorer
Definition: TerraView.h:223
QAction * m_projectAddFolderLayer
Definition: TerraView.h:215
QMenu * m_mapMenu
Definition: TerraView.h:231
QAction * m_projectProperties
Definition: TerraView.h:217
te::qt::widgets::ProgressViewerBar * m_pvb
Definition: TerraView.h:256
QAction * m_fileNewProject
Definition: TerraView.h:188
URI C++ Library.
QAction * m_projectAddLayerDataset
Definition: TerraView.h:211
A class that defines the interface of a qt bar progress viewer.
QMenu * m_pluginsMenu
Definition: TerraView.h:232
QAction * m_fileSaveProjectAs
Definition: TerraView.h:190
QAction * m_toolsDataSourceManagement
Definition: TerraView.h:224
QAction * m_toolsDataExchangerDirectPopUp
Definition: TerraView.h:222
te::qt::widgets::ProgressViewerWidget * m_pvw
Definition: TerraView.h:258
QMenu * m_helpMenu
Definition: TerraView.h:229
QMenu * m_recentProjectsMenu
Definition: TerraView.h:235
te::qt::af::InterfaceController * m_iController
Definition: TerraView.h:246
QAction * m_projectUpdateLayerDataSource
Definition: TerraView.h:216
QMenu * m_fileMenu
Definition: TerraView.h:228
This file defines a class for a Query Dialog Dialog.
Definition: QueryDialog.h:66
ProjectMetadata * m_project
Definition: TerraView.h:252
QMenu * m_viewToolBarsMenu
Definition: TerraView.h:239
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
QAction * m_pluginsManager
Definition: TerraView.h:209
QAction * m_layerObjectGrouping
Definition: TerraView.h:205
QAction * m_fileOpenProject
Definition: TerraView.h:191
The API for controller of TerraView application.
QAction * m_toolsRasterMultiResolution
Definition: TerraView.h:226
QAction * m_helpContents
Definition: TerraView.h:198
QAction * m_helpAbout
Definition: TerraView.h:197
QAction * m_layerQuery
Definition: TerraView.h:207
A connector to controll all non modal interfaces.
te::qt::widgets::QueryDialog * m_queryDlg
Definition: TerraView.h:248
QAction * m_filePrint
Definition: TerraView.h:193
This class is widget that provides a menu for composition mode selection.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
QAction * m_toolsDataExchanger
Definition: TerraView.h:220
A QMainWindow to be used as the basis for TerraLib applications.
QAction * m_layerLinkTable
Definition: TerraView.h:204
An interface for help managers implementations.
QMenu * m_layerMenu
Definition: TerraView.h:230
te::qt::widgets::HelpManagerImpl * m_helpManager
Definition: TerraView.h:244
TerraViewController * m_tvController
Definition: TerraView.h:254