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 #include "../../../dataaccess/datasource/DataSourceInfo.h"
31 #include "../../../dataaccess/query/Where.h"
32 #include "../../../maptools/AbstractLayer.h"
33 #include "../table/DataSetTableModel.h"
34 #include "../canvas/MapDisplay.h"
35 #include "../mapdisplay/DataSetDisplay.h"
36 #include "../Config.h"
37 
38 // STL
39 #include <memory>
40 
41 // Qt
42 #include <QColor>
43 #include <QDialog>
44 #include <QListWidgetItem>
45 
46 namespace Ui { class QueryDataSourceDialogForm; }
47 
48 namespace te
49 {
50 // Forward declaration
51  namespace da
52  {
53  class DataSet;
54  }
55 
56  namespace qt
57  {
58  namespace widgets
59  {
60  /*!
61  \class QueryDataSourceDialog
62 
63  \brief This file defines a class for a Query Data Source Dialog Dialog.
64  */
66  {
67  Q_OBJECT
68 
69  public:
70 
71  QueryDataSourceDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
72 
74 
75  public:
76 
77  /*!
78  \brief This method is used to set the list of layers
79 
80  */
81  void setLayerList(std::list<te::map::AbstractLayerPtr> layerList);
82 
83  void setAppMapDisplay(te::qt::widgets::MapDisplay* appMapDisplay);
84 
85  protected:
86 
87  void loadDataSourcesInformation();
88 
89  void buildMap();
90 
91  protected slots:
92 
93  void onDataSourceSelected(int index);
94 
95  void onBaseDataSetSelected(int index);
96 
97  void onDataSetItemClicked(QListWidgetItem* item);
98 
99  void onPkTableComboBoxSelected(int index);
100 
101  void onApplyPushButtonClicked();
102 
103  void onClearPushButtonClicked();
104 
105  void onSQLEditorTextChanged();
106 
107  void onSaveSqlToolButtonClicked();
108 
109  void onOpenSqlToolButtonClicked();
110 
111  void onApplySelToolButtonClicked();
112 
113  void onCreateLayerToolButtonClicked();
114 
115  void onTargetDatasourceToolButtonPressed();
116 
117  void onTargetFileToolButtonPressed();
118 
119  signals:
120 
121  /*! This signal is emitted when the layer objects must be highlighted. */
122  //void highlightLayerObjects(const te::map::AbstractLayerPtr& layer, te::da::DataSet* dataset, const QColor& color);
123 
124  void createNewLayer(te::map::AbstractLayerPtr layer);
125 
126  private:
127 
128  std::auto_ptr<Ui::QueryDataSourceDialogForm> m_ui;
129 
130  std::list<te::map::AbstractLayerPtr> m_layerList;
131 
133 
135 
137 
139 
140  bool m_toFile;
141 
142  std::map<std::string, Qt::GlobalColor> m_keyWords;
143  };
144 
145  } // end namespace widgets
146  } // end namespace qt
147 } // end namespace te
148 
149 #endif // __TERRALIB_QT_WIDGETS_QUERY_INTERNAL_QUERYDIALOG_H
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:66
std::list< te::map::AbstractLayerPtr > m_layerList
std::auto_ptr< Ui::QueryDataSourceDialogForm > m_ui
URI C++ Library.
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