author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 09:45:25 +0300 | |
changeset 52 | 12db4185673b |
parent 44 | 36f374c67aa8 |
child 70 | a15d9966050f |
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: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#include "msgconversationviewitem.h" |
|
19 |
||
20 |
// SYSTEM INCLUDES |
|
21 |
#include <QDateTime> |
|
22 |
#include "debugtraces.h" |
|
23 |
#include <QDir> |
|
24 |
#include <QChar> |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
25 |
#include <QStringBuilder> |
31 | 26 |
#include <HbTextItem> |
27 |
#include <HbIconItem> |
|
28 |
#include <HbIconAnimationManager> |
|
29 |
#include <HbIconAnimator> |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
30 |
#include <HbExtendedLocale> |
31 | 31 |
#include <ccsdefs.h> |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
32 |
#include <HbInstance> |
31 | 33 |
|
34 |
// USER INCLUDES |
|
35 |
#include "msgconversationwidget.h" |
|
36 |
#include "msgviewdefines.h" |
|
37 |
#include "msgviewutils.h" |
|
38 |
#include "convergedmessage.h" |
|
39 |
#include "conversationsenginedefines.h" |
|
40 |
||
41 |
// LOCAL CONSTANTS |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
42 |
static const char MSG_OUTBOX_ICON[] = "qtg_small_outbox"; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
43 |
static const char MSG_FAIL_ICON[] = "qtg_small_fail"; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
44 |
static const char ANIMATION_FILE[] = ":/qtg_anim_loading.axml"; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
45 |
static const char ANIMATION_ICON_NAME[] = "qtg_anim_loading"; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
46 |
static const char VCARD_ICON[] = "qtg_large_mycard"; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
47 |
static const char IMAGE_ICON[] = "qtg_small_image"; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
48 |
static const char CORRUPTED_ICON[] = "qtg_small_corrupted"; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
49 |
static const char MSG_VIDEO_ICON[] = "qtg_small_video"; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
50 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
51 |
// @see hbi18ndef.h |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
52 |
static const char DATE_FORMAT[] = r_qtn_date_short_with_zero; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
53 |
static const char TIME_FORMAT[] = r_qtn_time_usual_with_zero; |
31 | 54 |
|
55 |
// LOCALIZATION |
|
56 |
#define LOC_RINGING_TONE hbTrId("txt_messaging_dpopinfo_ringing_tone") |
|
57 |
#define LOC_BUSINESS_CARD hbTrId("txt_messaging_list_business_card") |
|
58 |
#define LOC_CALENDAR_EVENT hbTrId("txt_messaging_list_calendar_event") |
|
59 |
#define LOC_UNSUPPORTED_MSG_TYPE hbTrId("txt_messaging_list_listview_unsupported_message_type") |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
60 |
#define LOC_RESEND_AT hbTrId("txt_messaging_list_resend_at_time") |
31 | 61 |
|
62 |
//--------------------------------------------------------------- |
|
63 |
// MsgConversationViewItem::MsgConversationViewItem |
|
64 |
// Constructor |
|
65 |
//--------------------------------------------------------------- |
|
66 |
MsgConversationViewItem::MsgConversationViewItem(QGraphicsItem* parent) : |
|
67 |
HbListViewItem(parent), mIncoming(false), mConversation(0), |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
68 |
mIncomingMsgStateIconItem(0), mOutgoingMsgStateIconItem(0) |
31 | 69 |
{ |
70 |
} |
|
71 |
||
72 |
//--------------------------------------------------------------- |
|
73 |
// MsgConversationViewItem::MsgConversationViewItem |
|
74 |
// Destructor |
|
75 |
//--------------------------------------------------------------- |
|
76 |
MsgConversationViewItem::~MsgConversationViewItem() |
|
77 |
{ |
|
78 |
} |
|
79 |
||
80 |
//--------------------------------------------------------------- |
|
81 |
// MsgConversationViewItem::createItem |
|
82 |
// Create a new decorator item. |
|
83 |
//--------------------------------------------------------------- |
|
84 |
MsgConversationViewItem* MsgConversationViewItem::createItem() |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
85 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
86 |
MsgConversationViewItem *item = new MsgConversationViewItem(*this); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
87 |
item->init(); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
88 |
return item; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
89 |
} |
31 | 90 |
|
91 |
//--------------------------------------------------------------- |
|
92 |
// MsgConversationViewItem::updateChildItems |
|
93 |
// |
|
94 |
//--------------------------------------------------------------- |
|
95 |
void MsgConversationViewItem::updateChildItems() |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
96 |
{ |
31 | 97 |
QModelIndex index = modelIndex(); |
98 |
||
99 |
#ifdef _DEBUG_TRACES_ |
|
100 |
qCritical() << "START MsgConversationViewItem::updateChildItems: " |
|
101 |
<< index.data(ConvergedMsgId).toInt(); |
|
102 |
#endif |
|
103 |
||
104 |
int messageType = index.data(MessageType).toInt(); |
|
105 |
int messageSubType = index.data(MessageSubType).toInt(); |
|
106 |
||
107 |
||
108 |
if (messageType == ConvergedMessage::Sms) |
|
109 |
{ |
|
110 |
updateSmsTypeItem(index); |
|
111 |
} |
|
112 |
else if (messageType == ConvergedMessage::Mms || messageType |
|
113 |
== ConvergedMessage::MmsNotification || messageType |
|
114 |
== ConvergedMessage::BT) |
|
115 |
{ |
|
116 |
updateMmsTypeItem(index, messageType, messageSubType); |
|
117 |
} |
|
118 |
else if (messageType == ConvergedMessage::BioMsg) |
|
119 |
{ |
|
120 |
if (messageSubType == ConvergedMessage::VCard || messageSubType |
|
121 |
== ConvergedMessage::RingingTone) |
|
122 |
{ |
|
123 |
updateMmsTypeItem(index, messageType, messageSubType); |
|
124 |
} |
|
125 |
else |
|
126 |
{ |
|
127 |
updateSmsTypeItem(index, messageSubType); |
|
128 |
} |
|
129 |
} |
|
130 |
||
131 |
#ifdef _DEBUG_TRACES_ |
|
132 |
qCritical() << "END MsgConversationViewItem::updateChildItems: " |
|
133 |
<< index.data(ConvergedMsgId).toInt(); |
|
134 |
#endif |
|
135 |
||
136 |
repolish(); |
|
137 |
HbListViewItem::updateChildItems(); |
|
138 |
} |
|
139 |
||
140 |
//--------------------------------------------------------------- |
|
141 |
// MsgConversationViewItem::updateSmsTypeItem |
|
142 |
// @see header file |
|
143 |
//--------------------------------------------------------------- |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
144 |
void MsgConversationViewItem::updateSmsTypeItem(const QModelIndex& index, |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
145 |
int messageSubType) |
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 |
|
31 | 148 |
mIncoming = false; |
149 |
mConversation->resetProperties(); |
|
150 |
||
151 |
int direction = index.data(Direction).toInt(); |
|
152 |
||
153 |
if (direction == ConvergedMessage::Incoming) |
|
154 |
{ |
|
155 |
setIncoming(true); |
|
156 |
mConversation->setIncoming(true); |
|
157 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
158 |
mIncomingMsgStateIconItem->setVisible(false); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
159 |
} |
31 | 160 |
else if (direction == ConvergedMessage::Outgoing) |
161 |
{ |
|
162 |
setIncoming(false); |
|
163 |
mConversation->setIncoming(false); |
|
164 |
||
165 |
int sendingState = index.data(SendingState).toInt(); |
|
166 |
mConversation->setSendingState(sendingState); |
|
167 |
setMessageStateIcon(sendingState); |
|
168 |
} |
|
169 |
||
170 |
bool unreadStatus = index.data(UnReadStatus).toBool(); |
|
171 |
mConversation->setUnread(unreadStatus); |
|
172 |
||
173 |
mConversation->drawBubbleFrame(); |
|
174 |
mConversation->drawNewItemFrame(); |
|
175 |
||
176 |
QDateTime dateTime; |
|
177 |
dateTime.setTime_t(index.data(TimeStamp).toUInt()); |
|
178 |
QString resendStateNote((index.data(SendingState).toInt() |
|
179 |
== ConvergedMessage::Resend) ? LOC_RESEND_AT : ""); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
180 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
181 |
HbExtendedLocale locale = HbExtendedLocale::system(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
182 |
QString date = locale.format(dateTime.date(), DATE_FORMAT); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
183 |
QString time = locale.format(dateTime.time(), TIME_FORMAT); |
31 | 184 |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
185 |
if (dateTime.date() == QDateTime::currentDateTime().date()) { |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
186 |
mConversation->setTimeStamp(resendStateNote % time); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
187 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
188 |
else { |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
189 |
mConversation->setTimeStamp(resendStateNote % date); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
190 |
} |
31 | 191 |
|
192 |
if (messageSubType == ConvergedMessage::VCal) |
|
193 |
{ |
|
194 |
mConversation->setSubject(LOC_UNSUPPORTED_MSG_TYPE); |
|
195 |
} |
|
196 |
else |
|
197 |
{ |
|
198 |
QString bodyText = index.data(BodyText).toString(); |
|
199 |
bodyText.replace(QChar::ParagraphSeparator, QChar::LineSeparator); |
|
200 |
bodyText.replace('\r', QChar::LineSeparator); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
201 |
mConversation->setBodyText(bodyText); |
31 | 202 |
} |
203 |
||
204 |
//repolish |
|
205 |
mConversation->repolishWidget(); |
|
206 |
} |
|
207 |
||
208 |
//--------------------------------------------------------------- |
|
209 |
// MsgConversationViewItem::updateMmsTypeItem |
|
210 |
// @see header file |
|
211 |
//--------------------------------------------------------------- |
|
212 |
void MsgConversationViewItem::updateMmsTypeItem(const QModelIndex& index, |
|
213 |
int messageType, int messageSubType) |
|
214 |
{ |
|
215 |
// create widget |
|
216 |
if (!mConversation) |
|
217 |
{ |
|
218 |
mConversation = new MsgConversationWidget(this); |
|
219 |
HbStyle::setItemName(mConversation, "msgconvwidget"); |
|
220 |
} |
|
221 |
mIncoming = false; |
|
222 |
mConversation->resetProperties(); |
|
223 |
||
224 |
mConversation->setMMS(true); |
|
225 |
int direction = index.data(Direction).toInt(); |
|
226 |
QString bodyText = index.data(BodyText).toString(); |
|
227 |
||
228 |
if (direction == ConvergedMessage::Incoming) |
|
229 |
{ |
|
230 |
setIncoming(true); |
|
231 |
mConversation->setIncoming(true); |
|
232 |
||
233 |
if (messageType == ConvergedMessage::MmsNotification) |
|
234 |
{ |
|
235 |
mConversation->setMMSNotification(true); |
|
236 |
int notificationState = index.data(NotificationStatus).toInt(); |
|
237 |
mConversation->setNotificationState(notificationState); |
|
238 |
setNotificationStateIcon(notificationState); |
|
239 |
} |
|
240 |
else |
|
241 |
{ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
242 |
mIncomingMsgStateIconItem->setVisible(false); |
31 | 243 |
} |
244 |
} |
|
245 |
else if (direction == ConvergedMessage::Outgoing) |
|
246 |
{ |
|
247 |
setIncoming(false); |
|
248 |
mConversation->setIncoming(false); |
|
249 |
||
250 |
int sendingState = index.data(SendingState).toInt(); |
|
251 |
mConversation->setSendingState(sendingState); |
|
252 |
setMessageStateIcon(sendingState); |
|
253 |
} |
|
254 |
||
255 |
bool unreadStatus = index.data(UnReadStatus).toBool(); |
|
256 |
mConversation->setUnread(unreadStatus); |
|
257 |
||
258 |
mConversation->drawBubbleFrame(); |
|
259 |
mConversation->drawNewItemFrame(); |
|
260 |
||
261 |
QDateTime dateTime; |
|
262 |
dateTime.setTime_t(index.data(TimeStamp).toUInt()); |
|
263 |
QString resendStateNote((index.data(SendingState).toInt() |
|
264 |
== ConvergedMessage::Resend) ? LOC_RESEND_AT : ""); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
265 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
266 |
HbExtendedLocale locale = HbExtendedLocale::system(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
267 |
QString date = locale.format(dateTime.date(), DATE_FORMAT); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
268 |
QString time = locale.format(dateTime.time(), TIME_FORMAT); |
31 | 269 |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
270 |
if (dateTime.date() == QDateTime::currentDateTime().date()) { |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
271 |
mConversation->setTimeStamp(resendStateNote % time); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
272 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
273 |
else { |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
274 |
mConversation->setTimeStamp(resendStateNote % date); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
275 |
} |
31 | 276 |
|
277 |
if (messageType == ConvergedMessage::Mms) |
|
278 |
{ |
|
279 |
//preview path |
|
280 |
QString previewPath = index.data(Attachments).toString(); |
|
281 |
QString subject = index.data(Subject).toString(); |
|
282 |
||
283 |
int msgProperty = index.data(MessageProperty).toInt(); |
|
284 |
bool hasAttachments = (msgProperty & EPreviewAttachment) ? true : false; |
|
285 |
||
286 |
if (hasAttachments) |
|
287 |
{ |
|
288 |
mConversation->setAttachment(); |
|
289 |
} |
|
290 |
else |
|
291 |
{ |
|
292 |
mConversation->setAttachment(false); |
|
293 |
} |
|
294 |
||
295 |
// Now set the media contents |
|
296 |
||
297 |
//preview image |
|
298 |
bool hasImage = (msgProperty & EPreviewImage) ? true : false; |
|
299 |
if (hasImage) |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
300 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
301 |
mConversation->setImage(true); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
302 |
HbIcon previewIcon; |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
303 |
if (msgProperty & EPreviewProtectedImage) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
304 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
305 |
previewIcon = HbIcon(IMAGE_ICON); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
306 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
307 |
else if (msgProperty & EPreviewCorruptedImage) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
308 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
309 |
// TODO: Change to official icon. |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
310 |
previewIcon = HbIcon(CORRUPTED_ICON); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
311 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
312 |
else |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
313 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
314 |
QVariant previewData = index.data(PreviewIcon); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
315 |
previewIcon = qvariant_cast<HbIcon> (previewData); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
316 |
} |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
317 |
mConversation->setPreviewIcon(previewIcon); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
318 |
} |
31 | 319 |
|
320 |
bool hasVideo = (msgProperty & EPreviewVideo) ? true : false; |
|
321 |
if (hasVideo) |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
322 |
{ |
31 | 323 |
mConversation->setVideo(true); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
324 |
HbIcon videoPreviewIcon; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
325 |
if (msgProperty & EPreviewProtectedVideo) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
326 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
327 |
videoPreviewIcon = HbIcon(MSG_VIDEO_ICON); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
328 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
329 |
else if (msgProperty & EPreviewCorruptedVideo) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
330 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
331 |
videoPreviewIcon = HbIcon(CORRUPTED_ICON); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
332 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
333 |
else |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
334 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
335 |
videoPreviewIcon = HbIcon(MSG_VIDEO_ICON); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
336 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
337 |
mConversation->setPreviewIcon(videoPreviewIcon); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
338 |
} |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
339 |
bool hasAudio = (msgProperty & EPreviewAudio) ? true : false; |
31 | 340 |
if (hasAudio) |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
341 |
{ |
31 | 342 |
mConversation->setAudio(true); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
343 |
if (msgProperty & EPreviewProtectedAudio) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
344 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
345 |
mConversation->displayAudioIcon(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
346 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
347 |
else if (msgProperty & EPreviewCorruptedAudio) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
348 |
{ |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
349 |
mConversation->displayAudioIcon(CORRUPTED_ICON); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
350 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
351 |
else |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
352 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
353 |
mConversation->displayAudioIcon(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
354 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
355 |
} |
31 | 356 |
|
357 |
int priority = index.data(MessagePriority).toInt(); |
|
358 |
mConversation->setPriority(priority); |
|
359 |
mConversation->setSubject(subject); |
|
360 |
mConversation->setBodyText(bodyText); |
|
361 |
} |
|
362 |
else if (messageType == ConvergedMessage::BioMsg) |
|
363 |
{ |
|
364 |
if (messageSubType == ConvergedMessage::RingingTone) |
|
365 |
{ |
|
366 |
mConversation->setImage(false); |
|
367 |
mConversation->setAudio(true); |
|
368 |
mConversation->displayAudioIcon(); |
|
369 |
mConversation->setSubject(LOC_RINGING_TONE); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
370 |
mConversation->setBodyText(bodyText); |
31 | 371 |
} |
372 |
else if (messageSubType == ConvergedMessage::VCard) |
|
373 |
{ |
|
374 |
mConversation->setImage(false); |
|
375 |
mConversation->setAudio(true); |
|
376 |
mConversation->displayAudioIcon(VCARD_ICON); |
|
377 |
mConversation->setSubject(LOC_BUSINESS_CARD); |
|
378 |
mConversation->setBodyText(bodyText); |
|
379 |
} |
|
380 |
} |
|
381 |
else if (messageType == ConvergedMessage::BT) |
|
382 |
{ |
|
383 |
QString deviceName = index.data(ConversationAddress).toString(); |
|
384 |
mConversation->setSubject(deviceName); |
|
385 |
QString blueToothBody; |
|
386 |
if (messageSubType == ConvergedMessage::VCard) |
|
387 |
{ |
|
388 |
mConversation->setImage(false); |
|
389 |
mConversation->setAudio(true); |
|
390 |
mConversation->displayAudioIcon(VCARD_ICON); |
|
391 |
blueToothBody.append(LOC_BUSINESS_CARD); |
|
392 |
blueToothBody.append(QChar::LineSeparator); |
|
393 |
blueToothBody.append(bodyText); |
|
394 |
} |
|
395 |
else |
|
396 |
{ |
|
397 |
blueToothBody.append(bodyText); |
|
398 |
} |
|
399 |
mConversation->setBodyText(blueToothBody); |
|
400 |
} |
|
401 |
else if (messageType == ConvergedMessage::MmsNotification) |
|
402 |
{ |
|
403 |
QString subject = index.data(Subject).toString(); |
|
404 |
int priority = index.data(MessagePriority).toInt(); |
|
405 |
mConversation->setPriority(priority); |
|
406 |
mConversation->setSubject(subject); |
|
407 |
mConversation->setBodyText(bodyText); |
|
408 |
} |
|
409 |
||
410 |
//repolish widget |
|
411 |
mConversation->repolishWidget(); |
|
412 |
} |
|
413 |
||
414 |
//--------------------------------------------------------------- |
|
415 |
// MsgConversationViewItem::containsPoint |
|
416 |
// |
|
417 |
//--------------------------------------------------------------- |
|
418 |
bool MsgConversationViewItem::containsPoint(const QPointF& point) |
|
419 |
{ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
420 |
return mConversation->boundingRect(). contains(mConversation->mapFromScene( |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
421 |
point)); |
31 | 422 |
} |
423 |
||
424 |
//--------------------------------------------------------------- |
|
425 |
// MsgConversationViewItem::setIncoming |
|
426 |
// @see header file |
|
427 |
//--------------------------------------------------------------- |
|
428 |
void MsgConversationViewItem::setIncoming(bool incoming) |
|
429 |
{ |
|
430 |
mIncoming = incoming; |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
431 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
432 |
if (mIncoming) |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
433 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
434 |
HbStyle::setItemName(mOutgoingMsgStateIconItem, ""); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
435 |
mOutgoingMsgStateIconItem->setVisible(false); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
436 |
HbStyle::setItemName(mIncomingMsgStateIconItem, "msgStateIconIncoming"); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
437 |
mIncomingMsgStateIconItem->setIcon(HbIcon()); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
438 |
mIncomingMsgStateIconItem->setVisible(false); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
439 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
440 |
else |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
441 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
442 |
HbStyle::setItemName(mIncomingMsgStateIconItem, ""); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
443 |
mIncomingMsgStateIconItem->setVisible(false); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
444 |
HbStyle::setItemName(mOutgoingMsgStateIconItem, "msgStateIconOutgoing"); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
445 |
mOutgoingMsgStateIconItem->setIcon(HbIcon()); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
446 |
mOutgoingMsgStateIconItem->setVisible(false); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
447 |
} |
31 | 448 |
} |
449 |
||
450 |
//--------------------------------------------------------------- |
|
451 |
// MsgConversationViewItem::isIncoming |
|
452 |
// @see header file |
|
453 |
//--------------------------------------------------------------- |
|
454 |
bool MsgConversationViewItem::isIncoming() |
|
455 |
{ |
|
456 |
return mIncoming; |
|
457 |
} |
|
458 |
||
459 |
//--------------------------------------------------------------- |
|
460 |
// MsgConversationViewItem::setMessageStateIcon |
|
461 |
// @see header file |
|
462 |
//--------------------------------------------------------------- |
|
463 |
void MsgConversationViewItem::setMessageStateIcon(int messageState) |
|
464 |
{ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
465 |
HbIconAnimator& iconAnimator = mOutgoingMsgStateIconItem->animator(); |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
466 |
|
31 | 467 |
switch (messageState) |
468 |
{ |
|
469 |
case ConvergedMessage::Waiting: |
|
470 |
case ConvergedMessage::Scheduled: |
|
471 |
case ConvergedMessage::Sending: |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
472 |
{ |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
473 |
HbIconAnimationManager::global()->addDefinitionFile(ANIMATION_FILE); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
474 |
mOutgoingMsgStateIconItem->setIconName(ANIMATION_ICON_NAME); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
475 |
mOutgoingMsgStateIconItem->setVisible(true); |
31 | 476 |
iconAnimator.startAnimation(); |
477 |
break; |
|
478 |
} |
|
479 |
case ConvergedMessage::Suspended: |
|
480 |
case ConvergedMessage::Resend: |
|
481 |
{ |
|
482 |
iconAnimator.stopAnimation(); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
483 |
mOutgoingMsgStateIconItem->setIconName(MSG_OUTBOX_ICON); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
484 |
mOutgoingMsgStateIconItem->setVisible(true); |
31 | 485 |
break; |
486 |
} |
|
487 |
case ConvergedMessage::Failed: |
|
488 |
{ |
|
489 |
iconAnimator.stopAnimation(); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
490 |
mOutgoingMsgStateIconItem->setIconName(MSG_FAIL_ICON); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
491 |
mOutgoingMsgStateIconItem->setVisible(true); |
31 | 492 |
break; |
493 |
} |
|
494 |
case ConvergedMessage::Unknown: |
|
495 |
default: |
|
496 |
{ |
|
497 |
iconAnimator.stopAnimation(); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
498 |
mOutgoingMsgStateIconItem->setVisible(false); |
31 | 499 |
break; |
500 |
} |
|
501 |
} |
|
502 |
} |
|
503 |
||
504 |
//--------------------------------------------------------------- |
|
505 |
// MsgConversationViewItem::setNotificationStateIcon |
|
506 |
// @see header file |
|
507 |
//--------------------------------------------------------------- |
|
508 |
||
509 |
void MsgConversationViewItem::setNotificationStateIcon(int notificationState) |
|
510 |
{ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
511 |
HbIconAnimator& iconAnimator = mIncomingMsgStateIconItem->animator(); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
512 |
HbIconAnimationManager* iconAnimationManager = |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
513 |
HbIconAnimationManager::global(); |
31 | 514 |
switch (notificationState) |
515 |
{ |
|
516 |
case ConvergedMessage::NotifRetrieving: |
|
517 |
case ConvergedMessage::NotifWaiting: |
|
518 |
{ |
|
519 |
//TODO: Temp icon until official icons are received |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
520 |
bool defined = iconAnimationManager->addDefinitionFile( |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
521 |
ANIMATION_FILE); |
31 | 522 |
HbIcon animIcon; |
523 |
animIcon.setIconName(ANIMATION_ICON_NAME); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
524 |
QSizeF size = mIncomingMsgStateIconItem->size(); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
525 |
mIncomingMsgStateIconItem->setIcon(animIcon); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
526 |
mIncomingMsgStateIconItem->setVisible(true); |
31 | 527 |
iconAnimator.startAnimation(); |
528 |
break; |
|
529 |
} |
|
530 |
default: |
|
531 |
{ |
|
532 |
iconAnimator.stopAnimation(); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
533 |
mIncomingMsgStateIconItem->setVisible(false); |
31 | 534 |
break; |
535 |
} |
|
536 |
} |
|
537 |
} |
|
538 |
||
539 |
//--------------------------------------------------------------- |
|
540 |
// MsgConversationViewItem::pressStateChanged |
|
541 |
// @see header file |
|
542 |
//--------------------------------------------------------------- |
|
543 |
void MsgConversationViewItem::pressStateChanged (bool pressed, bool animate) |
|
544 |
{ |
|
545 |
mConversation->pressStateChanged(pressed, animate); |
|
546 |
} |
|
547 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
548 |
//--------------------------------------------------------------- |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
549 |
// MsgConversationViewItem::init |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
550 |
// @see header file |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
551 |
//--------------------------------------------------------------- |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
552 |
void MsgConversationViewItem::init() |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
553 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
554 |
mConversation = new MsgConversationWidget(this); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
555 |
HbStyle::setItemName(mConversation, "msgconvwidget"); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
556 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
557 |
mIncomingMsgStateIconItem = new HbIconItem(this); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
558 |
HbStyle::setItemName(mIncomingMsgStateIconItem, "msgStateIconIncoming"); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
559 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
560 |
mOutgoingMsgStateIconItem = new HbIconItem(this); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
561 |
HbStyle::setItemName(mOutgoingMsgStateIconItem, "msgStateIconOutgoing"); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
562 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
563 |
HbMainWindow *mainWindow = hbInstance->allMainWindows()[0]; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
564 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
565 |
connect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
566 |
SLOT(orientationchanged(Qt::Orientation)), Qt::UniqueConnection); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
567 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
568 |
// Force polish to get all the sub-item properties right. |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
569 |
polishEvent(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
570 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
571 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
572 |
//--------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
573 |
// MsgConversationViewItem::orientationchanged |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
574 |
// @see header file |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
575 |
//--------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
576 |
void MsgConversationViewItem::orientationchanged(Qt::Orientation orientation) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
577 |
{ |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
578 |
Q_UNUSED(orientation) |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
579 |
QDEBUG_WRITE("MsgConversationViewItem:orientationchanged start.") |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
580 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
581 |
repolish(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
582 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
583 |
QDEBUG_WRITE("MsgConversationViewItem:orientationchanged end.") |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
584 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
585 |
|
31 | 586 |
// EOF |