messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp
changeset 34 84197e66a4bd
parent 31 ebfee66fde93
child 43 35b64624a9e7
equal deleted inserted replaced
31:ebfee66fde93 34:84197e66a4bd
    25 #include "nativemessageconsts.h"
    25 #include "nativemessageconsts.h"
    26 #include "univiewerfeeder.h"
    26 #include "univiewerfeeder.h"
    27 #include "unidatamodelloader.h"
    27 #include "unidatamodelloader.h"
    28 #include "msgcontacthandler.h"
    28 #include "msgcontacthandler.h"
    29 #include "debugtraces.h"
    29 #include "debugtraces.h"
       
    30 #include "msgbiouids.h"
    30 
    31 
    31 // ---------------------------------------------------------------------------
    32 // ---------------------------------------------------------------------------
    32 // UniViewerFeederPrivate::UniViewerFeederPrivate
    33 // UniViewerFeederPrivate::UniViewerFeederPrivate
    33 // @see header file
    34 // @see header file
    34 // ---------------------------------------------------------------------------
    35 // ---------------------------------------------------------------------------
   154 // Fetches message details from the store.
   155 // Fetches message details from the store.
   155 // ---------------------------------------------------------------------------
   156 // ---------------------------------------------------------------------------
   156 void UniViewerFeederPrivate::fetchDetailsL()
   157 void UniViewerFeederPrivate::fetchDetailsL()
   157 {
   158 {
   158     QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS start");
   159     QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS start");
   159     if (msgType() == KSenduiMtmSmsUidValue)
   160     if (msgType() == KSenduiMtmSmsUidValue || (msgType() == KSenduiMtmBioUidValue
   160     {
   161         && mEntry.iBioType == KMsgBioNokiaServiceMessage.iUid)) {
   161         QString body;
   162         QString body;
   162         mPluginInterface->body(body);
   163         mPluginInterface->body(body);
   163         q_ptr->emitMsgBody(body);
   164         q_ptr->emitMsgBody(body);
   164     }
   165     }
   165     QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS END");
   166     QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS END");
   246     {
   247     {
   247         mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
   248         mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
   248         mPluginInterface->setMessageId(msgId);
   249         mPluginInterface->setMessageId(msgId);
   249     }
   250     }
   250 
   251 
   251     if (msgType() == KSenduiMtmMmsUidValue)
   252     else if (msgType() == KSenduiMtmMmsUidValue) {
   252     {
       
   253         mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
   253         mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
   254         mPluginInterface->setMessageId(msgId);
   254         mPluginInterface->setMessageId(msgId);
   255         mSlideCount = mPluginInterface->slideCount();
   255         mSlideCount = mPluginInterface->slideCount();
   256     }
   256 
       
   257     }
       
   258     else if (msgType() == KSenduiMtmBioUidValue && mEntry.iBioType
       
   259         == KMsgBioNokiaServiceMessage.iUid) {
       
   260         mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
       
   261         mPluginInterface->setMessageId(msgId);
       
   262     }
       
   263 
   257     mPluginInterface->toRecipientList(mToAddressList);
   264     mPluginInterface->toRecipientList(mToAddressList);
   258     mPluginInterface->ccRecipientList(mCcAddressList);
   265     mPluginInterface->ccRecipientList(mCcAddressList);
       
   266     mPluginInterface->bccRecipientList(mBccAddressList);
   259 }
   267 }
   260 
   268 
   261 // ---------------------------------------------------------------------------
   269 // ---------------------------------------------------------------------------
   262 // UniViewerFeederPrivate::toAddressList
   270 // UniViewerFeederPrivate::toAddressList
   263 // @see header file
   271 // @see header file
   264 // ---------------------------------------------------------------------------
   272 // ---------------------------------------------------------------------------
   265 ConvergedMessageAddressList UniViewerFeederPrivate::toAddressList()
   273 ConvergedMessageAddressList UniViewerFeederPrivate::toAddressList()
   266 {
   274 {
   267     QString alias = QString();
   275     QString alias = QString();
   268     for (int i = 0; i < mToAddressList.count(); ++i)
   276     int count;
   269     {
   277     for (int i = 0; i < mToAddressList.count(); ++i) {
   270         MsgContactHandler::resolveContactDisplayName(
   278         MsgContactHandler::resolveContactDisplayName(
   271                 mToAddressList.at(i)->address(),
   279 		mToAddressList.at(i)->address(), alias, count);
   272                 alias,
       
   273                 0);
       
   274         mToAddressList.at(i)->setAlias(alias);
   280         mToAddressList.at(i)->setAlias(alias);
   275         alias.clear();
   281         alias.clear();
   276     }
   282     }
   277     return mToAddressList;
   283     return mToAddressList;
   278 }
   284 }
   282 // @see header file
   288 // @see header file
   283 // ---------------------------------------------------------------------------
   289 // ---------------------------------------------------------------------------
   284 ConvergedMessageAddressList UniViewerFeederPrivate::ccAddressList()
   290 ConvergedMessageAddressList UniViewerFeederPrivate::ccAddressList()
   285 {
   291 {
   286     QString alias = QString();
   292     QString alias = QString();
   287     for (int i = 0; i < mCcAddressList.count(); ++i)
   293     int count;
   288     {
   294     for (int i = 0; i < mCcAddressList.count(); ++i) {
   289         MsgContactHandler::resolveContactDisplayName(
   295         MsgContactHandler::resolveContactDisplayName(
   290                         mToAddressList.at(i)->address(),
   296 		mToAddressList.at(i)->address(), alias, count);
   291                         alias,
       
   292                         0);
       
   293         mCcAddressList.at(i)->setAlias(alias);
   297         mCcAddressList.at(i)->setAlias(alias);
   294         alias.clear();
   298         alias.clear();
   295 
   299 
   296     }
   300     }
   297     return mCcAddressList;
   301     return mCcAddressList;
   298 }
   302 }
   299 
   303 
   300 // ---------------------------------------------------------------------------
   304 // ---------------------------------------------------------------------------
       
   305 // UniViewerFeederPrivate::bccAddressList
       
   306 // @see header file
       
   307 // ---------------------------------------------------------------------------
       
   308 ConvergedMessageAddressList UniViewerFeederPrivate::bccAddressList()
       
   309 {
       
   310     QString alias = QString();
       
   311     int count;
       
   312     for (int i = 0; i < mBccAddressList.count(); ++i)
       
   313     {
       
   314         MsgContactHandler::resolveContactDisplayName(
       
   315             mBccAddressList.at(i)->address(),
       
   316             alias,
       
   317             count);
       
   318         mBccAddressList.at(i)->setAlias(alias);
       
   319         alias.clear();
       
   320     }
       
   321     return mBccAddressList;
       
   322 }
       
   323 
       
   324 // ---------------------------------------------------------------------------
       
   325 // UniViewerFeederPrivate::recipientCount
       
   326 // @see header file
       
   327 // ---------------------------------------------------------------------------
       
   328 int UniViewerFeederPrivate::recipientCount()
       
   329 {
       
   330     return mToAddressList.count() + mCcAddressList.count() + mBccAddressList.count();
       
   331 }
       
   332 
       
   333 // ---------------------------------------------------------------------------
   301 // UniViewerFeederPrivate::messageSize
   334 // UniViewerFeederPrivate::messageSize
   302 // @see header file
   335 // @see header file
   303 // ---------------------------------------------------------------------------
   336 // ---------------------------------------------------------------------------
   304 int UniViewerFeederPrivate::messageSize()
   337 int UniViewerFeederPrivate::messageSize()
   305 {
   338 {
   311 // @see header file
   344 // @see header file
   312 // ---------------------------------------------------------------------------
   345 // ---------------------------------------------------------------------------
   313 void UniViewerFeederPrivate::fromAddressAndAlias(QString& from, QString& alias)
   346 void UniViewerFeederPrivate::fromAddressAndAlias(QString& from, QString& alias)
   314 {
   347 {
   315     mPluginInterface->fromAddress(from);
   348     mPluginInterface->fromAddress(from);
   316     MsgContactHandler::resolveContactDisplayName(
   349     int count;
   317                     from,
   350     MsgContactHandler::resolveContactDisplayName(from, alias, count);
   318                     alias,
       
   319                     0);
       
   320 }
   351 }
   321 
   352 
   322 // ---------------------------------------------------------------------------
   353 // ---------------------------------------------------------------------------
   323 // UniViewerFeederPrivate::clearContent
   354 // UniViewerFeederPrivate::clearContent
   324 // @see header file
   355 // @see header file
   333 
   364 
   334     for (int i = 0; i < mCcAddressList.count(); ++i)
   365     for (int i = 0; i < mCcAddressList.count(); ++i)
   335     {
   366     {
   336         delete mCcAddressList.at(i);
   367         delete mCcAddressList.at(i);
   337     }
   368     }
   338 
       
   339     mCcAddressList.clear();
   369     mCcAddressList.clear();
       
   370 
       
   371     for (int i = 0; i < mBccAddressList.count(); ++i)
       
   372     {
       
   373         delete mBccAddressList.at(i);
       
   374     }
       
   375     mBccAddressList.clear();
   340 }
   376 }
   341 
   377 
   342 // EOF
   378 // EOF