39 #include "ringbc.h" |
39 #include "ringbc.h" |
40 #include "unidatamodelloader.h" |
40 #include "unidatamodelloader.h" |
41 #include "unidatamodelplugininterface.h" |
41 #include "unidatamodelplugininterface.h" |
42 #include "msgcontacthandler.h" |
42 #include "msgcontacthandler.h" |
43 #include "debugtraces.h" |
43 #include "debugtraces.h" |
44 #include "msgaudiofetcherview.h" |
|
45 |
44 |
46 // LOCALIZATION |
45 // LOCALIZATION |
47 #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") |
46 #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") |
48 #define LOC_DIALOG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") |
47 #define LOC_DIALOG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") |
49 |
48 |
50 const qint64 NULL_CONVERSATIONID = -1; |
49 const qint64 NULL_CONVERSATIONID = -1; |
51 |
50 |
52 MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent,int activityMsgId) : |
51 MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent,int activityMsgId) : |
53 QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0), mConversationView(0), |
52 QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0), mConversationView(0), |
54 mUniViewer(0), mDraftsListView(0), mSettingsView(0), mAudioFetcherView(0), mBackAction(0), |
53 mUniViewer(0), mDraftsListView(0), mSettingsView(0), mBackAction(0), |
55 mServiceRequest(serviceRequest), mConversationId(-1), mViewServiceRequest(false),mMessageId(-1) |
54 mServiceRequest(serviceRequest), mConversationId(-1), mViewServiceRequest(false),mMessageId(-1) |
56 { |
55 { |
57 //creating back action. |
56 //creating back action. |
58 mBackAction = new HbAction(Hb::BackNaviAction, this); |
57 mBackAction = new HbAction(Hb::BackNaviAction, this); |
59 connect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction())); |
58 connect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction())); |
573 if (mViewServiceRequest && (mPreviousView == MsgBaseView::UNIVIEWER)) { |
554 if (mViewServiceRequest && (mPreviousView == MsgBaseView::UNIVIEWER)) { |
574 // quit the application |
555 // quit the application |
575 HbApplication::quit(); |
556 HbApplication::quit(); |
576 } |
557 } |
577 |
558 |
578 // delete Audio Fetcher view |
|
579 if(mAudioFetcherView) |
|
580 { |
|
581 appendViewToBeDeleted(mAudioFetcherView); |
|
582 mAudioFetcherView = NULL; |
|
583 } |
|
584 |
|
585 //delete UniEditor |
559 //delete UniEditor |
586 if (mUniEditor) |
560 if (mUniEditor) |
587 { |
561 { |
588 // Save to drafts if CV is launched via service |
562 // Save to drafts if CV is launched via service |
589 if (mPreviousView == MsgBaseView::SERVICE) { |
563 if (mPreviousView == MsgBaseView::SERVICE) { |
692 |
666 |
693 /** |
667 /** |
694 * Editor is tried to open again before exiting the previously |
668 * Editor is tried to open again before exiting the previously |
695 * opened editor. Multi taping in DLV or Forward. |
669 * opened editor. Multi taping in DLV or Forward. |
696 */ |
670 */ |
697 if (mUniEditor && !mAudioFetcherView) |
671 if (mUniEditor) |
698 { |
672 { |
699 return; |
673 return; |
700 } |
674 } |
701 |
675 |
702 mCurrentView = MsgBaseView::UNIEDITOR; |
676 mCurrentView = MsgBaseView::UNIEDITOR; |
703 if(MsgBaseView::AUDIOFETCHER != data.at(1).toInt()) |
677 mPreviousView = data.at(1).toInt(); |
704 { |
678 |
705 mPreviousView = data.at(1).toInt(); |
|
706 } |
|
707 |
|
708 // delete Audio Fetcher view |
|
709 if(mAudioFetcherView) |
|
710 { |
|
711 appendViewToBeDeleted(mAudioFetcherView); |
|
712 mAudioFetcherView = NULL; |
|
713 } |
|
714 |
|
715 // delete UniViewer |
679 // delete UniViewer |
716 if (mUniViewer ) |
680 if (mUniViewer ) |
717 { |
681 { |
718 appendViewToBeDeleted(mUniViewer); |
682 appendViewToBeDeleted(mUniViewer); |
719 mUniViewer = NULL; |
683 mUniViewer = NULL; |
1116 { |
1080 { |
1117 return mCurrentView; |
1081 return mCurrentView; |
1118 } |
1082 } |
1119 |
1083 |
1120 // ---------------------------------------------------------------------------- |
1084 // ---------------------------------------------------------------------------- |
1121 // MsgViewManager::switchToAudioFetcher |
|
1122 // @see header |
|
1123 // ---------------------------------------------------------------------------- |
|
1124 void MsgViewManager::switchToAudioFetcher(const QVariantList& data) |
|
1125 { |
|
1126 /** |
|
1127 * Audio Fetcher is tried to open again |
|
1128 */ |
|
1129 if(mAudioFetcherView) |
|
1130 { |
|
1131 return; |
|
1132 } |
|
1133 |
|
1134 //switch to Audio Fetcher view |
|
1135 mCurrentView = MsgBaseView::AUDIOFETCHER; |
|
1136 mPreviousView = data.at(1).toInt(); |
|
1137 QVariantList editorData; |
|
1138 // i=2 because view manager consumed first two args |
|
1139 for (int i = 2; i < data.length(); i++) { |
|
1140 editorData << data.at(i); |
|
1141 } |
|
1142 mAudioFetcherView = new MsgAudioFetcherView(editorData); |
|
1143 mAudioFetcherView->setNavigationAction(mBackAction); |
|
1144 connect(mAudioFetcherView, SIGNAL(switchView(const QVariantList&)), this, |
|
1145 SLOT(switchView(const QVariantList&))); |
|
1146 |
|
1147 if(mPreviousView==MsgBaseView::CV && mConversationView) |
|
1148 { |
|
1149 mConversationView->setPSCVId(false); |
|
1150 } |
|
1151 |
|
1152 mMainWindow->addView(mAudioFetcherView); |
|
1153 mMainWindow->setCurrentView(mAudioFetcherView,true,Hb::ViewSwitchSequential); |
|
1154 } |
|
1155 |
|
1156 // ---------------------------------------------------------------------------- |
|
1157 // MsgViewManager::saveContentToDraft |
1085 // MsgViewManager::saveContentToDraft |
1158 // @see header |
1086 // @see header |
1159 // ---------------------------------------------------------------------------- |
1087 // ---------------------------------------------------------------------------- |
1160 int MsgViewManager::saveContentToDraft() |
1088 int MsgViewManager::saveContentToDraft() |
1161 { |
1089 { |