From 135266a1bb7d8bbed87641039aefb08afd5d164c Mon Sep 17 00:00:00 2001 From: Chulheon Date: Sat, 8 Jun 2013 16:04:12 +0900 Subject: [PATCH] Menu Button API CR Change-Id: I05a0258684a19e32bd671906b20330430cdd5def --- inc/FUiControls.h | 1 + inc/FUiCtrlFooter.h | 34 ++++----- inc/FUiCtrlForm.h | 10 +-- inc/FUiCtrlIFormMenuEventListener.h | 104 ++++++++++++++++++++++++++++ src/ui/controls/FUiCtrlFooter.cpp | 20 +++--- src/ui/controls/FUiCtrlForm.cpp | 4 +- src/ui/controls/FUiCtrl_FooterImpl.cpp | 24 +++---- src/ui/controls/FUiCtrl_Form.cpp | 58 ++++++++-------- src/ui/controls/FUiCtrl_FormImpl.cpp | 34 +++------ src/ui/inc/FUiCtrl_FooterImpl.h | 10 +-- src/ui/inc/FUiCtrl_Form.h | 6 +- src/ui/inc/FUiCtrl_FormImpl.h | 11 ++- src/ui/inc/FUiCtrl_IFormMenuEventListener.h | 102 +++++++++++++++++++++++++++ 13 files changed, 301 insertions(+), 117 deletions(-) create mode 100644 inc/FUiCtrlIFormMenuEventListener.h create mode 100644 src/ui/inc/FUiCtrl_IFormMenuEventListener.h diff --git a/inc/FUiControls.h b/inc/FUiControls.h index a8e0447..91d1c28 100644 --- a/inc/FUiControls.h +++ b/inc/FUiControls.h @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include diff --git a/inc/FUiCtrlFooter.h b/inc/FUiCtrlFooter.h index bf3057b..1f41e3f 100644 --- a/inc/FUiCtrlFooter.h +++ b/inc/FUiCtrlFooter.h @@ -807,64 +807,64 @@ public: /** - * Checks whether the option button item is set. + * Checks whether the menu button item is set. * * @since 2.2 * - * @return @c true if the option button item is set, @n + * @return @c true if the menu button item is set, @n * else @c false * @exception E_SUCCESS The method is successful. * @remarks The specific error code can be accessed using the GetLastResult() method. */ - bool IsOptionButtonSet(void) const; + bool IsMenuButtonSet(void) const; /** - * Gets the state of the option button. + * Gets the state of the menu button. * * @since 2.2 * - * @return The state of the option button, @n + * @return The state of the menu button, @n * else @c BUTTON_ITEM_STATUS_NORMAL if an error occurs. * @exception E_SUCCESS The method is successful. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The option button is not set. + * The menu button is not set. * @remarks The specific error code can be accessed using the GetLastResult() method. */ - ButtonItemStatus GetOptionButtonStatus(void) const; + ButtonItemStatus GetMenuButtonStatus(void) const; /** - * Removes the option button item. + * Removes the menu button item. * * @since 2.2 * * @return An error code * @exception E_SUCCESS The method is successful. * @exception E_SYSTEM A system error has occurred. - * @remarks If the option button item is not set, the method will return @c E_SUCCESS. + * @remarks If the menu button item is not set, the method will return @c E_SUCCESS. */ - result RemoveOptionButton(void); + result RemoveMenuButton(void); /** - * Enables or disables the option button. + * Enables or disables the menu button. * * @since 2.2 * * @return An error code - * @param[in] enable Set to @c true to enable the option button, @n + * @param[in] enable Set to @c true to enable the menu button, @n * else @c false * @exception E_SUCCESS The method is successful. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The option button item is not set. + * The menu button item is not set. * @exception E_SYSTEM A system error has occurred. */ - result SetOptionButtonEnabled(bool enable); + result SetMenuButtonEnabled(bool enable); /** - * Sets the option button. + * Sets the menu button. * * @since 2.2 * @@ -876,9 +876,9 @@ public: * The operation is not supported when the style of the %Footer control is ::FOOTER_STYLE_TAB. @n * @exception E_SYSTEM A system error has occurred. * @remarks - * - If the left button is already set, then the button is replaced with the option button. + * - If the left button is already set, then the button is replaced with the menu button. */ - result SetOptionButton(void); + result SetMenuButton(void); protected: diff --git a/inc/FUiCtrlForm.h b/inc/FUiCtrlForm.h index 2efe7a3..79df629 100644 --- a/inc/FUiCtrlForm.h +++ b/inc/FUiCtrlForm.h @@ -44,7 +44,7 @@ class Header; class Footer; class Tab; class IFormBackEventListener; -class IFormControlEventListener; +class IFormMenuEventListener; /** * @enum FormStyle @@ -1047,12 +1047,12 @@ public: /** * Sets the %Form control event listener. * - * @since 2.1 + * @since 2.2 * - * @param[in] pFormControlEventListener The %Form control event listener to set - * @see Tizen::Ui::Controls::IFormControlEventListener. + * @param[in] pFormMenuEventListener The %Form menu event listener to set + * @see Tizen::Ui::Controls::IFormMenuEventListener. */ - void SetFormControlEventListener(IFormControlEventListener* pFormControlEventListener); + void SetFormMenuEventListener(IFormMenuEventListener* pFormMenuEventListener); /** diff --git a/inc/FUiCtrlIFormMenuEventListener.h b/inc/FUiCtrlIFormMenuEventListener.h new file mode 100644 index 0000000..f0876bf --- /dev/null +++ b/inc/FUiCtrlIFormMenuEventListener.h @@ -0,0 +1,104 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUiCtrlIFormMenuventListener.h + * @brief This is the header file for the %IFormMenuventListener interface. + * + * This header file contains the declarations of the %IFormMenuventListener interface. + */ +#ifndef _FUI_CTRL_IFORM_MENU_EVENT_LISTENER_H_ +#define _FUI_CTRL_IFORM_MENU_EVENT_LISTENER_H_ + +// includes +#include + +// namespace declaration +namespace Tizen { namespace Ui { namespace Controls +{ + +class Form; + +/** + * @interface IFormMenuEventListener + * @brief This interface implements the listener for Form-related events. + * + * @since 2.2 + * + * The %IFormMenuEventListener interface is the listener interface for receiving Form-related events. + * + * For more information on the class features, see Form. + */ +class IFormMenuEventListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + /** + * This is the destructor for this class. + * + * @since 2.2 + */ + virtual ~IFormMenuEventListener(void) {} + +public: + /** + * Called when the current Form control needs to control the Menu button. + * + * @since 2.2 + * + * @param[in] source The source of the event + * @remarks This event is fired when the user clicks on the software 'menu' button on the Footer control, or the hardware menu button on the device. + */ + virtual void OnFormMenuRequested(Tizen::Ui::Controls::Form& source) = 0; + +protected: + // + //This method is for internal use only. Using this method can cause behavioral, security-related, + //and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.2 + // + virtual void IFormMenuEventListener_Reserved1(void) { } + + // + //This method is for internal use only. Using this method can cause behavioral, security-related, + //and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.2 + // + virtual void IFormMenuEventListener_Reserved2(void) { } + + // + //This method is for internal use only. Using this method can cause behavioral, security-related, + //and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.2 + // + virtual void IFormMenuEventListener_Reserved3(void) { } +}; // IFormMenuEventListener + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_IFORM_MENU_EVENT_LISTENER_H_ diff --git a/src/ui/controls/FUiCtrlFooter.cpp b/src/ui/controls/FUiCtrlFooter.cpp index 8e4bfa2..f3ffee4 100644 --- a/src/ui/controls/FUiCtrlFooter.cpp +++ b/src/ui/controls/FUiCtrlFooter.cpp @@ -572,7 +572,7 @@ Footer::SetButtonNumberedBadgeIcon(ButtonPosition position, int number) } bool -Footer::IsOptionButtonSet(void) const +Footer::IsMenuButtonSet(void) const { ClearLastResult(); @@ -581,11 +581,11 @@ Footer::IsOptionButtonSet(void) const SysAssertf(pFooterImpl != null, "Not yet constructed. Construct() should be called before use."); - return pFooterImpl->IsOptionButtonSet(); + return pFooterImpl->IsMenuButtonSet(); } ButtonItemStatus -Footer::GetOptionButtonStatus(void) const +Footer::GetMenuButtonStatus(void) const { ClearLastResult(); @@ -594,40 +594,40 @@ Footer::GetOptionButtonStatus(void) const SysAssertf(pFooterImpl != null, "Not yet constructed. Construct() should be called before use."); - return pFooterImpl->GetOptionButtonStatus(); + return pFooterImpl->GetMenuButtonStatus(); } result -Footer::RemoveOptionButton(void) +Footer::RemoveMenuButton(void) { _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this); SysAssertf(pFooterImpl != null, "Not yet constructed. Construct() should be called before use."); - return pFooterImpl->RemoveOptionButton(); + return pFooterImpl->RemoveMenuButton(); } result -Footer::SetOptionButtonEnabled(bool enable) +Footer::SetMenuButtonEnabled(bool enable) { _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this); SysAssertf(pFooterImpl != null, "Not yet constructed. Construct() should be called before use."); - return pFooterImpl->SetOptionButtonEnabled(enable); + return pFooterImpl->SetMenuButtonEnabled(enable); } result -Footer::SetOptionButton(void) +Footer::SetMenuButton(void) { _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this); SysAssertf(pFooterImpl != null, "Not yet constructed. Construct() should be called before use."); - return pFooterImpl->SetOptionButton(); + return pFooterImpl->SetMenuButton(); } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlForm.cpp b/src/ui/controls/FUiCtrlForm.cpp index d2be91d..c782383 100644 --- a/src/ui/controls/FUiCtrlForm.cpp +++ b/src/ui/controls/FUiCtrlForm.cpp @@ -669,13 +669,13 @@ Form::SetFormBackEventListener(IFormBackEventListener* pFormBackEventListener) } void -Form::SetFormControlEventListener(IFormControlEventListener* pFormControlEventListener) +Form::SetFormMenuEventListener(IFormMenuEventListener* pFormMenuEventListener) { _FormImpl* pImpl = _FormImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - return pImpl->SetFormControlEventListener(pFormControlEventListener); + return pImpl->SetFormMenuEventListener(pFormMenuEventListener); } DataBindingContext* diff --git a/src/ui/controls/FUiCtrl_FooterImpl.cpp b/src/ui/controls/FUiCtrl_FooterImpl.cpp index c583145..baa2cc0 100644 --- a/src/ui/controls/FUiCtrl_FooterImpl.cpp +++ b/src/ui/controls/FUiCtrl_FooterImpl.cpp @@ -403,7 +403,7 @@ _FooterImpl::SetButton(ButtonPosition position, const ButtonItem& button) if (position == BUTTON_POSITION_LEFT) { - SysTryReturnResult(NID_UI_CTRL, (IsOptionButtonSet() == false), E_SYSTEM, + SysTryReturnResult(NID_UI_CTRL, (IsMenuButtonSet() == false), E_SYSTEM, "[E_SYSTEM] A Option button exists."); } @@ -962,7 +962,7 @@ _FooterImpl::CheckItemValidate(const FooterItem& item) else if (__style == FOOTER_STYLE_SEGMENTED_TEXT || __style == FOOTER_STYLE_SEGMENTED_ICON || __style == FOOTER_STYLE_SEGMENTED_ICON_TEXT || __style == FOOTER_STYLE_BUTTON_TEXT || __style == FOOTER_STYLE_BUTTON_ICON || __style == FOOTER_STYLE_BUTTON_ICON_TEXT) { - if (IsBackButtonSet() || IsOptionButtonSet()) + if (IsBackButtonSet() || IsMenuButtonSet()) { SysTryReturnResult(NID_UI_CTRL, (count < 4), E_MAX_EXCEEDED, "[E_MAX_EXCEEDED] The number of items have exceeded the maximum limit."); @@ -1585,16 +1585,16 @@ _FooterImpl::ConvertFooterStyle(FooterStyle style) } bool -_FooterImpl::IsOptionButtonSet(void) const +_FooterImpl::IsMenuButtonSet(void) const { return GetCore().IsButtonSet(OPTION_BUTTON); } ButtonItemStatus -_FooterImpl::GetOptionButtonStatus(void) const +_FooterImpl::GetMenuButtonStatus(void) const { - SysTryReturn(NID_UI_CTRL, (IsOptionButtonSet() == true), BUTTON_ITEM_STATUS_NORMAL, E_INVALID_OPERATION, + SysTryReturn(NID_UI_CTRL, (IsMenuButtonSet() == true), BUTTON_ITEM_STATUS_NORMAL, E_INVALID_OPERATION, "[E_INVALID_OPERATION] A Option button doesn't exist"); _ButtonStatus buttonStatus; @@ -1606,29 +1606,29 @@ _FooterImpl::GetOptionButtonStatus(void) const result -_FooterImpl::RemoveOptionButton(void) +_FooterImpl::RemoveMenuButton(void) { return GetCore().RemoveButtonAt(OPTION_BUTTON); } result -_FooterImpl::SetOptionButtonEnabled(bool enable) +_FooterImpl::SetMenuButtonEnabled(bool enable) { return GetCore().SetButtonEnabled(OPTION_BUTTON, enable); } result -_FooterImpl::SetOptionButton(void) +_FooterImpl::SetMenuButton(void) { - bool isOptionButton = false; + bool isMenuButton = false; - Tizen::System::SystemInfo::GetValue(L"http://tizen.org/feature/input.option_key", isOptionButton); + Tizen::System::SystemInfo::GetValue(L"http://tizen.org/feature/input.option_key", isMenuButton); - if(isOptionButton) + if(isMenuButton) { - SysTryReturnResult(NID_UI_CTRL, 0, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] HW OptionButton exist"); + SysTryReturnResult(NID_UI_CTRL, 0, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] HW MenuButton exist"); } SysTryReturnResult(NID_UI_CTRL, (__style != FOOTER_STYLE_TAB), E_UNSUPPORTED_OPERATION, diff --git a/src/ui/controls/FUiCtrl_Form.cpp b/src/ui/controls/FUiCtrl_Form.cpp index c42355a..237a8b8 100644 --- a/src/ui/controls/FUiCtrl_Form.cpp +++ b/src/ui/controls/FUiCtrl_Form.cpp @@ -64,7 +64,7 @@ namespace Tizen { namespace Ui { namespace Controls _Form::_Form(void) : __pFormPresenter(null) , __pFormBackEventListener(null) - , __pFormControlEventListener(null) + , __pFormMenuEventListener(null) , __formStyle(0) , __pActionEvent(null) , __pHeader(null) @@ -354,10 +354,10 @@ _Form::SetFormBackEventListener(_IFormBackEventListener* pFormBackEventListener) } void -_Form::SetFormControlEventListener(_IFormControlEventListener* pFormControlEventListener) +_Form::SetFormMenuEventListener(_IFormMenuEventListener* pFormMenuEventListener) { SysTryReturnVoidResult(NID_UI_CTRL, __pFooter, E_INVALID_STATE, "[E_INVALID_STATE] Footer and Header aren't constructed."); - __pFormControlEventListener = pFormControlEventListener; + __pFormMenuEventListener = pFormMenuEventListener; if (__pFooter) { __pFooter->SetOptionEventListener(*this, ID_OPTION_BUTTON); @@ -2554,14 +2554,14 @@ _Form::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) { if (keyInfo.GetKeyCode() == _KEY_ESC || keyInfo.GetKeyCode() == _KEY_CLEAR) { - _Toolbar* pToolbar = GetFooter(); - if (pToolbar == null) - { - return null; - } +// _Toolbar* pToolbar = GetFooter(); +// if (pToolbar == null) +// { +// return null; +// } - if (pToolbar->IsButtonSet(BACK_BUTTON)) - { +// if (pToolbar->IsButtonSet(BACK_BUTTON)) +// { { void* pData = GetUserData(); if (pData) @@ -2570,33 +2570,33 @@ _Form::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) pDataImpl->OnFormBackRequested(*this); } } - } - { - void* pData = GetUserData(); - if (pData) - { - _FormImpl* pDataImpl = static_cast<_FormImpl*>(pData); - pDataImpl->OnFormBackButtonRequested(*this); - } - } +// } +// { +// void* pData = GetUserData(); +// if (pData) +// { +// _FormImpl* pDataImpl = static_cast<_FormImpl*>(pData); +// pDataImpl->OnFormBackButtonRequested(*this); +// } +// } return true; } if (keyInfo.GetKeyCode() == _KEY_CONTEXT_MENU) { - _Toolbar* pToolbar = GetFooter(); - if (pToolbar == null) - { - return null; - } +// _Toolbar* pToolbar = GetFooter(); +// if (pToolbar == null) +// { +// return null; +// } { void* pData = GetUserData(); if (pData) { _FormImpl* pDataImpl = static_cast<_FormImpl*>(pData); - pDataImpl->OnFormOptionButtonRequested(*this); + pDataImpl->OnFormMenuRequested(*this); } } @@ -2750,10 +2750,6 @@ _Form::OnActionPerformed(const _Control& source, int actionId) { __pFormBackEventListener->OnFormBackRequested(*this); } - if (__pFormControlEventListener) - { - __pFormControlEventListener->OnFormBackButtonRequested(*this); - } } else { @@ -2770,9 +2766,9 @@ _Form::OnActionPerformed(const _Control& source, int actionId) } break; case ID_OPTION_BUTTON : - if (__pFormControlEventListener) + if (__pFormMenuEventListener) { - __pFormControlEventListener->OnFormOptionButtonRequested(*this); + __pFormMenuEventListener->OnFormMenuRequested(*this); } break; diff --git a/src/ui/controls/FUiCtrl_FormImpl.cpp b/src/ui/controls/FUiCtrl_FormImpl.cpp index fe6d046..3475998 100644 --- a/src/ui/controls/FUiCtrl_FormImpl.cpp +++ b/src/ui/controls/FUiCtrl_FormImpl.cpp @@ -100,7 +100,7 @@ _FormImpl::_FormImpl(Form* pPublic, _Form* pCore, Layout* pPublicPortraitLayout, : _ContainerImpl(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout) , __pForm(null) , __pFormBackEventListener(null) - , __pFormControlEventListener(null) + , __pFormMenuEventListener(null) , __pOriAgent(null) , __pImeOriAgent(null) , __pLeftSoftkeyActionEvent(null) @@ -494,7 +494,7 @@ _FormImpl::SetFormStyle(unsigned long formStyle) SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); //[ToDo] GetCore().SetFormBackEventListener(this); - GetCore().SetFormControlEventListener(this); + GetCore().SetFormMenuEventListener(this); } } else if (formStyle & FORM_STYLE_SOFTKEY_0 || formStyle & FORM_STYLE_SOFTKEY_1 || formStyle & FORM_STYLE_OPTIONKEY) @@ -847,11 +847,11 @@ _FormImpl::SetFormBackEventListener(const IFormBackEventListener* pFormBackEvent } void -_FormImpl::SetFormControlEventListener(const IFormControlEventListener* pFormControlEventListener) +_FormImpl::SetFormMenuEventListener(const IFormMenuEventListener* pFormMenuEventListener) { SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed."); - __pFormControlEventListener = const_cast (pFormControlEventListener); - GetCore().SetFormControlEventListener(this); + __pFormMenuEventListener = const_cast (pFormMenuEventListener); + GetCore().SetFormMenuEventListener(this); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -1630,33 +1630,15 @@ _FormImpl::OnFormBackRequested(Tizen::Ui::Controls::_Form& source) } void -_FormImpl::OnFormBackButtonRequested(Tizen::Ui::Controls::_Form& source) +_FormImpl::OnFormMenuRequested(Tizen::Ui::Controls::_Form& source) { - if (__pFormControlEventListener) + if (__pFormMenuEventListener) { _FormImpl* pFormImpl = static_cast<_FormImpl*>(source.GetUserData()); Form* pForm = dynamic_cast (&pFormImpl->GetPublic()); if (pForm) { - __pFormControlEventListener->OnFormBackButtonRequested(*pForm); - } - else - { - return; - } - } -} - -void -_FormImpl::OnFormOptionButtonRequested(Tizen::Ui::Controls::_Form& source) -{ - if (__pFormControlEventListener) - { - _FormImpl* pFormImpl = static_cast<_FormImpl*>(source.GetUserData()); - Form* pForm = dynamic_cast (&pFormImpl->GetPublic()); - if (pForm) - { - __pFormControlEventListener->OnFormOptionButtonRequested(*pForm); + __pFormMenuEventListener->OnFormMenuRequested(*pForm); } else { diff --git a/src/ui/inc/FUiCtrl_FooterImpl.h b/src/ui/inc/FUiCtrl_FooterImpl.h index ad02ca7..7fcddc2 100644 --- a/src/ui/inc/FUiCtrl_FooterImpl.h +++ b/src/ui/inc/FUiCtrl_FooterImpl.h @@ -165,15 +165,15 @@ public: virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); - bool IsOptionButtonSet(void) const; + bool IsMenuButtonSet(void) const; - ButtonItemStatus GetOptionButtonStatus(void) const; + ButtonItemStatus GetMenuButtonStatus(void) const; - result RemoveOptionButton(void); + result RemoveMenuButton(void); - result SetOptionButtonEnabled(bool enable); + result SetMenuButtonEnabled(bool enable); - result SetOptionButton(void); + result SetMenuButton(void); private: diff --git a/src/ui/inc/FUiCtrl_Form.h b/src/ui/inc/FUiCtrl_Form.h index 96dfb25..633414a 100644 --- a/src/ui/inc/FUiCtrl_Form.h +++ b/src/ui/inc/FUiCtrl_Form.h @@ -42,7 +42,7 @@ class _Indicator; class _ActionEvent; class _OverlayRegionImpl; class _IFormBackEventListener; -class _IFormControlEventListener; +class _IFormMenuEventListener; enum _FormStyle { @@ -98,7 +98,7 @@ public: static _Form* CreateFormN(void); void SetFormBackEventListener(_IFormBackEventListener* pFormBackEventListener); - void SetFormControlEventListener(_IFormControlEventListener* pFormControlEventListener); + void SetFormMenuEventListener(_IFormMenuEventListener* pFormMenuEventListener); unsigned long GetFormStyle(void) const; _Toolbar* GetFooter(void) const; @@ -250,7 +250,7 @@ private: private: _FormPresenter* __pFormPresenter; _IFormBackEventListener* __pFormBackEventListener; - _IFormControlEventListener* __pFormControlEventListener; + _IFormMenuEventListener* __pFormMenuEventListener; unsigned long __formStyle; _ActionEvent* __pActionEvent; diff --git a/src/ui/inc/FUiCtrl_FormImpl.h b/src/ui/inc/FUiCtrl_FormImpl.h index a5cb326..a2738a6 100644 --- a/src/ui/inc/FUiCtrl_FormImpl.h +++ b/src/ui/inc/FUiCtrl_FormImpl.h @@ -21,7 +21,7 @@ #include "FUi_ContainerImpl.h" #include "FUiCtrl_Form.h" #include "FUiCtrl_IFormBackEventListener.h" -#include "FUiCtrl_IFormControlEventListener.h" +#include "FUiCtrl_IFormMenuEventListener.h" namespace Tizen { namespace Ui { class DataBindingContext; @@ -40,7 +40,7 @@ class _OSP_EXPORT_ _FormImpl : public _ContainerImpl , public Tizen::Ui::Controls::_IActionEventListener , public Tizen::Ui::Controls::_IFormBackEventListener - , public Tizen::Ui::Controls::_IFormControlEventListener + , public Tizen::Ui::Controls::_IFormMenuEventListener , virtual public Tizen::Base::Runtime::IEventListener , public _IFormOrientationStatusEventListener { @@ -67,7 +67,7 @@ public: _ControlImpl* GetFocusControl(void); void SetFormBackEventListener(const IFormBackEventListener* pFormBackEventListener); - void SetFormControlEventListener(const IFormControlEventListener* pFormControlEventListener); + void SetFormMenuEventListener(const IFormMenuEventListener* pFormMenuEventListener); unsigned long GetFormStyle(void) const; _FooterImpl* GetFooter(void) const; @@ -148,8 +148,7 @@ public: virtual bool IsOpaque(void) const; virtual void OnFormBackRequested(Tizen::Ui::Controls::_Form& source); - virtual void OnFormBackButtonRequested(Tizen::Ui::Controls::_Form& source); - virtual void OnFormOptionButtonRequested(Tizen::Ui::Controls::_Form& source); + virtual void OnFormMenuRequested(Tizen::Ui::Controls::_Form& source); virtual Tizen::Ui::OrientationStatus OnFormOrientationStatusRequested(void); @@ -180,7 +179,7 @@ private: private: _Form* __pForm; IFormBackEventListener* __pFormBackEventListener; - IFormControlEventListener* __pFormControlEventListener; + IFormMenuEventListener* __pFormMenuEventListener; Tizen::Ui::_OrientationAgent* __pOriAgent; Tizen::Ui::_ImeOrientationAgent* __pImeOriAgent; diff --git a/src/ui/inc/FUiCtrl_IFormMenuEventListener.h b/src/ui/inc/FUiCtrl_IFormMenuEventListener.h new file mode 100644 index 0000000..855ac4b --- /dev/null +++ b/src/ui/inc/FUiCtrl_IFormMenuEventListener.h @@ -0,0 +1,102 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUiCtrl_IFormMenuEventListener.h + * @brief This is the header file for the _IFormControlEventListener interface. + * + * This header file contains the declarations of the _IFormMenuEventListener interface. + */ +#ifndef _FUI_CTRL_INTERNAL_IFORM_MENU_EVENT_LISTENER_H_ +#define _FUI_CTRL_INTERNAL_IFORM_MENU_EVENT_LISTENER_H_ + +// includes +#include + +// namespace declaration +namespace Tizen { namespace Ui { namespace Controls +{ + +class _Form; + +/** + * @interface _IFormMenuEventListener + * @brief This interface implements the listener for Form related events. + * @since 2.2 + * + * The %_IFormMenuEventListener interface is the listener interface for receiving Form-related events. + * + * For more information on the class features, see Form. + */ +class _IFormMenuEventListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + /** + * This is the destructor for this class. + * @since 2.2 + */ + virtual ~_IFormMenuEventListener(void) {} + +public: + /** + * Called when the current %Form control needs to be control the Menu button. + * + * @since 2.2 + * @param[in] source The source of the event + * @remarks This event is fired when the user clicks on the software 'menu' button on the Footer control, or the hardware menu button on the device. + */ + virtual void OnFormMenuRequested(Tizen::Ui::Controls::_Form& source) = 0; + + +protected: + // + //This method is for internal use only. Using this method can cause behavioral, security-related, + //and consistency-related issues in the application. + // + // Following method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.2 + // + virtual void _IFormMenuEventListener_Reserved1(void) { } + + // + //This method is for internal use only. Using this method can cause behavioral, security-related, + //and consistency-related issues in the application. + // + // Following method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.2 + // + virtual void _IFormMenuEventListener_Reserved2(void) { } + + // + //This method is for internal use only. Using this method can cause behavioral, security-related, + //and consistency-related issues in the application. + // + // Following method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.2 + // + virtual void _IFormMenuEventListener_Reserved3(void) { } +}; // _IFormControlEventListener + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_INTERNAL_IFORM_MENU_EVENT_LISTENER_H_ -- 2.7.4