All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TimeSliderWidget.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2013 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/slider/TimeSliderWidget.h
22 
23  \brief A widget used to alow the user to control the visualization of temporal data
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_TIMESLIDERWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_TIMESLIDERWIDGET_H
28 
29 //TerraLib
30 #include "../Config.h"
31 
32 // Qt
33 #include <QtGui/QWidget>
34 #include <QTimer>
35 
36 //STL
37 #include <memory>
38 
39 namespace Ui { class TimeSliderWidgetForm; }
40 
41 namespace te
42 {
43  namespace qt
44  {
45  namespace widgets
46  {
47 
48  /*!
49  \class TimeSliderWidget
50 
51  \brief A wdiget used to control the visualization of temporal data
52  */
53  class TEQTWIDGETSEXPORT TimeSliderWidget : public QWidget
54  {
55  Q_OBJECT
56 
57  public:
58 
59  /*!
60  \brief Constructor
61 
62  It constructs a Time Slider Widget
63  */
64  TimeSliderWidget(QWidget* parent = 0, Qt::WindowFlags f = 0, int minimum = 0, int maximum = 10);
65 
66  /*!
67  \brief Destructor
68 
69  It destructs a Time Slider Widget
70  */
72 
73  void enterEvent(QEvent*);
74 
75  void leaveEvent(QEvent*);
76 
77  protected slots:
78 
79  void onExitToolButtonnClicked();
80  void onSettingsToolButtonnClicked();
81  void onPlayToolButtonnClicked();
82  void onSkipBackwardToolButtonnClicked();
83  void onSkipForwardToolButtonnClicked();
84  void onSliderValueChanged(int value);
85  void play();
86 
87  signals:
88 
89  /*!
90  \brief Emmit when the slider's value has been changed
91  */
92  void valueCHanged(int value);
93 
94  private:
95 
96  bool m_loop; //!< This property holds whether the slider's animation is on loop.
97  int m_speed; //!< The slider's animation speed in miliseconds
98  bool m_state; //!< This property holds whether the slider's animation is running.
99  std::auto_ptr<QTimer> m_timer; //!< The timer that will control the animation proccesses.
100  std::auto_ptr<Ui::TimeSliderWidgetForm> m_ui; //!< The widget form.
101  };
102  } // end namespace widgets
103  } // end namespace qt
104 } // end namespace te
105 
106 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_TIMESLIDERWIDGET_H
A wdiget used to control the visualization of temporal data.
std::auto_ptr< QTimer > m_timer
The timer that will control the animation proccesses.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:101
bool m_state
This property holds whether the slider&#39;s animation is running.
int m_speed
The slider&#39;s animation speed in miliseconds.
std::auto_ptr< Ui::TimeSliderWidgetForm > m_ui
The widget form.
bool m_loop
This property holds whether the slider&#39;s animation is on loop.