emailuis/nmailui/src/nmviewerserviceinterface.cpp
changeset 68 83cc6bae1de8
parent 66 084b5b1f02a7
child 74 6c59112cfd31
equal deleted inserted replaced
67:459da34cdb45 68:83cc6bae1de8
    60     QVariantList idList;
    60     QVariantList idList;
    61     idList.append(mailboxId);
    61     idList.append(mailboxId);
    62     idList.append(folderId);
    62     idList.append(folderId);
    63     idList.append(messageId);
    63     idList.append(messageId);
    64     QVariant idListAsVariant = QVariant::fromValue(idList);
    64     QVariant idListAsVariant = QVariant::fromValue(idList);
    65     viewMessage(idListAsVariant, QVariant());
    65     viewMessage(idListAsVariant, QVariant(EmailBackReturnsToMessageList));
    66 }
    66 }
    67 
    67 
    68 
    68 
    69 /*!
    69 /*!
    70     Opens the message view according to the given IDs.
    70     Opens the message view according to the given IDs.
    76                  list view should be added into the view stack.
    76                  list view should be added into the view stack.
    77 */
    77 */
    78 void NmViewerServiceInterface::viewMessage(QVariant idList, QVariant flags)
    78 void NmViewerServiceInterface::viewMessage(QVariant idList, QVariant flags)
    79 {
    79 {
    80     NM_FUNCTION;
    80     NM_FUNCTION;
    81     
    81 
    82     mAsyncReqId = setCurrentRequestAsync();
    82     mAsyncReqId = setCurrentRequestAsync();
    83 
    83 
    84     NmId mailboxId(0), folderId(0), messageId(0);
    84     NmId mailboxId(0), folderId(0), messageId(0);
    85 
    85 
    86     // Check the given arguments.
    86     // Check the given arguments.
    87     if (idList.canConvert(QVariant::List)) {
    87     if (idList.canConvert(QVariant::List)) {
    88         QList<QVariant> ids = idList.toList();
    88         QList<QVariant> ids = idList.toList();
    89         
    89 
    90         if (ids.count() >= 3) {
    90         if (ids.count() >= 3) {
    91             mailboxId = ids[0].toULongLong();
    91             mailboxId = ids[0].toULongLong();
    92             folderId = ids[1].toULongLong();
    92             folderId = ids[1].toULongLong();
    93             messageId = ids[2].toLongLong();
    93             messageId = ids[2].toLongLong();
    94         }
    94         }
   121         HbMainWindow *mainWindow = mApplication->mainWindow();
   121         HbMainWindow *mainWindow = mApplication->mainWindow();
   122         mainWindow->show();
   122         mainWindow->show();
   123 
   123 
   124         if (addMessageListViewToStack) {
   124         if (addMessageListViewToStack) {
   125             // Launch the message list view.
   125             // Launch the message list view.
   126             NmUiStartParam *startParam1 = 
   126             NmUiStartParam *startParam1 =
   127                 new NmUiStartParam(NmUiViewMessageList,
   127                 new NmUiStartParam(NmUiViewMessageList,
   128                                    mailboxId,
   128                                    mailboxId,
   129                                    folderId,
   129                                    folderId,
   130                                    messageId,
   130                                    messageId,
   131                                    NmUiEditorCreateNew, // editor start mode
   131                                    NmUiEditorCreateNew, // editor start mode
   133                                    NULL, // attachment list
   133                                    NULL, // attachment list
   134                                    true); // start as service
   134                                    true); // start as service
   135 
   135 
   136             mApplication->enterNmUiView(startParam1);
   136             mApplication->enterNmUiView(startParam1);
   137         }
   137         }
   138         
   138 
   139         // Launch the message view.
   139         // Launch the message view.
   140         NmUiStartParam *startParam =
   140         NmUiStartParam *startParam =
   141             new NmUiStartParam(NmUiViewMessageViewer,
   141             new NmUiStartParam(NmUiViewMessageViewer,
   142                                mailboxId,
   142                                mailboxId,
   143                                folderId, // folder id
   143                                folderId, // folder id