virtual ~FrameController();
virtual NaviFrameController &getParent();
+ void pop();
protected:
void setNaviBarTitle(const MsgAddressList &addressList);
/**
* @brief Pops last frame. Exit from app if frame count reaches zero.
+ * @param[in] frame FrameController for pop
*/
- void pop();
+ void pop(FrameController &frame);
+ using NaviFrameView::pop;
/**
* @brief Executes app control command of default type.
NaviFrameItem::onAttached(item);
}
+void FrameController::pop()
+{
+ getParent().pop(*this);
+}
+
void FrameController::setNaviBarTitle(const MsgAddressList &addressList)
{
std::string title;
setHwButtonListener(getEo(), this);
}
-void NaviFrameController::pop()
+void NaviFrameController::pop(FrameController &frame)
{
if(isLastFrame())
getApp().exit();
else
- NaviFrameView::pop();
+ NaviFrameView::pop(frame);
}
void NaviFrameController::destroy()
void push(NaviFrameItem &item, View &content);
/**
- * @brief Pops item from Naviframe.
+ * @brief Pops top item from Naviframe.
*/
void pop();
/**
+ * @brief Pops item from Naviframe.
+ * @param[in] item NaviFrame item for pop.
+ */
+ void pop(NaviFrameItem &item);
+
+ /**
* @brief Inserts specified item to bottom of item's stack.
* @param[in] item an item to be inserted.
*/
void NaviFrameView::create(Evas_Object *parent)
{
setEo(elm_naviframe_add(parent));
+ elm_naviframe_event_enabled_set(getEo(), true); // Remove it after fix: TSAM-6776
addSmartCb("transition,finished", SMART_CALLBACK(NaviFrameView, onTransitionFinished), this);
- elm_naviframe_event_enabled_set(getEo(), EINA_TRUE); //Enables event receiving during pushing/popping items
show();
}
elm_naviframe_item_pop(getEo());
}
+void NaviFrameView::pop(NaviFrameItem &item)
+{
+ pop();
+ // Uncomment it after fix: TSAM-6776
+ /* if(getTransitionStatus())
+ item.destroy();
+ else
+ pop();
+ */
+}
+
void NaviFrameView::insertToBottom(NaviFrameItem &item)
{
Elm_Object_Item *before = elm_naviframe_bottom_item_get(getEo());
if(cmd->getDefaultType() == AppControlDefault::NotificationType && getMsgEngine().getStorage().getUnreadThreadCount() > 1)
{
- getParent().pop();
+ pop();
return;
}
else
{
saveDraftMsg();
- getParent().pop();
+ pop();
}
}
{ // If we came from notification menu and unread threads will be more than one, we should to go back on thread list view
if(m_DefferedCmd.defaultCmd->getDefaultType() == AppControlDefault::NotificationType && getMsgEngine().getStorage().getUnreadThreadCount() > 1)
{
- getParent().pop();
+ pop();
}
else
{ // Go to needed conversation
}
else
{ // We will get here from conversation after tap on Back Button
- getParent().pop();
+ pop();
}
popup.destroy();
if(m_Mode == SearchMode || m_Mode == DeleteMode)
setMode(NormalMode);
else
- getParent().pop();
+ pop();
}
void MsgThread::onHwMoreButtonClicked()
}
}
else if(buttonId == NaviPrevButtonId)
- getParent().pop();
+ pop();
setMode(NormalMode);
}
if(m_SimMode == CopyToDeviceMode || m_SimMode == DeleteMode)
setNormalMode();
else
- getParent().pop();
+ pop();
}
void MsgOnSimCard::showCopyDeletePopup()
void Settings::onButtonClicked(NaviFrameItem &item, NaviButtonId buttonId)
{
if(buttonId == NaviPrevButtonId)
- getParent().pop();
+ pop();
}
#include "SmilPlayer.h"
#include "SubjectLayout.h"
#include "SystemSettingsManager.h"
+#include "MsgStorage.h"
namespace Msg
{
, private IConversationListener
, private ISmilPlayerListener
, private ISystemSettingsManager
+ , private IMsgStorageListener
{
public:
Viewer(NaviFrameController &parent, MsgId id);
// SystemSettingsManager:
virtual void onLanguageChanged();
+ // IMsgStorageListener:
+ virtual void onMsgStorageDelete(const MsgIdList &msgIdList);
+
private:
void naviExpandButtonHandler();
void naviCenterButtonHandler();
#include <sstream>
#include <iomanip>
+#include <algorithm>
using namespace Msg;
Viewer::~Viewer()
{
MSG_LOG("");
+ getApp().getMsgEngine().getStorage().removeListener(*this);
getApp().getContactManager().removeListener(*this);
getApp().getSysSettingsManager().removeListener(*this);
}
getApp().getSysSettingsManager().addListener(*this);
getApp().getContactManager().addListener(*this);
+ getApp().getMsgEngine().getStorage().addListener(*this);
setHwButtonListener(*m_pLayout, this);
m_pSmilPlayer->start();
void Viewer::naviPrevButtonHandler()
{
- getParent().pop();
+ pop();
}
void Viewer::showRecipPopup(const std::string &title)
void Viewer::onHwBackButtonClicked()
{
- getParent().pop();
+ pop();
}
void Viewer::onHwMoreButtonClicked()
{
popup.destroy();
getApp().getMsgEngine().getStorage().deleteMessage(m_Msg->getId());
- getParent().pop();
}
void Viewer::onCopyTextItemPressed(PopupListItem &item)
void Viewer::onConversationSentMessage()
{
- getParent().pop();
+ pop();
}
void Viewer::onSmilPlayerStateChanged()
MSG_LOG("");
updateSubject();
}
+
+void Viewer::onMsgStorageDelete(const MsgIdList &msgIdList)
+{
+ MSG_LOG("");
+ if(m_Msg)
+ {
+ MsgId id = m_Msg->getId();
+ if(std::find(msgIdList.begin(), msgIdList.end(), id) != msgIdList.end())
+ pop();
+ }
+}