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