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::OnActionPerformed(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;
1653 _SearchBar::OnKeypadWillOpen(void)
1655 if (!__isKeypadOpening)
1659 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_CREATED);
1660 result r = GetLastResult();
1661 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1663 __pKeypadEvent->Fire(*pEventArg);
1667 __isKeypadOpening = true;
1672 _SearchBar::OnKeypadOpened(void)
1676 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_OPEN);
1677 result r = GetLastResult();
1678 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1680 __pKeypadEvent->Fire(*pEventArg);
1683 __isKeypadOpening = false;
1689 _SearchBar::OnKeypadClosed(void)
1693 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_CLOSE);
1694 result r = GetLastResult();
1695 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1697 __pKeypadEvent->Fire(*pEventArg);
1700 __isKeypadOpening = false;
1707 _SearchBar::OnKeypadBoundsChanged(void)
1711 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
1712 result r = GetLastResult();
1713 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1715 __pKeypadEvent->Fire(*pEventArg);
1723 _SearchBar::OnKeypadActionPerformed(CoreKeypadAction keypadAction)
1727 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(keypadAction, CORE_KEYPAD_EVENT_STATUS_ENTERACTION);
1728 result r = GetLastResult();
1729 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1731 __pKeypadEvent->Fire(*pEventArg);
1736 // TextBlock callbacks
1738 _SearchBar::OnTextBlockSelected(_Control& source, int start, int end)
1740 if (__pTextBlockEvent)
1742 IEventArg* pEventArg = _TextBlockEvent::CreateTextBlockEventArgN(start, end);
1743 result r = GetLastResult();
1744 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1746 __pTextBlockEvent->Fire(*pEventArg);
1753 _SearchBar::OnTextValueChanged(const _Control& source)
1755 if (GetTextLength())
1757 SetContentAreaVisible(__contentVisibilitySetByApp);
1760 if (!__isCancelActionInProgress)
1762 SetContentDimming();
1763 if (__pTextEvent != null)
1765 IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(CORE_TEXT_EVENT_CHANGED);
1766 result r = GetLastResult();
1767 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1769 __pTextEvent->Fire(*pEventArg);
1776 _SearchBar::OnTextValueChangeCanceled(const _Control& source)
1778 if (__pTextEvent != null)
1780 IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(CORE_TEXT_EVENT_CANCELED);
1781 result r = GetLastResult();
1782 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1784 __pTextEvent->Fire(*pEventArg);
1790 _SearchBar::OnAttachedToMainTree(void)
1797 _SearchBar::OnFontChanged(Font* pFont)
1799 __pCancelButton->SetFont(pFont->GetFaceName());
1800 __pEdit->SetFont(*pFont);
1805 _SearchBar::OnFontInfoRequested(unsigned long& style, int& size)
1807 style = FONT_STYLE_PLAIN;
1808 size = __pCancelButton->GetTextSize();
1814 _SearchBar::OnFocusGained(const _Control& source)
1816 return _Control::OnFocusGained(source);
1820 _SearchBar::OnFocusLost(const _Control &source)
1822 return _Control::OnFocusLost(source);
1826 _SearchBar::OnDrawFocus(void)
1828 __isInFocusMode = true;
1829 __pEdit->SetSearchFieldFocus(true);
1830 _Control::OnDrawFocus();
1836 _SearchBar::OnFocusModeStateChanged(void)
1838 __isInFocusMode = false;
1840 if (__pEdit->IsFocused())
1842 __pEdit->SetSearchFieldFocus(false);
1843 __pEdit->Invalidate();
1846 if (__pCancelButton->IsFocused())
1848 __pCancelButton->OnFocusModeStateChanged();
1855 _SearchBar::IsChildControlFocusManage(void) const
1861 _SearchBar::OnPreviewKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
1863 if (!__pEdit->IsUsbKeyboardConnected())
1868 _KeyCode keyCode = keyInfo.GetKeyCode();
1875 SetFocusCallbackParameter(true);
1876 if ((__pContentControl && __pContentControl->IsVisible() == false) || !__pContentControl)
1878 SetContentAreaVisible(false);
1889 _SearchBar::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
1891 if (!__pEdit->IsUsbKeyboardConnected())
1896 if (!__isInFocusMode)
1901 _KeyCode keyCode = keyInfo.GetKeyCode();
1906 if (&source == this)
1908 SetContentAreaVisible(__contentVisibilitySetByApp);
1909 SetFocusCallbackParameter(true);
1910 SetMode(SEARCH_BAR_MODE_INPUT);
1911 __pEdit->SetFocused();
1914 SetFocusCallbackParameter(false);
1916 if (&source == __pEdit)
1918 if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->IsVisible() && __pContentControl->GetEnableState())
1920 __pContentControl->SetFocused();
1921 __pContentControl->OnDrawFocus();
1925 else if (__isButtonEnabled && __isUsableCancelButton)
1927 __pCancelButton->SetFocused();
1933 if (&source == __pCancelButton && __pContentControl && __pContentControl->IsVisible() && __pContentControl->GetEnableState())
1935 __pContentControl->SetFocused();
1936 __pContentControl->OnDrawFocus();
1944 if (&source == __pCancelButton)
1946 __pEdit->SetFocused();
1950 if (&source == __pContentControl)
1952 if ((__isButtonEnabled && __isUsableCancelButton))
1954 __pCancelButton->SetFocused();
1958 __pEdit->SetFocused();
1966 if (&source == __pCancelButton)
1968 SetFocusCallbackParameter(true);
1969 SetMode(SEARCH_BAR_MODE_NORMAL);
1971 _Control::OnDrawFocus();
1986 _SearchBar::OnSettingChanged(Tizen::Base::String& key)
1988 if (__isButtonTextChangedByApp || !__isUsableCancelButton)
1993 if (key.Equals(L"http://tizen.org/setting/locale.language", false))
1996 GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_CANCEL_ABB, cancelText);
1997 __pCancelButton->SetText(cancelText);
1998 __pCancelButton->Invalidate();
2005 _SearchBar::OnCanvasRequestedN(const FloatRectangle& bounds)
2007 return __pSearchBarPresenter->OnCanvasRequestedN(bounds);
2011 _SearchBar::GetParentForm(void) const
2013 _Form* pForm = null;
2014 _Control* pControlCore = GetParent();
2018 if (pControlCore == null)
2020 SysLog(NID_UI_CTRL,"[E_SYSTEM] The parent form is null.");
2025 pForm = dynamic_cast <_Form*>(pControlCore);
2032 pControlCore = pControlCore->GetParent();
2035 return pControlCore;
2039 _SearchBar::GetSearchBarButton(void) const
2041 return __pCancelButton;
2045 _SearchBar::GetSearchField(void)
2051 _SearchBar::GetSearchBarContainer(void) const
2053 return __pContainer;
2057 _SearchBar::GetClippedGroupControl(void) const
2059 return __pClippedGroupControl;
2063 _SearchBar::IsUsableCancelButton(void) const
2065 return __isUsableCancelButton;
2069 _SearchBar::ConvertSearchBarStatus(SearchFieldStatus status)
2071 EditStatus editStatus = EDIT_STATUS_NORMAL;
2074 case SEARCH_FIELD_STATUS_NORMAL:
2075 editStatus = EDIT_STATUS_NORMAL;
2078 case SEARCH_FIELD_STATUS_DISABLED:
2079 editStatus = EDIT_STATUS_DISABLED;
2082 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
2083 editStatus = EDIT_STATUS_HIGHLIGHTED;
2093 _SearchBar::ConvertSearchBarButtonStatus(SearchBarButtonStatus status)
2095 _ButtonStatus buttonStatus = _BUTTON_STATUS_NORMAL;
2099 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
2100 buttonStatus = _BUTTON_STATUS_NORMAL;
2103 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
2104 buttonStatus = _BUTTON_STATUS_PRESSED;
2107 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
2108 buttonStatus = _BUTTON_STATUS_HIGHLIGHTED;
2111 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
2112 buttonStatus = _BUTTON_STATUS_DISABLED;
2118 return buttonStatus;
2122 _SearchBar::SendSearchBarEvent(_SearchBarEventStatus status)
2124 result r = E_SUCCESS;
2125 if (__pSearchBarEvent)
2127 IEventArg* pEventArg = _SearchBarEvent::CreateSearchBarEventArgN(status);
2128 r = GetLastResult();
2129 SysTryReturn(NID_UI_CTRL, pEventArg, r, r, "[%s] Propagating.", GetErrorMessage(r));
2131 if (IsContentAreaVisible() == false)
2133 SetContentAreaVisible(false);
2136 __pSearchBarEvent->Fire(*pEventArg);
2143 _SearchBar::SetHeaderVisibleState(bool visible)
2145 if (__pSearchBarPresenter != null)
2147 __pSearchBarPresenter->SetHeaderVisibleState(visible);
2153 _SearchBar::SetPropertyButtonActionId(const Variant& actionId)
2155 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2156 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2157 SysTryReturn(NID_UI_CTRL, actionId.ToInt() > -1, E_INVALID_ARG, E_INVALID_ARG,
2158 "[E_INVALID_ARG] Invalid argument(s) is used. actionId.ToInt() = %d", actionId.ToInt());
2160 result r = E_SUCCESS;
2162 r = __pCancelButton->SetPropertyActionId(actionId);
2163 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2164 "[%s] A system error has occurred. Failed to set actionId.", GetErrorMessage(E_SYSTEM));
2166 __actionId = actionId.ToInt();
2172 _SearchBar::GetPropertyButtonActionId(void) const
2174 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(-1), E_SYSTEM,
2175 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2177 return Variant(__actionId);
2181 _SearchBar::SetPropertyButtonDisabledColor(const Variant& color)
2183 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2184 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2186 result r = E_SUCCESS;
2188 r = __pCancelButton->SetPropertyDisabledColor(color);
2189 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2190 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2192 __buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED] = color.ToColor();
2198 _SearchBar::GetPropertyButtonDisabledColor(void) const
2200 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2201 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2203 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
2207 _SearchBar::SetPropertyButtonHighlightedColor(const Variant& color)
2209 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2210 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2212 result r = E_SUCCESS;
2214 r = __pCancelButton->SetPropertyHighlightedColor(color);
2215 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2216 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2218 __buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED] = color.ToColor();
2224 _SearchBar::GetPropertyButtonHighlightedColor(void) const
2226 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2227 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2229 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
2233 _SearchBar::SetPropertyButtonNormalColor(const Variant& color)
2235 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2236 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2238 result r = E_SUCCESS;
2240 r = __pCancelButton->SetPropertyNormalColor(color);
2241 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2242 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2244 __buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL] = color.ToColor();
2250 _SearchBar::GetPropertyButtonNormalColor(void) const
2252 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2253 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2255 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
2259 _SearchBar::SetPropertyButtonPressedColor(const Variant& color)
2261 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2262 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2264 result r = E_SUCCESS;
2266 r = __pCancelButton->SetPropertyPressedColor(color);
2267 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2268 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2270 __buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED] = color.ToColor();
2276 _SearchBar::GetPropertyButtonPressedColor(void) const
2278 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2279 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2281 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
2285 _SearchBar::SetPropertyButtonDisabledTextColor(const Variant& textColor)
2287 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2288 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2290 result r = E_SUCCESS;
2292 r = __pCancelButton->SetPropertyDisabledTextColor(textColor);
2293 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2294 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2296 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_DISABLED] = textColor.ToColor();
2302 _SearchBar::GetPropertyButtonDisabledTextColor(void) const
2304 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2305 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2307 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
2311 _SearchBar::SetPropertyButtonHighlightedTextColor(const Variant& textColor)
2313 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2314 "[E_SYSTEM]] A system error has occurred. The cancel button instance is null.");
2316 result r = E_SUCCESS;
2318 r = __pCancelButton->SetPropertyHighlightedTextColor(textColor);
2319 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2320 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2322 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED] = textColor.ToColor();
2328 _SearchBar::GetPropertyButtonHighlightedTextColor(void) const
2330 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2331 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2333 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
2337 _SearchBar::SetPropertyButtonNormalTextColor(const Variant& textColor)
2339 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2340 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2342 result r = E_SUCCESS;
2344 r = __pCancelButton->SetPropertyNormalTextColor(textColor);
2345 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2346 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2348 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL] = textColor.ToColor();
2354 _SearchBar::GetPropertyButtonNormalTextColor(void) const
2356 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2357 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2359 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
2363 _SearchBar::SetPropertyButtonPressedTextColor(const Variant& textColor)
2365 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2366 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2368 result r = E_SUCCESS;
2370 r = __pCancelButton->SetPropertyPressedTextColor(textColor);
2371 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2372 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2374 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED] = textColor.ToColor();
2380 _SearchBar::GetPropertyButtonPressedTextColor(void) const
2382 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2383 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2385 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
2389 _SearchBar::SetPropertySearchFieldDisabledColor(const Variant& color)
2391 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2392 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2394 result r = E_SUCCESS;
2396 r = __pEdit->SetPropertyDisabledColor(color);
2397 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2398 "[E_SYSTEM] A system error has occurred. Failed to set the edit disabled color.");
2400 __color[SEARCH_FIELD_STATUS_DISABLED] = color.ToColor();
2406 _SearchBar::GetPropertySearchFieldDisabledColor(void) const
2408 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2409 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2411 return Variant(__color[SEARCH_FIELD_STATUS_DISABLED]);
2415 _SearchBar::SetPropertySearchFieldHighlightedColor(const Variant& color)
2417 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2418 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2420 result r = E_SUCCESS;
2422 r = __pEdit->SetPropertyHighlightedColor(color);
2423 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2424 "[E_SYSTEM] A system error has occurred. Failed to set the edit highlighted color.");
2426 __color[SEARCH_FIELD_STATUS_HIGHLIGHTED] = color.ToColor();
2432 _SearchBar::GetPropertySearchFieldHighlightedColor(void) const
2434 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2435 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2437 return Variant(__color[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
2441 _SearchBar::SetPropertySearchFieldNormalColor(const Variant& color)
2443 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2444 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2446 result r = E_SUCCESS;
2448 r = __pEdit->SetPropertyNormalColor(color);
2449 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2450 "[E_SYSTEM] A system error has occurred. Failed to set edit normal color.");
2452 __color[SEARCH_FIELD_STATUS_NORMAL] = color.ToColor();
2458 _SearchBar::GetPropertySearchFieldNormalColor(void) const
2460 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2461 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2463 return Variant(__color[SEARCH_FIELD_STATUS_NORMAL]);
2467 _SearchBar::SetPropertySearchFieldDisabledTextColor(const Variant& textColor)
2469 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2470 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2472 result r = E_SUCCESS;
2474 r = __pEdit->SetPropertyDisabledTextColor(textColor);
2475 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2476 "[E_SYSTEM] A system error has occurred. Failed to set edit disabled text color.");
2478 __textColor[SEARCH_FIELD_STATUS_DISABLED] = textColor.ToColor();
2484 _SearchBar::GetPropertySearchFieldDisabledTextColor(void) const
2486 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2487 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2489 return Variant(__textColor[SEARCH_FIELD_STATUS_DISABLED]);
2493 _SearchBar::SetPropertySearchFieldHighlightedTextColor(const Variant& textColor)
2495 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2496 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2498 result r = E_SUCCESS;
2500 r = __pEdit->SetPropertyHighlightedTextColor(textColor);
2501 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2502 "[E_SYSTEM] A system error has occurred. Failed to set edit highlighted text color.");
2504 __textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED] = textColor.ToColor();
2510 _SearchBar::GetPropertySearchFieldHighlightedTextColor(void) const
2512 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2513 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2515 return Variant(__textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
2519 _SearchBar::SetPropertySearchFieldNormalTextColor(const Variant& textColor)
2521 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2522 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2524 result r = E_SUCCESS;
2526 r = __pEdit->SetPropertyNormalTextColor(textColor);
2527 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2528 "[E_SYSTEM] A system error has occurred. Failed to set edit normal text color.");
2530 __textColor[SEARCH_FIELD_STATUS_NORMAL] = textColor.ToColor();
2536 _SearchBar::GetPropertySearchFieldNormalTextColor(void) const
2538 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2539 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2541 return Variant(__textColor[SEARCH_FIELD_STATUS_NORMAL]);
2545 _SearchBar::SetPropertyColor(const Variant& color)
2547 __backgroundColor = color.ToColor();
2553 _SearchBar::GetPropertyColor(void) const
2555 return Variant(__backgroundColor);
2559 _SearchBar::SetPropertyContentAreaSize(const Variant& size)
2561 FloatDimension contentAreaSize = size.ToFloatDimension();
2562 SysTryReturn(NID_UI_CTRL, contentAreaSize.width >= 0 && contentAreaSize.height >= 0, E_INVALID_ARG, E_INVALID_ARG,
2563 "[E_INVALID_ARG] Invalid argument(s) is used. contentAreaSize.width = %f, contenAreaSize.height = %f",
2564 contentAreaSize.width, contentAreaSize.height);
2566 result r = E_SUCCESS;
2569 FloatRectangle bounds = GetBoundsF();
2570 FloatRectangle contentAreaBounds(0.0f, 0.0f, 0.0f, 0.0f);
2572 contentAreaBounds.x = 0.0f;
2573 contentAreaBounds.y = bounds.height;
2574 contentAreaBounds.width = contentAreaSize.width;
2575 contentAreaBounds.height = contentAreaSize.height;
2577 __contentAreaBounds = contentAreaBounds;
2578 __isUserContainerBounds = true;
2583 r = __pContainer->SetBounds(__contentAreaBounds);
2584 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
2591 _SearchBar::GetPropertyContentAreaSize(void) const
2593 FloatDimension contentAreaSize(__contentAreaBounds.width, __contentAreaBounds.height);
2595 return Variant(contentAreaSize);
2599 _SearchBar::CreateClippedGroupControl(void)
2601 result r = E_SUCCESS;
2602 FloatRectangle clippedGroupControlBounds(FloatPoint(0.0f, 0.0f), GetSizeF());
2603 __pClippedGroupControl = _Control::CreateControlN();
2604 r = GetLastResult();
2605 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
2607 r = AttachChild(*__pClippedGroupControl);
2608 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM,
2609 "[E_SYSTEM] A system error has occurred. Failed to attach the parent of clipped control.");
2611 r = __pClippedGroupControl->SetBounds(clippedGroupControlBounds);
2612 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
2614 __pClippedGroupControl->SetBackgroundColor(Color(0));
2616 __pClippedGroupControl->SetClipChildrenEnabled(true);
2621 delete __pClippedGroupControl;
2622 __pClippedGroupControl = null;
2628 _SearchBar::InitializeAccessibility(void)
2630 _AccessibilityContainer* pSBContainer = null;
2631 pSBContainer = GetAccessibilityContainer();
2633 _AccessibilityContainer* pEditContainer = null;
2634 pEditContainer = __pEdit->GetAccessibilityContainer();
2635 pSBContainer->AddChildContainer(*pEditContainer);
2637 _AccessibilityContainer* pButtonContainer = null;
2638 pButtonContainer = __pCancelButton->GetAccessibilityContainer();
2640 if (__isUsableCancelButton)
2642 pSBContainer->AddChildContainer(*pButtonContainer);
2645 _AccessibilityElement* pEditElement = __pEdit->GetTextAccessibilityElement();
2647 pEditElement->SetHint("Double Tap To Type Search Text");
2648 pEditElement->SetTrait("SearchBar");
2649 pEditElement->SetName("SearchField");
2651 pSBContainer->Activate(false);
2657 _SearchBar::SetContentDimming(void)
2659 if (__pContainer != NULL)
2661 if (!GetTextLength())
2663 __contentColor.SetAlpha(_SEARCH_CONTENT_DIM_OPACITY);
2667 __contentColor.SetAlpha(0);
2669 __pContainer->SetBackgroundColor(__contentColor);
2675 _SearchBar::IsContentAttachable(const _Control* pContent)
2677 const _Window* pWindow = dynamic_cast <const _Window*>(pContent);
2678 const _ColorPicker* pColorPicker = dynamic_cast <const _ColorPicker*>(pContent);
2679 const _Form* pForm = dynamic_cast <const _Form*>(pContent);
2680 const _Keypad* pKeypad = dynamic_cast <const _Keypad*>(pContent);
2681 const _OverlayPanel* pOverlayPanel = dynamic_cast <const _OverlayPanel*>(pContent);
2683 bool isContentAttachable = true;
2685 isContentAttachable = ((pWindow == null) && (pColorPicker == null) &&
2686 (pForm == null) && (pKeypad == null) && (pOverlayPanel == null));
2687 return isContentAttachable;
2691 _SearchBar::ResizeCancelButton(void)
2693 result r = E_SUCCESS;
2695 float horizontalMargin = 0.0f;
2696 float buttonLeftMargin = 0.0f;
2697 float buttonRightMargin = 0.0f;
2698 float buttonMinWidth = 0.0f;
2699 float searchFieldMinWidth = 0.0f;
2700 float buttonVerticalMargin = 0.0f;
2701 float searchBarMinHeight = 0.0f;
2702 float buttonWidth = 0.0f;
2703 float buttonHeight = 0.0f;
2705 FloatRectangle cancelButtonBounds;
2706 FloatRectangle searchBarBounds = GetBoundsF();
2708 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
2710 GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
2711 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_LEFT_MARGIN, orientation, buttonLeftMargin);
2712 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_RIGHT_MARGIN, orientation, buttonRightMargin);
2713 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
2714 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_HEIGHT, orientation, buttonHeight);
2715 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_MIN_WIDTH, orientation, buttonMinWidth);
2716 GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
2717 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin);
2718 GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
2720 cancelButtonBounds.width = buttonWidth;
2721 cancelButtonBounds.height = buttonHeight;
2723 float buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth +
2724 cancelButtonBounds.width + buttonLeftMargin + buttonRightMargin);
2726 if (searchBarBounds.width < buttonResizableSearchBarWidth)
2728 cancelButtonBounds.width = searchBarBounds.width -(searchFieldMinWidth + buttonLeftMargin
2729 + buttonRightMargin + horizontalMargin);
2732 cancelButtonBounds.x = searchBarBounds.width - cancelButtonBounds.width - buttonRightMargin;
2733 cancelButtonBounds.y = (searchBarBounds.height - cancelButtonBounds.height)/2.0f;
2735 cancelButtonBounds.y = cancelButtonBounds.y < 0.0f ? 0.0f:cancelButtonBounds.y;
2737 if (cancelButtonBounds.width < buttonMinWidth)
2739 cancelButtonBounds.width = buttonMinWidth;
2742 cancelButtonBounds.width = (cancelButtonBounds.width > 0.0f) ? cancelButtonBounds.width : 0.0f;
2743 cancelButtonBounds.height = (cancelButtonBounds.height > 0.0f) ? cancelButtonBounds.height : 0.0f;
2744 r = __pCancelButton->SetBounds(cancelButtonBounds);
2750 _SearchBar::RecalculateButtonBounds(void)
2752 result r = E_SUCCESS;
2754 float horizontalMargin = 0.0f;
2755 float verticalMargin = 0.0f;
2756 float buttonLeftMargin = 0.0f;
2757 float buttonRightMargin = 0.0f;
2758 float buttonMinWidth = 0.0f;
2759 float searchFieldMinWidth = 0.0f;
2760 float buttonVerticalMargin = 0.0f;
2761 float searchBarMinHeight = 0.0f;
2762 float buttonWidth = 0.0f;
2763 float buttonHeight = 0.0f;
2764 float cancelButtonWidth = 0.0f;
2766 FloatRectangle cancelButtonBounds;
2767 FloatRectangle editBounds;
2768 FloatRectangle searchBarBounds = GetBoundsF();
2770 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
2772 GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
2773 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, verticalMargin);
2774 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_LEFT_MARGIN, orientation, buttonLeftMargin);
2775 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_RIGHT_MARGIN, orientation, buttonRightMargin);
2776 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
2777 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_HEIGHT, orientation, buttonHeight);
2778 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_MIN_WIDTH, orientation, buttonMinWidth);
2779 GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
2780 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin);
2781 GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
2783 cancelButtonBounds.height = buttonHeight;
2785 float searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2.0f);
2786 cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
2787 editBounds.x = horizontalMargin;
2789 if (searchBarBounds.height < searchBarMinHeight)
2791 verticalMargin = (searchBarBounds.height - searchFieldMinHeight)/2.0f;
2792 if (verticalMargin < 0.0f)
2794 verticalMargin = 0.0f;
2798 editBounds.y = verticalMargin;
2799 editBounds.height = searchBarBounds.height - (editBounds.y * 2.0f);
2801 editBounds.height = (editBounds.height > searchFieldMinHeight) ? editBounds.height : searchFieldMinHeight;
2803 editBounds.width = searchBarBounds.width - cancelButtonWidth - horizontalMargin - buttonLeftMargin - buttonRightMargin;
2805 if (editBounds.width < searchFieldMinWidth)
2807 editBounds.width = searchFieldMinWidth;
2810 cancelButtonBounds.x = editBounds.width + horizontalMargin + buttonLeftMargin;
2811 cancelButtonBounds.y = (searchBarBounds.height - cancelButtonBounds.height)/2.0f;
2813 cancelButtonBounds.y = cancelButtonBounds.y < 0.0f ? 0.0f:cancelButtonBounds.y;
2815 float remainingWidth = searchBarBounds.width - editBounds.width - horizontalMargin - buttonLeftMargin - buttonRightMargin;
2817 if (remainingWidth < buttonMinWidth)
2819 cancelButtonBounds.width = buttonMinWidth;
2823 cancelButtonBounds.width = searchBarBounds.width - cancelButtonBounds.x - buttonRightMargin;
2826 cancelButtonBounds.width = (cancelButtonBounds.width > 0.0f) ? cancelButtonBounds.width : 0.0f;
2827 cancelButtonBounds.height = (cancelButtonBounds.height > 0.0f) ? cancelButtonBounds.height : 0.0f;
2829 r = __pCancelButton->SetBounds(cancelButtonBounds);
2830 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
2831 r = __pEdit->SetBounds(editBounds);
2832 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
2838 _SearchBar::GetCurrentStatus(void)
2840 SearchFieldStatus searchFieldStatus = SEARCH_FIELD_STATUS_NORMAL;
2844 if (__pEdit->IsFocused())
2846 searchFieldStatus = SEARCH_FIELD_STATUS_HIGHLIGHTED;
2851 searchFieldStatus = SEARCH_FIELD_STATUS_DISABLED;
2854 return searchFieldStatus;
2858 _SearchBar::SetEditTextFilter(IEditTextFilter* pFilter)
2860 SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM,
2861 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2863 __pEdit->SetEditTextFilter(pFilter);
2869 _SearchBar::SendOpaqueCommand(const String& command)
2871 SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM,
2872 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2874 __pEdit->SendOpaqueCommand(command);
2880 _SearchBar::SetFocusCallbackParameter(bool state)
2882 __isFocusCallbackToBeFired = state;
2887 _SearchBar::IsFocusCallbackToBeFired(void) const
2889 return __isFocusCallbackToBeFired;
2891 }}} // Tizen::Ui::Controls