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