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 (pContent != null && __pContentControl == null)
326 __pContentControl = const_cast <Control*>(pContent);
327 _Control& control = _ControlImpl::GetInstance(*__pContentControl)->GetCore();
329 r = __pSearchBar->SetContent(&control);
336 _SearchBarImpl::UpdateContentArea(bool invalidate)
340 return __pSearchBar->UpdateContentArea(invalidate);
344 _SearchBarImpl::SetContentAreaVisible(bool visible)
348 return __pSearchBar->SetContentAreaVisible(visible);
352 _SearchBarImpl::IsContentAreaVisible(void) const
356 return __pSearchBar->IsContentAreaVisible();
360 _SearchBarImpl::SetContentAreaSize(const Dimension& size)
364 FloatDimension contentSize;
365 contentSize = _CoordinateSystemUtils::ConvertToFloat(size);
366 Variant var(contentSize);
368 return __pSearchBar->SetPropertyContentAreaSize(var);
372 _SearchBarImpl::SetContentAreaSize(const FloatDimension& size)
377 return __pSearchBar->SetPropertyContentAreaSize(var);
381 _SearchBarImpl::GetContentAreaSize(void) const
386 size = _CoordinateSystemUtils::ConvertToInteger(__pSearchBar->GetPropertyContentAreaSize().ToFloatDimension());
392 _SearchBarImpl::GetContentAreaSizeF(void) const
396 return __pSearchBar->GetPropertyContentAreaSize().ToFloatDimension();
400 _SearchBarImpl::GetMode(void) const
404 return __pSearchBar->GetMode();
408 _SearchBarImpl::IsModeLocked(void) const
412 return __pSearchBar->IsModeLocked();
416 _SearchBarImpl::SetMode(SearchBarMode mode)
420 return __pSearchBar->SetMode(mode);
424 _SearchBarImpl::SetModeLocked(bool modeLocked)
428 return __pSearchBar->SetModeLocked(modeLocked);
432 _SearchBarImpl::GetButtonActionId(void) const
436 return __pSearchBar->GetPropertyButtonActionId().ToInt();
440 _SearchBarImpl::GetButtonColor(SearchBarButtonStatus status) const
448 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
449 buttonColor = __pSearchBar->GetPropertyButtonNormalColor();
451 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
452 buttonColor = __pSearchBar->GetPropertyButtonPressedColor();
454 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
455 buttonColor = __pSearchBar->GetPropertyButtonHighlightedColor();
457 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
458 buttonColor = __pSearchBar->GetPropertyButtonDisabledColor();
464 return buttonColor.ToColor();
468 _SearchBarImpl::GetButtonTextColor(SearchBarButtonStatus status) const
472 Variant buttonTextColor;
476 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
477 buttonTextColor = __pSearchBar->GetPropertyButtonNormalTextColor();
479 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
480 buttonTextColor = __pSearchBar->GetPropertyButtonPressedTextColor();
482 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
483 buttonTextColor = __pSearchBar->GetPropertyButtonHighlightedTextColor();
485 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
486 buttonTextColor = __pSearchBar->GetPropertyButtonDisabledTextColor();
492 return buttonTextColor.ToColor();
495 SearchBarButtonStatus
496 _SearchBarImpl::GetButtonStatus(void) const
500 return __pSearchBar->GetButtonStatus();
504 _SearchBarImpl::SetButton(const String& text, int actionId)
508 result r = E_SUCCESS;
509 Variant var(actionId);
511 r = __pSearchBar->SetButtonText(text);
512 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
514 r = __pSearchBar->SetPropertyButtonActionId(var);
520 _SearchBarImpl::SetButtonEnabled(bool enabled)
524 return __pSearchBar->SetButtonEnabled(enabled);
528 _SearchBarImpl::SetButtonColor(SearchBarButtonStatus status, const Color& color)
532 result r = E_SUCCESS;
537 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
538 r = __pSearchBar->SetPropertyButtonNormalColor(var);
540 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
541 r = __pSearchBar->SetPropertyButtonPressedColor(var);
543 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
544 r = __pSearchBar->SetPropertyButtonHighlightedColor(var);
546 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
547 r = __pSearchBar->SetPropertyButtonDisabledColor(var);
557 _SearchBarImpl::SetButtonTextColor(SearchBarButtonStatus status, const Color& color)
561 result r = E_SUCCESS;
566 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
567 r = __pSearchBar->SetPropertyButtonNormalTextColor(var);
569 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
570 r = __pSearchBar->SetPropertyButtonPressedTextColor(var);
572 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
573 r = __pSearchBar->SetPropertyButtonHighlightedTextColor(var);
575 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
576 r = __pSearchBar->SetPropertyButtonDisabledTextColor(var);
586 _SearchBarImpl::AppendCharacter(const Character& character)
590 return __pSearchBar->AppendCharacter(character);
594 _SearchBarImpl::AppendText(const String& text)
598 return __pSearchBar->AppendText(text);
602 _SearchBarImpl::SetText(const String& text)
606 return __pSearchBar->SetText(text);
610 _SearchBarImpl::InsertCharacterAt(int index, const Character& character)
614 return __pSearchBar->InsertCharacterAt(index, character);
618 _SearchBarImpl::InsertTextAt(int index, const String& text)
622 return __pSearchBar->InsertTextAt(index, text);
626 _SearchBarImpl::DeleteCharacterAt(int index)
630 return __pSearchBar->DeleteCharacterAt(index);
634 _SearchBarImpl::Clear(void)
638 result r = E_SUCCESS;
639 r = __pSearchBar->Clear();
641 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM,
642 "[E_SYSTEM] A system error has occured. Failed to clear the text.");
647 _SearchBarImpl::GetTextLength(void) const
651 return __pSearchBar->GetTextLength();
655 _SearchBarImpl::GetText(void) const
659 return __pSearchBar->GetText();
663 _SearchBarImpl::GetText(int start, int end) const
667 return __pSearchBar->GetText(start, end);
671 _SearchBarImpl::GetLimitLength(void) const
675 return __pSearchBar->GetLimitLength();
679 _SearchBarImpl::SetLimitLength(int limitLength)
683 return __pSearchBar->SetLimitLength(limitLength);
687 _SearchBarImpl::ShowKeypad(void) const
691 return __pSearchBar->ShowKeypad();
695 _SearchBarImpl::HideKeypad(void) const
699 return __pSearchBar->HideKeypad();
703 _SearchBarImpl::GetSearchFieldTextSize(void) const
707 int textSize = _CoordinateSystemUtils::ConvertToInteger(__pSearchBar->GetSearchFieldTextSizeF());
712 _SearchBarImpl::GetSearchFieldTextSizeF(void) const
716 return __pSearchBar->GetSearchFieldTextSizeF();
720 _SearchBarImpl::SetSearchFieldTextSize(int size)
724 float textSize = _CoordinateSystemUtils::ConvertToFloat(size);
725 return SetSearchFieldTextSize(textSize);
729 _SearchBarImpl::SetSearchFieldTextSize(float size)
733 return __pSearchBar->SetSearchFieldTextSize(size);
737 _SearchBarImpl::GetBlockRange(int& start, int& end) const
741 return __pSearchBar->GetBlockRange(start, end);
745 _SearchBarImpl::ReleaseBlock(void)
749 return __pSearchBar->ReleaseBlock();
753 _SearchBarImpl::SetBlockRange(int start, int end)
757 return __pSearchBar->SetBlockRange(start, end + 1);
761 _SearchBarImpl::RemoveTextBlock(void)
764 result r = __pSearchBar->RemoveTextBlock();
765 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
766 "[E_SYSTEM] A system error has occured. Unable to remove the text block.")
772 _SearchBarImpl::GetColor(void) const
776 return __pSearchBar->GetPropertyColor().ToColor();
780 _SearchBarImpl::GetSearchFieldColor(SearchFieldStatus status) const
784 Variant searchFieldColor;
788 case SEARCH_FIELD_STATUS_NORMAL:
789 searchFieldColor = __pSearchBar->GetPropertySearchFieldNormalColor();
791 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
792 searchFieldColor = __pSearchBar->GetPropertySearchFieldHighlightedColor();
794 case SEARCH_FIELD_STATUS_DISABLED:
795 searchFieldColor = __pSearchBar->GetPropertySearchFieldDisabledColor();
801 return searchFieldColor.ToColor();
805 _SearchBarImpl::GetSearchFieldTextColor(SearchFieldStatus status) const
810 _Edit* pEdit = __pSearchBar->GetSearchField();
815 case SEARCH_FIELD_STATUS_NORMAL:
816 color = pEdit->GetTextColor(EDIT_TEXT_COLOR_NORMAL);
818 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
819 color = pEdit->GetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED);
821 case SEARCH_FIELD_STATUS_DISABLED:
822 color = pEdit->GetTextColor(EDIT_TEXT_COLOR_DISABLED);
832 _SearchBarImpl::SetBackgroundBitmap(const Bitmap& bitmap)
836 return __pSearchBar->SetBackgroundBitmap(bitmap);
840 _SearchBarImpl::SetColor(const Color& color)
846 return __pSearchBar->SetPropertyColor(var);
850 _SearchBarImpl::SetSearchFieldColor(SearchFieldStatus status, const Color& color)
854 result r = E_SUCCESS;
859 case SEARCH_FIELD_STATUS_NORMAL:
860 r = __pSearchBar->SetPropertySearchFieldNormalColor(var);
862 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
863 r = __pSearchBar->SetPropertySearchFieldHighlightedColor(var);
865 case SEARCH_FIELD_STATUS_DISABLED:
866 r = __pSearchBar->SetPropertySearchFieldDisabledColor(var);
876 _SearchBarImpl::SetSearchFieldTextColor(SearchFieldStatus status, const Color& color)
880 result r = E_SUCCESS;
881 _Edit* pEdit = __pSearchBar->GetSearchField();
886 case SEARCH_FIELD_STATUS_NORMAL:
887 r = pEdit->SetTextColor(EDIT_TEXT_COLOR_NORMAL, color);
889 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
890 r = pEdit->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, color);
892 case SEARCH_FIELD_STATUS_DISABLED:
893 r = pEdit->SetTextColor(EDIT_TEXT_COLOR_DISABLED, color);
904 _SearchBarImpl::GetGuideText(void) const
908 return __pSearchBar->GetGuideText();
912 _SearchBarImpl::SetGuideText(const String& guideText)
916 return __pSearchBar->SetGuideText(guideText);
920 _SearchBarImpl::GetGuideTextColor(void) const
924 return __pSearchBar->GetGuideTextColor();
928 _SearchBarImpl::SetGuideTextColor(const Color& color)
932 return __pSearchBar->SetGuideTextColor(color);
936 _SearchBarImpl::GetCursorPosition(void) const
940 return __pSearchBar->GetCursorPosition();
944 _SearchBarImpl::SetCursorPosition(int index)
948 return __pSearchBar->SetCursorPosition(index);
952 _SearchBarImpl::IsLowerCaseModeEnabled(void) const
956 return __pSearchBar->IsLowerCaseModeEnabled();
960 _SearchBarImpl::SetLowerCaseModeEnabled(bool enable)
964 return __pSearchBar->SetLowerCaseModeEnabled(enable);
968 _SearchBarImpl::GetEllipsisPosition(void) const
972 return __pSearchBar->GetEllipsisPosition();
976 _SearchBarImpl::SetEllipsisPosition(EllipsisPosition position)
980 return __pSearchBar->SetEllipsisPosition(position);
984 _SearchBarImpl::GetKeypadAction(void) const
988 CoreKeypadAction coreKeypadAction = __pSearchBar->GetKeypadAction();
989 KeypadAction publicKeypadAction = ConvertKeypadAction(coreKeypadAction);
991 return publicKeypadAction;
995 _SearchBarImpl::IsTextPredictionEnabled(void) const
997 return __pSearchBar->IsTextPredictionEnabled();
1001 _SearchBarImpl::SetTextPredictionEnabled(bool enable)
1003 return __pSearchBar->SetTextPredictionEnabled(enable);
1007 _SearchBarImpl::SetCurrentLanguage(LanguageCode languageCode)
1009 return __pSearchBar->SetCurrentLanguage(languageCode);
1013 _SearchBarImpl::GetCurrentLanguage(LanguageCode& language) const
1015 return __pSearchBar->GetCurrentLanguage(language);
1019 _SearchBarImpl::AddActionEventListener(IActionEventListener& listener)
1023 SysTryReturn(NID_UI_CTRL, __pPublicActionEvent, E_SYSTEM, E_SYSTEM,
1024 "[E_SYSTEM] A system error has occurred.");
1026 result r = __pPublicActionEvent->AddListener(listener);
1027 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1028 "A system error has occurred. The same listener instance already exists in the event listener list.");
1033 _SearchBarImpl::RemoveActionEventListener(IActionEventListener& listener)
1037 SysTryReturn(NID_UI_CTRL, __pPublicActionEvent, E_SYSTEM, E_SYSTEM,
1038 "[E_SYSTEM] A system error has occurred.");
1040 result r = __pPublicActionEvent->RemoveListener(listener);
1041 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1042 "A system error has occurred. The specified listener does not exist in the event listener list.");
1047 _SearchBarImpl::AddKeypadEventListener(IKeypadEventListener& listener)
1051 SysTryReturn(NID_UI_CTRL, __pPublicKeypadEvent, E_SYSTEM, E_SYSTEM,
1052 "[E_SYSTEM] A system error has occurred.");
1054 result r = __pPublicKeypadEvent->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.");
1063 _SearchBarImpl::RemoveKeypadEventListener(IKeypadEventListener& listener)
1067 SysTryReturn(NID_UI_CTRL, __pPublicKeypadEvent, E_SYSTEM, E_SYSTEM,
1068 "[E_SYSTEM] A system error has occurred.");
1070 result r = __pPublicKeypadEvent->RemoveListener(listener);
1071 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1072 "A system error has occurred. The specified listener does not exist in the event listener list.");
1078 _SearchBarImpl::AddTextBlockEventListener(ITextBlockEventListener& listener)
1082 SysTryReturn(NID_UI_CTRL, __pPublicTextBlockEvent, E_SYSTEM, E_SYSTEM,
1083 "[E_SYSTEM] A system error has occurred.");
1085 result r = __pPublicTextBlockEvent->AddListener(listener);
1086 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1087 "A system error has occurred. The same listener instance already exists in the event listener list.");
1093 _SearchBarImpl::RemoveTextBlockEventListener(ITextBlockEventListener& listener)
1097 SysTryReturn(NID_UI_CTRL, __pPublicTextBlockEvent, E_SYSTEM, E_SYSTEM,
1098 "[E_SYSTEM] A system error has occurred.");
1100 result r = __pPublicTextBlockEvent->RemoveListener(listener);
1101 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1102 "A system error has occurred. The specified listener does not exist in the event listener list.");
1109 _SearchBarImpl::AddTextEventListener(ITextEventListener& listener)
1113 SysTryReturn(NID_UI_CTRL, __pPublicTextEvent, E_SYSTEM, E_SYSTEM,
1114 "[E_SYSTEM] A system error has occurred.");
1116 result r = __pPublicTextEvent->AddListener(listener);
1117 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1118 "A system error has occurred. The same listener instance already exists in the event listener list.");
1124 _SearchBarImpl::RemoveTextEventListener(ITextEventListener& listener)
1128 SysTryReturn(NID_UI_CTRL, __pPublicTextEvent, E_SYSTEM, E_SYSTEM,
1129 "[E_SYSTEM] A system error has occurred.");
1131 result r = __pPublicTextEvent->RemoveListener(listener);
1132 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1133 "A system error has occurred. The specified listener does not exist in the event listener list.");
1139 _SearchBarImpl::AddSearchBarEventListener(const ISearchBarEventListener& listener)
1143 SysTryReturn(NID_UI_CTRL, __pPublicSearchBarEvent, E_SYSTEM, E_SYSTEM,
1144 "[E_SYSTEM] A system error has occurred.");
1146 result r = __pPublicSearchBarEvent->AddListener(listener);
1147 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1148 "A system error has occurred. The same listener instance already exists in the event listener list.");
1154 _SearchBarImpl::RemoveSearchBarEventListener(const ISearchBarEventListener& listener)
1158 SysTryReturn(NID_UI_CTRL, __pPublicSearchBarEvent, E_SYSTEM, E_SYSTEM,
1159 "[E_SYSTEM] A system error has occurred.");
1161 result r = __pPublicSearchBarEvent->RemoveListener(listener);
1162 SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1163 "A system error has occurred. The specified listener does not exist in the event listener list.");
1169 _SearchBarImpl::AddLanguageEventListener(ILanguageEventListener& listener)
1173 SysAssertf(__pPublicLanguageEvent != null, "Not yet constructed. Construct() should be called before use.");
1175 return __pPublicLanguageEvent->AddListener(listener);
1179 _SearchBarImpl::RemoveLanguageEventListener(ILanguageEventListener& listener)
1183 SysAssertf(__pPublicLanguageEvent != null, "Not yet constructed. Construct() should be called before use.");
1185 return __pPublicLanguageEvent->RemoveListener(listener);
1189 _SearchBarImpl::SetEditTextFilter(IEditTextFilter* pFilter)
1191 __pSearchBar->SetEditTextFilter(pFilter);
1197 _SearchBarImpl::SendOpaqueCommand (const String& command)
1199 __pSearchBar->SendOpaqueCommand(command);
1205 _SearchBarImpl::OnActionPerformed(const _Control& source, int actionId)
1209 if (__pPublicActionEvent != null)
1211 IEventArg* pEventArg = _PublicActionEvent::CreateActionEventArgN(actionId);
1212 result r = GetLastResult();
1213 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1215 __pPublicActionEvent->Fire(*pEventArg);
1221 _SearchBarImpl::OnKeypadWillOpen(void)
1225 if (__pPublicKeypadEvent != null)
1227 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1228 GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_CREATED);
1229 result r = GetLastResult();
1230 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1232 __pPublicKeypadEvent->Fire(*pEventArg);
1238 _SearchBarImpl::OnKeypadOpened(void)
1242 if (__pPublicKeypadEvent != null)
1244 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1245 GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_OPEN);
1246 result r = GetLastResult();
1247 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1249 __pPublicKeypadEvent->Fire(*pEventArg);
1256 _SearchBarImpl::OnKeypadClosed(void)
1260 if (__pPublicKeypadEvent != null)
1262 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1263 GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_CLOSE);
1264 result r = GetLastResult();
1265 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1267 __pPublicKeypadEvent->Fire(*pEventArg);
1273 _SearchBarImpl::OnKeypadBoundsChanged(void)
1277 if (__pPublicKeypadEvent != null)
1279 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1280 GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
1281 result r = GetLastResult();
1282 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1284 __pPublicKeypadEvent->Fire(*pEventArg);
1290 _SearchBarImpl::OnKeypadActionPerformed(CoreKeypadAction keypadAction)
1294 if (__pPublicKeypadEvent != null)
1296 KeypadAction publicKeypadAction = ConvertKeypadAction(keypadAction);
1298 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1299 GetPublic(), publicKeypadAction, KEYPAD_EVENT_STATUS_ENTERACTION);
1300 result r = GetLastResult();
1301 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1303 __pPublicKeypadEvent->Fire(*pEventArg);
1309 _SearchBarImpl::OnTextBlockSelected(_Control& source, int start, int end)
1313 if (__pPublicTextBlockEvent != null)
1315 IEventArg* pEventArg = _PublicTextBlockEvent::CreateTextBlockEventArgN(start, end);
1316 result r = GetLastResult();
1317 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1319 __pPublicTextBlockEvent->Fire(*pEventArg);
1325 _SearchBarImpl::OnTextValueChanged(const _Control& source)
1329 if (__pPublicTextEvent != null)
1331 IEventArg* pEventArg = _PublicTextEvent::CreateTextEventArgN(TEXT_EVENT_CHANGED);
1332 result r = GetLastResult();
1333 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1335 __pPublicTextEvent->Fire(*pEventArg);
1341 _SearchBarImpl::OnTextValueChangeCanceled(const _Control& source)
1345 if (__pPublicTextEvent != null)
1347 IEventArg* pEventArg = _PublicTextEvent::CreateTextEventArgN(TEXT_EVENT_CANCELED);
1348 result r = GetLastResult();
1349 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1351 __pPublicTextEvent->Fire(*pEventArg);
1357 _SearchBarImpl::OnSearchBarModeChanged(_SearchBar& source, SearchBarMode mode)
1361 if ((_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) && __pSearchBar != null)
1363 if (mode == SEARCH_BAR_MODE_NORMAL)
1365 __pSearchBar->SetHeaderVisibleState(true);
1369 __pSearchBar->SetHeaderVisibleState(false);
1371 __pSearchBar->SetContentsArea();
1374 if (__pPublicSearchBarEvent != null)
1376 IEventArg* pEventArg = _PublicSearchBarEvent::CreateSearchBarEventArgN(SEARCH_BAR_EVENT_MODE_CHANGE);
1377 result r = GetLastResult();
1378 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1380 __pPublicSearchBarEvent->Fire(*pEventArg);
1386 _SearchBarImpl::OnLanguageChanged(LanguageCode oldLanguage, LanguageCode newLanguage)
1388 if (__pPublicLanguageEvent)
1390 IEventArg* pKLanguageEventArg = _PublicLanguageEvent::CreateLanguageEventArgN(GetPublic(), oldLanguage, newLanguage);
1391 result r = GetLastResult();
1392 SysTryReturnVoidResult(NID_UI_CTRL, pKLanguageEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1394 __pPublicLanguageEvent->Fire(*pKLanguageEventArg);
1398 SysLog(NID_UI_CTRL, "Event is not created.");
1404 _SearchBarImpl::ConvertKeypadAction(CoreKeypadAction keypadAction) const
1406 KeypadAction publicKeypadAction = KEYPAD_ACTION_SEARCH;
1407 switch (keypadAction)
1409 case CORE_KEYPAD_ACTION_ENTER:
1410 publicKeypadAction = KEYPAD_ACTION_ENTER;
1413 case CORE_KEYPAD_ACTION_GO:
1414 publicKeypadAction = KEYPAD_ACTION_GO;
1417 case CORE_KEYPAD_ACTION_NEXT:
1418 publicKeypadAction = KEYPAD_ACTION_NEXT;
1421 case CORE_KEYPAD_ACTION_SEND:
1422 publicKeypadAction = KEYPAD_ACTION_SEND;
1425 case CORE_KEYPAD_ACTION_SEARCH:
1426 publicKeypadAction = KEYPAD_ACTION_SEARCH;
1429 case CORE_KEYPAD_ACTION_LOGIN:
1430 publicKeypadAction = KEYPAD_ACTION_LOGIN;
1433 case CORE_KEYPAD_ACTION_SIGN_IN:
1434 publicKeypadAction = KEYPAD_ACTION_SIGN_IN;
1437 case CORE_KEYPAD_ACTION_JOIN:
1438 publicKeypadAction = KEYPAD_ACTION_JOIN;
1441 case CORE_KEYPAD_ACTION_DONE:
1442 publicKeypadAction = KEYPAD_ACTION_DONE;
1449 return publicKeypadAction;
1452 class _SearchBarMaker
1453 : public _UiBuilderControlMaker
1456 _SearchBarMaker(_UiBuilder* pUibuilder)
1457 : _UiBuilderControlMaker(pUibuilder){}
1458 virtual ~_SearchBarMaker(void){}
1459 static _UiBuilderControlMaker*
1460 GetInstance(_UiBuilder* pUibuilder)
1462 _SearchBarMaker* pSearchBarMaker = new (std::nothrow) _SearchBarMaker(pUibuilder);
1463 return pSearchBarMaker;
1468 Make(_UiBuilderControl* pControl)
1470 result r = E_SUCCESS;
1472 FloatRectangle rect;
1473 SearchBar* pSearchBar = null;
1474 _UiBuilderControlLayout* pControlProperty = null;
1475 bool showSearchBarButton = true;
1476 KeypadAction keypadAction = KEYPAD_ACTION_ENTER;
1478 int opacity = SEARCHBAR_DEFAULT_OPACITY;
1479 EllipsisPosition ellipsisPosition = ELLIPSIS_POSITION_END;
1482 int limitLength = SEARCHBAR_TEXT_LENGTH_MAX;
1483 int buttonActionId = -1;
1485 float searchFieldTextSize = 0.0f;
1486 bool lowercaseEnable = false;
1487 String elementString;
1489 GetProperty(pControl, &pControlProperty);
1490 if (pControlProperty == null)
1495 pSearchBar = new (std::nothrow) SearchBar;
1496 if (pSearchBar == null)
1501 rect = pControlProperty->GetRectF();
1502 if (pControl->GetElement("showSearchBarButton", elementString))
1504 if (elementString.Equals(L"false", false))
1506 showSearchBarButton = false;
1510 if (pControl->GetElement("keypadAction", elementString))
1512 if (elementString.Equals(L"KEYPAD_ACTION_ENTER", false))
1514 keypadAction = KEYPAD_ACTION_ENTER;
1516 else if (elementString.Equals(L"KEYPAD_ACTION_GO", false))
1518 keypadAction = KEYPAD_ACTION_GO;
1520 else if (elementString.Equals(L"KEYPAD_ACTION_NEXT", false))
1522 keypadAction = KEYPAD_ACTION_NEXT;
1524 else if (elementString.Equals(L"KEYPAD_ACTION_SEND", false))
1526 keypadAction = KEYPAD_ACTION_SEND;
1528 else if (elementString.Equals(L"KEYPAD_ACTION_SEARCH", false))
1530 keypadAction = KEYPAD_ACTION_SEARCH;
1532 else if (elementString.Equals(L"KEYPAD_ACTION_LOGIN", false))
1534 keypadAction = KEYPAD_ACTION_LOGIN;
1536 else if (elementString.Equals(L"KEYPAD_ACTION_SIGN_IN", false))
1538 keypadAction = KEYPAD_ACTION_SIGN_IN;
1540 else if (elementString.Equals(L"KEYPAD_ACTION_JOIN", false))
1542 keypadAction = KEYPAD_ACTION_JOIN;
1544 else if (elementString.Equals(L"KEYPAD_ACTION_DONE", false))
1546 keypadAction = KEYPAD_ACTION_DONE;
1550 r = pSearchBar->Construct(rect, showSearchBarButton, keypadAction);
1557 if (showSearchBarButton)
1559 if (pControl->GetElement("buttonActionId", elementString))
1561 Base::Integer::Parse(elementString, buttonActionId);
1564 if (pControl->GetElement("buttonText", elementString))
1566 r = pSearchBar->SetButton(elementString, buttonActionId);
1570 if (pControl->GetElement("text", elementString))
1572 r = pSearchBar->SetText(elementString);
1575 if (pControl->GetElement("guideText", elementString))
1577 r = pSearchBar->SetGuideText(elementString);
1580 if (pControl->GetElement("searchFieldTextSize", elementString))
1582 Base::Float::Parse(elementString, searchFieldTextSize);
1583 _ICoordinateSystemTransformer* pTransform = GetTransformer();
1586 searchFieldTextSize = pTransform->Transform(searchFieldTextSize);
1588 r = pSearchBar->SetSearchFieldTextSize(searchFieldTextSize);
1591 if (pControl->GetElement("limitLength", elementString))
1593 Base::Integer::Parse(elementString, limitLength);
1594 r = pSearchBar->SetLimitLength(limitLength);
1597 if (pControl->GetElement("lowerCaseMode", elementString))
1599 if (elementString.Equals(L"true", false))
1601 lowercaseEnable = true;
1605 lowercaseEnable = false;
1608 pSearchBar->SetLowerCaseModeEnabled(lowercaseEnable);
1611 if (pControl->GetElement("ellipsisPosition", elementString))
1613 if (elementString.Equals(L"ELLIPSIS_POSITION_START", false))
1615 ellipsisPosition = ELLIPSIS_POSITION_START;
1617 else if (elementString.Equals(L"ELLIPSIS_POSITION_MIDDLE", false))
1619 ellipsisPosition = ELLIPSIS_POSITION_MIDDLE;
1623 ellipsisPosition = ELLIPSIS_POSITION_END;
1626 r = pSearchBar->SetEllipsisPosition(ellipsisPosition);
1629 if (pControl->GetElement("backgroundBitmapPath", elementString))
1631 Bitmap* pBackgroundBitmap = null;
1632 pBackgroundBitmap = LoadBitmapN(elementString);
1633 if (pBackgroundBitmap != null)
1635 pSearchBar->SetBackgroundBitmap(*pBackgroundBitmap);
1636 delete pBackgroundBitmap;
1640 if (pControl->GetElement("colorOpacity", elementString))
1642 Base::Integer::Parse(elementString, opacity);
1644 if (pControl->GetElement("color", elementString))
1646 ConvertStringToColor32(elementString, opacity, color);
1647 r = pSearchBar->SetColor(color);
1650 opacity = SEARCHBAR_DEFAULT_OPACITY;
1651 if (pControl->GetElement("normalButtonColor", elementString))
1653 ConvertStringToColor32(elementString, opacity, color);
1654 r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_NORMAL, color);
1657 if (pControl->GetElement("normalButtonTextColor", elementString))
1659 ConvertStringToColor32(elementString, opacity, color);
1660 r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_NORMAL, color);
1663 if (pControl->GetElement("normalSearchFieldColor", elementString))
1665 ConvertStringToColor32(elementString, opacity, color);
1666 r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_NORMAL, color);
1669 if (pControl->GetElement("normalSearchFieldTextColor", elementString))
1671 ConvertStringToColor32(elementString, opacity, color);
1672 r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_NORMAL, color);
1675 if (pControl->GetElement("disabledButtonColor", elementString))
1677 ConvertStringToColor32(elementString, opacity, color);
1678 r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_DISABLED, color);
1681 if (pControl->GetElement("disabledButtonTextColor", elementString))
1683 ConvertStringToColor32(elementString, opacity, color);
1684 r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_DISABLED, color);
1687 if (pControl->GetElement("disabledSearchFieldColor", elementString))
1689 ConvertStringToColor32(elementString, opacity, color);
1690 r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_DISABLED, color);
1693 if (pControl->GetElement("disabledSearchFieldTextColor", elementString))
1695 ConvertStringToColor32(elementString, opacity, color);
1696 r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_DISABLED, color);
1699 if (pControl->GetElement("highlightedButtonColor", elementString))
1701 ConvertStringToColor32(elementString, opacity, color);
1702 r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED, color);
1705 if (pControl->GetElement("highlightedButtonTextColor", elementString))
1707 ConvertStringToColor32(elementString, opacity, color);
1708 r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED, color);
1711 if (pControl->GetElement("highlightedSearchFieldColor", elementString))
1713 ConvertStringToColor32(elementString, opacity, color);
1714 r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_HIGHLIGHTED, color);
1717 if (pControl->GetElement("highlightedSearchFieldTextColor", elementString))
1719 ConvertStringToColor32(elementString, opacity, color);
1720 r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_HIGHLIGHTED, color);
1723 if (pControl->GetElement("pressedButtonColor", elementString))
1725 ConvertStringToColor32(elementString, opacity, color);
1726 r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_PRESSED, color);
1729 if (pControl->GetElement("pressedButtonTextColor", elementString))
1731 ConvertStringToColor32(elementString, opacity, color);
1732 r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_PRESSED, color);
1735 if (pControl->GetElement("guideTextColor", elementString))
1737 ConvertStringToColor32(elementString, opacity, color);
1738 r = pSearchBar->SetGuideTextColor(color);
1741 if (pControl->GetElement(L"accessibilityHint", elementString))
1743 AccessibilityContainer* pContainer = pSearchBar->GetAccessibilityContainer();
1746 AccessibilityElement* pElement = pContainer->GetElement(L"EditText");
1749 pElement->SetHint(elementString);
1758 _SearchBarRegister::_SearchBarRegister(void)
1760 _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1761 pUiBuilderControlTableManager->RegisterControl(L"SearchBar", _SearchBarMaker::GetInstance);
1764 _SearchBarRegister::~_SearchBarRegister(void)
1766 _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1767 pUiBuilderControlTableManager->UnregisterControl(L"SearchBar");
1769 static _SearchBarRegister SearchBarRegisterToUiBuilder;
1770 }}} // Tizen::Ui::Controls