DataPropertiesWidget.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/externalTable/DataPropertiesWidget.h
22 
23  \brief A class used to configure the properties of a new textual file based layer
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_DATAPROPERTIESWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_DATAPROPERTIESWIDGET_H
28 
29 //TerraLib
30 #include "../Config.h"
31 #include "../../../dataaccess/datasource/DataSource.h"
32 
33 // Qt
34 #include <QSignalMapper>
35 #include <QWidget>
36 
37 //STL
38 #include <memory>
39 
40 namespace Ui { class DataPropertiesWidgetForm; }
41 
42 namespace te
43 {
44 
45  namespace da {class DataSet;
46  class DataSetAdapter;
47  class DataSetType;
48  class DataSetTypeConverter;}
49 
50  namespace qt
51  {
52  namespace widgets
53  {
54 
55  class DataSetTableView;
56 
57  /*!
58  \class DatapPropertiesWidget
59 
60  \brief A class to represent a chart display
61  */
63  {
64 
65  Q_OBJECT
66 
67  public:
68 
69  /*!
70  \brief Constructor
71 
72  It constructs a DatapPropertiesWidget.
73 
74  \param parent this widget's parent
75  \param f Window flags used to configure this widget
76 
77  */
78  DatapPropertiesWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
79 
80  /*!
81  \brief Destructor
82  */
84 
85  /*!
86  \brief Returns a pointer to the generated DataSetTypeConverter
87 
88  \return A DataSetTypeConverter pointer.
89  \note The caller will take ownership of the returned auto pointer.
90  */
91  std::auto_ptr<te::da::DataSetTypeConverter> getConverter();
92 
93  /*!
94  \brief Returns a pointer to the widget's dataSetType
95 
96  \return A DataSetType pointer.
97  \note The caller will not take ownership of the returned pointer.
98  */
99  te::da::DataSetType* getDataSetType();
100 
101  /*!
102  \brief Returns a pointer to the widget's dataSource
103 
104  \return A DataSource pointer.
105  \note The caller will not take ownership of the returned pointer.
106  */
107  te::da::DataSource* getDataSource();
108 
109  Ui::DataPropertiesWidgetForm* getForm() const;
110 
111  protected slots:
112 
113  void onInputDataToolButtonTriggered();
114  void onSridPushButtonCLicked();
115  void onGeomPropertyChecked(int checked);
116  void onPropertyTypeChanged(int index);
117 
118  signals:
119 
120  void itemChanged();
121 
122  private:
123 
124  QSignalMapper* m_mapper; //!< The mapper used to know which property was configured.
125  std::map<int, std::string> m_typeMap; //!< A map that correlates a terralib type with a label.
126  std::auto_ptr<te::da::DataSetType> m_dataType; //!< The DataSetType that will be generated by this widget.
127  std::auto_ptr<DataSetTableView> m_tblView; //!< The widget used to preview the data of the new dataset.
128  std::auto_ptr<Ui::DataPropertiesWidgetForm> m_ui; //!< The widget's form.
129  std::auto_ptr<te::da::DataSetTypeConverter> m_dsConverter; //!< The DataSetConverter that will be configured by this widget.
130  te::da::DataSourcePtr m_dataSource; //!< The DataSource that will be generated by this widget.
131  };
132  } // end namespace widgets
133  } // end namespace qt
134 } // end namespace te
135 
136 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_DATAPROPERTIESWIDGET_H
std::map< int, std::string > m_typeMap
A map that correlates a terralib type with a label.
std::auto_ptr< Ui::DataPropertiesWidgetForm > m_ui
The widget's form.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
A class to represent a chart display.
A class that models the description of a dataset.
Definition: DataSetType.h:72
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Definition: DataSource.h:118
std::auto_ptr< te::da::DataSetType > m_dataType
The DataSetType that will be generated by this widget.
std::auto_ptr< te::da::DataSetTypeConverter > m_dsConverter
The DataSetConverter that will be configured by this widget.
URI C++ Library.
te::da::DataSourcePtr m_dataSource
The DataSource that will be generated by this widget.
std::auto_ptr< DataSetTableView > m_tblView
The widget used to preview the data of the new dataset.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
QSignalMapper * m_mapper
The mapper used to know which property was configured.