DataSetOptionsWizardPage.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/plugins/exchanger/DataSetOptionsWizardPage.h
22 
23  \brief A Qt dialog for ....
24 */
25 
26 #ifndef __TERRALIB_PLUGINS_EXCHANGER_INTERNAL_DATASETOPTIONSWIZARDPAGE_H
27 #define __TERRALIB_PLUGINS_EXCHANGER_INTERNAL_DATASETOPTIONSWIZARDPAGE_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../dataaccess/dataset/DataSetType.h"
32 #include "../../../dataaccess/datasource/DataSourceInfo.h"
33 #endif
34 #include "../Config.h"
35 
36 // STL
37 #include <map>
38 #include <memory>
39 
40 // Qt
41 #include <QWizardPage>
42 
43 // Forward declaration
44 namespace Ui { class DataSetOptionsWizardPageForm; }
45 
46 class QListWidgetItem;
47 
48 namespace te
49 {
50  namespace da { class DataSetTypeConverter; }
51  namespace qt
52  {
53  namespace widgets
54  {
55  class ConstraintsIndexesListWidget;
56  class DataSetAdapterWidget;
57  class DataSetTableView;
58 
59  class TEQTWIDGETSEXPORT DataSetOptionsWizardPage : public QWizardPage
60  {
61  Q_OBJECT
62 
63  public:
64 
65  DataSetOptionsWizardPage(QWidget* parent = 0);
66 
68 
69  void set(const std::list<te::da::DataSetTypePtr>& datasets,
70  const te::da::DataSourceInfoPtr& datasource,
71  const te::da::DataSourceInfoPtr& targetDatasource);
72 
73  const std::map<te::da::DataSetTypePtr, te::da::DataSetTypeConverter*>& getDatasets() const;
74 
75  void showSimpleMode(const bool& mode);
76 
77  public slots:
78 
79  void applyChanges();
80 
81  protected slots:
82 
83  void sridInputSearchToolButtonPressed();
84 
85  void sridOutputSearchToolButtonPressed();
86 
87  void datasetPressed(QListWidgetItem* item);
88 
89  void onDataPreviewGroupBoxClicked();
90 
91  //void checkModificationsOnFocusChange(QWidget* old, QWidget* now);
92 
93  protected:
94 
95  te::da::DataSetTypePtr getSelectedDataSet() const;
96 
97  private:
98 
99  void clearForm();
100 
101  void setControlsEnabled(bool enabled);
102 
103  void fillCharEncodingTypes();
104 
105  void previewData(QListWidgetItem* item, bool isResult);
106 
107  private:
108 
109  struct FindByName
110  {
111  std::string m_name;
112 
113  FindByName(const QString& name);
114 
115  bool operator()(const te::da::DataSetTypePtr& dataset) const;
116  };
117 
118  private:
119 
120  std::unique_ptr<Ui::DataSetOptionsWizardPageForm> m_ui;
121  std::unique_ptr<te::qt::widgets::ConstraintsIndexesListWidget> m_constraintWidget;
122  std::unique_ptr<te::qt::widgets::DataSetAdapterWidget> m_dataSetAdapterWidget;
123  std::unique_ptr<te::qt::widgets::DataSetTableView> m_tblView;
124  std::map<te::da::DataSetTypePtr, te::da::DataSetTypeConverter*> m_datasets;
127  };
128 
129  } // end namespace widgets
130  } // end namespace qt
131 } // end namespace te
132 
133 #endif // __TERRALIB_PLUGINS_EXCHANGER_INTERNAL_DATASETOPTIONSWIZARDPAGE_H
std::unique_ptr< te::qt::widgets::DataSetAdapterWidget > m_dataSetAdapterWidget
#define slots
boost::shared_ptr< DataSetType > DataSetTypePtr
Definition: DataSetType.h:653
std::map< te::da::DataSetTypePtr, te::da::DataSetTypeConverter * > m_datasets
std::unique_ptr< te::qt::widgets::ConstraintsIndexesListWidget > m_constraintWidget
std::unique_ptr< te::qt::widgets::DataSetTableView > m_tblView
std::unique_ptr< Ui::DataSetOptionsWizardPageForm > m_ui
URI C++ Library.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr