#include "FUiCtrl_SearchBarImpl.h"
#include "FUiCtrl_EditFieldImpl.h"
#include "FUiCtrl_ButtonImpl.h"
+#include <FSys_SettingInfoImpl.h>
+
using namespace Tizen::Graphics;
using namespace Tizen::Ui;
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
using namespace Tizen::Locales;
+using namespace Tizen::System;
namespace Tizen { namespace Ui { namespace Controls
{
, __isupdateContentBounds(false)
, __isKeyPressed(false)
, __isFocusCallbackToBeFired(true)
+ , __isButtonTextChangedByApp(false)
, __keypadAction(CORE_KEYPAD_ACTION_SEARCH)
, __pBackgroundBitmap(null)
, __backgroundColor(Color())
_SearchBar::~_SearchBar(void)
{
+ SettingInfo::RemoveSettingEventListener(*this);
+
delete __pSearchBarPresenter;
__pSearchBarPresenter = null;
__pSearchBarPresenter = pPresenter;
CreateAccessibilityElement();
+
+ r = _SettingInfoImpl::AddSettingEventListener(*this);
+ SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
return r;
CATCH:
result
_SearchBar::SetButtonText(const String& text)
{
+ __isButtonTextChangedByApp = true;
SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
return false;
}
+void
+_SearchBar::OnSettingChanged(Tizen::Base::String& key)
+{
+ if (__isButtonTextChangedByApp || !__isUsableCancelButton)
+ {
+ return;
+ }
+
+ if (key.Equals(L"http://tizen.org/setting/locale.language", false))
+ {
+ String cancelText;
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, cancelText);
+ __pCancelButton->SetText(cancelText);
+ __pCancelButton->Invalidate();
+ }
+
+ return;
+}
+
_Control*
_SearchBar::GetParentForm(void) const
{
, virtual public Tizen::Base::Runtime::IEventListener
, virtual public Tizen::Ui::_IUiEventListener
, virtual public Tizen::Ui::_IUiEventPreviewer
+ , virtual public Tizen::System::ISettingEventListener
{
DECLARE_CLASS_BEGIN(_SearchBar, _Control);
DECLARE_PROPERTY("buttonActionId", GetPropertyButtonActionId, SetPropertyButtonActionId);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+ virtual void OnSettingChanged(Tizen::Base::String& key);
+
protected:
virtual void OnDraw(void);
bool __isupdateContentBounds;
bool __isKeyPressed;
bool __isFocusCallbackToBeFired;
+ bool __isButtonTextChangedByApp;
CoreKeypadAction __keypadAction;