author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:12:40 +0300 | |
changeset 44 | 36f374c67aa8 |
parent 43 | 35b64624a9e7 |
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: |
|
15 |
* class to manage differnt messaging views. |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#include "msgviewmanager.h" |
|
20 |
||
21 |
#include <HbMainWindow> |
|
22 |
#include <HbAction> |
|
23 |
#include <xqserviceutil.h> |
|
24 |
#include <QSqlQuery> |
|
25 |
#include <QSqlError> |
|
26 |
#include <HbApplication> |
|
27 |
#include <xqappmgr.h> |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
28 |
#include <hbmessagebox.h> |
31 | 29 |
#include <HbView> |
30 |
||
31 |
#include "conversationsengine.h" |
|
32 |
#include "msglistview.h" |
|
33 |
#include "msgunieditorview.h" |
|
34 |
#include "msgconversationbaseview.h" |
|
35 |
#include "unifiedviewer.h" |
|
36 |
#include "draftslistview.h" |
|
37 |
#include "msgsettingsview.h" |
|
38 |
#include "convergedmessageid.h" |
|
39 |
#include "ringbc.h" |
|
40 |
#include "unidatamodelloader.h" |
|
41 |
#include "unidatamodelplugininterface.h" |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
42 |
#include "msgcontacthandler.h" |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
43 |
#include "debugtraces.h" |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
44 |
#include "msgaudiofetcherview.h" |
31 | 45 |
|
46 |
// LOCALIZATION |
|
47 |
#define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") |
|
48 |
#define LOC_DIALOG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") |
|
49 |
||
50 |
const qint64 NULL_CONVERSATIONID = -1; |
|
51 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
52 |
MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent,int activityMsgId) : |
31 | 53 |
QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0), mConversationView(0), |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
54 |
mUniViewer(0), mDraftsListView(0), mSettingsView(0), mAudioFetcherView(0), mBackAction(0), |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
55 |
mServiceRequest(serviceRequest), mConversationId(-1), mViewServiceRequest(false),mMessageId(-1) |
31 | 56 |
{ |
57 |
//creating back action. |
|
58 |
mBackAction = new HbAction(Hb::BackNaviAction, this); |
|
59 |
connect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction())); |
|
60 |
||
61 |
//create clv as first view if not a service request. |
|
62 |
if (!mServiceRequest) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
63 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
64 |
if(activityMsgId == NULL_CONVERSATIONID) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
65 |
{ |
31 | 66 |
QVariantList param; |
67 |
param << MsgBaseView::CLV; |
|
68 |
param << MsgBaseView::CLV; |
|
69 |
switchView(param); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
70 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
71 |
else |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
72 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
73 |
openUniEditorActivity(activityMsgId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
74 |
} |
31 | 75 |
} |
76 |
else |
|
77 |
{ |
|
78 |
mDummyview = new HbView(); |
|
79 |
mMainWindow->addView(mDummyview); |
|
80 |
mMainWindow->setCurrentView(mDummyview); |
|
81 |
mViewTobeDeleted << mDummyview; |
|
82 |
} |
|
83 |
} |
|
84 |
||
85 |
MsgViewManager::~MsgViewManager() |
|
86 |
{ |
|
87 |
// TODO Auto-generated destructor stub |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
88 |
mEditorData.clear(); |
31 | 89 |
} |
90 |
||
91 |
void MsgViewManager::onBackAction() |
|
92 |
{ |
|
93 |
switch (mCurrentView) { |
|
94 |
case MsgBaseView::CLV: |
|
95 |
{ |
|
96 |
// if its viewer service then quit the application |
|
97 |
if (mViewServiceRequest) { |
|
98 |
HbApplication::quit(); |
|
99 |
break; |
|
100 |
} |
|
101 |
||
102 |
if (!mServiceRequest) { |
|
103 |
HbApplication::quit(); |
|
104 |
} |
|
105 |
else { |
|
106 |
completeServiceRequest(); |
|
107 |
} |
|
108 |
||
109 |
break; |
|
110 |
} |
|
111 |
||
112 |
case MsgBaseView::CV: |
|
113 |
{ |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
114 |
mConversationId = -1; //reset the conversation view id since its closed |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
115 |
|
31 | 116 |
//Save content to drafts before switching to clv |
117 |
mConversationView->saveContentToDrafts(); |
|
118 |
||
119 |
//marking messages as red in CV. |
|
120 |
mConversationView->markMessagesAsRead(); |
|
121 |
||
122 |
// reset the conversation id published |
|
123 |
mConversationView->setPSCVId(false); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
124 |
|
31 | 125 |
//clearing content of cv. |
126 |
mConversationView->clearContent(); |
|
127 |
||
128 |
// if service request for veiwer the just switch to univiewer. |
|
129 |
if (mViewServiceRequest) { |
|
130 |
mCurrentView = MsgBaseView::UNIVIEWER; |
|
131 |
mMainWindow->setCurrentView(mUniViewer); |
|
132 |
break; |
|
133 |
} |
|
134 |
||
135 |
if (mServiceRequest) { |
|
136 |
completeServiceRequest(); |
|
137 |
} |
|
138 |
else { |
|
139 |
//switch to clv. |
|
140 |
QVariantList param; |
|
141 |
param << MsgBaseView::CLV; |
|
142 |
param << MsgBaseView::CV; |
|
143 |
switchView(param); |
|
144 |
} |
|
145 |
||
146 |
break; |
|
147 |
} |
|
148 |
||
149 |
case MsgBaseView::DLV: |
|
150 |
{ |
|
151 |
if (mServiceRequest) { |
|
152 |
completeServiceRequest(); |
|
153 |
} |
|
154 |
else { |
|
155 |
//switch to clv. |
|
156 |
QVariantList param; |
|
157 |
param << MsgBaseView::CLV; |
|
158 |
param << MsgBaseView::DLV; |
|
159 |
switchView(param); |
|
160 |
} |
|
161 |
||
162 |
break; |
|
163 |
} |
|
164 |
||
165 |
case MsgBaseView::UNIEDITOR: |
|
166 |
{ |
|
167 |
//Save content to drafts before switching to clv |
|
168 |
mUniEditor->saveContentToDrafts(); |
|
169 |
||
170 |
// if service request for veiwer the just switch to univiewer. |
|
171 |
if (mViewServiceRequest) { |
|
172 |
mCurrentView = MsgBaseView::UNIVIEWER; |
|
173 |
mMainWindow->setCurrentView(mUniViewer); |
|
174 |
break; |
|
175 |
} |
|
176 |
||
177 |
//switch to clv. |
|
178 |
if (mServiceRequest) { |
|
179 |
completeServiceRequest(); |
|
180 |
} |
|
181 |
else { |
|
182 |
//switch to clv. |
|
183 |
QVariantList param; |
|
184 |
param << MsgBaseView::CLV; |
|
185 |
param << MsgBaseView::UNIEDITOR; |
|
186 |
switchView(param); |
|
187 |
} |
|
188 |
||
189 |
break; |
|
190 |
} |
|
191 |
||
192 |
case MsgBaseView::UNIVIEWER: |
|
193 |
{ |
|
194 |
// if its launched via service request quit the app |
|
195 |
if (mViewServiceRequest) { |
|
196 |
HbApplication::quit(); |
|
197 |
} |
|
198 |
else { |
|
199 |
QVariantList param; |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
200 |
if (mConversationId != -1) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
201 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
202 |
//this means CV is till open then just open the fresh CV |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
203 |
param << MsgBaseView::CV; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
204 |
param << MsgBaseView::UNIVIEWER; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
205 |
param << mConversationView->conversationId(); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
206 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
207 |
else |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
208 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
209 |
param << MsgBaseView::CLV; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
210 |
param << MsgBaseView::UNIVIEWER; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
211 |
} |
31 | 212 |
switchView(param); |
213 |
||
214 |
} |
|
215 |
break; |
|
216 |
} |
|
217 |
case MsgBaseView::MSGSETTINGS: |
|
218 |
{ |
|
219 |
QVariantList param; |
|
220 |
param << MsgBaseView::DEFAULT; |
|
221 |
param << MsgBaseView::MSGSETTINGS; |
|
222 |
switchView(param); |
|
223 |
break; |
|
224 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
225 |
case MsgBaseView::AUDIOFETCHER: |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
226 |
{ |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
227 |
// switch back to previous view |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
228 |
QVariantList param; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
229 |
param << mPreviousView; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
230 |
param << MsgBaseView::AUDIOFETCHER; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
231 |
if(mPreviousView == MsgBaseView::CV) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
232 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
233 |
param << mConversationId; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
234 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
235 |
switchView(param); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
236 |
break; |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
237 |
} |
31 | 238 |
default: |
239 |
{ |
|
240 |
break; |
|
241 |
} |
|
242 |
} |
|
243 |
} |
|
244 |
||
245 |
void MsgViewManager::switchView(const QVariantList& data) |
|
246 |
{ |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
247 |
QCRITICAL_WRITE("MsgViewManager::switchView start."); |
31 | 248 |
|
249 |
int viewId = data.at(0).toInt(); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
250 |
|
31 | 251 |
switch (viewId) { |
252 |
case MsgBaseView::DEFAULT: |
|
253 |
{ |
|
254 |
handleDefault(data); |
|
255 |
break; |
|
256 |
} |
|
257 |
case MsgBaseView::CLV: |
|
258 |
{ |
|
259 |
switchToClv(data); |
|
260 |
break; |
|
261 |
} |
|
262 |
||
263 |
case MsgBaseView::CV: |
|
264 |
{ |
|
265 |
||
266 |
switchToCv(data); |
|
267 |
break; |
|
268 |
} |
|
269 |
||
270 |
case MsgBaseView::DLV: |
|
271 |
{ |
|
272 |
switchToDlv(data); |
|
273 |
break; |
|
274 |
} |
|
275 |
||
276 |
case MsgBaseView::UNIEDITOR: |
|
277 |
{ |
|
278 |
switchToUniEditor(data); |
|
279 |
break; |
|
280 |
} |
|
281 |
||
282 |
case MsgBaseView::UNIVIEWER: |
|
283 |
{ |
|
284 |
switchToUniViewer(data); |
|
285 |
break; |
|
286 |
} |
|
287 |
||
288 |
case MsgBaseView::MSGSETTINGS: |
|
289 |
{ |
|
290 |
switchToMsgSettings(data); |
|
291 |
break; |
|
292 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
293 |
case MsgBaseView::AUDIOFETCHER: |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
294 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
295 |
switchToAudioFetcher(data); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
296 |
break; |
31 | 297 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
298 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
299 |
QCRITICAL_WRITE("MsgViewManager::switchView end."); |
31 | 300 |
} |
301 |
||
302 |
void MsgViewManager::deletePreviousView() |
|
303 |
{ |
|
304 |
while(mViewTobeDeleted.count()) |
|
305 |
{ |
|
306 |
HbView* v = mViewTobeDeleted.takeAt(0); |
|
307 |
mMainWindow->removeView(v); |
|
308 |
delete v; |
|
309 |
} |
|
310 |
} |
|
311 |
||
312 |
||
313 |
void MsgViewManager::send(const qint32 contactId, const QString phoneNumber, |
|
314 |
const QString displayName) |
|
315 |
{ |
|
316 |
qint64 conversationId = ConversationsEngine::instance()-> getConversationIdFromContactId( |
|
317 |
contactId); |
|
318 |
||
319 |
//set mode to viewer, if conversations found else send mode. |
|
320 |
QVariantList param; |
|
321 |
if (conversationId > 0) { |
|
322 |
param << MsgBaseView::CV; |
|
323 |
param << MsgBaseView::SERVICE; |
|
324 |
param << conversationId; |
|
325 |
} |
|
326 |
else { |
|
327 |
ConvergedMessage message; |
|
328 |
ConvergedMessageAddress address; |
|
329 |
address.setAddress(phoneNumber); |
|
330 |
address.setAlias(displayName); |
|
331 |
message.addToRecipient(address); |
|
332 |
||
333 |
QByteArray dataArray; |
|
334 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
|
335 |
message.serialize(messageStream); |
|
336 |
||
337 |
param << MsgBaseView::UNIEDITOR; |
|
338 |
param << MsgBaseView::SERVICE; |
|
339 |
param << dataArray; |
|
340 |
} |
|
341 |
switchView(param); |
|
342 |
XQServiceUtil::toBackground(false); |
|
343 |
} |
|
344 |
||
345 |
void MsgViewManager::send(const QString phoneNumber, const QString alias, const QString bodyText) |
|
346 |
{ |
|
347 |
ConvergedMessage message; |
|
348 |
ConvergedMessageAddress address; |
|
349 |
address.setAddress(phoneNumber); |
|
350 |
address.setAlias(alias); |
|
351 |
message.addToRecipient(address); |
|
352 |
message.setBodyText(bodyText); |
|
353 |
||
354 |
QVariantList param; |
|
355 |
QByteArray dataArray; |
|
356 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
|
357 |
message.serialize(messageStream); |
|
358 |
||
359 |
param << MsgBaseView::UNIEDITOR; |
|
360 |
param << MsgBaseView::SERVICE; |
|
361 |
param << dataArray; |
|
362 |
||
363 |
switchView(param); |
|
364 |
XQServiceUtil::toBackground(false); |
|
365 |
} |
|
366 |
||
367 |
void MsgViewManager::setServiceRequest(bool request) |
|
368 |
{ |
|
369 |
mServiceRequest = request; |
|
370 |
mViewAtServiceRequest = mCurrentView; |
|
371 |
} |
|
372 |
||
373 |
void MsgViewManager::switchToLastSavedView() |
|
374 |
{ |
|
375 |
QVariantList param; |
|
376 |
||
377 |
switch (mViewAtServiceRequest) { |
|
378 |
case MsgBaseView::CV: |
|
379 |
{ |
|
380 |
param << MsgBaseView::CV; |
|
381 |
param << MsgBaseView::SERVICE; |
|
382 |
param << mConversationId; |
|
383 |
break; |
|
384 |
} |
|
385 |
case MsgBaseView::UNIVIEWER: |
|
386 |
{ |
|
387 |
param << MsgBaseView::UNIVIEWER; |
|
388 |
param << MsgBaseView::SERVICE; |
|
389 |
break; |
|
390 |
} |
|
391 |
default: |
|
392 |
{ |
|
393 |
param << MsgBaseView::CLV; |
|
394 |
param << MsgBaseView::SERVICE; |
|
395 |
break; |
|
396 |
} |
|
397 |
} |
|
398 |
switchView(param); |
|
399 |
} |
|
400 |
||
401 |
void MsgViewManager::open(qint64 conversationId) |
|
402 |
{ |
|
403 |
QVariantList param; |
|
404 |
||
405 |
if (conversationId < 0) { |
|
406 |
param << MsgBaseView::CLV; |
|
407 |
param << MsgBaseView::SERVICE; |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
408 |
|
31 | 409 |
if( mCurrentView == MsgBaseView::CV && mConversationView) |
410 |
{ |
|
411 |
mConversationView->setPSCVId(false); |
|
412 |
} |
|
413 |
} |
|
414 |
else { |
|
415 |
param << MsgBaseView::CV; |
|
416 |
param << MsgBaseView::SERVICE; |
|
417 |
param << conversationId; |
|
418 |
} |
|
419 |
||
420 |
switchView(param); |
|
421 |
XQServiceUtil::toBackground(false); |
|
422 |
} |
|
423 |
||
424 |
void MsgViewManager::send(QVariant data) |
|
425 |
{ |
|
426 |
ConvergedMessage message; |
|
427 |
ConvergedMessageAttachmentList attachmentList; |
|
428 |
// handle multiple files from sendUI |
|
429 |
// e.g. contacts can send multiple vcards |
|
430 |
QStringList receivedFiles = data.toStringList(); |
|
431 |
int recFileCount = receivedFiles.count(); |
|
432 |
for (int i = 0; i < recFileCount; i++) { |
|
433 |
ConvergedMessageAttachment *attachment = |
|
434 |
new ConvergedMessageAttachment(receivedFiles.at(i)); |
|
435 |
attachmentList.append(attachment); |
|
436 |
} |
|
437 |
message.addAttachments(attachmentList); |
|
438 |
||
439 |
QByteArray dataArray; |
|
440 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
|
441 |
message.serialize(messageStream); |
|
442 |
||
443 |
QVariantList param; |
|
444 |
param << MsgBaseView::UNIEDITOR; |
|
445 |
param << MsgBaseView::SERVICE; |
|
446 |
param << dataArray; |
|
447 |
||
448 |
switchView(param); |
|
449 |
XQServiceUtil::toBackground(false); |
|
450 |
} |
|
451 |
||
452 |
qint64 MsgViewManager::findConversationId(const QString phoneNum) |
|
453 |
{ |
|
454 |
return ConversationsEngine::instance()-> getConversationIdFromAddress(phoneNum); |
|
455 |
} |
|
456 |
||
457 |
//will be depricated in future. |
|
458 |
void MsgViewManager::openEditor(QString phoneNumber, QString name) |
|
459 |
{ |
|
460 |
ConvergedMessage message; |
|
461 |
ConvergedMessageAddress address; |
|
462 |
address.setAddress(phoneNumber); |
|
463 |
address.setAlias(name); |
|
464 |
message.addToRecipient(address); |
|
465 |
||
466 |
QByteArray dataArray; |
|
467 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
|
468 |
message.serialize(messageStream); |
|
469 |
||
470 |
QVariantList param; |
|
471 |
param << MsgBaseView::UNIEDITOR; |
|
472 |
param << MsgBaseView::SERVICE; |
|
473 |
param << dataArray; |
|
474 |
||
475 |
switchView(param); |
|
476 |
XQServiceUtil::toBackground(false); |
|
477 |
} |
|
478 |
||
479 |
void MsgViewManager::completeServiceRequest() |
|
480 |
{ |
|
481 |
mServiceRequest = false; |
|
482 |
XQServiceUtil::toBackground(true); |
|
483 |
switchToLastSavedView(); |
|
484 |
} |
|
485 |
||
486 |
void MsgViewManager::switchToClv(const QVariantList& data) |
|
487 |
{ |
|
488 |
mPreviousView = data.at(1).toInt(); |
|
489 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
490 |
// delete case from viewer service |
31 | 491 |
if (mViewServiceRequest && (mPreviousView == MsgBaseView::UNIVIEWER)) { |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
492 |
// quit the application |
31 | 493 |
HbApplication::quit(); |
494 |
} |
|
495 |
||
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
496 |
// this is the case when viewer/editor is opened and contacts update takes |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
497 |
// place resulting in CV close, the view should directly come to CLV |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
498 |
// bypassing the CV |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
499 |
if ((mCurrentView == MsgBaseView::UNIVIEWER |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
500 |
&& mPreviousView != MsgBaseView::UNIVIEWER) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
501 |
|| (mCurrentView == MsgBaseView::UNIEDITOR |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
502 |
&& mPreviousView != MsgBaseView::UNIEDITOR)) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
503 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
504 |
//dont do anything |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
505 |
//wait for the back from viewer/editor |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
506 |
//and reset the open CV id |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
507 |
mConversationId = -1; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
508 |
return; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
509 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
510 |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
511 |
//delete UniEditor |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
512 |
if (mUniEditor) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
513 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
514 |
appendViewToBeDeleted(mUniEditor); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
515 |
mUniEditor = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
516 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
517 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
518 |
//delete UniViewer |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
519 |
if (mUniViewer) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
520 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
521 |
appendViewToBeDeleted(mUniViewer); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
522 |
mUniViewer = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
523 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
524 |
|
31 | 525 |
if (mConversationView) { |
526 |
mConversationView->saveContentToDrafts(); |
|
527 |
//clearing content of cv. |
|
528 |
mConversationView->clearContent(); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
529 |
//reset the open CV id |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
530 |
mConversationId = -1; |
31 | 531 |
} |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
532 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
533 |
//switch to CLV. |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
534 |
mCurrentView = MsgBaseView::CLV; |
31 | 535 |
if (!mListView) { |
536 |
mListView = new MsgListView(); |
|
537 |
mListView->setNavigationAction(mBackAction); |
|
538 |
connect(mListView, SIGNAL(switchView(const QVariantList&)), this, |
|
539 |
SLOT(switchView(const QVariantList&))); |
|
540 |
mMainWindow->addView(mListView); |
|
541 |
} |
|
542 |
||
543 |
mMainWindow->setCurrentView(mListView); |
|
544 |
} |
|
545 |
||
546 |
void MsgViewManager::switchToCv(const QVariantList& data) |
|
547 |
{ |
|
548 |
//switch to CV. |
|
549 |
mCurrentView = MsgBaseView::CV; |
|
550 |
mPreviousView = data.at(1).toInt(); |
|
551 |
||
552 |
// delete case from viewer service |
|
553 |
if (mViewServiceRequest && (mPreviousView == MsgBaseView::UNIVIEWER)) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
554 |
// quit the application |
31 | 555 |
HbApplication::quit(); |
556 |
} |
|
557 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
558 |
// delete Audio Fetcher view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
559 |
if(mAudioFetcherView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
560 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
561 |
appendViewToBeDeleted(mAudioFetcherView); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
562 |
mAudioFetcherView = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
563 |
} |
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 |
//delete UniEditor |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
566 |
if (mUniEditor) |
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 |
appendViewToBeDeleted(mUniEditor); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
569 |
mUniEditor = NULL; |
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 |
//delete UniViewer |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
573 |
if (mUniViewer) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
574 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
575 |
appendViewToBeDeleted(mUniViewer); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
576 |
mUniViewer = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
577 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
578 |
|
31 | 579 |
QVariant var = data.at(2); |
580 |
qint64 conversationId; |
|
581 |
if (var.type() == QVariant::String) { |
|
582 |
QString phoneNumber = var.toString(); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
583 |
qint32 contactId = findContactId(phoneNumber); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
584 |
if (contactId != -1) { |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
585 |
conversationId = ConversationsEngine::instance()->getConversationIdFromContactId(contactId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
586 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
587 |
else { |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
588 |
conversationId = findConversationId(phoneNumber); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
589 |
} |
31 | 590 |
|
591 |
if (conversationId == NULL_CONVERSATIONID) { |
|
592 |
QVariantList param; |
|
593 |
param << MsgBaseView::CLV; |
|
594 |
param << MsgBaseView::CV; |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
595 |
|
31 | 596 |
if( mCurrentView == MsgBaseView::CV && mConversationView){ |
597 |
mConversationView->setPSCVId(false); |
|
598 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
599 |
|
31 | 600 |
switchView(param); |
601 |
return; |
|
602 |
} |
|
603 |
} |
|
604 |
else if (var.type() == QVariant::Invalid) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
605 |
// this case comes when a message is deleted from |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
606 |
// Unified viewer set curent view as conversation view |
31 | 607 |
// and return |
608 |
mMainWindow->setCurrentView(mConversationView); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
609 |
|
31 | 610 |
// publish already opened conversation's id |
611 |
mConversationView->setPSCVId(true); |
|
612 |
return; |
|
613 |
} |
|
614 |
else { |
|
615 |
conversationId = var.toLongLong(); |
|
616 |
} |
|
617 |
//switch to CV. |
|
618 |
mConversationId = conversationId; |
|
619 |
||
620 |
if (!mConversationView) { |
|
621 |
mConversationView = new MsgConversationBaseView(); |
|
622 |
mConversationView->setNavigationAction(mBackAction); |
|
623 |
connect(mConversationView, SIGNAL(switchView(const QVariantList&)), this, |
|
624 |
SLOT(switchView(const QVariantList&))); |
|
625 |
||
626 |
mMainWindow->addView(mConversationView); |
|
627 |
} |
|
628 |
else if (mConversationView->conversationId() != mConversationId){ |
|
629 |
//Save content to drafts before switching to different CV |
|
630 |
mConversationView->saveContentToDrafts(); |
|
631 |
//clearing content of current cv. |
|
632 |
mConversationView->clearContent(); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
633 |
} |
31 | 634 |
|
635 |
mConversationView->openConversation(conversationId); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
636 |
mMainWindow->setCurrentView(mConversationView); |
31 | 637 |
} |
638 |
||
639 |
void MsgViewManager::switchToDlv(const QVariantList& data) |
|
640 |
{ |
|
641 |
//switch to DLV. |
|
642 |
mCurrentView = MsgBaseView::DLV; |
|
643 |
mPreviousView = data.at(1).toInt(); |
|
644 |
||
645 |
if (!mDraftsListView) { |
|
646 |
mDraftsListView = new DraftsListView(); |
|
647 |
mDraftsListView->setNavigationAction(mBackAction); |
|
648 |
connect(mDraftsListView, SIGNAL(switchView(const QVariantList&)), this, |
|
649 |
SLOT(switchView(const QVariantList&))); |
|
650 |
||
651 |
mMainWindow->addView(mDraftsListView); |
|
652 |
} |
|
653 |
mMainWindow->setCurrentView(mDraftsListView); |
|
654 |
} |
|
655 |
||
656 |
void MsgViewManager::switchToUniEditor(const QVariantList& data) |
|
657 |
{ |
|
658 |
/** |
|
659 |
* Editor is tried to open again before exiting the previously |
|
660 |
* opened editor. Multi taping in DLV or Forward. |
|
661 |
*/ |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
662 |
if (mUniEditor && !mAudioFetcherView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
663 |
{ |
31 | 664 |
return; |
665 |
} |
|
666 |
||
667 |
mCurrentView = MsgBaseView::UNIEDITOR; |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
668 |
if(MsgBaseView::AUDIOFETCHER != data.at(1).toInt()) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
669 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
670 |
mPreviousView = data.at(1).toInt(); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
671 |
} |
31 | 672 |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
673 |
// delete Audio Fetcher view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
674 |
if(mAudioFetcherView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
675 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
676 |
appendViewToBeDeleted(mAudioFetcherView); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
677 |
mAudioFetcherView = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
678 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
679 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
680 |
// delete UniViewer |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
681 |
if (mUniViewer ) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
682 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
683 |
appendViewToBeDeleted(mUniViewer); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
684 |
mUniViewer = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
685 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
686 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
687 |
if (mConversationView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
688 |
{ |
31 | 689 |
//clearing content of cv. |
690 |
mConversationView->clearContent(); |
|
691 |
} |
|
692 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
693 |
// reset conversation id published |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
694 |
if(mPreviousView == MsgBaseView::CV && mConversationView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
695 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
696 |
mConversationView->setPSCVId(false); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
697 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
698 |
|
31 | 699 |
//swich to unieditor. |
700 |
if (!mUniEditor) { |
|
701 |
mUniEditor = new MsgUnifiedEditorView(); |
|
702 |
mMainWindow->addView(mUniEditor); |
|
703 |
mUniEditor->setNavigationAction(mBackAction); |
|
704 |
connect(mUniEditor, SIGNAL(switchView(const QVariantList&)), this, |
|
705 |
SLOT(switchView(const QVariantList&))); |
|
706 |
} |
|
707 |
||
708 |
// check if additional data for unieditor's consumption is available |
|
709 |
if (data.length() > 2) { |
|
710 |
QVariantList editorData; |
|
711 |
// i=2 because view manager consumed first two args |
|
712 |
for (int i = 2; i < data.length(); i++) { |
|
713 |
editorData << data.at(i); |
|
714 |
} |
|
715 |
||
716 |
if (MsgBaseView::DLV == mPreviousView) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
717 |
//Populate editor after view ready indication |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
718 |
populateUniEditorAfterViewReady(editorData); |
31 | 719 |
} |
720 |
else { |
|
721 |
mUniEditor->populateContent(editorData); |
|
722 |
} |
|
723 |
} |
|
724 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
725 |
mMainWindow->setCurrentView(mUniEditor); |
31 | 726 |
} |
727 |
||
728 |
void MsgViewManager::switchToUniViewer(const QVariantList& data) |
|
729 |
{ |
|
730 |
/** |
|
731 |
* Viewer is tried to open again before exiting the previously |
|
732 |
* opened viewer. Multi taping bubbles in CV. |
|
733 |
*/ |
|
734 |
if (mUniViewer) { |
|
735 |
return; |
|
736 |
} |
|
737 |
||
738 |
mCurrentView = MsgBaseView::UNIVIEWER; |
|
739 |
mPreviousView = data.at(1).toInt(); |
|
740 |
||
741 |
//switch to univiewer. |
|
742 |
if (data.length() > 2) { |
|
743 |
qint32 contactId = data.at(2).toLongLong(); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
744 |
qint32 messageId = data.at(3).toInt(); |
31 | 745 |
int msgCount = data.at(4).toInt(); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
746 |
int canForwardMessage = data.at(5).toInt(); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
747 |
|
31 | 748 |
if (!mUniViewer) { |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
749 |
mUniViewer = new UnifiedViewer(messageId, canForwardMessage); |
31 | 750 |
mUniViewer->setNavigationAction(mBackAction); |
751 |
mMainWindow->addView(mUniViewer); |
|
752 |
connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this, |
|
753 |
SLOT(switchView(const QVariantList&))); |
|
754 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
755 |
mUniViewer->populateContent(messageId, true, msgCount); |
31 | 756 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
757 |
|
31 | 758 |
if(mPreviousView==MsgBaseView::CV && mConversationView) |
759 |
{ |
|
760 |
mConversationView->setPSCVId(false); |
|
761 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
762 |
|
31 | 763 |
mMainWindow->setCurrentView(mUniViewer); |
764 |
} |
|
765 |
void MsgViewManager::switchToMsgSettings(const QVariantList& data) |
|
766 |
{ |
|
767 |
mCurrentView = MsgBaseView::MSGSETTINGS; |
|
768 |
mPreviousView = data.at(1).toInt(); |
|
769 |
||
770 |
if (!mSettingsView) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
771 |
|
31 | 772 |
MsgSettingsView::SettingsView view = MsgSettingsView::DefaultView; |
773 |
if (mPreviousView == MsgBaseView::UNIEDITOR || mPreviousView |
|
774 |
== MsgBaseView::CV) |
|
775 |
{ |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
776 |
view = (MsgSettingsView::SettingsView)data.at(2).toInt(); |
31 | 777 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
778 |
|
31 | 779 |
mSettingsView = new MsgSettingsView(view); |
780 |
mSettingsView->setNavigationAction(mBackAction); |
|
781 |
mMainWindow->addView(mSettingsView); |
|
782 |
mMainWindow->setCurrentView(mSettingsView); |
|
783 |
} |
|
784 |
if(mPreviousView==MsgBaseView::CV && mConversationView){ |
|
785 |
mConversationView->setPSCVId(false); |
|
786 |
} |
|
787 |
} |
|
788 |
||
789 |
void MsgViewManager::handleDefault(const QVariantList& data) |
|
790 |
{ |
|
791 |
//special handling incase we switch from settings-view |
|
792 |
int previousViewId = data.at(1).toInt(); |
|
793 |
if (MsgBaseView::MSGSETTINGS == previousViewId) { |
|
794 |
//switch to view, where from settings view was launched |
|
795 |
mCurrentView = mPreviousView; |
|
796 |
mPreviousView = previousViewId; |
|
797 |
//remove the settings view from main window |
|
798 |
if (mSettingsView) |
|
799 |
{ |
|
800 |
appendViewToBeDeleted(mSettingsView); |
|
801 |
mSettingsView = NULL; |
|
802 |
} |
|
803 |
switch (mCurrentView) { |
|
804 |
case MsgBaseView::CLV: |
|
805 |
{ |
|
806 |
if (mListView) |
|
807 |
mMainWindow->setCurrentView(mListView); |
|
808 |
break; |
|
809 |
} |
|
810 |
case MsgBaseView::CV: |
|
811 |
{ |
|
812 |
if (mConversationView) |
|
813 |
mMainWindow->setCurrentView(mConversationView); |
|
814 |
break; |
|
815 |
} |
|
816 |
case MsgBaseView::DLV: |
|
817 |
{ |
|
818 |
if (mDraftsListView) |
|
819 |
mMainWindow->setCurrentView(mDraftsListView); |
|
820 |
break; |
|
821 |
} |
|
822 |
case MsgBaseView::UNIEDITOR: |
|
823 |
{ |
|
824 |
if (mServiceRequest) { |
|
825 |
mMainWindow->setCurrentView(mUniEditor); |
|
826 |
} |
|
827 |
else { |
|
828 |
mMainWindow->setCurrentView(mUniEditor); |
|
829 |
} |
|
830 |
break; |
|
831 |
} |
|
832 |
} |
|
833 |
} |
|
834 |
} |
|
835 |
||
836 |
void MsgViewManager::view(int msgId) |
|
837 |
{ |
|
838 |
int msgType; |
|
839 |
int msgSubType; |
|
840 |
mMessageId = msgId; |
|
841 |
qint32 messageId(msgId); |
|
842 |
ConversationsEngine::instance()->markAsReadAndGetType(messageId, msgType, msgSubType); |
|
843 |
||
844 |
switch (msgType) { |
|
845 |
case ConvergedMessage::Sms: |
|
846 |
case ConvergedMessage::Mms: |
|
847 |
case ConvergedMessage::MmsNotification: |
|
848 |
{ |
|
849 |
handleSmsMmsMsg(msgId); |
|
850 |
break; |
|
851 |
} |
|
852 |
case ConvergedMessage::BioMsg: |
|
853 |
{ |
|
854 |
if (msgSubType == ConvergedMessage::RingingTone) { |
|
855 |
handleRingtoneMsg(msgId); |
|
856 |
||
857 |
} |
|
858 |
else if (msgSubType == ConvergedMessage::Provisioning) { |
|
859 |
handleProvisoningMsg(msgId); |
|
860 |
} |
|
861 |
break; |
|
862 |
} |
|
863 |
case ConvergedMessage::BT: |
|
864 |
{ |
|
865 |
break; |
|
866 |
} |
|
867 |
default: |
|
868 |
{ |
|
869 |
// for un supported message show delete option |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
870 |
HbMessageBox::question(LOC_DELETE_MESSAGE,this, |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
871 |
SLOT(onDialogDeleteMsg(HbAction*)), |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
872 |
HbMessageBox::Delete | HbMessageBox::Cancel); |
31 | 873 |
break; |
874 |
} |
|
875 |
} |
|
876 |
} |
|
877 |
||
878 |
// ---------------------------------------------------------------------------- |
|
879 |
// MsgViewManager::handleSmsMmsMsg |
|
880 |
// @see header |
|
881 |
// ---------------------------------------------------------------------------- |
|
882 |
void MsgViewManager::handleSmsMmsMsg(int msgId) |
|
883 |
{ |
|
884 |
mViewServiceRequest = true; |
|
885 |
||
886 |
mCurrentView = MsgBaseView::UNIVIEWER; |
|
887 |
||
888 |
if (!mUniViewer) { |
|
889 |
mUniViewer = new UnifiedViewer(msgId); |
|
890 |
mUniViewer->setNavigationAction(mBackAction); |
|
891 |
mMainWindow->addView(mUniViewer); |
|
892 |
connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this, |
|
893 |
SLOT(switchView(const QVariantList&))); |
|
894 |
} |
|
895 |
mUniViewer->populateContent(msgId, true, -1); |
|
896 |
||
897 |
mMainWindow->setCurrentView(mUniViewer); |
|
898 |
} |
|
899 |
||
900 |
// ---------------------------------------------------------------------------- |
|
901 |
// MsgViewManager::handleRingtoneMsg |
|
902 |
// @see header |
|
903 |
// ---------------------------------------------------------------------------- |
|
904 |
void MsgViewManager::handleRingtoneMsg(int msgId) |
|
905 |
{ |
|
906 |
mMessageId = msgId; |
|
907 |
HbMessageBox::question(LOC_DIALOG_SAVE_RINGTONE, this, |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
908 |
SLOT(onDialogSaveTone(HbAction*)), |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
909 |
HbMessageBox::Save | HbMessageBox::Cancel); |
31 | 910 |
} |
911 |
||
912 |
// ---------------------------------------------------------------------------- |
|
913 |
// MsgViewManager::handleProvisoningMsg |
|
914 |
// @see header |
|
915 |
// ---------------------------------------------------------------------------- |
|
916 |
void MsgViewManager::handleProvisoningMsg(int msgId) |
|
917 |
{ |
|
918 |
QString messageId; |
|
919 |
messageId.setNum(msgId); |
|
920 |
||
921 |
XQApplicationManager* aiwMgr = new XQApplicationManager(); |
|
922 |
||
923 |
XQAiwRequest* request = aiwMgr->create("com.nokia.services.MDM", "Provisioning", |
|
924 |
"ProcessMessage(QString)", true); // embedded |
|
925 |
||
926 |
if (request) { |
|
927 |
QList<QVariant> args; |
|
928 |
args << QVariant(messageId); |
|
929 |
request->setArguments(args); |
|
930 |
||
931 |
// Send the request |
|
932 |
bool res = request->send(); |
|
933 |
||
934 |
// Cleanup |
|
935 |
delete request; |
|
936 |
} |
|
937 |
||
938 |
delete aiwMgr; |
|
939 |
||
940 |
// close the application once its handled |
|
941 |
HbApplication::quit(); |
|
942 |
} |
|
943 |
||
944 |
void MsgViewManager::setViewInteractive() |
|
945 |
{ |
|
946 |
if(!mMainWindow->isInteractive()) |
|
947 |
{ |
|
948 |
mMainWindow->setInteractive(true); |
|
949 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
950 |
|
31 | 951 |
disconnect(mMainWindow, SIGNAL(viewReady()),this,SLOT(setViewInteractive())); |
952 |
} |
|
953 |
||
954 |
void MsgViewManager::appendViewToBeDeleted(HbView* view) |
|
955 |
{ |
|
956 |
if (view) |
|
957 |
{ |
|
958 |
mViewTobeDeleted << view; |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
959 |
connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(deletePreviousView()), Qt::UniqueConnection); |
31 | 960 |
} |
961 |
} |
|
962 |
||
963 |
// ---------------------------------------------------------------------------- |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
964 |
// MsgViewManager::populateEditorAfterViewReady |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
965 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
966 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
967 |
void MsgViewManager::populateUniEditorAfterViewReady(const QVariantList& editorData) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
968 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
969 |
//Save the editor data and use it in ViewReady handler |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
970 |
mEditorData = editorData; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
971 |
connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(populateUniEditorView())); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
972 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
973 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
974 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
975 |
// MsgViewManager::populateUniEditorView |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
976 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
977 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
978 |
void MsgViewManager::populateUniEditorView() |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
979 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
980 |
if (mUniEditor) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
981 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
982 |
mUniEditor->openDraftsMessage(mEditorData); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
983 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
984 |
mEditorData.clear(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
985 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
986 |
disconnect(mMainWindow, SIGNAL(viewReady()), this, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
987 |
SLOT(populateUniEditorView())); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
988 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
989 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
990 |
// ---------------------------------------------------------------------------- |
31 | 991 |
// MsgViewManager::onDialogDeleteMsg |
992 |
// @see header |
|
993 |
// ---------------------------------------------------------------------------- |
|
994 |
void MsgViewManager::onDialogDeleteMsg(HbAction* action) |
|
995 |
{ |
|
996 |
HbMessageBox *dlg = qobject_cast<HbMessageBox*> (sender()); |
|
997 |
if (action == dlg->actions().at(0)) { |
|
998 |
QList<int> msgIdList; |
|
999 |
msgIdList << mMessageId; |
|
1000 |
ConversationsEngine::instance()->deleteMessages(msgIdList); |
|
1001 |
} |
|
1002 |
HbApplication::quit(); // exit after handling |
|
1003 |
} |
|
1004 |
||
1005 |
// ---------------------------------------------------------------------------- |
|
1006 |
// MsgViewManager::onDialogSaveTone |
|
1007 |
// @see header |
|
1008 |
// ---------------------------------------------------------------------------- |
|
1009 |
void MsgViewManager::onDialogSaveTone(HbAction* action) |
|
1010 |
{ |
|
1011 |
HbMessageBox *dlg = qobject_cast<HbMessageBox*> (sender()); |
|
1012 |
if (action == dlg->actions().at(0)) { |
|
1013 |
UniDataModelLoader* pluginLoader = new UniDataModelLoader(); |
|
1014 |
UniDataModelPluginInterface* pluginInterface = pluginLoader->getDataModelPlugin( |
|
1015 |
ConvergedMessage::BioMsg); |
|
1016 |
pluginInterface->setMessageId(mMessageId); |
|
1017 |
UniMessageInfoList attachments = pluginInterface->attachmentList(); |
|
1018 |
||
1019 |
QString attachmentPath = attachments.at(0)->path(); |
|
1020 |
||
1021 |
RingBc* ringBc = new RingBc(); |
|
1022 |
ringBc->saveTone(attachmentPath); |
|
1023 |
||
1024 |
// clear attachement list : its allocated at data model |
|
1025 |
while (!attachments.isEmpty()) { |
|
1026 |
delete attachments.takeFirst(); |
|
1027 |
} |
|
1028 |
||
1029 |
delete ringBc; |
|
1030 |
delete pluginLoader; |
|
1031 |
} |
|
1032 |
||
1033 |
// close the application once its handled |
|
1034 |
HbApplication::quit(); |
|
1035 |
} |
|
1036 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1037 |
// ---------------------------------------------------------------------------- |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1038 |
// MsgViewManager::currentView |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1039 |
// @see header |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1040 |
// ---------------------------------------------------------------------------- |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1041 |
int MsgViewManager::currentView() |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1042 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1043 |
return mCurrentView; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1044 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1045 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1046 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1047 |
// MsgViewManager::switchToAudioFetcher |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1048 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1049 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1050 |
void MsgViewManager::switchToAudioFetcher(const QVariantList& data) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1051 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1052 |
/** |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1053 |
* Audio Fetcher is tried to open again |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1054 |
*/ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1055 |
if(mAudioFetcherView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1056 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1057 |
return; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1058 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1059 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1060 |
//switch to Audio Fetcher view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1061 |
mCurrentView = MsgBaseView::AUDIOFETCHER; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1062 |
mPreviousView = data.at(1).toInt(); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1063 |
QVariantList editorData; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1064 |
// i=2 because view manager consumed first two args |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1065 |
for (int i = 2; i < data.length(); i++) { |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1066 |
editorData << data.at(i); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1067 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1068 |
mAudioFetcherView = new MsgAudioFetcherView(editorData); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1069 |
mAudioFetcherView->setNavigationAction(mBackAction); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1070 |
connect(mAudioFetcherView, SIGNAL(switchView(const QVariantList&)), this, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1071 |
SLOT(switchView(const QVariantList&))); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1072 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1073 |
if(mPreviousView==MsgBaseView::CV && mConversationView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1074 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1075 |
mConversationView->setPSCVId(false); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1076 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1077 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1078 |
mMainWindow->addView(mAudioFetcherView); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1079 |
mMainWindow->setCurrentView(mAudioFetcherView); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1080 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1081 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1082 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1083 |
// MsgViewManager::saveContentToDraft |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1084 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1085 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1086 |
int MsgViewManager::saveContentToDraft() |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1087 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1088 |
int msgId = NULL_CONVERSATIONID; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1089 |
if( mCurrentView == MsgBaseView::CV ) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1090 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1091 |
msgId = mConversationView->saveContentToDrafts(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1092 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1093 |
else if( mCurrentView ==MsgBaseView::UNIEDITOR) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1094 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1095 |
msgId = mUniEditor->saveContentToDrafts(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1096 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1097 |
return msgId; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1098 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1099 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1100 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1101 |
// MsgViewManager::saveContentToDraft |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1102 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1103 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1104 |
void MsgViewManager::openUniEditorActivity(int activityMsgId) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1105 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1106 |
int msgType; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1107 |
int msgSubType; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1108 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1109 |
qint32 messageId(activityMsgId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1110 |
// get the message type |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1111 |
ConversationsEngine::instance()->markAsReadAndGetType(messageId, msgType, msgSubType); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1112 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1113 |
if (!mUniEditor) { |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1114 |
mUniEditor = new MsgUnifiedEditorView(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1115 |
mMainWindow->addView(mUniEditor); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1116 |
mUniEditor->setNavigationAction(mBackAction); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1117 |
connect(mUniEditor, SIGNAL(switchView(const QVariantList&)), this, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1118 |
SLOT(switchView(const QVariantList&))); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1119 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1120 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1121 |
// buffer data to open the draft message |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1122 |
ConvergedMessageId convergedMsgId(activityMsgId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1123 |
ConvergedMessage message; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1124 |
message.setMessageType((ConvergedMessage::MessageType) msgType); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1125 |
message.setMessageId(convergedMsgId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1126 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1127 |
// Launch uni-editor view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1128 |
QByteArray dataArray; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1129 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1130 |
message.serialize(messageStream); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1131 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1132 |
QVariantList editorData; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1133 |
editorData << dataArray; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1134 |
mUniEditor->openDraftsMessage(editorData); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1135 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1136 |
// set the current view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1137 |
mCurrentView = MsgBaseView::UNIEDITOR; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1138 |
mMainWindow->setCurrentView(mUniEditor); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1139 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1140 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1141 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1142 |
// MsgViewManager::findContactId |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1143 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1144 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1145 |
qint32 MsgViewManager::findContactId(QString address) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1146 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1147 |
QString displayLabel; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1148 |
int count; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1149 |
int localId = |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1150 |
MsgContactHandler::resolveContactDisplayName(address, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1151 |
displayLabel, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1152 |
count); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1153 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1154 |
return localId; |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1155 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1156 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1157 |
//EOF |