|
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 HBNOTIFICATIONDIALOGCONTENT_H |
|
27 #define HBNOTIFICATIONDIALOGCONTENT_H |
|
28 |
|
29 #include <hbwidget.h> |
|
30 |
|
31 class QGraphicsItem; |
|
32 class HbIcon; |
|
33 class HbStyleOptionNotificationDialog; |
|
34 |
|
35 class HbNotificationDialogContent : public HbWidget |
|
36 { |
|
37 Q_OBJECT |
|
38 |
|
39 public: |
|
40 HbNotificationDialogContent(QGraphicsWidget *parent = 0); |
|
41 void setText(const QString &text); |
|
42 void setTitle(const QString &title); |
|
43 void setIcon(const HbIcon &icon); |
|
44 void setTitleTextWrapping(Hb::TextWrapping wrapping); |
|
45 Hb::TextWrapping titleTextWrapping() const; |
|
46 |
|
47 QString text() const { return mText; } |
|
48 QString title() const { return mTitle; } |
|
49 HbIcon icon() const { return mIcon; } |
|
50 |
|
51 enum { Type = Hb::ItemType_NotificationDialog }; |
|
52 int type() const { return Type; } |
|
53 void enableTouchActivation(bool enabled); |
|
54 bool isTouchActivating() const; |
|
55 |
|
56 public slots: |
|
57 virtual void updatePrimitives(); |
|
58 |
|
59 protected: |
|
60 void polish( HbStyleParameters& params ); |
|
61 void initStyleOption(HbStyleOptionNotificationDialog *option) const; |
|
62 QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const; |
|
63 private: |
|
64 Hb::TextWrapping mTitleWrapping; |
|
65 QString mText; |
|
66 QString mTitle; |
|
67 HbIcon mIcon; |
|
68 bool mIsTouchActivating; |
|
69 |
|
70 QGraphicsItem *mTextItem; |
|
71 QGraphicsItem *mTitleItem; |
|
72 QGraphicsItem *mIconItem; |
|
73 }; |
|
74 |
|
75 #endif // HBNOTIFICATIONDIALOGCONTENT |