1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (developer.feedback@nokia.com) |
|
6 ** |
|
7 ** This file is part of the HbWidgets module of the UI Extensions for Mobile. |
|
8 ** |
|
9 ** GNU Lesser General Public License Usage |
|
10 ** This file may be used under the terms of the GNU Lesser General Public |
|
11 ** License version 2.1 as published by the Free Software Foundation and |
|
12 ** appearing in the file LICENSE.LGPL included in the packaging of this file. |
|
13 ** Please review the following information to ensure the GNU Lesser General |
|
14 ** Public License version 2.1 requirements will be met: |
|
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
16 ** |
|
17 ** In addition, as a special exception, Nokia gives you certain additional |
|
18 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
20 ** |
|
21 ** If you have questions regarding the use of this file, please contact |
|
22 ** Nokia at developer.feedback@nokia.com. |
|
23 ** |
|
24 ****************************************************************************/ |
|
25 |
|
26 |
|
27 #ifndef HBPROGRESSNOTE_H |
|
28 #define HBPROGRESSNOTE_H |
|
29 |
|
30 #include <hbdialog.h> |
|
31 |
|
32 class HbProgressNotePrivate; |
|
33 |
|
34 class HB_WIDGETS_EXPORT HbProgressNote : public HbDialog |
|
35 { |
|
36 Q_OBJECT |
|
37 Q_ENUMS(ProgressNoteType) |
|
38 Q_PROPERTY( int maximum READ maximum WRITE setMaximum ) |
|
39 Q_PROPERTY( int minimum READ minimum WRITE setMinimum ) |
|
40 Q_PROPERTY( int value READ progressValue WRITE setProgressValue ) |
|
41 Q_PROPERTY( bool autoClose READ autoClose WRITE setAutoClose ) |
|
42 Q_PROPERTY( ProgressNoteType progressNoteType READ progressNoteType WRITE setProgressNoteType) |
|
43 Q_PROPERTY( QString text READ text WRITE setText ) |
|
44 Q_PROPERTY( HbIcon icon READ icon WRITE setIcon ) |
|
45 Q_PROPERTY( Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment ) |
|
46 Q_PROPERTY( Qt::Alignment iconAlignment READ iconAlignment WRITE setIconAlignment ) |
|
47 Q_PROPERTY( bool textWrapping READ textWrapping WRITE setTextWrapping ) |
|
48 public: |
|
49 |
|
50 enum ProgressNoteType { ProgressNote,WaitNote }; |
|
51 |
|
52 HbProgressNote(ProgressNoteType type , QGraphicsItem *parent = 0); |
|
53 explicit HbProgressNote(QGraphicsItem *parent = 0); |
|
54 |
|
55 enum { Type = Hb::ItemType_ProgressNote }; |
|
56 int type() const { return Type; } |
|
57 |
|
58 int maximum() const; |
|
59 int minimum() const; |
|
60 |
|
61 void setRange(int min,int max); |
|
62 int progressValue() const; |
|
63 |
|
64 bool autoClose () const ; |
|
65 void setAutoClose ( bool b ) ; |
|
66 |
|
67 void setText(const QString &text); |
|
68 QString text() const; |
|
69 |
|
70 void setIcon(const HbIcon &icon); |
|
71 HbIcon icon() const; |
|
72 |
|
73 void setTextAlignment(Qt::Alignment align); |
|
74 Qt::Alignment textAlignment() const; |
|
75 |
|
76 void setIconAlignment(Qt::Alignment align); |
|
77 Qt::Alignment iconAlignment() const; |
|
78 |
|
79 void setTextWrapping(bool wrap); |
|
80 bool textWrapping() const; |
|
81 |
|
82 void setProgressNoteType(HbProgressNote::ProgressNoteType type ); |
|
83 HbProgressNote::ProgressNoteType progressNoteType() const; |
|
84 |
|
85 QGraphicsItem* primitive(HbStyle::Primitive primitive) const; |
|
86 |
|
87 public slots: |
|
88 void cancel(); |
|
89 void setProgressValue(int progressValue); |
|
90 void setMinimum(int min); |
|
91 void setMaximum(int max); |
|
92 void delayedShow(); |
|
93 |
|
94 signals: |
|
95 void cancelled(); |
|
96 |
|
97 protected: |
|
98 void showEvent(QShowEvent *event); |
|
99 void initStyleOption(HbStyleOption *option) const; |
|
100 void closeEvent ( QCloseEvent * event ); |
|
101 |
|
102 private: |
|
103 Q_DECLARE_PRIVATE_D(d_ptr, HbProgressNote) |
|
104 Q_DISABLE_COPY(HbProgressNote) |
|
105 Q_PRIVATE_SLOT(d_func(), void _q_finished()) |
|
106 Q_PRIVATE_SLOT(d_func(), void _q_progressValueChanged(int)) |
|
107 Q_PRIVATE_SLOT(d_func(), void _q_userCancel()) |
|
108 }; |
|
109 |
|
110 #endif // HBPROGRESSNOTE_H |
|