author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:32:06 +0100 | |
branch | GCC_SURGE |
changeset 47 | 5b14749788d7 |
parent 27 | e4592d119491 |
parent 43 | 35b64624a9e7 |
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:Message chat View decorator item prototype |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef MSG_CONVERSATION_VIEW_ITEM_H |
|
19 |
#define MSG_CONVERSATION_VIEW_ITEM_H |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include <HbListViewItem> |
|
23 |
#include "convergedmessage.h" |
|
24 |
||
25 |
//Forward Declarations |
|
26 |
class MsgConversationWidget; |
|
27 |
class HbTextItem; |
|
28 |
class HbIconItem; |
|
29 |
||
30 |
/** |
|
31 |
* This class represents the item decorator of |
|
32 |
* the conversation view. |
|
33 |
*/ |
|
34 |
class MsgConversationViewItem : public HbListViewItem |
|
35 |
{ |
|
36 |
Q_OBJECT |
|
37 |
||
38 |
Q_PROPERTY(bool isIncoming READ isIncoming WRITE setIncoming) |
|
39 |
||
40 |
public: |
|
41 |
/** |
|
42 |
* Constructor |
|
43 |
* @param parent, reference of QGraphicsItem |
|
44 |
* default set to 0 |
|
45 |
*/ |
|
46 |
MsgConversationViewItem(QGraphicsItem* parent = 0); |
|
47 |
||
48 |
/** |
|
49 |
* Destructor |
|
50 |
*/ |
|
51 |
virtual ~MsgConversationViewItem(); |
|
52 |
||
53 |
/** |
|
54 |
* Factory method to the items |
|
55 |
*/ |
|
56 |
virtual MsgConversationViewItem* createItem(); |
|
57 |
||
58 |
/** |
|
59 |
* Overridden method to draw the custom item in the list view |
|
60 |
*/ |
|
61 |
void updateChildItems(); |
|
62 |
||
63 |
/** |
|
64 |
* Checks if point in question is within bubble frame or not. |
|
65 |
* @param point, point to be checked. |
|
66 |
* @return returns true is point is within bubble frame geometry. |
|
67 |
*/ |
|
68 |
bool containsPoint(const QPointF& point); |
|
69 |
||
70 |
/** |
|
71 |
* Specify if this widget's message is incoming |
|
72 |
* @param incoming |
|
73 |
*/ |
|
74 |
void setIncoming(bool incoming = true); |
|
75 |
||
76 |
/** |
|
77 |
* Get to find if this is incoming message |
|
78 |
* @return bool |
|
79 |
*/ |
|
80 |
bool isIncoming(); |
|
81 |
||
82 |
private: |
|
83 |
||
84 |
/** |
|
85 |
* Set the Icon that displays the message state. |
|
86 |
*/ |
|
87 |
void setMessageStateIcon(int messageState); |
|
88 |
||
89 |
/** |
|
90 |
* Set the Icon that displays the message notification state. |
|
91 |
*/ |
|
92 |
void setNotificationStateIcon(int notificationState); |
|
93 |
||
94 |
/* |
|
95 |
* Update item with sms content |
|
96 |
*/ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
97 |
void updateSmsTypeItem(const QModelIndex& index, int messageSubType = |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
98 |
ConvergedMessage::None); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
99 |
|
31 | 100 |
/* |
101 |
* Update item with mms type content |
|
102 |
*/ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
103 |
void updateMmsTypeItem(const QModelIndex& index, int messageType, |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
104 |
int messageSubType); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
105 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
106 |
/* |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
107 |
* Initializes the msgconverstionviewitem |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
108 |
*/ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
109 |
void init(); |
31 | 110 |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
111 |
private slots: |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
112 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
113 |
/* |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
114 |
* Handler for orientation changed |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
115 |
* @param orientation Qt::Orientation |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
116 |
*/ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
117 |
void orientationchanged(Qt::Orientation orientation); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
118 |
|
31 | 119 |
protected: |
120 |
||
121 |
/** |
|
122 |
* Reimplemented from HbAbstractViewItem. |
|
123 |
* This function is called whenever item press state changes. |
|
124 |
* @see HbAbstractViewItem::pressStateChanged |
|
125 |
*/ |
|
126 |
virtual void pressStateChanged (bool pressed, bool animate); |
|
127 |
||
128 |
private: |
|
129 |
||
130 |
/** |
|
131 |
* Info about received or outgoing message. |
|
132 |
* true if received message else false. |
|
133 |
*/ |
|
134 |
bool mIncoming; |
|
135 |
||
136 |
/* |
|
137 |
* The chat custom control to show the conversation item |
|
138 |
* Owned |
|
139 |
*/ |
|
140 |
MsgConversationWidget *mConversation; |
|
141 |
||
142 |
/** |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
143 |
* Graphics Item to hold message incoming state. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
144 |
* Applicable for notification |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
145 |
* Owned |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
146 |
*/ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
147 |
HbIconItem *mIncomingMsgStateIconItem; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
148 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
149 |
/** |
31 | 150 |
* Graphics Item to hold message sending state. |
151 |
* Owned |
|
152 |
*/ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
153 |
HbIconItem *mOutgoingMsgStateIconItem; |
31 | 154 |
}; |
155 |
||
156 |
#endif // MSG_CONVERSATION_VIEW_ITEM_H |
|
157 |
// EOF |