author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 11 Jun 2010 13:35:48 +0300 | |
changeset 34 | 84197e66a4bd |
parent 31 | ebfee66fde93 |
child 47 | 5b14749788d7 |
child 52 | 12db4185673b |
permissions | -rw-r--r-- |
31 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description:Item decorator of the message list view. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef MSG_LIST_VIEW_ITEM_H |
|
19 |
#define MSG_LIST_VIEW_ITEM_H |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include <hblistviewitem.h> |
|
23 |
||
24 |
//forward declarations |
|
25 |
class HbIconItem; |
|
26 |
class HbFrameItem; |
|
27 |
class HbTextItem; |
|
28 |
class HbIconItem; |
|
29 |
||
30 |
/** |
|
31 |
* This class represents the item decorator of |
|
32 |
* the message list view. |
|
33 |
*/ |
|
34 |
class MsgListViewItem : public HbListViewItem |
|
35 |
{ |
|
36 |
Q_OBJECT |
|
37 |
Q_PROPERTY(bool unReadMsg READ hasUnReadMsg WRITE setHasUnReadMsg) |
|
38 |
||
39 |
public: |
|
40 |
/** |
|
41 |
* Constructor |
|
42 |
*/ |
|
43 |
MsgListViewItem(QGraphicsItem* parent=0); |
|
44 |
||
45 |
/** |
|
46 |
* Creates the list view item |
|
47 |
*/ |
|
48 |
HbAbstractViewItem* createItem(); |
|
49 |
||
50 |
/** |
|
51 |
* Sets up the list item layout and display |
|
52 |
*/ |
|
53 |
void updateChildItems(); |
|
54 |
||
55 |
/** |
|
56 |
* Draws the seperator line between items in the View |
|
57 |
* @param painter the painter object for the current widget |
|
58 |
* @param option the graphics option for the widget |
|
59 |
* @param widget the widget instance |
|
60 |
*/ |
|
61 |
/*void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, |
|
62 |
QWidget *widget);*/ |
|
63 |
||
64 |
/** |
|
65 |
* Sets the mUnReadMsg |
|
66 |
* @param bool |
|
67 |
*/ |
|
68 |
void setHasUnReadMsg(bool unread = true); |
|
69 |
||
70 |
/** |
|
71 |
* Returns the value of mUnReadMsg |
|
72 |
* @return bool |
|
73 |
*/ |
|
74 |
bool hasUnReadMsg(); |
|
75 |
||
76 |
private: |
|
77 |
||
78 |
/** |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
79 |
* Create permanent items. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
80 |
*/ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
81 |
void initItems(); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
82 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
83 |
/** |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
84 |
* Returns the preview text based on message type, sub type. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
85 |
* Also sets the indicator icon. |
31 | 86 |
* @return QString |
87 |
*/ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
88 |
QString defaultPreviewText(int msgType, int msgSubType); |
31 | 89 |
|
90 |
/** |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
91 |
* Sets the preview text and timestamp. |
31 | 92 |
*/ |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
93 |
void setTimestampAndPreviewText(); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
94 |
|
31 | 95 |
private: |
96 |
/** |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
97 |
* Property to change the color of text |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
98 |
*/ |
31 | 99 |
bool mUnReadMsg; |
100 |
||
101 |
/** |
|
102 |
* To display the new message indication |
|
103 |
*/ |
|
104 |
HbFrameItem* mNewMsgIndicatorItem; |
|
105 |
||
106 |
/** |
|
107 |
* To display address. |
|
108 |
* Owned |
|
109 |
*/ |
|
110 |
HbTextItem *mAddressLabelItem; |
|
111 |
||
112 |
/** |
|
113 |
* To display time stamp. |
|
114 |
* Owned |
|
115 |
*/ |
|
116 |
HbTextItem *mTimestampItem; |
|
117 |
||
118 |
/** |
|
119 |
* To display message preview. |
|
120 |
* Owned |
|
121 |
*/ |
|
122 |
HbTextItem *mPreviewLabelItem; |
|
123 |
||
124 |
/** |
|
125 |
* To display unread message count |
|
126 |
* Owned |
|
127 |
*/ |
|
128 |
HbTextItem *mUnreadCountItem; |
|
129 |
||
130 |
/** |
|
131 |
* To display the presence indication |
|
132 |
*/ |
|
133 |
HbIconItem* mPresenceIndicatorItem; |
|
134 |
||
135 |
}; |
|
136 |
||
137 |
#endif // MSG_LIST_VIEW_ITEM_H |
|
138 |
||
139 |
// EOF |