|
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 #ifndef HBNOTIFICATIONDIALOG_H |
|
27 #define HBNOTIFICATIONDIALOG_H |
|
28 |
|
29 #include <hbdialog.h> |
|
30 |
|
31 class HbNotificationDialogPrivate; |
|
32 class HbIcon; |
|
33 |
|
34 class HB_WIDGETS_EXPORT HbNotificationDialog : public HbDialog |
|
35 { |
|
36 Q_OBJECT |
|
37 Q_PROPERTY(QString text READ text WRITE setText) |
|
38 Q_PROPERTY(QString title READ title WRITE setTitle) |
|
39 Q_PROPERTY(int wrapMode READ wrapMode WRITE setWrapMode) //deprecated |
|
40 Q_PROPERTY(HbIcon icon READ icon WRITE setIcon) |
|
41 Q_PROPERTY(Hb::TextWrapping titleTextWrapping READ titleTextWrapping WRITE setTitleTextWrapping) |
|
42 Q_PROPERTY(bool sequentialShow READ isSequentialShow WRITE setSequentialShow) |
|
43 |
|
44 public: |
|
45 |
|
46 //deprecated |
|
47 enum WrapMode |
|
48 { |
|
49 NoWrap = 0, |
|
50 TitleWrapsTwoLines |
|
51 }; |
|
52 |
|
53 public: |
|
54 HbNotificationDialog(); |
|
55 ~HbNotificationDialog(); |
|
56 |
|
57 static void launchDialog(const QString &title, QGraphicsScene *scene = 0); |
|
58 |
|
59 //deprecated. |
|
60 static void launchDialog(const HbIcon &icon, QGraphicsScene *scene = 0); |
|
61 static void launchDialog(const QString &title, const QString &text, QGraphicsScene *scene = 0); |
|
62 static void launchDialog(const HbIcon &icon, const QString &title, const QString &text, QGraphicsScene *scene = 0); |
|
63 |
|
64 void enableTouchActivation(bool enabled); |
|
65 |
|
66 bool isTouchActivating() const; |
|
67 |
|
68 void setTitle(const QString &text); |
|
69 void setText(const QString &text); |
|
70 void setIcon(const HbIcon &icon); |
|
71 |
|
72 QString title() const; |
|
73 QString text() const; |
|
74 HbIcon icon() const; |
|
75 |
|
76 //deprecated |
|
77 int wrapMode() const; |
|
78 |
|
79 //deprecated |
|
80 void setWrapMode(int mode); |
|
81 |
|
82 void setTitleTextWrapping(Hb::TextWrapping wrapping); |
|
83 Hb::TextWrapping titleTextWrapping() const; |
|
84 |
|
85 void setSequentialShow(bool sequential); |
|
86 bool isSequentialShow() const; |
|
87 |
|
88 enum { Type = Hb::ItemType_NotificationDialog }; |
|
89 int type() const { return Type; } |
|
90 |
|
91 signals: |
|
92 void activated(); |
|
93 |
|
94 protected: |
|
95 HbNotificationDialog( HbNotificationDialogPrivate &dd, QGraphicsItem *parent); |
|
96 void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
97 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
98 void hideEvent(QHideEvent *event); |
|
99 void showEvent(QShowEvent *event); |
|
100 QVariant itemChange(GraphicsItemChange change, const QVariant &value); |
|
101 |
|
102 private slots: |
|
103 void orientationChanged(Qt::Orientation orientation); |
|
104 |
|
105 private: |
|
106 Q_DECLARE_PRIVATE_D(d_ptr, HbNotificationDialog) |
|
107 Q_DISABLE_COPY(HbNotificationDialog) |
|
108 }; |
|
109 |
|
110 #endif /*HBNOTIFICATIONDIALOG_H*/ |