All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UpdateProperty.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2011 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 UpdateProperty.h
22 
23  \brief It updates a property of a data set.
24  */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_UPDATEPROPERTY_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_UPDATEPROPERTY_H
28 
29 // TerraLib
30 #include "../Config.h"
32 
33 // Qt
34 #include <QtGui/QDialog>
35 #include <ui_UpdateProperty.h>
36 
37 namespace te
38 {
39  namespace da
40  {
41  class DataSource;
42  }
43 
44  namespace dt { class Property; }
45 
46  namespace qt
47  {
48  namespace widgets
49  {
50  class TEQTWIDGETSEXPORT UpdateProperty : public QDialog, public Ui_UpdatePropertyDialog
51  {
52  Q_OBJECT
53 
54  public:
55  UpdateProperty(te::da::DataSource* ds, QWidget* parent = 0);
56 
57  ~UpdateProperty();
58 
59  te::dt::Property* getOldProperty() const { return m_oldProperty; }
60  te::dt::Property* getUpdatedProperty() const { return m_updatedProperty; }
61 
62  private slots:
63  void dataSetComboBoxChanged(const QString& dataSet);
64  void propertiesComboBoxActivated(const QString& p);
65  void dataTypeComboBoxChanged(const QString& dataType);
66  void requiredCheckBoxClicked(bool checked);
67  void arrayElementDataTypeComboBoxChanged(const QString& arrayElementDataType);
68  void okPushButtonClicked();
69  void cancelPushButtonClicked();
70  void helpPushButtonClicked();
71 
72  protected:
73  void setArrayPropertyData();
74  void setCompositePropertyData();
75  void setDateTimePropertyData();
76  void setGeometryPropertyData();
77  void setNumericPropertyData();
78  void setRasterPropertyData();
79  void setStringPropertyData();
80 
81  te::dt::Property* buildUpdatedProperty(const QString& dataType);
82 
83  te::dt::Property* buildUpdatedArrayProperty();
84  te::dt::Property* buildUpdatedBitProperty();
85  te::dt::Property* buildUpdatedBooleanProperty();
86  te::dt::Property* buildUpdatedByteArrayProperty();
87  te::dt::Property* buildUpdatedCharProperty();
88  te::dt::Property* buildUpdatedCompositeProperty();
89  te::dt::Property* buildUpdatedDateTimeProperty();
90  te::dt::Property* buildUpdatedDoubleProperty();
91  te::dt::Property* buildUpdatedFloatProperty();
92  te::dt::Property* buildUpdatedGeometryProperty();
93  te::dt::Property* buildUpdatedInt16Property();
94  te::dt::Property* buildUpdatedInt32Property();
95  te::dt::Property* buildUpdatedInt64Property();
96  te::dt::Property* buildUpdatedNumericProperty();
97  te::dt::Property* buildUpdatedRasterProperty();
98  te::dt::Property* buildUpdatedStringProperty();
99  te::dt::Property* buildUpdatedUcharProperty();
100  te::dt::Property* buildUpdatedUint16Property();
101  te::dt::Property* buildUpdatedUint32Property();
102  te::dt::Property* buildUpdatedUint64Property();
103  te::dt::Property* buildUpdatedUnknownProperty();
104  te::dt::Property* buildUpdatedVoidProperty();
105 
106  void closeEvent(QCloseEvent* e);
107 
108  private:
110 
111  te::dt::Property* m_oldProperty; // The property to be updated
112  te::dt::Property* m_updatedProperty; // The updated property
113 
114  std::string m_propertyName; // The property name
115  std::string* m_defaultValue; // The property default value
116 
117  std::map<int, QString> m_propertyTypeMap; // map of property type to property type text
118  std::map<te::gm::GeomType, QString> m_geomTypeTextMap; // map of geometry type to geometry type text
119  };
120  }
121  }
122 }
123 
124 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_UPDATEPROPERTY_H
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:101
te::dt::Property * m_updatedProperty
te::dt::Property * getOldProperty() const
te::dt::Property * getUpdatedProperty() const
Enumerations related to Geometry module.
te::dt::Property * m_oldProperty
std::map< int, QString > m_propertyTypeMap
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Definition: DataSource.h:116
It models a property definition.
Definition: Property.h:59
std::map< te::gm::GeomType, QString > m_geomTypeTextMap