QueryDataSourceDialog.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/widgets/query/QueryDataSourceDialog.h
22 
23  \brief This file defines a class for a Query DataSource Dialog Dialog.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_QUERY_INTERNAL_QUERYDATASOURCEDIALOG_H
27 #define __TERRALIB_QT_WIDGETS_QUERY_INTERNAL_QUERYDATASOURCEDIALOG_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../dataaccess/datasource/DataSourceInfo.h"
32 #include "../../../dataaccess/query/Where.h"
33 #include "../../../maptools/AbstractLayer.h"
34 #include "../table/DataSetTableModel.h"
35 #include "../canvas/MapDisplay.h"
36 #include "../mapdisplay/DataSetDisplay.h"
37 #endif
38 #include "../Config.h"
39 
40 // STL
41 #include <memory>
42 
43 // Qt
44 #include <QColor>
45 #include <QCompleter>
46 #include <QDialog>
47 #include <QListWidgetItem>
48 
49 namespace Ui { class QueryDataSourceDialogForm; }
50 
51 namespace te
52 {
53 // Forward declaration
54  namespace da
55  {
56  class DataSet;
57  }
58 
59  namespace qt
60  {
61  namespace widgets
62  {
63  /*!
64  \class QueryDataSourceDialog
65 
66  \brief This file defines a class for a Query Data Source Dialog Dialog.
67  */
69  {
70  Q_OBJECT
71 
72  public:
73 
74  QueryDataSourceDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
75 
77 
78  public:
79 
80  /*!
81  \brief This method is used to set the list of layers
82 
83  */
84  void setLayerList(std::list<te::map::AbstractLayerPtr> layerList);
85 
86  void setAppMapDisplay(te::qt::widgets::MapDisplay* appMapDisplay);
87 
88  protected:
89 
90  void loadDataSourcesType();
91 
92  void loadDataSourcesInformation(std::string dsType);
93 
94  void buildMap();
95 
96  protected slots:
97 
98  void onDataSourceTypeSelected(int index);
99 
100  void onDataSourceSelected(int index);
101 
102  void onBaseDataSetSelected(int index);
103 
104  void onDataSetItemClicked(QListWidgetItem* item);
105 
106  void onPkTableComboBoxSelected(int index);
107 
108  void onApplyPushButtonClicked();
109 
110  void onExecutePushButtonClicked();
111 
112  void onClearPushButtonClicked();
113 
114  void onSQLEditorTextChanged();
115 
116  void onSaveCsvToolButtonClicked();
117 
118  void onSaveSqlToolButtonClicked();
119 
120  void onOpenSqlToolButtonClicked();
121 
122  void onQuickSelectToolButtonClicked();
123 
124  void onApplySelToolButtonClicked();
125 
126  void onCreateLayerToolButtonClicked();
127 
128  void onTargetDatasourceToolButtonPressed();
129 
130  void onTargetFileToolButtonPressed();
131 
132  void onListWidgetDoubleClicked(QListWidgetItem* item);
133 
134  signals:
135 
136  /*! This signal is emitted when the layer objects must be highlighted. */
137  //void highlightLayerObjects(const te::map::AbstractLayerPtr& layer, te::da::DataSet* dataset, const QColor& color);
138 
139  void createNewLayer(te::map::AbstractLayerPtr layer);
140 
141  private:
142 
143  std::unique_ptr<Ui::QueryDataSourceDialogForm> m_ui;
144 
145  std::list<te::map::AbstractLayerPtr> m_layerList;
146 
148 
150 
152 
154 
155  bool m_toFile;
156 
157  std::map<std::string, Qt::GlobalColor> m_keyWords;
158 
159  QCompleter* m_completer;
160  };
161 
162  } // end namespace widgets
163  } // end namespace qt
164 } // end namespace te
165 
166 #endif // __TERRALIB_QT_WIDGETS_QUERY_INTERNAL_QUERYDIALOG_H
#define slots
std::unique_ptr< Ui::QueryDataSourceDialogForm > m_ui
This file defines a class for a Query Data Source Dialog Dialog.
te::qt::widgets::MapDisplay * m_appMapDisplay
te::qt::widgets::DataSetDisplay * m_dataSetDisplay
A widget to control the display of a set of layers.
Definition: MapDisplay.h:71
std::list< te::map::AbstractLayerPtr > m_layerList
TerraLib.
te::qt::widgets::DataSetTableModel * m_tableModel
A map display for a dataset.
std::map< std::string, Qt::GlobalColor > m_keyWords
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
A table model representing a te::da::DataSet.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr