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 #ifndef Q_MOC_RUN
32 #include "../../../dataaccess/datasource/DataSource.h"
33 #endif
34 
35 // Qt
36 #include <QSignalMapper>
37 #include <QWidget>
38 
39 //STL
40 #include <memory>
41 
42 namespace Ui { class DataPropertiesWidgetForm; }
43 
44 namespace te
45 {
46 
47  namespace da {class DataSet;
48  class DataSetAdapter;
49  class DataSetType;
50  class DataSetTypeConverter;}
51 
52  namespace qt
53  {
54  namespace widgets
55  {
56 
57  class DataSetTableView;
58 
59  /*!
60  \class DatapPropertiesWidget
61 
62  \brief A widget used to configure the properties of a layer based on a tabular file
63  */
65  {
66 
67  Q_OBJECT
68 
69  public:
70 
71  /*!
72  \brief Constructor
73 
74  It constructs a DatapPropertiesWidget.
75 
76  \param parent this widget's parent
77  \param f Window flags used to configure this widget
78 
79  */
80  DatapPropertiesWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
81 
82  /*!
83  \brief Destructor
84  */
86 
87  /*!
88  \brief Returns a pointer to the generated DataSetTypeConverter
89 
90  \return A DataSetTypeConverter pointer.
91  \note The caller will take ownership of the returned auto pointer.
92  */
93  std::auto_ptr<te::da::DataSetTypeConverter> getConverter();
94 
95  /*!
96  \brief Returns a pointer to the widget's dataSetType
97 
98  \return A DataSetType pointer.
99  \note The caller will not take ownership of the returned pointer.
100  */
101  te::da::DataSetType* getDataSetType();
102 
103  /*!
104  \brief Returns a pointer to the widget's dataSource
105 
106  \return A DataSource pointer.
107  \note The caller will not take ownership of the returned pointer.
108  */
109  te::da::DataSource* getDataSource();
110 
111  Ui::DataPropertiesWidgetForm* getForm() const;
112 
113  protected slots:
114 
115  void onInputDataToolButtonTriggered();
116  void onSridPushButtonCLicked();
117  void onPropertyTypeChanged(int index);
118 
119  signals:
120 
121  void itemChanged();
122 
123  private:
124 
125  QSignalMapper* m_mapper; //!< The mapper used to know which property was configured.
126  std::map<int, std::string> m_typeMap; //!< A map that correlates a terralib type with a label.
127  std::auto_ptr<te::da::DataSetType> m_dataType; //!< The DataSetType that will be generated by this widget.
128  std::auto_ptr<DataSetTableView> m_tblView; //!< The widget used to preview the data of the new dataset.
129  std::auto_ptr<Ui::DataPropertiesWidgetForm> m_ui; //!< The widget's form.
130  std::auto_ptr<te::da::DataSetTypeConverter> m_dsConverter; //!< The DataSetConverter that will be configured by this widget.
131  te::da::DataSourcePtr m_dataSource; //!< The DataSource that will be generated by this widget.
132  };
133  } // end namespace widgets
134  } // end namespace qt
135 } // end namespace te
136 
137 #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:1438
A widget used to configure the properties of a layer based on a tabular file.
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:119
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.