From 8bb29db74d1c76acd915e7f63962308e840847dc Mon Sep 17 00:00:00 2001 From: chitta ranjan Date: Thu, 20 Jun 2013 21:37:51 +0900 Subject: [PATCH] HwKey related changes Change-Id: I7394f124402e8c413af6ec46cd44ee1cf85e7e6d Signed-off-by: chitta ranjan --- inc/MsgBaseForm.h | 5 + inc/MsgComposerForm.h | 2 + inc/MsgMessagesApp.h | 5 + inc/MsgMmsDetailForm.h | 6 +- inc/MsgThreadListForm.h | 7 +- inc/MsgTypes.h | 1 + res/screen-size-normal/IDL_THREAD_LIST_FORM.xml | 2 +- src/MsgBaseForm.cpp | 22 +++ src/MsgComposerForm.cpp | 171 ++++++++++++++++++++---- src/MsgConversationForm.cpp | 155 ++++++++++++++------- src/MsgMessagesApp.cpp | 17 +++ src/MsgMmsDetailForm.cpp | 48 ++++--- src/MsgSettingsForm.cpp | 16 +-- src/MsgSpamSettingsForm.cpp | 55 ++------ src/MsgThreadListForm.cpp | 141 +++++++------------ src/MsgTypes.cpp | 1 + 16 files changed, 405 insertions(+), 249 deletions(-) diff --git a/inc/MsgBaseForm.h b/inc/MsgBaseForm.h index 9f01a0d..496d75c 100644 --- a/inc/MsgBaseForm.h +++ b/inc/MsgBaseForm.h @@ -25,6 +25,7 @@ #include #include +#include /** * @class BaseForm @@ -36,6 +37,7 @@ class BaseForm : public Tizen::Ui::Controls::Form , public Tizen::Ui::IActionEventListener , public Tizen::Ui::Controls::IFormBackEventListener + , public Tizen::Ui::Controls::IFormMenuEventListener { public: //! Constructor @@ -56,6 +58,9 @@ public: //! Initialize, this should call if from derived from MsgBaseForm result InitializeBase(void); + //IFormMenuEventListener + virtual void OnFormMenuRequested(Tizen::Ui::Controls::Form& source); + protected: //! From IActionEventListener void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); diff --git a/inc/MsgComposerForm.h b/inc/MsgComposerForm.h index 629fd06..6b67d6a 100644 --- a/inc/MsgComposerForm.h +++ b/inc/MsgComposerForm.h @@ -79,6 +79,8 @@ public: bool Initialize(void); void LoadComposeData(const MessageComposeData& composeData, bool appControl = false); + void OnFormBackRequested(Tizen::Ui::Controls::Form& source); + protected: // From Form diff --git a/inc/MsgMessagesApp.h b/inc/MsgMessagesApp.h index e84afcc..e57db32 100644 --- a/inc/MsgMessagesApp.h +++ b/inc/MsgMessagesApp.h @@ -64,6 +64,7 @@ public: * Allocator method , create instance of this class */ static Tizen::App::UiApp* CreateInstance(void); + bool IsHwKeySupported(void); protected: // New API @@ -95,6 +96,9 @@ protected: void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs); private: + void CheckHwKeySupport(void); + +private: RequestId __pClientAppRequestId; Tizen::App::AppCtrlResult __appCntlResult; bool __isApplicationRunning; @@ -105,6 +109,7 @@ private: Tizen::Base::Collection::ArrayList* __pLaunchArgs; Tizen::Base::String __currentDisplayLanguage; bool __appControlReturnResult; + bool __isHwKeySupported; }; #endif //_MSG_MESSAGES_APP_H_ diff --git a/inc/MsgMmsDetailForm.h b/inc/MsgMmsDetailForm.h index f5b6305..1338d1b 100644 --- a/inc/MsgMmsDetailForm.h +++ b/inc/MsgMmsDetailForm.h @@ -41,6 +41,7 @@ class Progress; class ScrollPanel; class Slider; class TextBox; +class OptionMenu; }}}; class AttachListPanel; @@ -95,6 +96,7 @@ protected: // Back event listener. void OnFormBackRequested(Tizen::Ui::Controls::Form& source); + void OnFormMenuRequested(Tizen::Ui::Controls::Form& source); //IGalleryItemProvider virtual Tizen::Ui::Controls::GalleryItem* CreateItem(int index); virtual bool DeleteItem(int index, Tizen::Ui::Controls::GalleryItem* pItem); @@ -131,7 +133,7 @@ private: void ShowMessageDetails(void); void ShowVolumePopup(void); void ShowDeletePopup(void); - void ShowMoreContextMenu(void); + void ShowMoreOptionMenu(void); /** * Start slide show @@ -266,7 +268,7 @@ private: Tizen::Ui::Controls::Popup* __pDeletePopup; Tizen::Ui::Controls::Popup* __pVolumePopup; Tizen::Ui::Controls::Popup* __pBlockPopup; - Tizen::Ui::Controls::ContextMenu* __pMoreContextMenu; + Tizen::Ui::Controls::OptionMenu* __pMoreOptionMenu; Tizen::Ui::Controls::ContextMenu* __pRecipientContextMenu; Tizen::Ui::Controls::Slider* __pMediaVolumeSlider; Tizen::Ui::Controls::ScrollPanel* __pScrollPanel; diff --git a/inc/MsgThreadListForm.h b/inc/MsgThreadListForm.h index 4d22442..23f2adb 100644 --- a/inc/MsgThreadListForm.h +++ b/inc/MsgThreadListForm.h @@ -49,7 +49,7 @@ enum ContextItemType namespace Tizen { namespace Ui { namespace Controls { class CheckButton; -class ContextMenu; +class OptionMenu; class Label; }}}; @@ -150,6 +150,7 @@ protected: void OnIntializeFooter(Tizen::Ui::Controls::Footer& footer); void OnIntializeHeader(Tizen::Ui::Controls::Header& header); void OnFormBackRequested(Tizen::Ui::Controls::Form& source); + void OnFormMenuRequested(Tizen::Ui::Controls::Form& source); void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs); // Form IRestoreEventListener @@ -252,7 +253,7 @@ private: /** * Show popup menu. */ - result ShowContextPopup(Tizen::Graphics::Point& position); + result ShowOptionMenu(Tizen::Graphics::Point& position); /** * Show popup with contact number on tapping call button in thread list. @@ -314,7 +315,7 @@ private: Tizen::Ui::Controls::Label* __pSelectionInfo; Tizen::Base::Collection::ArrayListT* __pSelectedIds; MsgProgressPopup* __pProgressPopup; - Tizen::Ui::Controls::ContextMenu* __pContextMenu; + Tizen::Ui::Controls::OptionMenu* __pOptionMenu; Tizen::Ui::Controls::Popup* __pDeletePopup; int __msgListItemIndex; PhoneNumberListPopup* __pPhoneNumberListPopup; diff --git a/inc/MsgTypes.h b/inc/MsgTypes.h index 5633c71..eed8927 100644 --- a/inc/MsgTypes.h +++ b/inc/MsgTypes.h @@ -615,6 +615,7 @@ extern const int MARGIN_26PX; extern const int MARGIN_28PX; extern const int MARGIN_42PX; extern const int MARGIN_46PX; +extern const int MARGIN_80PX; extern const int H_ICON_64PX; extern const int W_ICON_64PX; diff --git a/res/screen-size-normal/IDL_THREAD_LIST_FORM.xml b/res/screen-size-normal/IDL_THREAD_LIST_FORM.xml index 74d140f..8d6a5b8 100644 --- a/res/screen-size-normal/IDL_THREAD_LIST_FORM.xml +++ b/res/screen-size-normal/IDL_THREAD_LIST_FORM.xml @@ -11,7 +11,7 @@
- +
diff --git a/src/MsgBaseForm.cpp b/src/MsgBaseForm.cpp index 00b0d28..1a8370a 100644 --- a/src/MsgBaseForm.cpp +++ b/src/MsgBaseForm.cpp @@ -19,6 +19,7 @@ #include #include "MsgBaseForm.h" +#include "MsgMessagesApp.h" using namespace Tizen::App; using namespace Tizen::Ui::Controls; @@ -66,6 +67,21 @@ BaseForm::InitializeBase(void) AppLogDebug("ENTER"); SetOrientation(Tizen::Ui::ORIENTATION_PORTRAIT); result r = E_SUCCESS; + + MessagesApp* pMessages = static_cast (Application::GetInstance()); + + bool isHwKeySupported = false; + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + + if (isHwKeySupported) + { + SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER); + } + Header* pHeader = GetHeader(); if (pHeader) { @@ -77,6 +93,7 @@ BaseForm::InitializeBase(void) OnIntializeFooter(*pFooter); } SetFormBackEventListener(this); + SetFormMenuEventListener(this); AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return r; @@ -94,3 +111,8 @@ BaseForm::OnFormBackRequested(Form& source) AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); } + +void +BaseForm::OnFormMenuRequested(Tizen::Ui::Controls::Form& source) +{ +} diff --git a/src/MsgComposerForm.cpp b/src/MsgComposerForm.cpp index 1d7f18b..6bd3d21 100644 --- a/src/MsgComposerForm.cpp +++ b/src/MsgComposerForm.cpp @@ -63,7 +63,6 @@ ComposerForm::ComposerForm(void) ComposerForm::~ComposerForm(void) { AppLogDebug("ENTER"); - SettingInfo::RemoveSettingEventListener(*this); if (__pMoreContextMenu) { delete __pMoreContextMenu; @@ -95,8 +94,11 @@ result ComposerForm::OnTerminating(void) { AppLogDebug("ENTER"); - result r = E_SUCCESS; + + SettingInfo::RemoveSettingEventListener(*this); + RemoveKeyEventListener(*this); + AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return r; } @@ -112,22 +114,45 @@ ComposerForm::OnIntializeHeader(Header& header) String strText; Application::GetInstance()->GetAppResource()->GetString(L"IDS_COM_POP_NEW_MESSAGE", strText); header.SetTitleText(strText); - // Set right button - ButtonItem buttonRightItem; - buttonRightItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_HEADER_BACK); - Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK); - buttonRightItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); - pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK_PRESSED); - buttonRightItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); - header.SetButton(BUTTON_POSITION_RIGHT, buttonRightItem); - // Set left button - ButtonItem btnLeft; - btnLeft.Construct(BUTTON_ITEM_STYLE_ICON, IDA_OPTION_TRAY_COMMAND); - pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE); - btnLeft.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); - pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE_PRESSED); - btnLeft.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); - header.SetButton(BUTTON_POSITION_LEFT, btnLeft); + + MessagesApp* pMessages = static_cast (Application::GetInstance()); + + bool isHwKeySupported = false; + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + + if (!isHwKeySupported) + { + // Set right button + ButtonItem buttonRightItem; + buttonRightItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_HEADER_BACK); + Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK); + buttonRightItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK_PRESSED); + buttonRightItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); + header.SetButton(BUTTON_POSITION_RIGHT, buttonRightItem); + // Set left button + ButtonItem btnLeft; + btnLeft.Construct(BUTTON_ITEM_STYLE_ICON, IDA_OPTION_TRAY_COMMAND); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE); + btnLeft.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE_PRESSED); + btnLeft.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); + header.SetButton(BUTTON_POSITION_LEFT, btnLeft); + } + else + { + ButtonItem btnRight; + btnRight.Construct(BUTTON_ITEM_STYLE_ICON, IDA_OPTION_TRAY_COMMAND); + Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE); + btnRight.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE_PRESSED); + btnRight.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); + header.SetButton(BUTTON_POSITION_RIGHT, btnRight); + } AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return; @@ -616,6 +641,7 @@ ComposerForm::ShowMoreContextMenu(const Control& source) AppLogDebug("ENTER"); result r = E_SUCCESS; + bool isHwKeySupported = false; if (__pMoreContextMenu) { delete __pMoreContextMenu; @@ -645,6 +671,18 @@ ComposerForm::ShowMoreContextMenu(const Control& source) strText.Format(strFormat.GetLength() * 2, strFormat.GetPointer(), __pMsgComposePanel->GetDefaultPageDuration()); __pMoreContextMenu->AddItem(strText, IDA_PAGE_DURATION); } + + MessagesApp* pMessages = static_cast (Application::GetInstance()); + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + + if (isHwKeySupported) + { + __pMoreContextMenu->SetAnchorPosition(Point((source.GetWidth() * 4 / 5) + MARGIN_80PX, source.GetHeight() + MARGIN_15PX)); + } __pMoreContextMenu->AddActionEventListener(*this); SendUserEvent(REQUEST_SET_FOCUS_TO_FORM, null); __pMoreContextMenu->SetShowState(true); @@ -835,7 +873,16 @@ ComposerForm::OnKeypadOpened(Control& source) { AppLogDebug("ENTER"); - if (!Clipboard::GetInstance()->IsPopupVisible()) + MessagesApp* pMessages = static_cast (Application::GetInstance()); + + bool isHwKeySupported = false; + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + + if (!Clipboard::GetInstance()->IsPopupVisible() && !isHwKeySupported) { GetHeader()->RemoveButtonAt(BUTTON_POSITION_RIGHT); ButtonItem btnRight; @@ -865,15 +912,27 @@ void ComposerForm::OnKeypadClosed(Control& source) { AppLogDebug("ENTER"); - //Hide drop-down button in header and display back button: - GetHeader()->RemoveButtonAt(BUTTON_POSITION_RIGHT); - ButtonItem btnRight; - btnRight.Construct(BUTTON_ITEM_STYLE_ICON, IDA_HEADER_BACK); - Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK); - btnRight.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); - pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK_PRESSED); - btnRight.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); - GetHeader()->SetButton(BUTTON_POSITION_RIGHT, btnRight); + + MessagesApp* pMessages = static_cast (Application::GetInstance()); + + bool isHwKeySupported = false; + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + if (!isHwKeySupported) + { + //Hide drop-down button in header and display back button: + GetHeader()->RemoveButtonAt(BUTTON_POSITION_RIGHT); + ButtonItem btnRight; + btnRight.Construct(BUTTON_ITEM_STYLE_ICON, IDA_HEADER_BACK); + Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK); + btnRight.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK_PRESSED); + btnRight.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); + GetHeader()->SetButton(BUTTON_POSITION_RIGHT, btnRight); + } Rectangle clientArea = GetClientAreaBounds(); AppLogDebug("clientArea : %d", clientArea.height); @@ -1135,3 +1194,59 @@ ComposerForm::DestroyMessagePopup(void) AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return; } + +void +ComposerForm::OnFormBackRequested(Form& source) +{ + AppLogDebug("ENTER"); + + MessageComposeData* pComposeData = __pMsgComposePanel->GetMessageComposeDataN(); + + bool IsContentExist(pComposeData != null); + if(__pRecipientPanel->IsTextForTokenExist()) + { + __pRecipientPanel->CheckRecipientForToken(); + } + bool IsRecipientExist(__pRecipientPanel->GetRecipientCount() > 0); + + if(IsContentExist && IsRecipientExist) // If both exists, create a draft message + { + ArrayList* pRecipientsNumberArray = __pRecipientPanel->GetRecipientNumberListN(); + MessagePresentationModel* pMessagePresentationModel = MessagePresentationModel::GetInstance(); + if (pMessagePresentationModel && pRecipientsNumberArray) + { + int draftId(-1); + if (__pDraftMessageEntry) + { + draftId = __pDraftMessageEntry->GetEntryId(); + } + pMessagePresentationModel->SaveMessage(*pComposeData, *pRecipientsNumberArray); + if (draftId > -1) + { + pMessagePresentationModel->Delete(draftId, REQUEST_DELETE_MESSAGE); + } + } + pRecipientsNumberArray->RemoveAll(true); + delete pRecipientsNumberArray; + } + else if(IsContentExist || IsRecipientExist) // If one of them exists, then display popup message as to quit or not + { + String warningMessage; + Application::GetInstance()->GetAppResource()->GetString(L"IDS_MSGC_POP_DISCARD_CURRENT_MESSAGE_Q", warningMessage); + ShowMessagePopup(warningMessage, IDA_DISCARD_MESSAGE_OK, IDA_DISCARD_MESSAGE_CANCEL); + return; + } + MessagesApp* pMsgApp = (MessagesApp*) UiApp::GetInstance(); + if (pMsgApp->IsAppRunningEmbededMode()) + { + delete pComposeData; + pMsgApp->ExitApp(APP_CTRL_RESULT_CANCELED); + return; + } + else + { + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoBackward(BackwardSceneTransition()); + } + delete pComposeData; +} diff --git a/src/MsgConversationForm.cpp b/src/MsgConversationForm.cpp index 9f68f50..b408c47 100644 --- a/src/MsgConversationForm.cpp +++ b/src/MsgConversationForm.cpp @@ -27,6 +27,7 @@ #include "MsgConversationPresentationModel.h" #include "MsgDurationPopup.h" #include "MsgFontsettings.h" +#include "MsgMessagesApp.h" #include "MsgMessageComposePanel.h" #include "MsgMessageData.h" #include "MsgMessagePresentationModel.h" @@ -94,7 +95,7 @@ ConversationForm::~ConversationForm(void) pConvPrModel->RemoveConversationEventListener(*this); pConvPrModel->CancelDelete(); } - SettingInfo::RemoveSettingEventListener(*this); + if (__pOptionPopup) { delete __pOptionPopup; @@ -187,13 +188,16 @@ ConversationForm::SetFooter(void) Footer* footer = GetFooter(); { - if (__convFormType == CONVERSATION_LIST_FORM_VIEW) + if (footer) { - SetViewModeFooter(*footer); - } - else - { - SetEditModeFooter(*footer); + if (__convFormType == CONVERSATION_LIST_FORM_VIEW) + { + SetViewModeFooter(*footer); + } + else + { + SetEditModeFooter(*footer); + } } } @@ -229,19 +233,9 @@ ConversationForm::SetEditModeFooter(Footer& footer) deleteBtn.SetText(strText); footer.AddItem(deleteBtn); - ButtonItem closeBtn; - closeBtn.Construct(BUTTON_ITEM_STYLE_ICON, IDA_CANCEL_CMD); - Bitmap* pCloseIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - if (pCloseIcon) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pCloseIcon); - } - Bitmap* pCloseIconPressed = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - if (pCloseIconPressed) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pCloseIconPressed); - } - footer.SetButton(BUTTON_POSITION_RIGHT, closeBtn); + + footer.SetBackButton(); + if (__pSelectedIds && __pSelectedIds->GetCount() > 0) { @@ -321,21 +315,43 @@ ConversationForm::SetViewModeHeader(Header& header) headerLeftItem.SetText(GetTitleText()); header.AddItem(headerLeftItem); - ButtonItem btnRight; - btnRight.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK_CMD); - Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK); - btnRight.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); - pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK_PRESSED); - btnRight.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); - header.SetButton(BUTTON_POSITION_RIGHT, btnRight); - - ButtonItem btnLeft; - btnLeft.Construct(BUTTON_ITEM_STYLE_ICON, IDA_OPTION_TRAY_COMMAND); - pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE); - btnLeft.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); - pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE_PRESSED); - btnLeft.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); - header.SetButton(BUTTON_POSITION_LEFT, btnLeft); + MessagesApp* pMessages = static_cast (Application::GetInstance()); + + bool isHwKeySupported = false; + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + + if (!isHwKeySupported) + { + ButtonItem btnRight; + btnRight.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK_CMD); + Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK); + btnRight.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK_PRESSED); + btnRight.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); + header.SetButton(BUTTON_POSITION_RIGHT, btnRight); + + ButtonItem btnLeft; + btnLeft.Construct(BUTTON_ITEM_STYLE_ICON, IDA_OPTION_TRAY_COMMAND); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE); + btnLeft.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE_PRESSED); + btnLeft.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); + header.SetButton(BUTTON_POSITION_LEFT, btnLeft); + } + else + { + ButtonItem btnRight; + btnRight.Construct(BUTTON_ITEM_STYLE_ICON, IDA_OPTION_TRAY_COMMAND); + Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE); + btnRight.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE_PRESSED); + btnRight.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); + header.SetButton(BUTTON_POSITION_RIGHT, btnRight); + } //header.Draw(); header.Invalidate(true); @@ -358,6 +374,8 @@ ConversationForm::OnInitializing(void) } else { + SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER); + OnIntializeFooter(*GetFooter()); r = InitializeConversationEditControls(); } } @@ -444,6 +462,9 @@ ConversationForm::OnTerminating(void) AppLogDebug("ENTER"); result r = E_SUCCESS; + + SettingInfo::RemoveSettingEventListener(*this); + RemoveKeyEventListener(*this); if (__pConContactList) { delete __pConContactList; @@ -870,15 +891,27 @@ ConversationForm::OnKeypadClosed(Control& source) { AppLogDebug("ENTER"); - //Hide drop-down button in header and display back button: - GetHeader()->RemoveButtonAt(BUTTON_POSITION_RIGHT); - ButtonItem btnRight; - btnRight.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK_CMD); - Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK); - btnRight.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); - pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK_PRESSED); - btnRight.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); - GetHeader()->SetButton(BUTTON_POSITION_RIGHT, btnRight); + MessagesApp* pMessages = static_cast (Application::GetInstance()); + + bool isHwKeySupported = false; + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + + if (!isHwKeySupported) + { + //Hide drop-down button in header and display back button: + GetHeader()->RemoveButtonAt(BUTTON_POSITION_RIGHT); + ButtonItem btnRight; + btnRight.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK_CMD); + Bitmap* pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK); + btnRight.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitMap); + pBitMap = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_HEADER_BACK_PRESSED); + btnRight.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitMap); + GetHeader()->SetButton(BUTTON_POSITION_RIGHT, btnRight); + } //INFO: Resizing of Message compose panel bounds should be followed by Conversation view resizing. //Not the other way around as it will increase conversation view height @@ -932,7 +965,16 @@ ConversationForm::OnKeypadOpened(Control& source) { AppLogDebug("ENTER"); - if (!Clipboard::GetInstance()->IsPopupVisible()) + MessagesApp* pMessages = static_cast (Application::GetInstance()); + + bool isHwKeySupported = false; + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + + if (!Clipboard::GetInstance()->IsPopupVisible() && !isHwKeySupported) { //Hide Back button in header and display drop down button: GetHeader()->RemoveButtonAt(BUTTON_POSITION_RIGHT); @@ -1085,7 +1127,14 @@ ConversationForm::OnFormBackRequested(Form& source) switch (__convFormType) { case CONVERSATION_LIST_FORM_VIEW: - { + { + // Back to thread list view. + __pMsgComposePanel->SetMessageTypeMms(false); + __pMsgComposePanel->HideKeypad(); // To avoid control overlapping + if (!__isInvalidRecipientInList) + { + CreateDraftMessage(); + } SceneManager* pSceneManager = SceneManager::GetInstance(); pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_THREAD_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE)); @@ -1929,6 +1978,20 @@ ConversationForm::ShowMoreContextMenu(const Control& source) strText.Format(strFormat.GetLength() * 2, strFormat.GetPointer(), __pMsgComposePanel->GetDefaultPageDuration()); __pMoreContextMenu->AddItem(strText, IDA_PAGE_DURATION); } + + MessagesApp* pMessages = static_cast (Application::GetInstance()); + + bool isHwKeySupported = false; + if (pMessages) + { + isHwKeySupported = pMessages->IsHwKeySupported(); + AppLog("IsHWKeySupported = %d", pMessages->IsHwKeySupported()); + } + + if (isHwKeySupported) + { + __pMoreContextMenu->SetAnchorPosition(Point((source.GetWidth() * 4 / 5) + MARGIN_80PX, source.GetHeight() + MARGIN_15PX)); + } __pMoreContextMenu->AddActionEventListener(*this); __pMoreContextMenu->SetShowState(true); __pMoreContextMenu->Show(); diff --git a/src/MsgMessagesApp.cpp b/src/MsgMessagesApp.cpp index fa0dc29..01c47ad 100644 --- a/src/MsgMessagesApp.cpp +++ b/src/MsgMessagesApp.cpp @@ -108,6 +108,8 @@ MessagesApp::OnAppInitializing(AppRegistry& appRegistry) } AppControlProviderManager::GetInstance()->SetAppControlProviderEventListener(this); + CheckHwKeySupport(); + AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return true; } @@ -867,3 +869,18 @@ MessagesApp::OnSettingChanged(String& key) AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return; } + +void +MessagesApp::CheckHwKeySupport(void) +{ + AppLog("Enter"); + bool isHwBackButtonExist = false; + Tizen::System::SystemInfo::GetValue("http://tizen.org/feature/input.keys.back", isHwBackButtonExist); + __isHwKeySupported = isHwBackButtonExist; +} + +bool +MessagesApp::IsHwKeySupported(void) +{ + return __isHwKeySupported; +} diff --git a/src/MsgMmsDetailForm.cpp b/src/MsgMmsDetailForm.cpp index 178fba3..c7fc254 100644 --- a/src/MsgMmsDetailForm.cpp +++ b/src/MsgMmsDetailForm.cpp @@ -69,7 +69,7 @@ MmsDetailForm::MmsDetailForm(MmsDetailFormType mmsDetailFormType) , __pDeletePopup(null) , __pVolumePopup(null) , __pBlockPopup(null) - , __pMoreContextMenu(null) + , __pMoreOptionMenu(null) , __pRecipientContextMenu(null) , __pMediaVolumeSlider(null) , __pScrollPanel(null) @@ -119,9 +119,9 @@ MmsDetailForm::~MmsDetailForm(void) { delete __pVolumePopup; } - if (__pMoreContextMenu) + if (__pMoreOptionMenu) { - delete __pMoreContextMenu; + delete __pMoreOptionMenu; } if (__pBlockPopup) { @@ -587,7 +587,7 @@ MmsDetailForm::OnActionPerformed(const Control& source, int actionId) } else { - ShowMoreContextMenu(); + ShowMoreOptionMenu(); } } break; @@ -1482,34 +1482,34 @@ MmsDetailForm::ShowDeletePopup() } void -MmsDetailForm::ShowMoreContextMenu() +MmsDetailForm::ShowMoreOptionMenu() { AppLogDebug("ENTER"); PauseSlideShow(); - if (__pMoreContextMenu) + if (__pMoreOptionMenu) { - delete __pMoreContextMenu; - __pMoreContextMenu = null; + delete __pMoreOptionMenu; + __pMoreOptionMenu = null; } - __pMoreContextMenu = new (std::nothrow) ContextMenu(); - __pMoreContextMenu->Construct(Point(16, GetFooter()->GetY()), CONTEXT_MENU_STYLE_LIST); + __pMoreOptionMenu = new (std::nothrow) OptionMenu(); + __pMoreOptionMenu->Construct(); String strText; Application::GetInstance()->GetAppResource()->GetString(L"IDS_COM_SK_DELETE", strText); - __pMoreContextMenu->AddItem(strText, IDA_DELETE_MESSAGE); + __pMoreOptionMenu->AddItem(strText, IDA_DELETE_MESSAGE); Application::GetInstance()->GetAppResource()->GetString(L"IDS_COM_BODY_FORWARD", strText); - __pMoreContextMenu->AddItem(strText, IDA_FORWARD_MESSAGE); + __pMoreOptionMenu->AddItem(strText, IDA_FORWARD_MESSAGE); Application::GetInstance()->GetAppResource()->GetString(L"IDS_MSGF_BODY_VIEW_MESSAGE_DETAILS_ABB", strText); - __pMoreContextMenu->AddItem(strText, IDA_BUTTON_MESSAGE_DETAILS_POPUP); + __pMoreOptionMenu->AddItem(strText, IDA_BUTTON_MESSAGE_DETAILS_POPUP); const MmsSlideBase* pSlideData = __pMmsSlideData->GetSlideAt(__currentSlideIndex); if (pSlideData->IsTextExist()) { Application::GetInstance()->GetAppResource()->GetString(L"IDS_MSGF_BODY_COPY_MESSAGE_TEXT_ABB", strText); - __pMoreContextMenu->AddItem(strText, IDA_COPY_MESSAGE_TEXT); + __pMoreOptionMenu->AddItem(strText, IDA_COPY_MESSAGE_TEXT); } - __pMoreContextMenu->AddActionEventListener(*this); - __pMoreContextMenu->SetShowState(true); - __pMoreContextMenu->Show(); + __pMoreOptionMenu->AddActionEventListener(*this); + __pMoreOptionMenu->SetShowState(true); + __pMoreOptionMenu->Show(); AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); } @@ -2097,3 +2097,17 @@ MmsDetailForm::OnTouchReleased(const Control& source, const Point& currentPositi } AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); } + +void +MmsDetailForm::OnFormMenuRequested(Tizen::Ui::Controls::Form& source) +{ + AppLogDebug("ENTER"); + if (__pRecipientList && __pRecipientList->GetShowState()) + { + __pRecipientList->SetShowState(false); + } + else + { + ShowMoreOptionMenu(); + } +} diff --git a/src/MsgSettingsForm.cpp b/src/MsgSettingsForm.cpp index 5572ded..8947cd9 100644 --- a/src/MsgSettingsForm.cpp +++ b/src/MsgSettingsForm.cpp @@ -321,20 +321,8 @@ SettingsForm::OnIntializeFooter(Footer& footer) // Set event listener footer.AddActionEventListener(*this); footer.SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT); - // close button creation - ButtonItem closeBtn; - closeBtn.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK_CMD); - Bitmap* pCloseIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - if (pCloseIcon) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pCloseIcon); - } - Bitmap* pCloseIconPressed = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - if (pCloseIconPressed) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pCloseIconPressed); - } - footer.SetButton(BUTTON_POSITION_RIGHT, closeBtn); + + footer.SetBackButton(); AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return; diff --git a/src/MsgSpamSettingsForm.cpp b/src/MsgSpamSettingsForm.cpp index 62ad258..3aeb4f5 100644 --- a/src/MsgSpamSettingsForm.cpp +++ b/src/MsgSpamSettingsForm.cpp @@ -170,6 +170,12 @@ SpamSettingsForm::OnInitializing(void) pEmptyBgCntl->SetShowState(false); } + if (__spamFormType != SPAM_SETTING_FORM_MAIN) + { + SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER); + OnIntializeFooter(*GetFooter()); + } + switch (__spamFormType) { case SPAM_SETTING_FORM_MAIN: @@ -271,16 +277,7 @@ SpamSettingsForm::OnIntializeFooter(Footer& footer) { case SPAM_SETTING_FORM_MAIN: { - //Place form back button instead of cancel button: - ButtonItem backItem; - backItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK); - Bitmap* pBackIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - backItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBackIcon); - Bitmap* pBackIconPress = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - backItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBackIconPress); - - // footer.SetBackButton(); - footer.SetButton(BUTTON_POSITION_RIGHT, backItem); + footer.SetBackButton(); } break; @@ -304,16 +301,8 @@ SpamSettingsForm::OnIntializeFooter(Footer& footer) saveBtn.SetText(strText); footer.AddItem(saveBtn); - //Place form back button instead of cancel button: - ButtonItem backItem; - backItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK); - Bitmap* pBackIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - backItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBackIcon); - Bitmap* pBackIconPress = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - backItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBackIconPress); - footer.SetBackButton(); - footer.SetButton(BUTTON_POSITION_RIGHT, backItem); + footer.SetItemEnabled(0, false); footer.Invalidate(true); @@ -334,17 +323,11 @@ SpamSettingsForm::OnIntializeFooter(Footer& footer) centerItem.Construct(IDA_EDIT); Application::GetInstance()->GetAppResource()->GetString(L"IDS_COM_SK_DELETE", strText); centerItem.SetText(strText); - ButtonItem backItem; - backItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK); - Bitmap* pBackIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - backItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBackIcon); - Bitmap* pBackIconPress = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - backItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBackIconPress); footer.AddItem(leftItem); footer.AddItem(centerItem); - footer.SetButton(BUTTON_POSITION_RIGHT, backItem); + footer.SetBackButton(); } break; @@ -360,16 +343,7 @@ SpamSettingsForm::OnIntializeFooter(Footer& footer) deleteItem.SetText(strText); footer.AddItem(deleteItem); - // Right footer item - //Place form back button instead of cancel button: - ButtonItem backItem; - backItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK); - Bitmap* pBackIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - backItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBackIcon); - Bitmap* pBackIconPress = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - backItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBackIconPress); - - footer.SetButton(BUTTON_POSITION_RIGHT, backItem); + footer.SetBackButton(); } break; @@ -772,15 +746,6 @@ SpamSettingsForm::HandleSpamMatchCriteriaItemSelection(int groupIndex, int itemI saveBtn.SetText(strText); pFooter->AddItem(saveBtn); - ButtonItem backItem; - backItem.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK); - Bitmap* pBackIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - backItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBackIcon); - Bitmap* pBackIconPress = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - backItem.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBackIconPress); - - pFooter->SetBackButton(); - pFooter->SetButton(BUTTON_POSITION_RIGHT, backItem); pFooter->SetItemEnabled(0, __pEditField->GetTextLength() > 0); if(__isBlockNumberExisting) { diff --git a/src/MsgThreadListForm.cpp b/src/MsgThreadListForm.cpp index 94a8782..15786c8 100644 --- a/src/MsgThreadListForm.cpp +++ b/src/MsgThreadListForm.cpp @@ -49,7 +49,7 @@ ThreadListForm::ThreadListForm(ThreadListFormType threadListFormType, ThreadList , __pSelectionInfo(null) , __pSelectedIds(null) , __pProgressPopup(null) - , __pContextMenu(null) + , __pOptionMenu(null) , __pDeletePopup(null) , __msgListItemIndex(-1) , __pPhoneNumberListPopup(null) @@ -75,9 +75,9 @@ ThreadListForm::~ThreadListForm(void) pThreadPrModel->CancelDelete(); pThreadPrModel->CancelRestore(); } - if (__pContextMenu) + if (__pOptionMenu) { - delete __pContextMenu; + delete __pOptionMenu; } if (__pItemContext) { @@ -136,7 +136,7 @@ ThreadListForm::OnIntializeFooter(Footer& footer) AppLogDebug("ENTER"); // Update footer. - SetFooter(); + //SetFooter(); footer.AddActionEventListener(*this); AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); @@ -174,6 +174,8 @@ ThreadListForm::OnInitializing(void) { // result r = E_SUCCESS; BaseForm::InitializeBase(); + SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER); + OnIntializeFooter(*GetFooter()); // if (r != E_SUCCESS) // { // AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); @@ -457,6 +459,9 @@ ThreadListForm::OnTerminating(void) result r = E_SUCCESS; + SetFormBackEventListener(null); + SetFormMenuEventListener(null); + if (__pItemContext) { delete __pItemContext; @@ -515,20 +520,8 @@ ThreadListForm::SetThreadListViewModeFooter(Footer& footer) // compose button creation footer.SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT); - // Add more button creation - ButtonItem moreBtn; - moreBtn.Construct(BUTTON_ITEM_STYLE_ICON, IDA_MORE_CMD); - Bitmap* pMoreIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE); - if (pMoreIcon) - { - moreBtn.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pMoreIcon); - } - Bitmap* pMoreIconPressed = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_MORE_PRESSED); - if (pMoreIconPressed) - { - moreBtn.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pMoreIconPressed); - } - footer.SetButton(BUTTON_POSITION_LEFT, moreBtn); + + // Add compose buttoon String strText; FooterItem composeBtn; @@ -537,20 +530,9 @@ ThreadListForm::SetThreadListViewModeFooter(Footer& footer) composeBtn.SetText(strText); footer.AddItem(composeBtn); // adding compose button to footer as item - //Add back button - ButtonItem closeBtn; - closeBtn.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK_CMD); - Bitmap* pCloseIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - if (pCloseIcon) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pCloseIcon); - } - Bitmap* pCloseIconPressed = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - if (pCloseIconPressed) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pCloseIconPressed); - } - footer.SetButton(BUTTON_POSITION_RIGHT, closeBtn); + footer.SetBackButton(); + footer.SetMenuButton(); + // Enable disable footer item @@ -564,6 +546,8 @@ ThreadListForm::SetThreadListViewModeFooter(Footer& footer) // footer.SetItemEnabled(1, false); // } + OnIntializeFooter(footer); + AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return; } @@ -586,19 +570,6 @@ ThreadListForm::SetThreadListEditModeFooter(Footer& footer) deleteBtn.SetText(strText); footer.AddItem(deleteBtn); - ButtonItem closeBtn; - closeBtn.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK_CMD); - Bitmap* pCloseIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - if (pCloseIcon) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pCloseIcon); - Bitmap* pCloseIconPressed = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - if (pCloseIconPressed) - closeBtn.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pCloseIconPressed); - - } - footer.SetButton(BUTTON_POSITION_RIGHT, closeBtn); - // Enable disable footer item if (__pSelectedIds && __pSelectedIds->GetCount() > 0) { @@ -648,20 +619,6 @@ ThreadListForm::SetMessageListViewModeFooter(Footer& footer) footer.AddItem(settingsBtn); } - // close button creation - ButtonItem closeBtn; - closeBtn.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BACK_CMD); - Bitmap* pCloseIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - if (pCloseIcon) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pCloseIcon); - } - Bitmap* pCloseIconPressed = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - if (pCloseIconPressed) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pCloseIconPressed); - } - footer.SetButton(BUTTON_POSITION_RIGHT, closeBtn); // Enable disable footer item ThreadPresentationModel* pThreadPrModel = ThreadPresentationModel::GetInstance(); @@ -725,19 +682,7 @@ ThreadListForm::SetMessageListEditModeFooter(Footer& footer) } break; } - ButtonItem closeBtn; - closeBtn.Construct(BUTTON_ITEM_STYLE_ICON, IDA_CANCEL_CMD); - Bitmap* pCloseIcon = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK); - if (pCloseIcon) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pCloseIcon); - } - Bitmap* pCloseIconPressed = BitmapUtility::GetInstance()->GetIcon(MSG_ICON_BACK_PRESSED); - if (pCloseIconPressed) - { - closeBtn.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pCloseIconPressed); - } - footer.SetButton(BUTTON_POSITION_RIGHT, closeBtn); + // Enable disable footer item if (__pSelectedIds && __pSelectedIds->GetCount() > 0) { @@ -1149,7 +1094,7 @@ ThreadListForm::OnActionPerformed(const Control& source, int actionId) case IDA_MORE_CMD: { Point point = source.GetPosition(); - ShowContextPopup(point); + ShowOptionMenu(point); } break; @@ -1862,11 +1807,11 @@ ThreadListForm::UpdateMessageThreadList() { AppLogDebug("ENTER"); - if (__pContextMenu) + if (__pOptionMenu) { - __pContextMenu->SetShowState(false); - delete __pContextMenu; - __pContextMenu = null; + __pOptionMenu->SetShowState(false); + delete __pOptionMenu; + __pOptionMenu = null; } //Get thread data list ThreadPresentationModel* pThreadprModel = ThreadPresentationModel::GetInstance(); @@ -1906,21 +1851,21 @@ ThreadListForm::UpdateMessageThreadList() } result -ThreadListForm::ShowContextPopup(Point& position) +ThreadListForm::ShowOptionMenu(Point& position) { AppLogDebug("ENTER"); result r = E_SUCCESS; - if (__pContextMenu) + if (__pOptionMenu) { - delete __pContextMenu; + delete __pOptionMenu; } - __pContextMenu = new (std::nothrow) ContextMenu(); - r = __pContextMenu->Construct(position, CONTEXT_MENU_STYLE_LIST); + __pOptionMenu = new (std::nothrow) OptionMenu(); + r = __pOptionMenu->Construct(); if (r != E_SUCCESS) { AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); - delete __pContextMenu; - __pContextMenu = null; + delete __pOptionMenu; + __pOptionMenu = null; return r; } String strText; @@ -1928,20 +1873,21 @@ ThreadListForm::ShowContextPopup(Point& position) if (pThreadPrModel && pThreadPrModel->GetCount() > 0) { Application::GetInstance()->GetAppResource()->GetString(L"IDS_COM_SK_DELETE", strText); - __pContextMenu->AddItem(strText, IDA_DELETE_CMD); + __pOptionMenu->AddItem(strText, IDA_DELETE_CMD); } Application::GetInstance()->GetAppResource()->GetString(L"IDS_MSGF_BODY_SIM_CARD_MESSAGES", strText); - __pContextMenu->AddItem(strText, IDA_SIM_MESSAGES_CMD); + __pOptionMenu->AddItem(strText, IDA_SIM_MESSAGES_CMD); Application::GetInstance()->GetAppResource()->GetString(L"IDS_MSGF_BODY_SPAM_MESSAGES", strText); - __pContextMenu->AddItem(strText, IDA_SPAM_MESSAGES_CMD); + __pOptionMenu->AddItem(strText, IDA_SPAM_MESSAGES_CMD); Application::GetInstance()->GetAppResource()->GetString(L"IDS_MSG_BODY_DRAFT_MESSAGES", strText); - __pContextMenu->AddItem(strText, IDA_DRAFT_MESSAGES_CMD); + __pOptionMenu->AddItem(strText, IDA_DRAFT_MESSAGES_CMD); Application::GetInstance()->GetAppResource()->GetString(L"IDS_COM_BODY_SETTINGS", strText); - __pContextMenu->AddItem(strText, IDA_SETTING_CMD); - __pContextMenu->AddActionEventListener(*this); - __pContextMenu->SetShowState(true); - __pContextMenu->SetMaxVisibleItemsCount(6); - __pContextMenu->Show(); + __pOptionMenu->AddItem(strText, IDA_SETTING_CMD); + __pOptionMenu->AddActionEventListener(*this); + __pOptionMenu->SetShowState(true); + __pOptionMenu->SetMaxVisibleItemsCount(6); + __pOptionMenu->Show(); + //__pOptionMenu->SetPosition(10, GetBounds().height - GetFooter()->GetHeight()); AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return r; @@ -2382,3 +2328,12 @@ ThreadListForm::CreateContextMenuUnBlock() AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult())); return r; } + +void +ThreadListForm::OnFormMenuRequested(Tizen::Ui::Controls::Form& source) +{ + AppLogDebug("ENTER"); + //Point point = source.GetPosition(); + Point point(0,GetBounds().height); + ShowOptionMenu(point); +} diff --git a/src/MsgTypes.cpp b/src/MsgTypes.cpp index 9384f13..5c57df3 100644 --- a/src/MsgTypes.cpp +++ b/src/MsgTypes.cpp @@ -97,6 +97,7 @@ const int MARGIN_26PX = 26; const int MARGIN_28PX = 28; const int MARGIN_42PX = 42; const int MARGIN_46PX = 46; +const int MARGIN_80PX = 80; // Icon realted const int H_UNREAD_ICON = 42; -- 2.7.4