16 * |
16 * |
17 */ |
17 */ |
18 #include "univiewerfeeder_p.h" |
18 #include "univiewerfeeder_p.h" |
19 // SYSTEM INCLUDES |
19 // SYSTEM INCLUDES |
20 #include <msvstd.h> |
20 #include <msvstd.h> |
21 #include <s60qconversions.h> |
|
22 #include <msvids.h> |
21 #include <msvids.h> |
23 |
22 |
24 // USER INCLUDES |
23 // USER INCLUDES |
25 #include "nativemessageconsts.h" |
24 #include "nativemessageconsts.h" |
26 #include "univiewerfeeder.h" |
25 #include "univiewerfeeder.h" |
27 #include "unidatamodelloader.h" |
26 #include "unidatamodelloader.h" |
28 #include "msgcontacthandler.h" |
27 #include "msgcontacthandler.h" |
29 #include "debugtraces.h" |
28 #include "debugtraces.h" |
|
29 #include "msgbiouids.h" |
30 |
30 |
31 // --------------------------------------------------------------------------- |
31 // --------------------------------------------------------------------------- |
32 // UniViewerFeederPrivate::UniViewerFeederPrivate |
32 // UniViewerFeederPrivate::UniViewerFeederPrivate |
33 // @see header file |
33 // @see header file |
34 // --------------------------------------------------------------------------- |
34 // --------------------------------------------------------------------------- |
154 // Fetches message details from the store. |
154 // Fetches message details from the store. |
155 // --------------------------------------------------------------------------- |
155 // --------------------------------------------------------------------------- |
156 void UniViewerFeederPrivate::fetchDetailsL() |
156 void UniViewerFeederPrivate::fetchDetailsL() |
157 { |
157 { |
158 QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS start"); |
158 QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS start"); |
159 if (msgType() == KSenduiMtmSmsUidValue) |
159 if (msgType() == KSenduiMtmSmsUidValue || (msgType() == KSenduiMtmBioUidValue |
160 { |
160 && mEntry.iBioType == KMsgBioNokiaServiceMessage.iUid)) { |
161 QString body; |
161 QString body; |
162 mPluginInterface->body(body); |
162 mPluginInterface->body(body); |
163 q_ptr->emitMsgBody(body); |
163 q_ptr->emitMsgBody(body); |
164 } |
164 } |
165 QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS END"); |
165 QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS END"); |
246 { |
246 { |
247 mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Sms); |
247 mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Sms); |
248 mPluginInterface->setMessageId(msgId); |
248 mPluginInterface->setMessageId(msgId); |
249 } |
249 } |
250 |
250 |
251 if (msgType() == KSenduiMtmMmsUidValue) |
251 else if (msgType() == KSenduiMtmMmsUidValue) { |
252 { |
|
253 mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Mms); |
252 mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Mms); |
254 mPluginInterface->setMessageId(msgId); |
253 mPluginInterface->setMessageId(msgId); |
255 mSlideCount = mPluginInterface->slideCount(); |
254 mSlideCount = mPluginInterface->slideCount(); |
256 } |
255 |
|
256 } |
|
257 else if (msgType() == KSenduiMtmBioUidValue && mEntry.iBioType |
|
258 == KMsgBioNokiaServiceMessage.iUid) { |
|
259 mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg); |
|
260 mPluginInterface->setMessageId(msgId); |
|
261 } |
|
262 |
257 mPluginInterface->toRecipientList(mToAddressList); |
263 mPluginInterface->toRecipientList(mToAddressList); |
258 mPluginInterface->ccRecipientList(mCcAddressList); |
264 mPluginInterface->ccRecipientList(mCcAddressList); |
|
265 mPluginInterface->bccRecipientList(mBccAddressList); |
259 } |
266 } |
260 |
267 |
261 // --------------------------------------------------------------------------- |
268 // --------------------------------------------------------------------------- |
262 // UniViewerFeederPrivate::toAddressList |
269 // UniViewerFeederPrivate::toAddressList |
263 // @see header file |
270 // @see header file |
264 // --------------------------------------------------------------------------- |
271 // --------------------------------------------------------------------------- |
265 ConvergedMessageAddressList UniViewerFeederPrivate::toAddressList() |
272 ConvergedMessageAddressList UniViewerFeederPrivate::toAddressList() |
266 { |
273 { |
267 QString alias = QString(); |
274 QString alias = QString(); |
268 for (int i = 0; i < mToAddressList.count(); ++i) |
275 int count; |
269 { |
276 for (int i = 0; i < mToAddressList.count(); ++i) { |
270 MsgContactHandler::resolveContactDisplayName( |
277 MsgContactHandler::resolveContactDisplayName( |
271 mToAddressList.at(i)->address(), |
278 mToAddressList.at(i)->address(), alias, count); |
272 alias, |
|
273 0); |
|
274 mToAddressList.at(i)->setAlias(alias); |
279 mToAddressList.at(i)->setAlias(alias); |
275 alias.clear(); |
280 alias.clear(); |
276 } |
281 } |
277 return mToAddressList; |
282 return mToAddressList; |
278 } |
283 } |
282 // @see header file |
287 // @see header file |
283 // --------------------------------------------------------------------------- |
288 // --------------------------------------------------------------------------- |
284 ConvergedMessageAddressList UniViewerFeederPrivate::ccAddressList() |
289 ConvergedMessageAddressList UniViewerFeederPrivate::ccAddressList() |
285 { |
290 { |
286 QString alias = QString(); |
291 QString alias = QString(); |
287 for (int i = 0; i < mCcAddressList.count(); ++i) |
292 int count; |
288 { |
293 for (int i = 0; i < mCcAddressList.count(); ++i) { |
289 MsgContactHandler::resolveContactDisplayName( |
294 MsgContactHandler::resolveContactDisplayName( |
290 mToAddressList.at(i)->address(), |
295 mToAddressList.at(i)->address(), alias, count); |
291 alias, |
|
292 0); |
|
293 mCcAddressList.at(i)->setAlias(alias); |
296 mCcAddressList.at(i)->setAlias(alias); |
294 alias.clear(); |
297 alias.clear(); |
295 |
298 |
296 } |
299 } |
297 return mCcAddressList; |
300 return mCcAddressList; |
298 } |
301 } |
299 |
302 |
300 // --------------------------------------------------------------------------- |
303 // --------------------------------------------------------------------------- |
|
304 // UniViewerFeederPrivate::bccAddressList |
|
305 // @see header file |
|
306 // --------------------------------------------------------------------------- |
|
307 ConvergedMessageAddressList UniViewerFeederPrivate::bccAddressList() |
|
308 { |
|
309 QString alias = QString(); |
|
310 int count; |
|
311 for (int i = 0; i < mBccAddressList.count(); ++i) |
|
312 { |
|
313 MsgContactHandler::resolveContactDisplayName( |
|
314 mBccAddressList.at(i)->address(), |
|
315 alias, |
|
316 count); |
|
317 mBccAddressList.at(i)->setAlias(alias); |
|
318 alias.clear(); |
|
319 } |
|
320 return mBccAddressList; |
|
321 } |
|
322 |
|
323 // --------------------------------------------------------------------------- |
|
324 // UniViewerFeederPrivate::recipientCount |
|
325 // @see header file |
|
326 // --------------------------------------------------------------------------- |
|
327 int UniViewerFeederPrivate::recipientCount() |
|
328 { |
|
329 return mToAddressList.count() + mCcAddressList.count() + mBccAddressList.count(); |
|
330 } |
|
331 |
|
332 // --------------------------------------------------------------------------- |
301 // UniViewerFeederPrivate::messageSize |
333 // UniViewerFeederPrivate::messageSize |
302 // @see header file |
334 // @see header file |
303 // --------------------------------------------------------------------------- |
335 // --------------------------------------------------------------------------- |
304 int UniViewerFeederPrivate::messageSize() |
336 int UniViewerFeederPrivate::messageSize() |
305 { |
337 { |
311 // @see header file |
343 // @see header file |
312 // --------------------------------------------------------------------------- |
344 // --------------------------------------------------------------------------- |
313 void UniViewerFeederPrivate::fromAddressAndAlias(QString& from, QString& alias) |
345 void UniViewerFeederPrivate::fromAddressAndAlias(QString& from, QString& alias) |
314 { |
346 { |
315 mPluginInterface->fromAddress(from); |
347 mPluginInterface->fromAddress(from); |
316 MsgContactHandler::resolveContactDisplayName( |
348 int count; |
317 from, |
349 MsgContactHandler::resolveContactDisplayName(from, alias, count); |
318 alias, |
|
319 0); |
|
320 } |
350 } |
321 |
351 |
322 // --------------------------------------------------------------------------- |
352 // --------------------------------------------------------------------------- |
323 // UniViewerFeederPrivate::clearContent |
353 // UniViewerFeederPrivate::clearContent |
324 // @see header file |
354 // @see header file |