ProgressWidgetItem.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/progress/ProgressWidgetItem.h
22 
23  \brief Custom widget used to represent a single task.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_PROGRESS_INTERNAL_PROGRESSWIDGETITEM_H
27 #define __TERRALIB_QT_WIDGETS_PROGRESS_INTERNAL_PROGRESSWIDGETITEM_H
28 
29 //TerraLib
30 #include "../../widgets/Config.h"
31 
32 //Qt
33 #include <QCommandLinkButton>
34 #include <QFrame>
35 #include <QGridLayout>
36 #include <QLabel>
37 #include <QProgressBar>
38 #include <QWidget>
39 
40 namespace te
41 {
42  namespace qt
43  {
44  namespace widgets
45  {
46 
47  /*!
48  \class ProgressWidgetItem
49 
50  \brief Custom widget used to represent a single task.
51 
52  \ingroup widgets
53 
54  \sa ProgressViewerWidget
55  */
56  class TEQTWIDGETSEXPORT ProgressWidgetItem : public QWidget
57  {
58  Q_OBJECT
59 
60  public:
61 
62  /*! \brief Default constructor. */
63  ProgressWidgetItem(QWidget* parent, int taskId, int totalSteps, QString label);
64 
65  /*! \brief Virtual destructor. */
67 
68  /*!
69  \brief Set the current value in progress bar.
70 
71  \param step Step value as integer.
72  */
73  virtual void setValue(int step);
74 
75  /*!
76  \brief Set task total steps
77  */
78  void setTotalValues(int values);
79 
80  /*!
81  \brief Set the progress label information.
82 
83  \param message String with the label information.
84  */
85  virtual void setLabel(const std::string& message);
86 
87  /*! \brief Reset the progress bar. */
88  virtual void reset();
89 
90  public slots:
91 
92  /*! \brief Get the button clicked and cancel ALL tasks. */
93  virtual void cancel();
94 
95  signals:
96 
97  /*!
98  \brief Inform that a task was canceled.
99 
100  \param id taskId.
101  */
102  void taskCanceled(int id);
103 
104  protected:
105 
106  /*!
107  \brief Used to receive custom progress events.
108 
109  \param e Event sent to this object.
110  */
111  virtual void customEvent(QEvent* e);
112 
113  protected:
114 
115  int m_taskId; //!< Task Identifier.
116  int m_totalSteps; //!< Attribute used to define the total steps of all tasks.
117  int m_currentStep; //!< Attribute used to define the current steps of all task.
118  int m_propStep; //!< Attribute used to define the proportional step (0-100).
119  QLabel* m_label; //!< GUI Objects used to build the custom widget.
120  QProgressBar* m_progressBar; //!< GUI Objects used to build the custom widget.
121  QCommandLinkButton* m_button; //!< GUI Objects used to build the custom widget.
122  QFrame* m_frame; //!< GUI Objects used to build the custom widget.
123  QGridLayout* m_mainGridLayout; //!< GUI Objects used to build the custom widget.
124  QGridLayout* m_frameGridLayout; //!< GUI Objects used to build the custom widget.
125  };
126 
127  } // end namespace widgets
128  } // end namespave qt
129 } // end namespave te
130 
131 #endif // __TERRALIB_QT_WIDGETS_PROGRESS_INTERNAL_PROGRESSWIDGETITEM_H
132 
int m_propStep
Attribute used to define the proportional step (0-100).
QProgressBar * m_progressBar
GUI Objects used to build the custom widget.
QGridLayout * m_frameGridLayout
GUI Objects used to build the custom widget.
int m_totalSteps
Attribute used to define the total steps of all tasks.
QCommandLinkButton * m_button
GUI Objects used to build the custom widget.
QFrame * m_frame
GUI Objects used to build the custom widget.
Custom widget used to represent a single task.
QLabel * m_label
GUI Objects used to build the custom widget.
URI C++ Library.
QGridLayout * m_mainGridLayout
GUI Objects used to build the custom widget.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
int m_currentStep
Attribute used to define the current steps of all task.