2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_SearchBarImpl.cpp
20 * @brief This is the implementation file for _SearchBarImpl class.
23 #include <FApp_AppInfo.h>
24 #include <FBaseSysLog.h>
25 #include <FLclLocale.h>
26 #include <FUiAccessibilityContainer.h>
27 #include <FUiAccessibilityElement.h>
28 #include "FUi_ResourceSizeInfo.h"
29 #include "FUi_ResourceManager.h"
30 #include "FUi_UiBuilder.h"
31 #include "FUiCtrl_PublicActionEvent.h"
32 #include "FUiCtrl_PublicTextBlockEvent.h"
33 #include "FUiCtrl_PublicTextEvent.h"
34 #include "FUiCtrl_SearchBarImpl.h"
35 #include "FUi_CoordinateSystemUtils.h"
37 using namespace Tizen::App;
38 using namespace Tizen::Base;
39 using namespace Tizen::Base::Runtime;
40 using namespace Tizen::Locales;
41 using namespace Tizen::Graphics;
42 using namespace Tizen::Ui;
44 namespace Tizen { namespace Ui { namespace Controls
47 _SearchBarImpl::_SearchBarImpl(SearchBar* pPublic, _SearchBar* pCore)
48 : _ControlImpl(pPublic, pCore)
50 , __pContentControl(null)
51 , __pPublicActionEvent(null)
52 , __pPublicKeypadEvent(null)
53 , __pPublicTextBlockEvent(null)
54 , __pPublicTextEvent(null)
55 , __pPublicSearchBarEvent(null)
56 , __pPublicLanguageEvent(null)
61 _SearchBarImpl::~_SearchBarImpl(void)
68 if (__pPublicActionEvent)
70 delete __pPublicActionEvent;
71 __pPublicActionEvent = null;
74 if (__pPublicKeypadEvent)
76 delete __pPublicKeypadEvent;
77 __pPublicKeypadEvent = null;
80 if (__pPublicTextBlockEvent)
82 delete __pPublicTextBlockEvent;
83 __pPublicTextBlockEvent = null;
86 if (__pPublicTextEvent)
88 delete __pPublicTextEvent;
89 __pPublicTextEvent = null;
92 if (__pPublicSearchBarEvent)
94 delete __pPublicSearchBarEvent;
95 __pPublicSearchBarEvent = null;
100 _SearchBarImpl::CreateSearchBarImplN(SearchBar* pControl, const Rectangle& bounds, bool enableSearchBarButton, KeypadAction keypadAction)
103 result r = E_SUCCESS;
105 r = GET_SIZE_INFO(SearchBar).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT);
106 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG,
107 "[E_INVALID_ARG] Invalid argument(s) is used. The given size is not valid.");
109 _SearchBar* pCore = _SearchBar::CreateSearchBarN();
111 SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r));
113 _SearchBarImpl* pImpl = new (std::nothrow) _SearchBarImpl(pControl, pCore);
115 r = CheckConstruction(pCore, pImpl);
116 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
118 r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(SearchBar), bounds, pCore->GetOrientation());
119 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
121 r = pImpl->Initialize(enableSearchBarButton, keypadAction);
122 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
131 _SearchBarImpl::CreateSearchBarImplFN(SearchBar* pControl, const FloatRectangle& bounds, bool enableSearchBarButton, KeypadAction keypadAction)
134 result r = E_SUCCESS;
136 r = GET_SIZE_INFO(SearchBar).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT);
137 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG,
138 "[E_INVALID_ARG] Invalid argument(s) is used. The given size is not valid.");
140 _SearchBar* pCore = _SearchBar::CreateSearchBarN();
142 SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r));
144 _SearchBarImpl* pImpl = new (std::nothrow) _SearchBarImpl(pControl, pCore);
146 r = CheckConstruction(pCore, pImpl);
147 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
149 r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(SearchBar), bounds, pCore->GetOrientation());
150 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
152 r = pImpl->Initialize(enableSearchBarButton, keypadAction);
153 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
162 _SearchBarImpl::GetPublicClassName(void) const
164 return "Tizen::Ui::Controls::SearchBar";
168 _SearchBarImpl::GetPublic(void) const
170 return static_cast <const SearchBar&>(_ControlImpl::GetPublic());
174 _SearchBarImpl::GetPublic(void)
176 return static_cast <SearchBar&>(_ControlImpl::GetPublic());
180 _SearchBarImpl::GetCore(void) const
182 return static_cast <const _SearchBar&>(_ControlImpl::GetCore());
186 _SearchBarImpl::GetCore(void)
188 return static_cast <_SearchBar&>(_ControlImpl::GetCore());
192 _SearchBarImpl::GetInstance(SearchBar& searchBar)
194 return (static_cast<_SearchBarImpl*>(searchBar._pControlImpl));
197 const _SearchBarImpl*
198 _SearchBarImpl::GetInstance(const SearchBar& searchBar)
200 return (static_cast<const _SearchBarImpl*>(searchBar._pControlImpl));
205 _SearchBarImpl::Initialize(bool enableSearchBarButton, KeypadAction keypadAction)
209 result r = E_SUCCESS;
211 CoreKeypadAction coreKeypadAction = CORE_KEYPAD_ACTION_SEARCH;
212 switch (keypadAction)
214 case KEYPAD_ACTION_ENTER:
215 coreKeypadAction = CORE_KEYPAD_ACTION_ENTER;
218 case KEYPAD_ACTION_GO:
219 coreKeypadAction = CORE_KEYPAD_ACTION_GO;
222 case KEYPAD_ACTION_NEXT:
223 coreKeypadAction = CORE_KEYPAD_ACTION_NEXT;
226 case KEYPAD_ACTION_SEND:
227 coreKeypadAction = CORE_KEYPAD_ACTION_SEND;
230 case KEYPAD_ACTION_SEARCH:
231 coreKeypadAction = CORE_KEYPAD_ACTION_SEARCH;
234 case KEYPAD_ACTION_LOGIN:
235 coreKeypadAction = CORE_KEYPAD_ACTION_LOGIN;
238 case KEYPAD_ACTION_SIGN_IN:
239 coreKeypadAction = CORE_KEYPAD_ACTION_SIGN_IN;
242 case KEYPAD_ACTION_JOIN:
243 coreKeypadAction = CORE_KEYPAD_ACTION_JOIN;
246 case KEYPAD_ACTION_DONE:
247 coreKeypadAction = CORE_KEYPAD_ACTION_DONE;
254 r = __pSearchBar->Initialize(enableSearchBarButton, coreKeypadAction);
255 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
257 __pPublicActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
259 SysTryReturn(NID_UI_CTRL, __pPublicActionEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
261 r = __pSearchBar->AddActionEventListener(*this);
262 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
264 __pPublicKeypadEvent = _PublicKeypadEvent::CreateInstanceN(GetPublic());
266 SysTryReturn(NID_UI_CTRL, __pPublicKeypadEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
268 r = __pSearchBar->AddKeypadEventListener(*this);
269 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
271 __pPublicTextBlockEvent = _PublicTextBlockEvent::CreateInstanceN(GetPublic());
273 SysTryReturn(NID_UI_CTRL, __pPublicTextBlockEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
275 r = __pSearchBar->AddTextBlockEventListener(*this);
276 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
278 __pPublicTextEvent = _PublicTextEvent::CreateInstanceN(GetPublic());
280 SysTryReturn(NID_UI_CTRL, __pPublicTextEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
282 r = __pSearchBar->AddTextEventListener(*this);
283 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
285 __pPublicSearchBarEvent = _PublicSearchBarEvent::CreateInstanceN(GetPublic());
287 SysTryReturn(NID_UI_CTRL, __pPublicSearchBarEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
289 r = __pSearchBar->AddSearchBarEventListener(*this);
290 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
292 __pPublicLanguageEvent = _PublicLanguageEvent::CreateInstanceN(GetPublic());
294 SysTryReturn(NID_UI_CTRL, __pPublicLanguageEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
296 r = __pSearchBar->AddLanguageEventListener(*this);
297 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
303 _SearchBarImpl::GetContent(void) const
307 return __pContentControl;
311 _SearchBarImpl::SetContent(const Control* pContent)
315 result r = E_SUCCESS;
316 if (pContent != null)
318 const _Control& content = _ControlImpl::GetInstance(*pContent)->GetCore();
319 bool isContentAttachable = __pSearchBar->IsContentAttachable(&content);
320 SysTryReturn(NID_UI_CTRL, isContentAttachable, E_INVALID_ARG, E_INVALID_ARG,
321 "[E_INVALID_ARG] Invalid argument(s) is used. The content cannot be set.");
324 if (__pContentControl != null)
326 _Control& contentControl = _ControlImpl::GetInstance(*__pContentControl)->GetCore();
328 if (pContent != null)
330 const _Control& content = _ControlImpl::GetInstance(*pContent)->GetCore();
332 if (contentControl.GetHandle() == content.GetHandle())
338 _Control* pContainer = __pSearchBar->GetSearchBarContainer();
342 pContainer->DetachChild(contentControl);
344 if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
346 delete __pContentControl;
348 __pContentControl = null;
352 if (pContent != null && __pContentControl == null)
354 __pContentControl = const_cast <Control*>(pContent);
355 _Control& control = _ControlImpl::GetInstance(*__pContentControl)->GetCore();
357 r = __pSearchBar->SetContent(&control);
364 _SearchBarImpl::UpdateContentArea(bool invalidate)
368 return __pSearchBar->UpdateContentArea(invalidate);
372 _SearchBarImpl::SetContentAreaVisible(bool visible)
376 return __pSearchBar->SetContentAreaVisible(visible);
380 _SearchBarImpl::IsContentAreaVisible(void) const
384 return __pSearchBar->IsContentAreaVisible();
388 _SearchBarImpl::SetContentAreaSize(const Dimension& size)
392 FloatDimension contentSize;
393 contentSize = _CoordinateSystemUtils::ConvertToFloat(size);
394 Variant var(contentSize);
396 return __pSearchBar->SetPropertyContentAreaSize(var);
400 _SearchBarImpl::SetContentAreaSize(const FloatDimension& size)
405 return __pSearchBar->SetPropertyContentAreaSize(var);
409 _SearchBarImpl::GetContentAreaSize(void) const
414 size = _CoordinateSystemUtils::ConvertToInteger(__pSearchBar->GetPropertyContentAreaSize().ToFloatDimension());
420 _SearchBarImpl::GetContentAreaSizeF(void) const
424 return __pSearchBar->GetPropertyContentAreaSize().ToFloatDimension();
428 _SearchBarImpl::GetMode(void) const
432 return __pSearchBar->GetMode();
436 _SearchBarImpl::IsModeLocked(void) const
440 return __pSearchBar->IsModeLocked();
444 _SearchBarImpl::SetMode(SearchBarMode mode)
448 return __pSearchBar->SetMode(mode);
452 _SearchBarImpl::SetModeLocked(bool modeLocked)
456 return __pSearchBar->SetModeLocked(modeLocked);
460 _SearchBarImpl::GetButtonActionId(void) const
464 return __pSearchBar->GetPropertyButtonActionId().ToInt();
468 _SearchBarImpl::GetButtonColor(SearchBarButtonStatus status) const
476 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
477 buttonColor = __pSearchBar->GetPropertyButtonNormalColor();
479 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
480 buttonColor = __pSearchBar->GetPropertyButtonPressedColor();
482 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
483 buttonColor = __pSearchBar->GetPropertyButtonHighlightedColor();
485 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
486 buttonColor = __pSearchBar->GetPropertyButtonDisabledColor();
492 return buttonColor.ToColor();
496 _SearchBarImpl::GetButtonTextColor(SearchBarButtonStatus status) const
500 Variant buttonTextColor;
504 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
505 buttonTextColor = __pSearchBar->GetPropertyButtonNormalTextColor();
507 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
508 buttonTextColor = __pSearchBar->GetPropertyButtonPressedTextColor();
510 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
511 buttonTextColor = __pSearchBar->GetPropertyButtonHighlightedTextColor();
513 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
514 buttonTextColor = __pSearchBar->GetPropertyButtonDisabledTextColor();
520 return buttonTextColor.ToColor();
523 SearchBarButtonStatus
524 _SearchBarImpl::GetButtonStatus(void) const
528 return __pSearchBar->GetButtonStatus();
532 _SearchBarImpl::SetButton(const String& text, int actionId)
536 result r = E_SUCCESS;
537 Variant var(actionId);
539 r = __pSearchBar->SetButtonText(text);
540 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
542 r = __pSearchBar->SetPropertyButtonActionId(var);
548 _SearchBarImpl::SetButtonEnabled(bool enabled)
552 return __pSearchBar->SetButtonEnabled(enabled);
556 _SearchBarImpl::SetButtonColor(SearchBarButtonStatus status, const Color& color)
560 result r = E_SUCCESS;
565 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
566 r = __pSearchBar->SetPropertyButtonNormalColor(var);
568 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
569 r = __pSearchBar->SetPropertyButtonPressedColor(var);
571 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
572 r = __pSearchBar->SetPropertyButtonHighlightedColor(var);
574 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
575 r = __pSearchBar->SetPropertyButtonDisabledColor(var);
585 _SearchBarImpl::SetButtonTextColor(SearchBarButtonStatus status, const Color& color)
589 result r = E_SUCCESS;
594 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
595 r = __pSearchBar->SetPropertyButtonNormalTextColor(var);
597 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
598 r = __pSearchBar->SetPropertyButtonPressedTextColor(var);
600 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
601 r = __pSearchBar->SetPropertyButtonHighlightedTextColor(var);
603 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
604 r = __pSearchBar->SetPropertyButtonDisabledTextColor(var);
614 _SearchBarImpl::AppendCharacter(const Character& character)
618 return __pSearchBar->AppendCharacter(character);
622 _SearchBarImpl::AppendText(const String& text)
626 return __pSearchBar->AppendText(text);
630 _SearchBarImpl::SetText(const String& text)
634 return __pSearchBar->SetText(text);
638 _SearchBarImpl::InsertCharacterAt(int index, const Character& character)
642 return __pSearchBar->InsertCharacterAt(index, character);
646 _SearchBarImpl::InsertTextAt(int index, const String& text)
650 return __pSearchBar->InsertTextAt(index, text);
654 _SearchBarImpl::DeleteCharacterAt(int index)
658 return __pSearchBar->DeleteCharacterAt(index);
662 _SearchBarImpl::Clear(void)
666 result r = E_SUCCESS;
667 r = __pSearchBar->Clear();
669 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM,
670 "[E_SYSTEM] A system error has occured. Failed to clear the text.");
675 _SearchBarImpl::GetTextLength(void) const
679 return __pSearchBar->GetTextLength();
683 _SearchBarImpl::GetText(void) const
687 return __pSearchBar->GetText();
691 _SearchBarImpl::GetText(int start, int end) const
695 return __pSearchBar->GetText(start, end);
699 _SearchBarImpl::GetLimitLength(void) const
703 return __pSearchBar->GetLimitLength();
707 _SearchBarImpl::SetLimitLength(int limitLength)
711 return __pSearchBar->SetLimitLength(limitLength);
715 _SearchBarImpl::ShowKeypad(void) const
719 return __pSearchBar->ShowKeypad();
723 _SearchBarImpl::HideKeypad(void) const
727 return __pSearchBar->HideKeypad();
731 _SearchBarImpl::GetSearchFieldTextSize(void) const
735 int textSize = _CoordinateSystemUtils::ConvertToInteger(__pSearchBar->GetSearchFieldTextSizeF());
740 _SearchBarImpl::GetSearchFieldTextSizeF(void) const
744 return __pSearchBar->GetSearchFieldTextSizeF();
748 _SearchBarImpl::SetSearchFieldTextSize(int size)
752 float textSize = _CoordinateSystemUtils::ConvertToFloat(size);
753 return SetSearchFieldTextSize(textSize);
757 _SearchBarImpl::SetSearchFieldTextSize(float size)
761 return __pSearchBar->SetSearchFieldTextSize(size);
765 _SearchBarImpl::GetBlockRange(int& start, int& end) const
769 return __pSearchBar->GetBlockRange(start, end);
773 _SearchBarImpl::ReleaseBlock(void)
777 return __pSearchBar->ReleaseBlock();
781 _SearchBarImpl::SetBlockRange(int start, int end)
785 return __pSearchBar->SetBlockRange(start, end + 1);
789 _SearchBarImpl::RemoveTextBlock(void)
792 result r = __pSearchBar->RemoveTextBlock();
793 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
794 "[E_SYSTEM] A system error has occured. Unable to remove the text block.")
800 _SearchBarImpl::GetColor(void) const
804 return __pSearchBar->GetPropertyColor().ToColor();
808 _SearchBarImpl::GetSearchFieldColor(SearchFieldStatus status) const
812 Variant searchFieldColor;
816 case SEARCH_FIELD_STATUS_NORMAL:
817 searchFieldColor = __pSearchBar->GetPropertySearchFieldNormalColor();
819 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
820 searchFieldColor = __pSearchBar->GetPropertySearchFieldHighlightedColor();
822 case SEARCH_FIELD_STATUS_DISABLED:
823 searchFieldColor = __pSearchBar->GetPropertySearchFieldDisabledColor();
829 return searchFieldColor.ToColor();
833 _SearchBarImpl::GetSearchFieldTextColor(SearchFieldStatus status) const
838 _Edit* pEdit = __pSearchBar->GetSearchField();
843 case SEARCH_FIELD_STATUS_NORMAL:
844 color = pEdit->GetTextColor(EDIT_TEXT_COLOR_NORMAL);
846 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
847 color = pEdit->GetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED);
849 case SEARCH_FIELD_STATUS_DISABLED:
850 color = pEdit->GetTextColor(EDIT_TEXT_COLOR_DISABLED);
860 _SearchBarImpl::SetBackgroundBitmap(const Bitmap& bitmap)
864 return __pSearchBar->SetBackgroundBitmap(bitmap);
868 _SearchBarImpl::SetColor(const Color& color)
874 return __pSearchBar->SetPropertyColor(var);
878 _SearchBarImpl::SetSearchFieldColor(SearchFieldStatus status, const Color& color)
882 result r = E_SUCCESS;
887 case SEARCH_FIELD_STATUS_NORMAL:
888 r = __pSearchBar->SetPropertySearchFieldNormalColor(var);
890 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
891 r = __pSearchBar->SetPropertySearchFieldHighlightedColor(var);
893 case SEARCH_FIELD_STATUS_DISABLED:
894 r = __pSearchBar->SetPropertySearchFieldDisabledColor(var);
904 _SearchBarImpl::SetSearchFieldTextColor(SearchFieldStatus status, const Color& color)
908 result r = E_SUCCESS;
909 _Edit* pEdit = __pSearchBar->GetSearchField();
914 case SEARCH_FIELD_STATUS_NORMAL:
915 r = pEdit->SetTextColor(EDIT_TEXT_COLOR_NORMAL, color);
917 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
918 r = pEdit->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, color);
920 case SEARCH_FIELD_STATUS_DISABLED:
921 r = pEdit->SetTextColor(EDIT_TEXT_COLOR_DISABLED, color);
932 _SearchBarImpl::GetGuideText(void) const
936 return __pSearchBar->GetGuideText();
940 _SearchBarImpl::SetGuideText(const String& guideText)
944 return __pSearchBar->SetGuideText(guideText);
948 _SearchBarImpl::GetGuideTextColor(void) const
952 return __pSearchBar->GetGuideTextColor();
956 _SearchBarImpl::SetGuideTextColor(const Color& color)
960 return __pSearchBar->SetGuideTextColor(color);
964 _SearchBarImpl::GetCursorPosition(void) const
968 return __pSearchBar->GetCursorPosition();
972 _SearchBarImpl::SetCursorPosition(int index)
976 return __pSearchBar->SetCursorPosition(index);
980 _SearchBarImpl::IsLowerCaseModeEnabled(void) const
984 return __pSearchBar->IsLowerCaseModeEnabled();
988 _SearchBarImpl::SetLowerCaseModeEnabled(bool enable)
992 return __pSearchBar->SetLowerCaseModeEnabled(enable);
996 _SearchBarImpl::GetEllipsisPosition(void) const
1000 return __pSearchBar->GetEllipsisPosition();
1004 _SearchBarImpl::SetEllipsisPosition(EllipsisPosition position)
1008 return __pSearchBar->SetEllipsisPosition(position);
1012 _SearchBarImpl::GetKeypadAction(void) const
1016 CoreKeypadAction coreKeypadAction = __pSearchBar->GetKeypadAction();
1017 KeypadAction publicKeypadAction = ConvertKeypadAction(coreKeypadAction);
1019 return publicKeypadAction;
1023 _SearchBarImpl::IsTextPredictionEnabled(void) const
1025 return __pSearchBar->IsTextPredictionEnabled();
1029 _SearchBarImpl::SetTextPredictionEnabled(bool enable)
1031 return __pSearchBar->SetTextPredictionEnabled(enable);
1035 _SearchBarImpl::SetCurrentLanguage(LanguageCode languageCode)
1037 return __pSearchBar->SetCurrentLanguage(languageCode);
1041 _SearchBarImpl::GetCurrentLanguage(LanguageCode& language) const
1043 return __pSearchBar->GetCurrentLanguage(language);
1047 _SearchBarImpl::AddActionEventListener(IActionEventListener& listener)
1051 SysTryReturn(NID_UI_CTRL, __pPublicActionEvent, E_SYSTEM, E_SYSTEM,
1052 "[E_SYSTEM] A system error has occurred.");
1054 result r = __pPublicActionEvent->AddListener(listener);
1055 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1056 "A system error has occurred. The same listener instance already exists in the event listener list.");
1061 _SearchBarImpl::RemoveActionEventListener(IActionEventListener& listener)
1065 SysTryReturn(NID_UI_CTRL, __pPublicActionEvent, E_SYSTEM, E_SYSTEM,
1066 "[E_SYSTEM] A system error has occurred.");
1068 result r = __pPublicActionEvent->RemoveListener(listener);
1069 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1070 "A system error has occurred. The specified listener does not exist in the event listener list.");
1075 _SearchBarImpl::AddKeypadEventListener(IKeypadEventListener& listener)
1079 SysTryReturn(NID_UI_CTRL, __pPublicKeypadEvent, E_SYSTEM, E_SYSTEM,
1080 "[E_SYSTEM] A system error has occurred.");
1082 result r = __pPublicKeypadEvent->AddListener(listener);
1083 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1084 "A system error has occurred. The same listener instance already exists in the event listener list.");
1091 _SearchBarImpl::RemoveKeypadEventListener(IKeypadEventListener& listener)
1095 SysTryReturn(NID_UI_CTRL, __pPublicKeypadEvent, E_SYSTEM, E_SYSTEM,
1096 "[E_SYSTEM] A system error has occurred.");
1098 result r = __pPublicKeypadEvent->RemoveListener(listener);
1099 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1100 "A system error has occurred. The specified listener does not exist in the event listener list.");
1106 _SearchBarImpl::AddTextBlockEventListener(ITextBlockEventListener& listener)
1110 SysTryReturn(NID_UI_CTRL, __pPublicTextBlockEvent, E_SYSTEM, E_SYSTEM,
1111 "[E_SYSTEM] A system error has occurred.");
1113 result r = __pPublicTextBlockEvent->AddListener(listener);
1114 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1115 "A system error has occurred. The same listener instance already exists in the event listener list.");
1121 _SearchBarImpl::RemoveTextBlockEventListener(ITextBlockEventListener& listener)
1125 SysTryReturn(NID_UI_CTRL, __pPublicTextBlockEvent, E_SYSTEM, E_SYSTEM,
1126 "[E_SYSTEM] A system error has occurred.");
1128 result r = __pPublicTextBlockEvent->RemoveListener(listener);
1129 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1130 "A system error has occurred. The specified listener does not exist in the event listener list.");
1137 _SearchBarImpl::AddTextEventListener(ITextEventListener& listener)
1141 SysTryReturn(NID_UI_CTRL, __pPublicTextEvent, E_SYSTEM, E_SYSTEM,
1142 "[E_SYSTEM] A system error has occurred.");
1144 result r = __pPublicTextEvent->AddListener(listener);
1145 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1146 "A system error has occurred. The same listener instance already exists in the event listener list.");
1152 _SearchBarImpl::RemoveTextEventListener(ITextEventListener& listener)
1156 SysTryReturn(NID_UI_CTRL, __pPublicTextEvent, E_SYSTEM, E_SYSTEM,
1157 "[E_SYSTEM] A system error has occurred.");
1159 result r = __pPublicTextEvent->RemoveListener(listener);
1160 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1161 "A system error has occurred. The specified listener does not exist in the event listener list.");
1167 _SearchBarImpl::AddSearchBarEventListener(const ISearchBarEventListener& listener)
1171 SysTryReturn(NID_UI_CTRL, __pPublicSearchBarEvent, E_SYSTEM, E_SYSTEM,
1172 "[E_SYSTEM] A system error has occurred.");
1174 result r = __pPublicSearchBarEvent->AddListener(listener);
1175 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1176 "A system error has occurred. The same listener instance already exists in the event listener list.");
1182 _SearchBarImpl::RemoveSearchBarEventListener(const ISearchBarEventListener& listener)
1186 SysTryReturn(NID_UI_CTRL, __pPublicSearchBarEvent, E_SYSTEM, E_SYSTEM,
1187 "[E_SYSTEM] A system error has occurred.");
1189 result r = __pPublicSearchBarEvent->RemoveListener(listener);
1190 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1191 "A system error has occurred. The specified listener does not exist in the event listener list.");
1197 _SearchBarImpl::AddLanguageEventListener(ILanguageEventListener& listener)
1201 SysAssertf(__pPublicLanguageEvent != null, "Not yet constructed. Construct() should be called before use.");
1203 return __pPublicLanguageEvent->AddListener(listener);
1207 _SearchBarImpl::RemoveLanguageEventListener(ILanguageEventListener& listener)
1211 SysAssertf(__pPublicLanguageEvent != null, "Not yet constructed. Construct() should be called before use.");
1213 return __pPublicLanguageEvent->RemoveListener(listener);
1217 _SearchBarImpl::SetEditTextFilter(IEditTextFilter* pFilter)
1219 __pSearchBar->SetEditTextFilter(pFilter);
1225 _SearchBarImpl::SendOpaqueCommand (const String& command)
1227 __pSearchBar->SendOpaqueCommand(command);
1233 _SearchBarImpl::OnActionPerformed(const _Control& source, int actionId)
1237 if (__pPublicActionEvent != null)
1239 IEventArg* pEventArg = _PublicActionEvent::CreateActionEventArgN(actionId);
1240 result r = GetLastResult();
1241 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1243 __pPublicActionEvent->Fire(*pEventArg);
1249 _SearchBarImpl::OnKeypadWillOpen(void)
1253 if (__pPublicKeypadEvent != null)
1255 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1256 GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_CREATED);
1257 result r = GetLastResult();
1258 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1260 __pPublicKeypadEvent->Fire(*pEventArg);
1266 _SearchBarImpl::OnKeypadOpened(void)
1270 if (__pPublicKeypadEvent != null)
1272 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1273 GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_OPEN);
1274 result r = GetLastResult();
1275 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1277 __pPublicKeypadEvent->Fire(*pEventArg);
1284 _SearchBarImpl::OnKeypadClosed(void)
1288 if (__pPublicKeypadEvent != null)
1290 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1291 GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_CLOSE);
1292 result r = GetLastResult();
1293 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1295 __pPublicKeypadEvent->Fire(*pEventArg);
1301 _SearchBarImpl::OnKeypadBoundsChanged(void)
1305 if (__pPublicKeypadEvent != null)
1307 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1308 GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
1309 result r = GetLastResult();
1310 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1312 __pPublicKeypadEvent->Fire(*pEventArg);
1318 _SearchBarImpl::OnKeypadActionPerformed(CoreKeypadAction keypadAction)
1322 if (__pPublicKeypadEvent != null)
1324 KeypadAction publicKeypadAction = ConvertKeypadAction(keypadAction);
1326 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1327 GetPublic(), publicKeypadAction, KEYPAD_EVENT_STATUS_ENTERACTION);
1328 result r = GetLastResult();
1329 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1331 __pPublicKeypadEvent->Fire(*pEventArg);
1337 _SearchBarImpl::OnTextBlockSelected(_Control& source, int start, int end)
1341 if (__pPublicTextBlockEvent != null)
1343 IEventArg* pEventArg = _PublicTextBlockEvent::CreateTextBlockEventArgN(start, end);
1344 result r = GetLastResult();
1345 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1347 __pPublicTextBlockEvent->Fire(*pEventArg);
1353 _SearchBarImpl::OnTextValueChanged(const _Control& source)
1357 if (__pPublicTextEvent != null)
1359 IEventArg* pEventArg = _PublicTextEvent::CreateTextEventArgN(TEXT_EVENT_CHANGED);
1360 result r = GetLastResult();
1361 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1363 __pPublicTextEvent->Fire(*pEventArg);
1369 _SearchBarImpl::OnTextValueChangeCanceled(const _Control& source)
1373 if (__pPublicTextEvent != null)
1375 IEventArg* pEventArg = _PublicTextEvent::CreateTextEventArgN(TEXT_EVENT_CANCELED);
1376 result r = GetLastResult();
1377 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1379 __pPublicTextEvent->Fire(*pEventArg);
1385 _SearchBarImpl::OnSearchBarModeChanged(_SearchBar& source, SearchBarMode mode)
1389 if ((_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) && __pSearchBar != null)
1391 if (mode == SEARCH_BAR_MODE_NORMAL)
1393 __pSearchBar->SetHeaderVisibleState(true);
1397 __pSearchBar->SetHeaderVisibleState(false);
1399 __pSearchBar->SetContentsArea();
1402 if (__pPublicSearchBarEvent != null)
1404 IEventArg* pEventArg = _PublicSearchBarEvent::CreateSearchBarEventArgN(SEARCH_BAR_EVENT_MODE_CHANGE);
1405 result r = GetLastResult();
1406 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1408 __pPublicSearchBarEvent->Fire(*pEventArg);
1414 _SearchBarImpl::OnLanguageChanged(LanguageCode oldLanguage, LanguageCode newLanguage)
1416 if (__pPublicLanguageEvent)
1418 IEventArg* pKLanguageEventArg = _PublicLanguageEvent::CreateLanguageEventArgN(GetPublic(), oldLanguage, newLanguage);
1419 result r = GetLastResult();
1420 SysTryReturnVoidResult(NID_UI_CTRL, pKLanguageEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1422 __pPublicLanguageEvent->Fire(*pKLanguageEventArg);
1426 SysLog(NID_UI_CTRL, "Event is not created.");
1432 _SearchBarImpl::ConvertKeypadAction(CoreKeypadAction keypadAction) const
1434 KeypadAction publicKeypadAction = KEYPAD_ACTION_SEARCH;
1435 switch (keypadAction)
1437 case CORE_KEYPAD_ACTION_ENTER:
1438 publicKeypadAction = KEYPAD_ACTION_ENTER;
1441 case CORE_KEYPAD_ACTION_GO:
1442 publicKeypadAction = KEYPAD_ACTION_GO;
1445 case CORE_KEYPAD_ACTION_NEXT:
1446 publicKeypadAction = KEYPAD_ACTION_NEXT;
1449 case CORE_KEYPAD_ACTION_SEND:
1450 publicKeypadAction = KEYPAD_ACTION_SEND;
1453 case CORE_KEYPAD_ACTION_SEARCH:
1454 publicKeypadAction = KEYPAD_ACTION_SEARCH;
1457 case CORE_KEYPAD_ACTION_LOGIN:
1458 publicKeypadAction = KEYPAD_ACTION_LOGIN;
1461 case CORE_KEYPAD_ACTION_SIGN_IN:
1462 publicKeypadAction = KEYPAD_ACTION_SIGN_IN;
1465 case CORE_KEYPAD_ACTION_JOIN:
1466 publicKeypadAction = KEYPAD_ACTION_JOIN;
1469 case CORE_KEYPAD_ACTION_DONE:
1470 publicKeypadAction = KEYPAD_ACTION_DONE;
1477 return publicKeypadAction;
1480 class _SearchBarMaker
1481 : public _UiBuilderControlMaker
1484 _SearchBarMaker(_UiBuilder* pUibuilder)
1485 : _UiBuilderControlMaker(pUibuilder){}
1486 virtual ~_SearchBarMaker(void){}
1487 static _UiBuilderControlMaker*
1488 GetInstance(_UiBuilder* pUibuilder)
1490 _SearchBarMaker* pSearchBarMaker = new (std::nothrow) _SearchBarMaker(pUibuilder);
1491 return pSearchBarMaker;
1496 Make(_UiBuilderControl* pControl)
1498 result r = E_SUCCESS;
1500 FloatRectangle rect;
1501 SearchBar* pSearchBar = null;
1502 _UiBuilderControlLayout* pControlProperty = null;
1503 bool showSearchBarButton = true;
1504 KeypadAction keypadAction = KEYPAD_ACTION_ENTER;
1506 int opacity = SEARCHBAR_DEFAULT_OPACITY;
1507 EllipsisPosition ellipsisPosition = ELLIPSIS_POSITION_END;
1510 int limitLength = SEARCHBAR_TEXT_LENGTH_MAX;
1511 int buttonActionId = -1;
1513 float searchFieldTextSize = 0.0f;
1514 bool lowercaseEnable = false;
1515 String elementString;
1517 GetProperty(pControl, &pControlProperty);
1518 if (pControlProperty == null)
1523 pSearchBar = new (std::nothrow) SearchBar;
1524 if (pSearchBar == null)
1529 rect = pControlProperty->GetRectF();
1530 if (pControl->GetElement("showSearchBarButton", elementString))
1532 if (elementString.Equals(L"false", false))
1534 showSearchBarButton = false;
1538 if (pControl->GetElement("keypadAction", elementString))
1540 if (elementString.Equals(L"KEYPAD_ACTION_ENTER", false))
1542 keypadAction = KEYPAD_ACTION_ENTER;
1544 else if (elementString.Equals(L"KEYPAD_ACTION_GO", false))
1546 keypadAction = KEYPAD_ACTION_GO;
1548 else if (elementString.Equals(L"KEYPAD_ACTION_NEXT", false))
1550 keypadAction = KEYPAD_ACTION_NEXT;
1552 else if (elementString.Equals(L"KEYPAD_ACTION_SEND", false))
1554 keypadAction = KEYPAD_ACTION_SEND;
1556 else if (elementString.Equals(L"KEYPAD_ACTION_SEARCH", false))
1558 keypadAction = KEYPAD_ACTION_SEARCH;
1560 else if (elementString.Equals(L"KEYPAD_ACTION_LOGIN", false))
1562 keypadAction = KEYPAD_ACTION_LOGIN;
1564 else if (elementString.Equals(L"KEYPAD_ACTION_SIGN_IN", false))
1566 keypadAction = KEYPAD_ACTION_SIGN_IN;
1568 else if (elementString.Equals(L"KEYPAD_ACTION_JOIN", false))
1570 keypadAction = KEYPAD_ACTION_JOIN;
1572 else if (elementString.Equals(L"KEYPAD_ACTION_DONE", false))
1574 keypadAction = KEYPAD_ACTION_DONE;
1578 r = pSearchBar->Construct(rect, showSearchBarButton, keypadAction);
1585 if (showSearchBarButton)
1587 if (pControl->GetElement("buttonActionId", elementString))
1589 Base::Integer::Parse(elementString, buttonActionId);
1592 if (pControl->GetElement("buttonText", elementString))
1594 r = pSearchBar->SetButton(elementString, buttonActionId);
1598 if (pControl->GetElement("text", elementString))
1600 r = pSearchBar->SetText(elementString);
1603 if (pControl->GetElement("guideText", elementString))
1605 r = pSearchBar->SetGuideText(elementString);
1608 if (pControl->GetElement("searchFieldTextSize", elementString))
1610 Base::Float::Parse(elementString, searchFieldTextSize);
1611 _ICoordinateSystemTransformer* pTransform = GetTransformer();
1614 searchFieldTextSize = pTransform->Transform(searchFieldTextSize);
1616 r = pSearchBar->SetSearchFieldTextSize(searchFieldTextSize);
1619 if (pControl->GetElement("limitLength", elementString))
1621 Base::Integer::Parse(elementString, limitLength);
1622 r = pSearchBar->SetLimitLength(limitLength);
1625 if (pControl->GetElement("lowerCaseMode", elementString))
1627 if (elementString.Equals(L"true", false))
1629 lowercaseEnable = true;
1633 lowercaseEnable = false;
1636 pSearchBar->SetLowerCaseModeEnabled(lowercaseEnable);
1639 if (pControl->GetElement("ellipsisPosition", elementString))
1641 if (elementString.Equals(L"ELLIPSIS_POSITION_START", false))
1643 ellipsisPosition = ELLIPSIS_POSITION_START;
1645 else if (elementString.Equals(L"ELLIPSIS_POSITION_MIDDLE", false))
1647 ellipsisPosition = ELLIPSIS_POSITION_MIDDLE;
1651 ellipsisPosition = ELLIPSIS_POSITION_END;
1654 r = pSearchBar->SetEllipsisPosition(ellipsisPosition);
1657 if (pControl->GetElement("backgroundBitmapPath", elementString))
1659 Bitmap* pBackgroundBitmap = null;
1660 pBackgroundBitmap = LoadBitmapN(elementString);
1661 if (pBackgroundBitmap != null)
1663 pSearchBar->SetBackgroundBitmap(*pBackgroundBitmap);
1664 delete pBackgroundBitmap;
1668 if (pControl->GetElement("colorOpacity", elementString))
1670 Base::Integer::Parse(elementString, opacity);
1672 if (pControl->GetElement("color", elementString))
1674 ConvertStringToColor32(elementString, opacity, color);
1675 r = pSearchBar->SetColor(color);
1678 opacity = SEARCHBAR_DEFAULT_OPACITY;
1679 if (pControl->GetElement("normalButtonColor", elementString))
1681 ConvertStringToColor32(elementString, opacity, color);
1682 r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_NORMAL, color);
1685 if (pControl->GetElement("normalButtonTextColor", elementString))
1687 ConvertStringToColor32(elementString, opacity, color);
1688 r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_NORMAL, color);
1691 if (pControl->GetElement("normalSearchFieldColor", elementString))
1693 ConvertStringToColor32(elementString, opacity, color);
1694 r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_NORMAL, color);
1697 if (pControl->GetElement("normalSearchFieldTextColor", elementString))
1699 ConvertStringToColor32(elementString, opacity, color);
1700 r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_NORMAL, color);
1703 if (pControl->GetElement("disabledButtonColor", elementString))
1705 ConvertStringToColor32(elementString, opacity, color);
1706 r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_DISABLED, color);
1709 if (pControl->GetElement("disabledButtonTextColor", elementString))
1711 ConvertStringToColor32(elementString, opacity, color);
1712 r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_DISABLED, color);
1715 if (pControl->GetElement("disabledSearchFieldColor", elementString))
1717 ConvertStringToColor32(elementString, opacity, color);
1718 r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_DISABLED, color);
1721 if (pControl->GetElement("disabledSearchFieldTextColor", elementString))
1723 ConvertStringToColor32(elementString, opacity, color);
1724 r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_DISABLED, color);
1727 if (pControl->GetElement("highlightedButtonColor", elementString))
1729 ConvertStringToColor32(elementString, opacity, color);
1730 r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED, color);
1733 if (pControl->GetElement("highlightedButtonTextColor", elementString))
1735 ConvertStringToColor32(elementString, opacity, color);
1736 r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED, color);
1739 if (pControl->GetElement("highlightedSearchFieldColor", elementString))
1741 ConvertStringToColor32(elementString, opacity, color);
1742 r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_HIGHLIGHTED, color);
1745 if (pControl->GetElement("highlightedSearchFieldTextColor", elementString))
1747 ConvertStringToColor32(elementString, opacity, color);
1748 r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_HIGHLIGHTED, color);
1751 if (pControl->GetElement("pressedButtonColor", elementString))
1753 ConvertStringToColor32(elementString, opacity, color);
1754 r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_PRESSED, color);
1757 if (pControl->GetElement("pressedButtonTextColor", elementString))
1759 ConvertStringToColor32(elementString, opacity, color);
1760 r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_PRESSED, color);
1763 if (pControl->GetElement("guideTextColor", elementString))
1765 ConvertStringToColor32(elementString, opacity, color);
1766 r = pSearchBar->SetGuideTextColor(color);
1769 if (pControl->GetElement(L"accessibilityHint", elementString))
1771 AccessibilityContainer* pContainer = pSearchBar->GetAccessibilityContainer();
1774 AccessibilityElement* pElement = pContainer->GetElement(L"EditText");
1777 pElement->SetHint(elementString);
1786 _SearchBarRegister::_SearchBarRegister(void)
1788 _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1789 pUiBuilderControlTableManager->RegisterControl(L"SearchBar", _SearchBarMaker::GetInstance);
1792 _SearchBarRegister::~_SearchBarRegister(void)
1794 _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1795 pUiBuilderControlTableManager->UnregisterControl(L"SearchBar");
1797 static _SearchBarRegister SearchBarRegisterToUiBuilder;
1798 }}} // Tizen::Ui::Controls