TizenRefApp-5529 Forward message 19/58819/2
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 3 Feb 2016 16:05:35 +0000 (18:05 +0200)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 3 Feb 2016 16:08:23 +0000 (18:08 +0200)
Change-Id: I98907a274f98c28a4307bac3bdcfdc327d6323ad
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Conversation/ConvList/Controller/inc/ConvList.h
src/Conversation/ConvList/Controller/inc/ConvListItem.h
src/Conversation/ConvList/Controller/src/ConvList.cpp
src/Conversation/ConvList/Controller/src/ConvListItem.cpp
src/Conversation/Main/Controller/inc/Conversation.h
src/Conversation/Main/Controller/src/Conversation.cpp

index bd0c064..870c1aa 100644 (file)
@@ -114,6 +114,7 @@ namespace Msg
 
             // IConvListItemListener:
             virtual void onEditDraftMsg(ConvListItem &item);
+            virtual void onForwardMsg(ConvListItem &item);
 
             // SelectAll callback:
             void onSelectAllChanged(Evas_Object *obj, void *eventInfo);
@@ -138,6 +139,7 @@ namespace Msg
              */
             virtual void onAllItemsDeleted(ConvList &list) {};
             virtual void onEditDraftMsg(MsgId id) {};
+            virtual void onForwardMsg(MsgId id) {};
     };
 }
 
index cc5b9df..9b8c3ef 100644 (file)
@@ -100,6 +100,7 @@ namespace Msg
         public:
             virtual ~IConvListItemListener() {}
             virtual void onEditDraftMsg(ConvListItem &item) {};
+            virtual void onForwardMsg(ConvListItem &item) {};
     };
 }
 
index d8499d0..a795263 100644 (file)
@@ -217,6 +217,12 @@ void ConvList::onMsgStorageDelete(const MsgIdList &msgIdList)
         m_pListner->onAllItemsDeleted(*this);
 }
 
+void ConvList::onForwardMsg(ConvListItem &item)
+{
+    if(m_pListner)
+        m_pListner->onForwardMsg(item.getMsgId());
+}
+
 void ConvList::onEditDraftMsg(ConvListItem &item)
 {
     if(m_pListner)
index 50c0099..2e0a251 100644 (file)
@@ -212,6 +212,9 @@ void ConvListItem::onCopyTextItemPressed(ContextPopupItem &item)
 void ConvListItem::onForwardItemPressed(ContextPopupItem &item)
 {
     MSG_LOG("");
+    item.getParent().destroy();
+    if(m_pListener)
+        m_pListener->onForwardMsg(*this);
 }
 
 void ConvListItem::onResendItemPressed(ContextPopupItem &item)
index 241d2a2..30a2918 100644 (file)
@@ -117,6 +117,7 @@ namespace Msg
             // ConvList callbacks:
             virtual void onAllItemsDeleted(ConvList &list);
             virtual void onEditDraftMsg(MsgId id);
+            virtual void onForwardMsg(MsgId id);
 
             // IAttachPanelListener:
             virtual void onFileSelected(AttachPanel &panel, const AttachPanel::FileList &files);
@@ -165,6 +166,7 @@ namespace Msg
             void write(const Message &msg);
             void saveDraftMsg();
             void editDraftMsg(MsgId id);
+            void forwardMsg(MsgId id);
 
             void onNaviOkButtonClicked();
             void onNaviCenterButtonClicked();
index ccadbf8..2c2e0f9 100644 (file)
@@ -419,6 +419,18 @@ void Conversation::editDraftMsg(MsgId id)
     }
 }
 
+void Conversation::forwardMsg(MsgId id)
+{
+    MessageRef msg = getMsgEngine().getStorage().getMessage(id);
+    if(msg)
+    {
+        setThreadId(ThreadId());
+        if(m_pBody)
+            m_pBody->write(*msg);
+        m_pRecipPanel->setEntryFocus(true);
+    }
+}
+
 void Conversation::notifyConvertMsgType()
 {
     std::string notifText = m_IsMms ?
@@ -864,6 +876,12 @@ void Conversation::onEditDraftMsg(MsgId id)
     editDraftMsg(id);
 }
 
+void Conversation::onForwardMsg(MsgId id)
+{
+    MSG_LOG("");
+    forwardMsg(id);
+}
+
 void Conversation::onFileSelected(AttachPanel &panel, const AttachPanel::FileList &files)
 {
     MSG_LOG("");