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);
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 the progress label information.
77 
78  \param message String with the label information.
79  */
80  virtual void setLabel(const std::string& message);
81 
82  /*! \brief Reset the progress bar. */
83  virtual void reset();
84 
85  public slots:
86 
87  /*! \brief Get the button clicked and cancel ALL tasks. */
88  virtual void cancel();
89 
90  signals:
91 
92  /*!
93  \brief Inform that a task was canceled.
94 
95  \param id taskId.
96  */
97  void taskCanceled(int id);
98 
99  protected:
100 
101  /*!
102  \brief Used to receive custom progress events.
103 
104  \param e Event sent to this object.
105  */
106  virtual void customEvent(QEvent* e);
107 
108  protected:
109 
110  int m_taskId; //!< Task Identifier.
111  QLabel* m_label; //!< GUI Objects used to build the custom widget.
112  QProgressBar* m_progressBar; //!< GUI Objects used to build the custom widget.
113  QCommandLinkButton* m_button; //!< GUI Objects used to build the custom widget.
114  QFrame* m_frame; //!< GUI Objects used to build the custom widget.
115  QGridLayout* m_mainGridLayout; //!< GUI Objects used to build the custom widget.
116  QGridLayout* m_frameGridLayout; //!< GUI Objects used to build the custom widget.
117  };
118 
119  } // end namespace widgets
120  } // end namespave qt
121 } // end namespave te
122 
123 #endif // __TERRALIB_QT_WIDGETS_PROGRESS_INTERNAL_PROGRESSWIDGETITEM_H
124 
QProgressBar * m_progressBar
GUI Objects used to build the custom widget.
QGridLayout * m_frameGridLayout
GUI Objects used to build the custom widget.
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