2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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_SearchBar.cpp
20 * @brief This is the implementation file for the _SearchBar class.
23 #include <FBaseErrorDefine.h>
24 #include <FBaseSysLog.h>
25 #include <FGrp_BitmapImpl.h>
26 #include "FUiAnim_VisualElement.h"
27 #include "FUi_ResourceManager.h"
28 #include "FUiCtrl_SearchBar.h"
29 #include "FUiCtrl_SearchBarPresenter.h"
30 #include "FUiCtrl_Form.h"
31 #include "FUiCtrl_Edit.h"
32 #include "FUiCtrl_Panel.h"
33 #include "FUiCtrl_OverlayPanel.h"
34 #include "FUiCtrl_Keypad.h"
35 #include "FUiCtrl_ColorPicker.h"
36 #include "FUiCtrl_ActionEvent.h"
37 #include "FUiCtrl_TextBlockEvent.h"
38 #include "FUiCtrl_TextEvent.h"
39 #include "FUi_AccessibilityContainer.h"
40 #include "FUi_AccessibilityElement.h"
41 #include "FUi_AccessibilityManager.h"
42 #include "FUi_CoordinateSystemUtils.h"
43 #include "FUiCtrl_SearchBarImpl.h"
44 #include "FUiCtrl_EditFieldImpl.h"
45 #include "FUiCtrl_ButtonImpl.h"
46 #include <FSys_SettingInfoImpl.h>
49 using namespace Tizen::Graphics;
50 using namespace Tizen::Ui;
51 using namespace Tizen::Ui::Animations;
52 using namespace Tizen::Base;
53 using namespace Tizen::Base::Runtime;
54 using namespace Tizen::Locales;
55 using namespace Tizen::System;
57 namespace Tizen { namespace Ui { namespace Controls
60 IMPLEMENT_PROPERTY(_SearchBar);
62 _SearchBar::_SearchBar(void)
63 : __pSearchBarPresenter(null)
64 , __pClippedGroupControl(null)
66 , __pCancelButton(null)
68 , __pContentControl(null)
71 , __isButtonEnabled(true)
72 , __isUsableCancelButton(false)
73 , __isUserContainerBounds(false)
74 , __isCancelActionInProgress(false)
75 , __isUserGuideTextColor(false)
76 , __isKeypadOpening(false)
77 , __isupdateContentBounds(false)
78 , __isFocusCallbackToBeFired(true)
79 , __isButtonTextChangedByApp(false)
80 , __contentVisibilitySetByApp(true)
81 , __isInFocusMode(false)
82 , __keypadAction(CORE_KEYPAD_ACTION_SEARCH)
83 , __pBackgroundBitmap(null)
84 , __backgroundColor(Color())
85 , __contentColor(Color())
86 , __pActionEvent(null)
87 , __pKeypadEvent(null)
88 , __pTextBlockEvent(null)
90 , __pSearchBarEvent(null)
91 , __pLanguageEvent(null)
92 , __pAccessibilitySearchBarElement(null)
94 for (int i = 0; i < SEARCHBAR_BUTTON_COLOR_MAX; i++)
96 __buttonColor[i] = Color(0);
97 __buttonTextColor[i] = Color(0);
100 for (int i = 0; i < SEARCHBAR_COLOR_MAX; i++)
102 __color[i] = Color(0);
103 __textColor[i] = Color(0);
104 __guideTextColor[i] = Color(0);
107 _AccessibilityContainer* pContainer = GetAccessibilityContainer();
110 pContainer->Activate(true);
114 _SearchBar::~_SearchBar(void)
116 SettingInfo::RemoveSettingEventListener(*this);
118 delete __pSearchBarPresenter;
119 __pSearchBarPresenter = null;
121 if (__pClippedGroupControl)
123 DetachChild(*__pClippedGroupControl);
125 delete __pClippedGroupControl;
126 __pClippedGroupControl = null;
131 DetachChild(*__pContainer);
139 delete __pActionEvent;
140 __pActionEvent = null;
145 delete __pKeypadEvent;
146 __pKeypadEvent = null;
149 if (__pTextBlockEvent)
151 delete __pTextBlockEvent;
152 __pTextBlockEvent = null;
161 if (__pSearchBarEvent)
163 delete __pSearchBarEvent;
164 __pSearchBarEvent = null;
167 if (__pLanguageEvent)
169 delete __pLanguageEvent;
170 __pLanguageEvent = null;
173 if (__pAccessibilitySearchBarElement)
175 __pAccessibilitySearchBarElement->Activate(false);
176 __pAccessibilitySearchBarElement = null;
179 delete __pBackgroundBitmap;
180 __pBackgroundBitmap = null;
184 _SearchBar::CreateSearchBarN(void)
186 _SearchBar* pSearchBar = new (std::nothrow) _SearchBar;
187 SysTryReturn(NID_UI_CTRL, pSearchBar, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
188 if (GetLastResult() != E_SUCCESS)
194 pSearchBar->AcquireHandle();
195 pSearchBar->SetTouchPressThreshold(_TOUCH_PRESS_THRESHOLD_INSENSITIVE);
201 _SearchBar::Initialize(bool enableSearchBarButton, CoreKeypadAction keypadAction)
203 result r = E_SUCCESS;
205 // Setting Button color
206 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_NORMAL, __buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
207 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_PRESSED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
208 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_HIGHLIGHTED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
209 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_DISABLED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
211 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_NORMAL, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
212 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_PRESSED, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
213 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_HIGHLIGHTED, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
214 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_DISABLED, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
216 GET_COLOR_CONFIG(SEARCHBAR::CONTENT_AREA_BG_NORMAL, __contentColor);
218 for (int i = 0; i < SEARCHBAR_COLOR_MAX; i++)
222 case SEARCH_FIELD_STATUS_DISABLED:
223 GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_DISABLED, __color[i]);
224 GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_DISABLED, __textColor[i]);
225 GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_DISABLED, __guideTextColor[i]);
228 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
229 GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_NORMAL, __color[i]);
230 GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_HIGHLIGHTED, __textColor[i]);
231 GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_NORMAL, __guideTextColor[i]);
234 GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_NORMAL, __color[i]);
235 GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_NORMAL, __textColor[i]);
236 GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_NORMAL, __guideTextColor[i]);
241 GET_COLOR_CONFIG(SEARCHBAR::BG_NORMAL, __backgroundColor);
243 __isUsableCancelButton = enableSearchBarButton;
244 __keypadAction = keypadAction;
246 GetVisualElement()->SetClipChildrenEnabled(false);
248 r = CreateClippedGroupControl();
249 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
250 "[E_SYSTEM] A system error has occurred. The construction of parent control for clipped group control failed.");
252 r = CreateSearchField();
253 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
254 "[E_SYSTEM] A system error has occurred. The edit construction failed.");
255 r = CreateCancelButton();
256 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
257 "[E_SYSTEM] A system error has occurred. The cancel button construction failed.");
260 r = CreateContentsArea();
261 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
262 "[E_SYSTEM] A system error has occurred. The construction of parent for content failed.");
264 _SearchBarPresenter* pPresenter = new (std::nothrow) _SearchBarPresenter;
265 SysTryReturn(NID_UI_CTRL, pPresenter, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
267 r = pPresenter->Construct(*this);
268 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
270 r = pPresenter->Install();
271 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
273 __pSearchBarPresenter = pPresenter;
275 InitializeAccessibility();
277 r = _SettingInfoImpl::AddSettingEventListener(*this);
278 SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
290 _SearchBar::CreateSearchField(void)
292 result r = E_SUCCESS;
294 FloatRectangle editBounds;
295 float horizontalMargin = 0.0f;
296 float verticalMargin = 0.0f;
297 float iconHorizontalMargin = 0.0f;
298 float textHorizontalMargin = 0.0f;
299 float iconWidth = 0.0f;
300 float textSize = 0.0f;
301 float searchBarMinHeight = 0.0f;
302 float searchBarMinWidthModeNormal = 0.0f;
304 FloatRectangle searchBarBounds = GetBoundsF();
305 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
307 GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
308 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, verticalMargin);
309 GET_SHAPE_CONFIG(SEARCHBAR::ICON_HORIZONTAL_MARGIN, orientation, iconHorizontalMargin);
310 GET_SHAPE_CONFIG(SEARCHBAR::ICON_WIDTH, orientation, iconWidth);
311 GET_SHAPE_CONFIG(SEARCHBAR::TEXT_HORIZONTAL_MARGIN, orientation, textHorizontalMargin);
312 GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH_NORMAL_MODE, orientation, searchBarMinWidthModeNormal);
313 GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
315 float searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2.0f);
317 editBounds.x = horizontalMargin;
319 if (searchBarBounds.height < searchBarMinHeight)
321 verticalMargin = (searchBarBounds.height - searchFieldMinHeight)/2.0f;
322 if (verticalMargin < 0.0f)
324 verticalMargin = 0.0f;
328 editBounds.y = verticalMargin;
330 editBounds.width = searchBarBounds.width - (editBounds.x * 2.0f);
331 editBounds.height = searchBarBounds.height - (editBounds.y * 2.0f);
333 editBounds.width = (editBounds.width > searchBarMinWidthModeNormal) ? editBounds.width : searchBarMinWidthModeNormal;
334 editBounds.height = (editBounds.height > searchFieldMinHeight) ? editBounds.height : searchFieldMinHeight;
336 _SearchBarImpl* pSearchBarImpl = static_cast<_SearchBarImpl*>(GetUserData());
337 __pEdit = &(pSearchBarImpl->GetEditFieldImpl()->GetCore());
339 SysTryReturnResult(NID_UI_CTRL, __pEdit != null, E_SYSTEM,
340 "[E_SYSTEM] A system error has occured. Failed to get _Edit instance");
342 __pEdit->SetKeypadCommandButtonVisible(false);
343 __pEdit->SetBounds(editBounds);
344 __pEdit->AddKeypadEventListener(*this);
345 __pEdit->AddTextBlockEventListener(*this);
346 __pEdit->AddTextEventListener(*this);
348 GET_SHAPE_CONFIG(SEARCHBAR::EDIT_TEXT_SIZE, orientation, textSize);
349 __pEdit->SetTextSize(textSize);
351 __pEdit->SetHorizontalMargin(iconHorizontalMargin + iconWidth + textHorizontalMargin, EDIT_TEXT_LEFT_MARGIN);
352 __pEdit->SetHorizontalMargin(textHorizontalMargin, EDIT_TEXT_RIGHT_MARGIN);
353 __pEdit->SetLimitLength(SEARCHBAR_TEXT_LENGTH_MAX);
355 for (int status = 0; status < SEARCHBAR_COLOR_MAX; status++)
357 EditStatus editStatus = ConvertSearchBarStatus((SearchFieldStatus) status);
358 __pEdit->SetColor(editStatus, __color[status]);
361 __pEdit->SetTextColor(EDIT_TEXT_COLOR_NORMAL, __textColor[SEARCH_FIELD_STATUS_NORMAL]);
362 __pEdit->SetTextColor(EDIT_TEXT_COLOR_DISABLED, __textColor[SEARCH_FIELD_STATUS_DISABLED]);
363 __pEdit->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, __textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
365 __pEdit->ReplaceDefaultBackgroundBitmapForSearchBar();
367 __pEdit->SetKeypadAction(__keypadAction);
369 r = __pClippedGroupControl->AttachChild(*__pEdit);
370 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM,
371 "[E_SYSTEM] A system error has occurred. Failed to attach edit as child.");
383 _SearchBar::CreateCancelButton(void)
385 result r = E_SUCCESS;
387 float textSize = 0.0f;
388 String cancelButtonText;
390 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
392 _SearchBarImpl* pSearchBarImpl = static_cast<_SearchBarImpl*>(GetUserData());
393 __pCancelButton = &(pSearchBarImpl->GetButtonImpl()->GetCore());
395 SysTryReturnResult(NID_UI_CTRL, __pCancelButton != null, E_SYSTEM,
396 "[E_SYSTEM] A system error has occured. Failed to get _Edit instance");
399 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
401 r = ResizeCancelButton();
402 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
404 GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_CANCEL_ABB, cancelButtonText);
405 r = __pCancelButton->SetText(cancelButtonText);
406 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
408 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_TEXT_SIZE, orientation, textSize);
409 r = __pCancelButton->SetTextSize(textSize);
410 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
412 __pCancelButton->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
413 __pCancelButton->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
415 r = __pCancelButton->SetActionId(__actionId);
416 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
418 r = __pCancelButton->AddActionEventListener(*this);
419 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
421 __pCancelButton->SetVisibleState(false);
423 for (int status = 0; status < SEARCHBAR_BUTTON_COLOR_MAX; status++)
425 _ButtonStatus buttonStatus = ConvertSearchBarButtonStatus((SearchBarButtonStatus) status);
427 r = __pCancelButton->SetColor(buttonStatus, __buttonColor[status]);
428 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
430 r = __pCancelButton->SetTextColor(buttonStatus, __buttonTextColor[status]);
431 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
434 r = __pClippedGroupControl->AttachChild(*__pCancelButton);
435 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM,
436 "[E_SYSTEM] A system error has occurred. Failed to attach button as child.");
441 delete __pCancelButton;
442 __pCancelButton = null;
448 _SearchBar::CreateContentsArea(void)
450 result r = E_SUCCESS;
452 __pContainer = _Control::CreateControlN();
455 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
457 __pContainer->SetVisibleState(false);
459 r = AttachChild(*__pContainer);
460 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM,
461 "[E_SYSTEM] A system error has occurred. Failed to attach the parent of content.");
473 _SearchBar::SetContentsArea(void)
475 if (__isUserContainerBounds)
480 FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
481 float width = screenSize.width;
482 float height = screenSize.height;
484 _Control* pParent = GetParentForm();
487 width = pParent->GetClientBoundsF().width;
488 height = pParent->GetClientBoundsF().height;
491 FloatRectangle controlBounds = GetBoundsF();
492 controlBounds = CoordinateSystem::AlignToDevice(FloatRectangle(controlBounds));
494 __contentAreaBounds.x = 0.0f;
495 __contentAreaBounds.y = controlBounds.height;
496 __contentAreaBounds.width = width - controlBounds.x;
497 __contentAreaBounds.height = height - (controlBounds.y + controlBounds.height);
501 result r = E_SUCCESS;
502 r = __pContainer->SetBounds(__contentAreaBounds);
503 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
509 _SearchBar::GetContent(void) const
511 return __pContentControl;
515 _SearchBar::SetContent(const _Control* pContent)
517 __pContentControl = const_cast <_Control*>(pContent);
518 result r = E_SUCCESS;
522 r = __pContainer->AttachChild(*__pContentControl);
523 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating");
530 _SearchBar::UpdateContentArea(bool invalidate)
532 return __pSearchBarPresenter->UpdateContentArea(invalidate);
536 _SearchBar::SetContentAreaVisible(bool visible, bool isCalledByApp)
538 SysTryReturn(NID_UI_CTRL, __pContainer, E_SYSTEM, E_SYSTEM,
539 "[E_SYSTEM] A system error has occurred. The instance of parent to content is null.");
541 SearchBarMode searchBarMode = GetMode();
542 if (searchBarMode == SEARCH_BAR_MODE_INPUT)
544 __pContainer->SetVisibleState(visible);
549 __contentVisibilitySetByApp = visible;
552 return __pSearchBarPresenter->SetContentAreaVisible(visible);
556 _SearchBar::IsContentAreaVisible(void) const
558 return __pSearchBarPresenter->IsContentAreaVisible();
562 _SearchBar::SetContentAreaSize(const Dimension& size)
564 return SetProperty("contentAreaSize", Variant(size));
568 _SearchBar::GetContentAreaSize(void) const
570 Variant size = GetProperty("contentAreaSize");
572 return size.ToDimension();
576 _SearchBar::GetMode(void) const
578 return __pSearchBarPresenter->GetMode();
582 _SearchBar::IsModeLocked(void) const
584 return __pSearchBarPresenter->IsModeLocked();
588 _SearchBar::SetMode(SearchBarMode mode)
590 _AccessibilityElement* pEditElement = __pEdit->GetTextAccessibilityElement();
591 if (mode == SEARCH_BAR_MODE_NORMAL)
593 pEditElement->SetHint("Double Tap To Type Search Text");
597 pEditElement->SetHint("Enter Search Text");
600 pEditElement->SetTrait("SearchBar");
601 pEditElement->SetName("SearchField");
603 return __pSearchBarPresenter->SetMode(mode);
607 _SearchBar::SetModeLocked(bool modeLocked)
609 if (modeLocked == true && GetMode() == SEARCH_BAR_MODE_NORMAL)
611 __pEdit->SetViewModeEnabled(true);
614 if (modeLocked == false && __pEdit->IsViewModeEnabled())
616 __pEdit->SetViewModeEnabled(false);
619 return __pSearchBarPresenter->SetModeLocked(modeLocked);
623 _SearchBar::GetButtonActionId(void) const
625 Variant actionId = GetProperty("buttonActionId");
627 return actionId.ToInt();
631 _SearchBar::GetButtonColor(SearchBarButtonStatus status) const
637 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
638 buttonColor = GetProperty("buttonNormalColor");
640 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
641 buttonColor = GetProperty("buttonPressedColor");
643 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
644 buttonColor = GetProperty("buttonHighlightedColor");
646 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
647 buttonColor = GetProperty("buttonDisabledColor");
653 return buttonColor.ToColor();
657 _SearchBar::GetButtonTextColor(SearchBarButtonStatus status) const
659 Variant buttonTextColor;
663 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
664 buttonTextColor = GetProperty("buttonNormalTextColor");
666 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
667 buttonTextColor = GetProperty("buttonPressedTextColor");
669 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
670 buttonTextColor = GetProperty("buttonHighlightedTextColor");
672 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
673 buttonTextColor = GetProperty("buttonDisabledTextColor");
679 return buttonTextColor.ToColor();
682 SearchBarButtonStatus
683 _SearchBar::GetButtonStatus(void) const
685 SysTryReturn(NID_UI_CTRL, __pCancelButton, SEARCH_BAR_BUTTON_STATUS_NORMAL, E_SYSTEM,
686 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
688 SearchBarButtonStatus buttonStatus = SEARCH_BAR_BUTTON_STATUS_NORMAL;
690 if (__isButtonEnabled == false)
692 buttonStatus = SEARCH_BAR_BUTTON_STATUS_DISABLED;
699 _SearchBar::SetButtonText(const String& text)
701 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
702 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
704 result r = E_SUCCESS;
706 r = __pCancelButton->SetText(text);
707 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
708 "[E_SYSTEM] A system error has occurred. Failed to set text.");
710 __isButtonTextChangedByApp = true;
716 _SearchBar::SetButtonActionId(int actionId)
718 return SetProperty("buttonActionId", Variant(actionId));
722 _SearchBar::SetButtonEnabled(bool enabled)
724 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
725 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
727 __pCancelButton->SetEnableState(enabled);
729 __isButtonEnabled = enabled;
735 _SearchBar::SetButtonColor(SearchBarButtonStatus status, const Color& color)
737 result r = E_SUCCESS;
741 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
742 r = SetProperty("buttonNormalColor", Variant(color));
744 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
745 r = SetProperty("buttonPressedColor", Variant(color));
747 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
748 r = SetProperty("buttonHighlightedColor", Variant(color));
750 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
751 r = SetProperty("buttonDisabledColor", Variant(color));
761 _SearchBar::SetButtonTextColor(SearchBarButtonStatus status, const Color& color)
763 result r = E_SUCCESS;
767 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
768 r = SetProperty("buttonNormalTextColor", Variant(color));
770 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
771 r = SetProperty("buttonPressedTextColor", Variant(color));
773 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
774 r = SetProperty("buttonHighlightedTextColor", Variant(color));
776 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
777 r = SetProperty("buttonDisabledTextColor", Variant(color));
787 _SearchBar::AppendCharacter(const Character& character)
789 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
790 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
791 SysTryReturn(NID_UI_CTRL, character.CompareTo(null), E_SYSTEM, E_SYSTEM,
792 "[E_SYSTEM] A system error has occurred. The character is null.");
794 result r = E_SUCCESS;
796 r = __pEdit->AppendCharacter(character);
797 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
798 "[E_SYSTEM] A system error has occurred. Failed to set character.");
804 _SearchBar::AppendText(const String& text)
806 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
807 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
808 SysTryReturn(NID_UI_CTRL, text.IsEmpty() == false, E_SYSTEM, E_SYSTEM,
809 "[E_SYSTEM] A system error has occurred. The text is empty.");
811 result r = E_SUCCESS;
813 r = __pEdit->AppendText(text);
814 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
815 "[E_SYSTEM] A system error has occurred. Failed to set text.");
821 _SearchBar::SetText(const String& text)
823 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
824 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
826 result r = E_SUCCESS;
828 int limitLength = __pEdit->GetTextLimitLength();
829 int textLength = text.GetLength();
830 SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_SYSTEM, E_SYSTEM,
831 "[E_SYSTEM] A system error has occurred. textLength exceeds the limitLength");
833 r = __pEdit->SetText(text);
834 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
835 "[E_SYSTEM] A system error has occurred. Failed to set text.");
841 _SearchBar::InsertCharacterAt(int index, const Character& character)
843 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
844 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
845 SysTryReturn(NID_UI_CTRL, index > -1, E_OUT_OF_RANGE, E_OUT_OF_RANGE,
846 "[E_OUT_OF_RANGE] index(%d) is out of range.", index);
847 SysTryReturn(NID_UI_CTRL, character.CompareTo(null), E_SYSTEM, E_SYSTEM,
848 "[E_SYSTEM] A system error has occurred. The character is null.");
850 result r = E_SUCCESS;
854 limitLength = __pEdit->GetTextLimitLength();
855 textLength = __pEdit->GetTextLength() + 1;
857 SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED,
858 "[E_MAX_EXCEEDED] limitLength(%d) exceeds the maximum limit textLength(%d).", limitLength, textLength);
860 SysTryReturn(NID_UI_CTRL, index <= __pEdit->GetTextLength(), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
861 "[E_OUT_OF_RANGE] index(%d) is out of range of current textLength(%d).", index, __pEdit->GetTextLength());
863 r = __pEdit->InsertCharacterAt(index, character);
864 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
865 "[E_SYSTEM] A system error has occurred. Failed to set text.");
871 _SearchBar::InsertTextAt(int index, const String& text)
873 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
874 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
875 SysTryReturn(NID_UI_CTRL, index > -1, E_OUT_OF_RANGE, E_OUT_OF_RANGE,
876 "[E_OUT_OF_RANGE] index(%d) is out of range.", index);
878 result r = E_SUCCESS;
882 limitLength = __pEdit->GetTextLimitLength();
883 textLength = __pEdit->GetTextLength() + text.GetLength();
885 SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED,
886 "[E_MAX_EXCEEDED] limitLength(%d) exceeds the maximum limit textLength(%d).", limitLength, textLength);
887 SysTryReturn(NID_UI_CTRL, index <= __pEdit->GetTextLength(), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
888 "[E_OUT_OF_RANGE] index(%d) is out of range of current textLength(%d).", index, __pEdit->GetTextLength());
890 r = __pEdit->InsertTextAt(index, text);
891 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
892 "[E_SYSTEM] A system error has occurred. Failed to insert text.");
898 _SearchBar::DeleteCharacterAt(int index)
900 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
901 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
902 SysTryReturn(NID_UI_CTRL, index > -1, E_INVALID_ARG, E_INVALID_ARG,
903 "[E_INVALID_ARG] Invalid argument(s) is used. index = %d", index);
905 result r = E_SUCCESS;
907 textLength = __pEdit->GetTextLength();
909 SysTryReturn(NID_UI_CTRL, textLength > index, E_OUT_OF_RANGE, E_OUT_OF_RANGE,
910 "[E_OUT_OF_RANGE] index(%d) is out of range. textLength(%d)", index, textLength);
912 r = __pEdit->DeleteCharacterAt(index);
913 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM,
914 "[E_SYSTEM] A system error has occured. Failed to delete character.");
920 _SearchBar::Clear(void)
922 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
923 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
925 return __pEdit->ClearText();
929 _SearchBar::GetTextLength(void) const
931 SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM,
932 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
934 return __pEdit->GetTextLength();
938 _SearchBar::GetText(void) const
940 SysTryReturn(NID_UI_CTRL, __pEdit, String(), E_SYSTEM,
941 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
943 return __pEdit->GetText();
947 _SearchBar::GetText(int start, int end) const
949 SysTryReturn(NID_UI_CTRL, __pEdit, String(), E_SYSTEM,
950 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
952 return __pEdit->GetText(start, end);
956 _SearchBar::GetLimitLength(void) const
958 SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM,
959 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
961 return __pEdit->GetTextLimitLength();
965 _SearchBar::SetLimitLength(int limitLength)
967 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
968 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
969 SysTryReturn(NID_UI_CTRL, limitLength > 0, E_INVALID_ARG, E_INVALID_ARG,
970 "[E_INVALID_ARG] Invalid argument(s) is used.limitLength = %d", limitLength);
972 String tempString = GetText();
974 int textLength = tempString.GetLength();
975 SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_INVALID_ARG, E_INVALID_ARG,
976 "[E_INVALID_ARG] Invalid argument(s) is used. limitLength = %d, textLength = %d", limitLength, textLength);
978 result r = __pEdit->SetLimitLength(limitLength);
979 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
981 r = SetText(tempString);
982 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, r, "[%s] Propagating.", GetErrorMessage(r));
988 _SearchBar::ShowKeypad(void) const
990 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
991 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
993 SearchBarMode mode = __pSearchBarPresenter->GetMode();
994 SysTryReturn(NID_UI_CTRL, mode == SEARCH_BAR_MODE_INPUT, E_INVALID_STATE, E_INVALID_STATE,
995 "[E_INVALID_STATE] The SearchBar is currently in Normal mode.");
996 return __pEdit->ShowKeypad();
1000 _SearchBar::HideKeypad(void)
1002 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1003 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1005 SearchBarMode mode = __pSearchBarPresenter->GetMode();
1006 SysTryReturn(NID_UI_CTRL, mode == SEARCH_BAR_MODE_INPUT, E_SYSTEM, E_SYSTEM,
1007 "[E_SYSTEM] A system error has occurred. The SearchBar is currently in Normal mode.");
1009 result r = __pEdit->HideKeypad();
1017 _SearchBar::GetSearchFieldTextSizeF(void) const
1019 SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM,
1020 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1022 return __pEdit->GetTextSizeF();
1026 _SearchBar::SetSearchFieldTextSize(float size)
1028 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1029 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1031 return __pEdit->SetTextSize(size);
1035 _SearchBar::GetBlockRange(int& start, int& end) const
1037 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1038 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1040 int startIndex = -1;
1043 __pEdit->GetBlockRange(startIndex, endIndex);
1044 SysTryReturn(NID_UI_CTRL, (startIndex > -1 && endIndex > 0), E_SYSTEM, E_SYSTEM,
1045 "[E_SYSTEM] A system error has occurred. Failed to get text block range.");
1054 _SearchBar::ReleaseBlock(void)
1056 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1057 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1059 result r = E_SUCCESS;
1064 r = GetBlockRange(start, end);
1065 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1067 return __pEdit->ReleaseTextBlock();
1071 _SearchBar::SetBlockRange(int start, int end)
1073 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1074 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1076 result r = E_SUCCESS;
1079 textLength = __pEdit->GetTextLength();
1081 SysTryReturn(NID_UI_CTRL, (start < end && start >= 0 && textLength >= end), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
1082 "[E_OUT_OF_RANGE] start (%d) and end (%d) is out of range.", start, end - 1);
1084 r = SetCursorPosition(start);
1085 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1087 r = __pEdit->BeginTextBlock();
1088 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
1089 "[E_SYSTEM] A system error has occurred. Failed to set text block range.");
1091 r = SetCursorPosition(end);
1092 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
1093 "[E_SYSTEM] A system error has occurred. Failed to set cursor position.");
1099 _SearchBar::RemoveTextBlock(void)
1101 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1102 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1104 result r = E_SUCCESS;
1106 r = __pEdit->RemoveTextBlock();
1107 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1113 _SearchBar::GetColor(void) const
1115 Variant backgroundColor = GetProperty("color");
1117 return backgroundColor.ToColor();
1121 _SearchBar::GetSearchFieldColor(SearchFieldStatus status) const
1123 Variant searchFieldColor;
1127 case SEARCH_FIELD_STATUS_NORMAL:
1128 searchFieldColor = GetProperty("searchFieldNormalColor");
1130 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
1131 searchFieldColor = GetProperty("searchFieldHighlightedColor");
1133 case SEARCH_FIELD_STATUS_DISABLED:
1134 searchFieldColor = GetProperty("searchFieldDisabledColor");
1140 return searchFieldColor.ToColor();
1145 _SearchBar::GetSearchFieldTextColor(SearchFieldStatus status) const
1147 Variant searchFieldTextColor;
1151 case SEARCH_FIELD_STATUS_NORMAL:
1152 searchFieldTextColor = GetProperty("searchFieldNormalTextColor");
1154 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
1155 searchFieldTextColor = GetProperty("searchFieldHighlightedTextColor");
1157 case SEARCH_FIELD_STATUS_DISABLED:
1158 searchFieldTextColor = GetProperty("searchFieldDisabledTextColor");
1164 return searchFieldTextColor.ToColor();
1169 _SearchBar::SetBackgroundBitmap(const Bitmap& bitmap)
1171 Bitmap* pNewBitmap = _BitmapImpl::CloneN(bitmap);
1172 SysTryReturn(NID_UI_CTRL, pNewBitmap, E_SYSTEM, E_SYSTEM,
1173 "[E_SYSTEM] A system error has occurred. The creation of bitmap failed.");
1175 delete __pBackgroundBitmap;
1176 __pBackgroundBitmap = null;
1178 __pBackgroundBitmap = pNewBitmap;
1184 _SearchBar::GetBackgroundBitmap(void) const
1186 return __pBackgroundBitmap;
1190 _SearchBar::SetColor(const Color& color)
1192 return SetProperty("color", Variant(color));
1196 _SearchBar::SetSearchFieldColor(SearchFieldStatus status, const Color& color)
1198 result r = E_SUCCESS;
1202 case SEARCH_FIELD_STATUS_NORMAL:
1203 r = SetProperty("searchFieldNormalColor", Variant(color));
1205 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
1206 r = SetProperty("searchFieldHighlightedColor", Variant(color));
1208 case SEARCH_FIELD_STATUS_DISABLED:
1209 r = SetProperty("searchFieldDisabledColor", Variant(color));
1220 _SearchBar::SetSearchFieldTextColor(SearchFieldStatus status, const Color& color)
1222 result r = E_SUCCESS;
1226 case SEARCH_FIELD_STATUS_NORMAL:
1227 r = SetProperty("searchFieldNormalTextColor", Variant(color));
1229 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
1230 r = SetProperty("searchFieldHighlightedTextColor", Variant(color));
1232 case SEARCH_FIELD_STATUS_DISABLED:
1233 r = SetProperty("searchFieldDisabledTextColor", Variant(color));
1244 _SearchBar::GetGuideText(void) const
1246 SysTryReturn(NID_UI_CTRL, __pEdit, String(), E_SYSTEM,
1247 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1249 return __pEdit->GetGuideText();
1253 _SearchBar::SetGuideText(const String& guideText)
1255 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1256 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1258 __pEdit->SetGuideText(guideText);
1264 _SearchBar::GetGuideTextColor(void) const
1266 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1267 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1269 return __pEdit->GetGuideTextColor();
1273 _SearchBar::SetGuideTextColor(const Color& color)
1275 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1276 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1278 __isUserGuideTextColor = true;
1279 return __pEdit->SetGuideTextColor(color);
1283 _SearchBar::GetCursorPosition(void) const
1285 SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM,
1286 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1288 return __pEdit->GetCursorPosition();
1292 _SearchBar::SetCursorPosition(int index)
1294 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1295 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1296 SysTryReturn(NID_UI_CTRL, index > -1, E_OUT_OF_RANGE, E_OUT_OF_RANGE,
1297 "[E_OUT_OF_RANGE] index(%d) is out of range.", GetErrorMessage(E_OUT_OF_RANGE), index);
1299 int textLength = -1;
1300 textLength = __pEdit->GetTextLength();
1302 SysTryReturn(NID_UI_CTRL, (index > -1 && index <= textLength), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
1303 "[E_OUT_OF_RANGE] index(%d) is out of range.", index);
1305 return __pEdit->SetCursorPosition(index);
1309 _SearchBar::IsLowerCaseModeEnabled(void) const
1311 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1312 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1314 return __pEdit->IsLowerCaseModeEnabled();
1318 _SearchBar::SetLowerCaseModeEnabled(bool enable)
1320 SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM,
1321 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1323 __pEdit->SetLowerCaseModeEnabled(enable);
1327 _SearchBar::GetEllipsisPosition(void) const
1329 SysTryReturn(NID_UI_CTRL, __pEdit, ELLIPSIS_POSITION_START, E_SYSTEM,
1330 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1332 return __pEdit->GetEllipsisPosition();
1336 _SearchBar::SetEllipsisPosition(EllipsisPosition position)
1338 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1339 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1340 __pEdit->SetEllipsisPosition(position);
1346 _SearchBar::GetKeypadAction(void) const
1348 return __keypadAction;
1352 _SearchBar::IsTextPredictionEnabled(void) const
1354 SysTryReturn(NID_UI_CTRL, __pEdit, false, E_SYSTEM,
1355 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1356 return __pEdit->IsTextPredictionEnabled();
1360 _SearchBar::SetTextPredictionEnabled(bool enable)
1362 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1363 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1364 return __pEdit->SetTextPredictionEnabled(enable);
1368 _SearchBar::SetCurrentLanguage(LanguageCode languageCode)
1370 return __pEdit->SetCurrentLanguage(languageCode);
1374 _SearchBar::GetCurrentLanguage(LanguageCode& language) const
1376 return __pEdit->GetCurrentLanguage(language);
1380 _SearchBar::AddActionEventListener(const _IActionEventListener& listener)
1382 result r = E_SUCCESS;
1384 if (__pActionEvent == null)
1386 __pActionEvent = _ActionEvent::CreateInstanceN(*this);
1387 r = GetLastResult();
1388 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1390 __pActionEvent->AddListener(listener);
1397 _SearchBar::RemoveActionEventListener(const _IActionEventListener& listener)
1399 SysTryReturn(NID_UI_CTRL, __pActionEvent, E_SYSTEM, E_SYSTEM,
1400 "[E_SYSTEM] A system error has occurred. The action event instance is null.");
1401 result r = E_SUCCESS;
1403 r = __pActionEvent->RemoveListener(listener);
1404 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1410 _SearchBar::AddKeypadEventListener(const _IKeypadEventListener& listener)
1412 result r = E_SUCCESS;
1414 if (__pKeypadEvent == null)
1416 __pKeypadEvent = _KeypadEvent::CreateInstanceN(*this);
1417 r = GetLastResult();
1418 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1420 r = __pKeypadEvent->AddListener(listener);
1421 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1428 _SearchBar::RemoveKeypadEventListener(const _IKeypadEventListener& listener)
1430 SysTryReturn(NID_UI_CTRL, __pKeypadEvent, E_SYSTEM, E_SYSTEM,
1431 "[E_SYSTEM] A system error has occurred. The keypad event instance is null.");
1432 result r = E_SUCCESS;
1434 r = __pKeypadEvent->RemoveListener(listener);
1435 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1441 _SearchBar::AddTextBlockEventListener(const _ITextBlockEventListener& listener)
1443 result r = E_SUCCESS;
1445 if (__pTextBlockEvent == null)
1447 __pTextBlockEvent = _TextBlockEvent::CreateInstanceN(*this);
1448 r = GetLastResult();
1449 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1451 r = __pTextBlockEvent->AddListener(listener);
1452 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1460 _SearchBar::RemoveTextBlockEventListener(const _ITextBlockEventListener& listener)
1462 SysTryReturn(NID_UI_CTRL, __pTextBlockEvent, E_SYSTEM, E_SYSTEM,
1463 "[E_SYSTEM] A system error has occurred. The text block event instance is null.");
1464 result r = E_SUCCESS;
1466 r = __pTextBlockEvent->RemoveListener(listener);
1467 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1474 _SearchBar::AddTextEventListener(const _ITextEventListener& listener)
1476 result r = E_SUCCESS;
1478 if (__pTextEvent == null)
1480 __pTextEvent = _TextEvent::CreateInstanceN(*this);
1481 r = GetLastResult();
1482 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1484 r = __pTextEvent->AddListener(listener);
1485 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1492 _SearchBar::RemoveTextEventListener(const _ITextEventListener& listener)
1494 SysTryReturn(NID_UI_CTRL, __pTextEvent, E_SYSTEM, E_SYSTEM,
1495 "[E_SYSTEM] A system error has occurred. The text event instance is null.");
1496 result r = E_SUCCESS;
1498 r = __pTextEvent->RemoveListener(listener);
1499 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1505 _SearchBar::AddSearchBarEventListener(const _ISearchBarEventListener& listener)
1507 result r = E_SUCCESS;
1509 if (__pSearchBarEvent == null)
1511 __pSearchBarEvent = _SearchBarEvent::CreateInstanceN(*this);
1512 r = GetLastResult();
1513 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1515 r = __pSearchBarEvent->AddListener(listener);
1516 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1523 _SearchBar::RemoveSearchBarEventListener(const _ISearchBarEventListener& listener)
1525 SysTryReturn(NID_UI_CTRL, __pSearchBarEvent, E_SYSTEM, E_SYSTEM,
1526 "[E_SYSTEM] A system error has occurred. The searchbar event instance is null.");
1527 result r = E_SUCCESS;
1529 r = __pSearchBarEvent->RemoveListener(listener);
1530 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1536 _SearchBar::AddLanguageEventListener(const _ILanguageEventListener& listener)
1538 result r = E_SUCCESS;
1540 if (__pLanguageEvent == null)
1542 __pLanguageEvent = _LanguageEvent::CreateInstanceN(*this);
1543 r = GetLastResult();
1544 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1546 r = __pLanguageEvent->AddListener(listener);
1547 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1554 _SearchBar::RemoveLanguageEventListener(const _ILanguageEventListener& listener)
1556 SysTryReturn(NID_UI_CTRL, __pLanguageEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1557 result r = E_SUCCESS;
1559 __pLanguageEvent->RemoveListener(listener);
1560 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1566 _SearchBar::OnBoundsChanged(void)
1568 if (__pSearchBarPresenter != null)
1570 __isupdateContentBounds = true;
1571 __pSearchBarPresenter->OnBoundsChanged();
1574 if (__pAccessibilitySearchBarElement)
1576 __pAccessibilitySearchBarElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
1582 _SearchBar::OnChangeLayout(_ControlOrientation orientation)
1584 __isupdateContentBounds = true;
1589 _SearchBar::OnDraw(void)
1591 if (!__isUserGuideTextColor)
1593 SearchFieldStatus status = GetCurrentStatus();
1594 __pEdit->SetGuideTextColor(__guideTextColor[status]);
1597 if (__isupdateContentBounds)
1600 __isupdateContentBounds = false;
1602 __pSearchBarPresenter->Draw();
1606 _UiTouchEventDelivery
1607 _SearchBar::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1609 _Edit* pEdit = dynamic_cast <_Edit*>(const_cast <_Control*>(&source));
1612 return _UI_TOUCH_EVENT_DELIVERY_YES;
1615 if (pEdit->IsClearIconPressed())
1617 return _UI_TOUCH_EVENT_DELIVERY_YES;
1620 SetContentAreaVisible(__contentVisibilitySetByApp); //When a touch happens on SearchField
1621 SetFocusCallbackParameter(true);
1622 SetMode(SEARCH_BAR_MODE_INPUT);
1624 return _UI_TOUCH_EVENT_DELIVERY_YES;
1628 _SearchBar::FireButtonActionEvent(const _Control &source, int actionId)
1630 if (__actionId == actionId)
1632 __isCancelActionInProgress = true;
1633 SetFocusCallbackParameter(true);
1634 SetMode(SEARCH_BAR_MODE_NORMAL);
1640 IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(__actionId);
1641 result r = GetLastResult();
1642 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1644 __pActionEvent->Fire(*pEventArg);
1646 __isCancelActionInProgress = false;
1651 _SearchBar::OnActionPerformed(const _Control& source, int actionId)
1653 FireButtonActionEvent(source, actionId);
1659 _SearchBar::OnKeypadWillOpen(void)
1661 if (!__isKeypadOpening)
1665 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_CREATED);
1666 result r = GetLastResult();
1667 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1669 __pKeypadEvent->Fire(*pEventArg);
1673 __isKeypadOpening = true;
1678 _SearchBar::OnKeypadOpened(void)
1682 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_OPEN);
1683 result r = GetLastResult();
1684 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1686 __pKeypadEvent->Fire(*pEventArg);
1689 __isKeypadOpening = false;
1695 _SearchBar::OnKeypadClosed(void)
1699 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_CLOSE);
1700 result r = GetLastResult();
1701 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1703 __pKeypadEvent->Fire(*pEventArg);
1706 __isKeypadOpening = false;
1713 _SearchBar::OnKeypadBoundsChanged(void)
1717 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
1718 result r = GetLastResult();
1719 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1721 __pKeypadEvent->Fire(*pEventArg);
1729 _SearchBar::OnKeypadActionPerformed(CoreKeypadAction keypadAction)
1733 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(keypadAction, CORE_KEYPAD_EVENT_STATUS_ENTERACTION);
1734 result r = GetLastResult();
1735 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1737 __pKeypadEvent->Fire(*pEventArg);
1742 // TextBlock callbacks
1744 _SearchBar::OnTextBlockSelected(_Control& source, int start, int end)
1746 if (__pTextBlockEvent)
1748 IEventArg* pEventArg = _TextBlockEvent::CreateTextBlockEventArgN(start, end);
1749 result r = GetLastResult();
1750 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1752 __pTextBlockEvent->Fire(*pEventArg);
1759 _SearchBar::OnTextValueChanged(const _Control& source)
1761 if (GetTextLength())
1763 SetContentAreaVisible(__contentVisibilitySetByApp);
1766 if (!__isCancelActionInProgress)
1768 SetContentDimming();
1769 if (__pTextEvent != null)
1771 IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(CORE_TEXT_EVENT_CHANGED);
1772 result r = GetLastResult();
1773 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1775 __pTextEvent->Fire(*pEventArg);
1782 _SearchBar::OnTextValueChangeCanceled(const _Control& source)
1784 if (__pTextEvent != null)
1786 IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(CORE_TEXT_EVENT_CANCELED);
1787 result r = GetLastResult();
1788 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1790 __pTextEvent->Fire(*pEventArg);
1796 _SearchBar::OnAttachedToMainTree(void)
1803 _SearchBar::OnFontChanged(Font* pFont)
1805 __pCancelButton->SetFont(pFont->GetFaceName());
1806 __pEdit->SetFont(*pFont);
1811 _SearchBar::OnFontInfoRequested(unsigned long& style, int& size)
1813 style = FONT_STYLE_PLAIN;
1814 size = __pCancelButton->GetTextSize();
1820 _SearchBar::OnFocusGained(const _Control& source)
1822 return _Control::OnFocusGained(source);
1826 _SearchBar::OnFocusLost(const _Control &source)
1828 return _Control::OnFocusLost(source);
1832 _SearchBar::OnDrawFocus(void)
1834 __isInFocusMode = true;
1835 __pEdit->SetSearchFieldFocus(true);
1836 _Control::OnDrawFocus();
1842 _SearchBar::OnFocusModeStateChanged(void)
1844 __isInFocusMode = false;
1846 if (__pEdit->IsFocused())
1848 __pEdit->SetSearchFieldFocus(false);
1849 __pEdit->Invalidate();
1852 if (__pCancelButton->IsFocused())
1854 __pCancelButton->OnFocusModeStateChanged();
1861 _SearchBar::IsChildControlFocusManage(void) const
1867 _SearchBar::OnPreviewKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
1869 if (!__pEdit->IsUsbKeyboardConnected())
1874 _KeyCode keyCode = keyInfo.GetKeyCode();
1881 SetFocusCallbackParameter(true);
1882 if ((__pContentControl && __pContentControl->IsVisible() == false) || !__pContentControl)
1884 SetContentAreaVisible(false);
1895 _SearchBar::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
1897 if (!__pEdit->IsUsbKeyboardConnected())
1902 if (!__isInFocusMode)
1907 _KeyCode keyCode = keyInfo.GetKeyCode();
1912 if (&source == this)
1914 SetContentAreaVisible(__contentVisibilitySetByApp);
1915 SetFocusCallbackParameter(true);
1916 SetMode(SEARCH_BAR_MODE_INPUT);
1917 __pEdit->SetFocused();
1920 SetFocusCallbackParameter(false);
1922 if (&source == __pEdit)
1924 if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->IsVisible() && __pContentControl->GetEnableState())
1926 __pContentControl->SetFocused();
1927 __pContentControl->OnDrawFocus();
1931 else if (__isButtonEnabled && __isUsableCancelButton)
1933 __pCancelButton->SetFocused();
1939 if (&source == __pCancelButton && __pContentControl && __pContentControl->IsVisible() && __pContentControl->GetEnableState())
1941 __pContentControl->SetFocused();
1942 __pContentControl->OnDrawFocus();
1950 if (&source == __pCancelButton)
1952 __pEdit->SetFocused();
1956 if (&source == __pContentControl)
1958 if ((__isButtonEnabled && __isUsableCancelButton))
1960 __pCancelButton->SetFocused();
1964 __pEdit->SetFocused();
1972 if (&source == __pCancelButton)
1974 FireButtonActionEvent(source, __actionId);
1975 _Control::OnDrawFocus();
1990 _SearchBar::OnSettingChanged(Tizen::Base::String& key)
1992 if (__isButtonTextChangedByApp || !__isUsableCancelButton)
1997 if (key.Equals(L"http://tizen.org/setting/locale.language", false))
2000 GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_CANCEL_ABB, cancelText);
2001 __pCancelButton->SetText(cancelText);
2002 __pCancelButton->Invalidate();
2009 _SearchBar::OnCanvasRequestedN(const FloatRectangle& bounds)
2011 return __pSearchBarPresenter->OnCanvasRequestedN(bounds);
2015 _SearchBar::GetParentForm(void) const
2017 _Form* pForm = null;
2018 _Control* pControlCore = GetParent();
2022 if (pControlCore == null)
2024 SysLog(NID_UI_CTRL,"[E_SYSTEM] The parent form is null.");
2029 pForm = dynamic_cast <_Form*>(pControlCore);
2036 pControlCore = pControlCore->GetParent();
2039 return pControlCore;
2043 _SearchBar::GetSearchBarButton(void) const
2045 return __pCancelButton;
2049 _SearchBar::GetSearchField(void)
2055 _SearchBar::GetSearchBarContainer(void) const
2057 return __pContainer;
2061 _SearchBar::GetClippedGroupControl(void) const
2063 return __pClippedGroupControl;
2067 _SearchBar::IsUsableCancelButton(void) const
2069 return __isUsableCancelButton;
2073 _SearchBar::ConvertSearchBarStatus(SearchFieldStatus status)
2075 EditStatus editStatus = EDIT_STATUS_NORMAL;
2078 case SEARCH_FIELD_STATUS_NORMAL:
2079 editStatus = EDIT_STATUS_NORMAL;
2082 case SEARCH_FIELD_STATUS_DISABLED:
2083 editStatus = EDIT_STATUS_DISABLED;
2086 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
2087 editStatus = EDIT_STATUS_HIGHLIGHTED;
2097 _SearchBar::ConvertSearchBarButtonStatus(SearchBarButtonStatus status)
2099 _ButtonStatus buttonStatus = _BUTTON_STATUS_NORMAL;
2103 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
2104 buttonStatus = _BUTTON_STATUS_NORMAL;
2107 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
2108 buttonStatus = _BUTTON_STATUS_PRESSED;
2111 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
2112 buttonStatus = _BUTTON_STATUS_HIGHLIGHTED;
2115 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
2116 buttonStatus = _BUTTON_STATUS_DISABLED;
2122 return buttonStatus;
2126 _SearchBar::SendSearchBarEvent(_SearchBarEventStatus status)
2128 result r = E_SUCCESS;
2129 if (__pSearchBarEvent)
2131 IEventArg* pEventArg = _SearchBarEvent::CreateSearchBarEventArgN(status);
2132 r = GetLastResult();
2133 SysTryReturn(NID_UI_CTRL, pEventArg, r, r, "[%s] Propagating.", GetErrorMessage(r));
2135 if (IsContentAreaVisible() == false)
2137 SetContentAreaVisible(false);
2140 __pSearchBarEvent->Fire(*pEventArg);
2147 _SearchBar::SetHeaderVisibleState(bool visible)
2149 if (__pSearchBarPresenter != null)
2151 __pSearchBarPresenter->SetHeaderVisibleState(visible);
2157 _SearchBar::SetPropertyButtonActionId(const Variant& actionId)
2159 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2160 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2161 SysTryReturn(NID_UI_CTRL, actionId.ToInt() > -1, E_INVALID_ARG, E_INVALID_ARG,
2162 "[E_INVALID_ARG] Invalid argument(s) is used. actionId.ToInt() = %d", actionId.ToInt());
2164 result r = E_SUCCESS;
2166 r = __pCancelButton->SetPropertyActionId(actionId);
2167 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2168 "[%s] A system error has occurred. Failed to set actionId.", GetErrorMessage(E_SYSTEM));
2170 __actionId = actionId.ToInt();
2176 _SearchBar::GetPropertyButtonActionId(void) const
2178 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(-1), E_SYSTEM,
2179 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2181 return Variant(__actionId);
2185 _SearchBar::SetPropertyButtonDisabledColor(const Variant& color)
2187 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2188 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2190 result r = E_SUCCESS;
2192 r = __pCancelButton->SetPropertyDisabledColor(color);
2193 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2194 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2196 __buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED] = color.ToColor();
2202 _SearchBar::GetPropertyButtonDisabledColor(void) const
2204 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2205 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2207 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
2211 _SearchBar::SetPropertyButtonHighlightedColor(const Variant& color)
2213 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2214 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2216 result r = E_SUCCESS;
2218 r = __pCancelButton->SetPropertyHighlightedColor(color);
2219 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2220 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2222 __buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED] = color.ToColor();
2228 _SearchBar::GetPropertyButtonHighlightedColor(void) const
2230 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2231 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2233 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
2237 _SearchBar::SetPropertyButtonNormalColor(const Variant& color)
2239 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2240 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2242 result r = E_SUCCESS;
2244 r = __pCancelButton->SetPropertyNormalColor(color);
2245 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2246 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2248 __buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL] = color.ToColor();
2254 _SearchBar::GetPropertyButtonNormalColor(void) const
2256 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2257 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2259 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
2263 _SearchBar::SetPropertyButtonPressedColor(const Variant& color)
2265 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2266 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2268 result r = E_SUCCESS;
2270 r = __pCancelButton->SetPropertyPressedColor(color);
2271 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2272 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2274 __buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED] = color.ToColor();
2280 _SearchBar::GetPropertyButtonPressedColor(void) const
2282 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2283 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2285 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
2289 _SearchBar::SetPropertyButtonDisabledTextColor(const Variant& textColor)
2291 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2292 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2294 result r = E_SUCCESS;
2296 r = __pCancelButton->SetPropertyDisabledTextColor(textColor);
2297 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2298 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2300 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_DISABLED] = textColor.ToColor();
2306 _SearchBar::GetPropertyButtonDisabledTextColor(void) const
2308 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2309 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2311 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
2315 _SearchBar::SetPropertyButtonHighlightedTextColor(const Variant& textColor)
2317 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2318 "[E_SYSTEM]] A system error has occurred. The cancel button instance is null.");
2320 result r = E_SUCCESS;
2322 r = __pCancelButton->SetPropertyHighlightedTextColor(textColor);
2323 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2324 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2326 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED] = textColor.ToColor();
2332 _SearchBar::GetPropertyButtonHighlightedTextColor(void) const
2334 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2335 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2337 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
2341 _SearchBar::SetPropertyButtonNormalTextColor(const Variant& textColor)
2343 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2344 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2346 result r = E_SUCCESS;
2348 r = __pCancelButton->SetPropertyNormalTextColor(textColor);
2349 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2350 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2352 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL] = textColor.ToColor();
2358 _SearchBar::GetPropertyButtonNormalTextColor(void) const
2360 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2361 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2363 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
2367 _SearchBar::SetPropertyButtonPressedTextColor(const Variant& textColor)
2369 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2370 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2372 result r = E_SUCCESS;
2374 r = __pCancelButton->SetPropertyPressedTextColor(textColor);
2375 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2376 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2378 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED] = textColor.ToColor();
2384 _SearchBar::GetPropertyButtonPressedTextColor(void) const
2386 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2387 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2389 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
2393 _SearchBar::SetPropertySearchFieldDisabledColor(const Variant& color)
2395 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2396 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2398 result r = E_SUCCESS;
2400 r = __pEdit->SetPropertyDisabledColor(color);
2401 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2402 "[E_SYSTEM] A system error has occurred. Failed to set the edit disabled color.");
2404 __color[SEARCH_FIELD_STATUS_DISABLED] = color.ToColor();
2410 _SearchBar::GetPropertySearchFieldDisabledColor(void) const
2412 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2413 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2415 return Variant(__color[SEARCH_FIELD_STATUS_DISABLED]);
2419 _SearchBar::SetPropertySearchFieldHighlightedColor(const Variant& color)
2421 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2422 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2424 result r = E_SUCCESS;
2426 r = __pEdit->SetPropertyHighlightedColor(color);
2427 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2428 "[E_SYSTEM] A system error has occurred. Failed to set the edit highlighted color.");
2430 __color[SEARCH_FIELD_STATUS_HIGHLIGHTED] = color.ToColor();
2436 _SearchBar::GetPropertySearchFieldHighlightedColor(void) const
2438 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2439 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2441 return Variant(__color[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
2445 _SearchBar::SetPropertySearchFieldNormalColor(const Variant& color)
2447 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2448 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2450 result r = E_SUCCESS;
2452 r = __pEdit->SetPropertyNormalColor(color);
2453 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2454 "[E_SYSTEM] A system error has occurred. Failed to set edit normal color.");
2456 __color[SEARCH_FIELD_STATUS_NORMAL] = color.ToColor();
2462 _SearchBar::GetPropertySearchFieldNormalColor(void) const
2464 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2465 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2467 return Variant(__color[SEARCH_FIELD_STATUS_NORMAL]);
2471 _SearchBar::SetPropertySearchFieldDisabledTextColor(const Variant& textColor)
2473 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2474 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2476 result r = E_SUCCESS;
2478 r = __pEdit->SetPropertyDisabledTextColor(textColor);
2479 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2480 "[E_SYSTEM] A system error has occurred. Failed to set edit disabled text color.");
2482 __textColor[SEARCH_FIELD_STATUS_DISABLED] = textColor.ToColor();
2488 _SearchBar::GetPropertySearchFieldDisabledTextColor(void) const
2490 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2491 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2493 return Variant(__textColor[SEARCH_FIELD_STATUS_DISABLED]);
2497 _SearchBar::SetPropertySearchFieldHighlightedTextColor(const Variant& textColor)
2499 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2500 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2502 result r = E_SUCCESS;
2504 r = __pEdit->SetPropertyHighlightedTextColor(textColor);
2505 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2506 "[E_SYSTEM] A system error has occurred. Failed to set edit highlighted text color.");
2508 __textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED] = textColor.ToColor();
2514 _SearchBar::GetPropertySearchFieldHighlightedTextColor(void) const
2516 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2517 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2519 return Variant(__textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
2523 _SearchBar::SetPropertySearchFieldNormalTextColor(const Variant& textColor)
2525 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2526 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2528 result r = E_SUCCESS;
2530 r = __pEdit->SetPropertyNormalTextColor(textColor);
2531 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2532 "[E_SYSTEM] A system error has occurred. Failed to set edit normal text color.");
2534 __textColor[SEARCH_FIELD_STATUS_NORMAL] = textColor.ToColor();
2540 _SearchBar::GetPropertySearchFieldNormalTextColor(void) const
2542 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2543 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2545 return Variant(__textColor[SEARCH_FIELD_STATUS_NORMAL]);
2549 _SearchBar::SetPropertyColor(const Variant& color)
2551 __backgroundColor = color.ToColor();
2557 _SearchBar::GetPropertyColor(void) const
2559 return Variant(__backgroundColor);
2563 _SearchBar::SetPropertyContentAreaSize(const Variant& size)
2565 FloatDimension contentAreaSize = size.ToFloatDimension();
2566 SysTryReturn(NID_UI_CTRL, contentAreaSize.width >= 0 && contentAreaSize.height >= 0, E_INVALID_ARG, E_INVALID_ARG,
2567 "[E_INVALID_ARG] Invalid argument(s) is used. contentAreaSize.width = %f, contenAreaSize.height = %f",
2568 contentAreaSize.width, contentAreaSize.height);
2570 result r = E_SUCCESS;
2573 FloatRectangle bounds = GetBoundsF();
2574 FloatRectangle contentAreaBounds(0.0f, 0.0f, 0.0f, 0.0f);
2576 contentAreaBounds.x = 0.0f;
2577 contentAreaBounds.y = bounds.height;
2578 contentAreaBounds.width = contentAreaSize.width;
2579 contentAreaBounds.height = contentAreaSize.height;
2581 __contentAreaBounds = contentAreaBounds;
2582 __isUserContainerBounds = true;
2587 r = __pContainer->SetBounds(__contentAreaBounds);
2588 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
2595 _SearchBar::GetPropertyContentAreaSize(void) const
2597 FloatDimension contentAreaSize(__contentAreaBounds.width, __contentAreaBounds.height);
2599 return Variant(contentAreaSize);
2603 _SearchBar::CreateClippedGroupControl(void)
2605 result r = E_SUCCESS;
2606 FloatRectangle clippedGroupControlBounds(FloatPoint(0.0f, 0.0f), GetSizeF());
2607 __pClippedGroupControl = _Control::CreateControlN();
2608 r = GetLastResult();
2609 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
2611 r = AttachChild(*__pClippedGroupControl);
2612 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM,
2613 "[E_SYSTEM] A system error has occurred. Failed to attach the parent of clipped control.");
2615 r = __pClippedGroupControl->SetBounds(clippedGroupControlBounds);
2616 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
2618 __pClippedGroupControl->SetBackgroundColor(Color(0));
2620 __pClippedGroupControl->SetClipChildrenEnabled(true);
2625 delete __pClippedGroupControl;
2626 __pClippedGroupControl = null;
2632 _SearchBar::InitializeAccessibility(void)
2634 _AccessibilityContainer* pSBContainer = null;
2635 pSBContainer = GetAccessibilityContainer();
2637 _AccessibilityContainer* pEditContainer = null;
2638 pEditContainer = __pEdit->GetAccessibilityContainer();
2639 pSBContainer->AddChildContainer(*pEditContainer);
2641 _AccessibilityContainer* pButtonContainer = null;
2642 pButtonContainer = __pCancelButton->GetAccessibilityContainer();
2644 if (__isUsableCancelButton)
2646 pSBContainer->AddChildContainer(*pButtonContainer);
2649 _AccessibilityElement* pEditElement = __pEdit->GetTextAccessibilityElement();
2651 pEditElement->SetHint("Double Tap To Type Search Text");
2652 pEditElement->SetTrait("SearchBar");
2653 pEditElement->SetName("SearchField");
2655 pSBContainer->Activate(false);
2661 _SearchBar::SetContentDimming(void)
2663 if (__pContainer != NULL)
2665 if (!GetTextLength())
2667 __contentColor.SetAlpha(_SEARCH_CONTENT_DIM_OPACITY);
2671 __contentColor.SetAlpha(0);
2673 __pContainer->SetBackgroundColor(__contentColor);
2679 _SearchBar::IsContentAttachable(const _Control* pContent)
2681 const _Window* pWindow = dynamic_cast <const _Window*>(pContent);
2682 const _ColorPicker* pColorPicker = dynamic_cast <const _ColorPicker*>(pContent);
2683 const _Form* pForm = dynamic_cast <const _Form*>(pContent);
2684 const _Keypad* pKeypad = dynamic_cast <const _Keypad*>(pContent);
2685 const _OverlayPanel* pOverlayPanel = dynamic_cast <const _OverlayPanel*>(pContent);
2687 bool isContentAttachable = true;
2689 isContentAttachable = ((pWindow == null) && (pColorPicker == null) &&
2690 (pForm == null) && (pKeypad == null) && (pOverlayPanel == null));
2691 return isContentAttachable;
2695 _SearchBar::ResizeCancelButton(void)
2697 result r = E_SUCCESS;
2699 float horizontalMargin = 0.0f;
2700 float buttonLeftMargin = 0.0f;
2701 float buttonRightMargin = 0.0f;
2702 float buttonMinWidth = 0.0f;
2703 float searchFieldMinWidth = 0.0f;
2704 float buttonVerticalMargin = 0.0f;
2705 float searchBarMinHeight = 0.0f;
2706 float buttonWidth = 0.0f;
2707 float buttonHeight = 0.0f;
2709 FloatRectangle cancelButtonBounds;
2710 FloatRectangle searchBarBounds = GetBoundsF();
2712 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
2714 GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
2715 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_LEFT_MARGIN, orientation, buttonLeftMargin);
2716 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_RIGHT_MARGIN, orientation, buttonRightMargin);
2717 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
2718 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_HEIGHT, orientation, buttonHeight);
2719 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_MIN_WIDTH, orientation, buttonMinWidth);
2720 GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
2721 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin);
2722 GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
2724 cancelButtonBounds.width = buttonWidth;
2725 cancelButtonBounds.height = buttonHeight;
2727 float buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth +
2728 cancelButtonBounds.width + buttonLeftMargin + buttonRightMargin);
2730 if (searchBarBounds.width < buttonResizableSearchBarWidth)
2732 cancelButtonBounds.width = searchBarBounds.width -(searchFieldMinWidth + buttonLeftMargin
2733 + buttonRightMargin + horizontalMargin);
2736 cancelButtonBounds.x = searchBarBounds.width - cancelButtonBounds.width - buttonRightMargin;
2737 cancelButtonBounds.y = (searchBarBounds.height - cancelButtonBounds.height)/2.0f;
2739 cancelButtonBounds.y = cancelButtonBounds.y < 0.0f ? 0.0f:cancelButtonBounds.y;
2741 if (cancelButtonBounds.width < buttonMinWidth)
2743 cancelButtonBounds.width = buttonMinWidth;
2746 cancelButtonBounds.width = (cancelButtonBounds.width > 0.0f) ? cancelButtonBounds.width : 0.0f;
2747 cancelButtonBounds.height = (cancelButtonBounds.height > 0.0f) ? cancelButtonBounds.height : 0.0f;
2748 r = __pCancelButton->SetBounds(cancelButtonBounds);
2754 _SearchBar::RecalculateButtonBounds(void)
2756 result r = E_SUCCESS;
2758 float horizontalMargin = 0.0f;
2759 float verticalMargin = 0.0f;
2760 float buttonLeftMargin = 0.0f;
2761 float buttonRightMargin = 0.0f;
2762 float buttonMinWidth = 0.0f;
2763 float searchFieldMinWidth = 0.0f;
2764 float buttonVerticalMargin = 0.0f;
2765 float searchBarMinHeight = 0.0f;
2766 float buttonWidth = 0.0f;
2767 float buttonHeight = 0.0f;
2768 float cancelButtonWidth = 0.0f;
2770 FloatRectangle cancelButtonBounds;
2771 FloatRectangle editBounds;
2772 FloatRectangle searchBarBounds = GetBoundsF();
2774 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
2776 GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
2777 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, verticalMargin);
2778 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_LEFT_MARGIN, orientation, buttonLeftMargin);
2779 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_RIGHT_MARGIN, orientation, buttonRightMargin);
2780 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
2781 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_HEIGHT, orientation, buttonHeight);
2782 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_MIN_WIDTH, orientation, buttonMinWidth);
2783 GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
2784 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin);
2785 GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
2787 cancelButtonBounds.height = buttonHeight;
2789 float searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2.0f);
2790 cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
2791 editBounds.x = horizontalMargin;
2793 if (searchBarBounds.height < searchBarMinHeight)
2795 verticalMargin = (searchBarBounds.height - searchFieldMinHeight)/2.0f;
2796 if (verticalMargin < 0.0f)
2798 verticalMargin = 0.0f;
2802 editBounds.y = verticalMargin;
2803 editBounds.height = searchBarBounds.height - (editBounds.y * 2.0f);
2805 editBounds.height = (editBounds.height > searchFieldMinHeight) ? editBounds.height : searchFieldMinHeight;
2807 editBounds.width = searchBarBounds.width - cancelButtonWidth - horizontalMargin - buttonLeftMargin - buttonRightMargin;
2809 if (editBounds.width < searchFieldMinWidth)
2811 editBounds.width = searchFieldMinWidth;
2814 cancelButtonBounds.x = editBounds.width + horizontalMargin + buttonLeftMargin;
2815 cancelButtonBounds.y = (searchBarBounds.height - cancelButtonBounds.height)/2.0f;
2817 cancelButtonBounds.y = cancelButtonBounds.y < 0.0f ? 0.0f:cancelButtonBounds.y;
2819 float remainingWidth = searchBarBounds.width - editBounds.width - horizontalMargin - buttonLeftMargin - buttonRightMargin;
2821 if (remainingWidth < buttonMinWidth)
2823 cancelButtonBounds.width = buttonMinWidth;
2827 cancelButtonBounds.width = searchBarBounds.width - cancelButtonBounds.x - buttonRightMargin;
2830 cancelButtonBounds.width = (cancelButtonBounds.width > 0.0f) ? cancelButtonBounds.width : 0.0f;
2831 cancelButtonBounds.height = (cancelButtonBounds.height > 0.0f) ? cancelButtonBounds.height : 0.0f;
2833 r = __pCancelButton->SetBounds(cancelButtonBounds);
2834 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
2835 r = __pEdit->SetBounds(editBounds);
2836 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
2842 _SearchBar::GetCurrentStatus(void)
2844 SearchFieldStatus searchFieldStatus = SEARCH_FIELD_STATUS_NORMAL;
2848 if (__pEdit->IsFocused())
2850 searchFieldStatus = SEARCH_FIELD_STATUS_HIGHLIGHTED;
2855 searchFieldStatus = SEARCH_FIELD_STATUS_DISABLED;
2858 return searchFieldStatus;
2862 _SearchBar::SetEditTextFilter(IEditTextFilter* pFilter)
2864 SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM,
2865 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2867 __pEdit->SetEditTextFilter(pFilter);
2873 _SearchBar::SendOpaqueCommand(const String& command)
2875 SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM,
2876 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2878 __pEdit->SendOpaqueCommand(command);
2884 _SearchBar::SetFocusCallbackParameter(bool state)
2886 __isFocusCallbackToBeFired = state;
2891 _SearchBar::IsFocusCallbackToBeFired(void) const
2893 return __isFocusCallbackToBeFired;
2895 }}} // Tizen::Ui::Controls