TemporalPropertiesWidget.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/st/TimePropertiesWidget.h
22 
23  \brief A widget used to adjust a temporal layer's properties
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_TIMEPROPERTIESWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_TIMEPROPERTIESWIDGET_H
28 
29 //TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../dataaccess/dataset/DataSetType.h"
32 #endif
33 #include "../Config.h"
34 
35 // Qt
36 #include <QWidget>
37 
38 //STL
39 #include <memory>
40 
41 namespace Ui { class TemporalPropertiesWidgetForm; }
42 
43 namespace te
44 {
45 
46  //forward declarations
47  namespace da {class DataSetType;}
48 
49  namespace qt
50  {
51  namespace widgets
52  {
53  /*!
54  \class TemporalPropertiesWidget
55 
56  \brief A widget used to adjust a temporal layer's properties
57  */
59  {
60 
61  Q_OBJECT
62 
63  public:
64 
65  /*!
66  \brief Constructor
67 
68 
69  \param parent this widget's parent
70  \param f Window flags used to configure this widget
71  */
72  TemporalPropertiesWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
73 
74  /*!
75  \brief Destructor
76  */
78 
79  /*!
80  \brief Returns a pointer to the widget's form
81 
82  \return A TemporalPropertiesWidgetForm type pointer to the widget's form.
83  \note The caller will not take ownership of the returned pointer.
84  */
85  Ui::TemporalPropertiesWidgetForm* getForm();
86 
87  /*!
88  \brief Returns the name of the property that holds the Phenomenom Time
89 
90  \return The name of the property that holds the Phenomenom Time.
91  */
92  std::string getPhenomenonTime();
93 
94  /*!
95  \brief Returns the name of the property that holds the Result Time
96 
97  \return The name of the property that holds the result Time.
98  */
99  std::string getResultTime();
100 
101  /*!
102  \brief Returns the name of the property that holds the Valid Time
103 
104  \return The name of the property that holds the valid Time.
105  */
106  std::string getValidTime();
107 
108  /*!
109  \brief Returns the index of the datetime type
110 
111  \return The index of the datetime type.
112  */
113  int getDateType();
114 
115  /*!
116  \brief Returns the selected ordinal type
117 
118  \return The selected Ordinal Type.
119  */
120  int getOrdinalType();
121 
122  /*!
123  \brief Returns the selected temporal unit
124 
125  \return The selected temporal unit.
126  */
127  int getTemporalUnit();
128 
129  /*!
130  \brief Returns a custom (user-defined) temporal unit
131 
132  \return A custom (user-defined) temporal unit
133  */
134  std::string getTemporalValue();
135 
136  /*!
137  \brief Returns a custom (user-defined) Ordinal Type
138 
139  \return A custom (user-defined) Ordinal Type.
140  */
141  std::string getUserOrdinalType();
142 
143  /*!
144  \brief Returns the format that the indicates how the date will be displayed
145 
146  \return The format that the indicates how the date will be displayed.
147  */
148  int getDateFormat();
149 
150  /*!
151  \brief Adjusts the widget values according to the given datasettype
152 
153  \param dataType The datasetType that will be used to configure the widget.
154  */
155  void setUp(const te::da::DataSetTypePtr dataType);
156 
157  protected slots:
158 
159  void onTypeCBCurrentIndexChanged(int index);
160 
161  void onOrdTypeCBCurrentIndexChanged(int index);
162 
163  void onUnitTypeCBCurrentIndexChanged(int index);
164 
165  private:
166 
167  std::auto_ptr<Ui::TemporalPropertiesWidgetForm> m_ui; //!< The widget's form.
168  te::da::DataSetTypePtr m_dataType; //!< The datasetType that will be used to generate the spatio-temporal layer.
169 
170  };
171  } // end namespace widgets
172  } // end namespace qt
173 } // end namespace te
174 
175 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_TIMEPROPERTIESWIDGET_H
boost::shared_ptr< DataSetType > DataSetTypePtr
Definition: DataSetType.h:653
A widget used to adjust a temporal layer's properties.
te::da::DataSetTypePtr m_dataType
The datasetType that will be used to generate the spatio-temporal layer.
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
std::auto_ptr< Ui::TemporalPropertiesWidgetForm > m_ui
The widget's form.