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 (__pAccessibilitySearchBarElement)
169 __pAccessibilitySearchBarElement->Activate(false);
170 __pAccessibilitySearchBarElement = null;
173 delete __pBackgroundBitmap;
174 __pBackgroundBitmap = null;
178 _SearchBar::CreateSearchBarN(void)
180 _SearchBar* pSearchBar = new (std::nothrow) _SearchBar;
181 SysTryReturn(NID_UI_CTRL, pSearchBar, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
182 if (GetLastResult() != E_SUCCESS)
188 pSearchBar->AcquireHandle();
189 pSearchBar->SetTouchPressThreshold(_TOUCH_PRESS_THRESHOLD_INSENSITIVE);
195 _SearchBar::Initialize(bool enableSearchBarButton, CoreKeypadAction keypadAction)
197 result r = E_SUCCESS;
199 // Setting Button color
200 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_NORMAL, __buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
201 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_PRESSED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
202 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_HIGHLIGHTED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
203 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_DISABLED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
205 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_NORMAL, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
206 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_PRESSED, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
207 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_HIGHLIGHTED, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
208 GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_DISABLED, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
210 GET_COLOR_CONFIG(SEARCHBAR::CONTENT_AREA_BG_NORMAL, __contentColor);
212 for (int i = 0; i < SEARCHBAR_COLOR_MAX; i++)
216 case SEARCH_FIELD_STATUS_DISABLED:
217 GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_DISABLED, __color[i]);
218 GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_DISABLED, __textColor[i]);
219 GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_DISABLED, __guideTextColor[i]);
222 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
223 GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_NORMAL, __color[i]);
224 GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_HIGHLIGHTED, __textColor[i]);
225 GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_NORMAL, __guideTextColor[i]);
228 GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_NORMAL, __color[i]);
229 GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_NORMAL, __textColor[i]);
230 GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_NORMAL, __guideTextColor[i]);
235 GET_COLOR_CONFIG(SEARCHBAR::BG_NORMAL, __backgroundColor);
237 __isUsableCancelButton = enableSearchBarButton;
238 __keypadAction = keypadAction;
240 GetVisualElement()->SetClipChildrenEnabled(false);
242 r = CreateClippedGroupControl();
243 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
244 "[E_SYSTEM] A system error has occurred. The construction of parent control for clipped group control failed.");
246 r = CreateSearchField();
247 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
248 "[E_SYSTEM] A system error has occurred. The edit construction failed.");
249 r = CreateCancelButton();
250 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
251 "[E_SYSTEM] A system error has occurred. The cancel button construction failed.");
254 r = CreateContentsArea();
255 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
256 "[E_SYSTEM] A system error has occurred. The construction of parent for content failed.");
258 _SearchBarPresenter* pPresenter = new (std::nothrow) _SearchBarPresenter;
259 SysTryReturn(NID_UI_CTRL, pPresenter, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
261 r = pPresenter->Construct(*this);
262 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
264 r = pPresenter->Install();
265 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
267 __pSearchBarPresenter = pPresenter;
269 InitializeAccessibility();
271 r = _SettingInfoImpl::AddSettingEventListener(*this);
272 SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
284 _SearchBar::CreateSearchField(void)
286 result r = E_SUCCESS;
288 FloatRectangle editBounds;
289 float horizontalMargin = 0.0f;
290 float verticalMargin = 0.0f;
291 float iconHorizontalMargin = 0.0f;
292 float textHorizontalMargin = 0.0f;
293 float iconWidth = 0.0f;
294 float textSize = 0.0f;
295 float searchBarMinHeight = 0.0f;
296 float searchBarMinWidthModeNormal = 0.0f;
298 FloatRectangle searchBarBounds = GetBoundsF();
299 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
301 GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
302 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, verticalMargin);
303 GET_SHAPE_CONFIG(SEARCHBAR::ICON_HORIZONTAL_MARGIN, orientation, iconHorizontalMargin);
304 GET_SHAPE_CONFIG(SEARCHBAR::ICON_WIDTH, orientation, iconWidth);
305 GET_SHAPE_CONFIG(SEARCHBAR::TEXT_HORIZONTAL_MARGIN, orientation, textHorizontalMargin);
306 GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH_NORMAL_MODE, orientation, searchBarMinWidthModeNormal);
307 GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
309 float searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2.0f);
311 editBounds.x = horizontalMargin;
313 if (searchBarBounds.height < searchBarMinHeight)
315 verticalMargin = (searchBarBounds.height - searchFieldMinHeight)/2.0f;
316 if (verticalMargin < 0.0f)
318 verticalMargin = 0.0f;
322 editBounds.y = verticalMargin;
324 editBounds.width = searchBarBounds.width - (editBounds.x * 2.0f);
325 editBounds.height = searchBarBounds.height - (editBounds.y * 2.0f);
327 editBounds.width = (editBounds.width > searchBarMinWidthModeNormal) ? editBounds.width : searchBarMinWidthModeNormal;
328 editBounds.height = (editBounds.height > searchFieldMinHeight) ? editBounds.height : searchFieldMinHeight;
330 _SearchBarImpl* pSearchBarImpl = static_cast<_SearchBarImpl*>(GetUserData());
331 __pEdit = &(pSearchBarImpl->GetEditFieldImpl()->GetCore());
333 SysTryReturnResult(NID_UI_CTRL, __pEdit != null, E_SYSTEM,
334 "[E_SYSTEM] A system error has occured. Failed to get _Edit instance");
336 __pEdit->SetKeypadCommandButtonVisible(false);
337 __pEdit->SetBounds(editBounds);
338 __pEdit->AddKeypadEventListener(*this);
339 __pEdit->AddTextBlockEventListener(*this);
340 __pEdit->AddTextEventListener(*this);
342 GET_SHAPE_CONFIG(SEARCHBAR::EDIT_TEXT_SIZE, orientation, textSize);
343 __pEdit->SetTextSize(textSize);
345 __pEdit->SetHorizontalMargin(iconHorizontalMargin + iconWidth + textHorizontalMargin, EDIT_TEXT_LEFT_MARGIN);
346 __pEdit->SetHorizontalMargin(textHorizontalMargin, EDIT_TEXT_RIGHT_MARGIN);
347 __pEdit->SetLimitLength(SEARCHBAR_TEXT_LENGTH_MAX);
349 for (int status = 0; status < SEARCHBAR_COLOR_MAX; status++)
351 EditStatus editStatus = ConvertSearchBarStatus((SearchFieldStatus) status);
352 __pEdit->SetColor(editStatus, __color[status]);
355 __pEdit->SetTextColor(EDIT_TEXT_COLOR_NORMAL, __textColor[SEARCH_FIELD_STATUS_NORMAL]);
356 __pEdit->SetTextColor(EDIT_TEXT_COLOR_DISABLED, __textColor[SEARCH_FIELD_STATUS_DISABLED]);
357 __pEdit->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, __textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
359 __pEdit->ReplaceDefaultBackgroundBitmapForSearchBar();
361 __pEdit->SetKeypadAction(__keypadAction);
363 r = __pClippedGroupControl->AttachChild(*__pEdit);
364 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM,
365 "[E_SYSTEM] A system error has occurred. Failed to attach edit as child.");
377 _SearchBar::CreateCancelButton(void)
379 result r = E_SUCCESS;
381 float textSize = 0.0f;
382 String cancelButtonText;
384 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
386 _SearchBarImpl* pSearchBarImpl = static_cast<_SearchBarImpl*>(GetUserData());
387 __pCancelButton = &(pSearchBarImpl->GetButtonImpl()->GetCore());
389 SysTryReturnResult(NID_UI_CTRL, __pCancelButton != null, E_SYSTEM,
390 "[E_SYSTEM] A system error has occured. Failed to get _Edit instance");
393 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
395 r = ResizeCancelButton();
396 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
398 GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_CANCEL_ABB, cancelButtonText);
399 r = __pCancelButton->SetText(cancelButtonText);
400 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
402 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_TEXT_SIZE, orientation, textSize);
403 r = __pCancelButton->SetTextSize(textSize);
404 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
406 __pCancelButton->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
407 __pCancelButton->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
409 r = __pCancelButton->SetActionId(__actionId);
410 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
412 r = __pCancelButton->AddActionEventListener(*this);
413 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
415 __pCancelButton->SetVisibleState(false);
417 for (int status = 0; status < SEARCHBAR_BUTTON_COLOR_MAX; status++)
419 _ButtonStatus buttonStatus = ConvertSearchBarButtonStatus((SearchBarButtonStatus) status);
421 r = __pCancelButton->SetColor(buttonStatus, __buttonColor[status]);
422 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
424 r = __pCancelButton->SetTextColor(buttonStatus, __buttonTextColor[status]);
425 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
428 r = __pClippedGroupControl->AttachChild(*__pCancelButton);
429 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM,
430 "[E_SYSTEM] A system error has occurred. Failed to attach button as child.");
435 delete __pCancelButton;
436 __pCancelButton = null;
442 _SearchBar::CreateContentsArea(void)
444 result r = E_SUCCESS;
446 __pContainer = _Control::CreateControlN();
449 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
451 __pContainer->SetVisibleState(false);
453 r = AttachChild(*__pContainer);
454 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM,
455 "[E_SYSTEM] A system error has occurred. Failed to attach the parent of content.");
467 _SearchBar::SetContentsArea(void)
469 if (__isUserContainerBounds)
474 FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
475 float width = screenSize.width;
476 float height = screenSize.height;
478 _Control* pParent = GetParentForm();
481 width = pParent->GetClientBoundsF().width;
482 height = pParent->GetClientBoundsF().height;
485 FloatRectangle controlBounds = GetBoundsF();
486 controlBounds = CoordinateSystem::AlignToDevice(FloatRectangle(controlBounds));
488 __contentAreaBounds.x = 0.0f;
489 __contentAreaBounds.y = controlBounds.height;
490 __contentAreaBounds.width = width - controlBounds.x;
491 __contentAreaBounds.height = height - (controlBounds.y + controlBounds.height);
495 result r = E_SUCCESS;
496 r = __pContainer->SetBounds(__contentAreaBounds);
497 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
503 _SearchBar::GetContent(void) const
505 return __pContentControl;
509 _SearchBar::SetContent(const _Control* pContent)
511 __pContentControl = const_cast <_Control*>(pContent);
512 result r = E_SUCCESS;
516 r = __pContainer->AttachChild(*__pContentControl);
517 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating");
524 _SearchBar::UpdateContentArea(bool invalidate)
526 return __pSearchBarPresenter->UpdateContentArea(invalidate);
530 _SearchBar::SetContentAreaVisible(bool visible, bool isCalledByApp)
532 SysTryReturn(NID_UI_CTRL, __pContainer, E_SYSTEM, E_SYSTEM,
533 "[E_SYSTEM] A system error has occurred. The instance of parent to content is null.");
535 SearchBarMode searchBarMode = GetMode();
536 if (searchBarMode == SEARCH_BAR_MODE_INPUT)
538 __pContainer->SetVisibleState(visible);
543 __contentVisibilitySetByApp = visible;
546 return __pSearchBarPresenter->SetContentAreaVisible(visible);
550 _SearchBar::IsContentAreaVisible(void) const
552 return __pSearchBarPresenter->IsContentAreaVisible();
556 _SearchBar::SetContentAreaSize(const Dimension& size)
558 return SetProperty("contentAreaSize", Variant(size));
562 _SearchBar::GetContentAreaSize(void) const
564 Variant size = GetProperty("contentAreaSize");
566 return size.ToDimension();
570 _SearchBar::GetMode(void) const
572 return __pSearchBarPresenter->GetMode();
576 _SearchBar::IsModeLocked(void) const
578 return __pSearchBarPresenter->IsModeLocked();
582 _SearchBar::SetMode(SearchBarMode mode)
584 _AccessibilityElement* pEditElement = __pEdit->GetTextAccessibilityElement();
585 if (mode == SEARCH_BAR_MODE_NORMAL)
587 pEditElement->SetHint("Double Tap To Type Search Text");
591 pEditElement->SetHint("Enter Search Text");
594 pEditElement->SetTrait("SearchBar");
595 pEditElement->SetName("SearchField");
597 return __pSearchBarPresenter->SetMode(mode);
601 _SearchBar::SetModeLocked(bool modeLocked)
603 if (modeLocked == true && GetMode() == SEARCH_BAR_MODE_NORMAL)
605 __pEdit->SetViewModeEnabled(true);
608 if (modeLocked == false && __pEdit->IsViewModeEnabled())
610 __pEdit->SetViewModeEnabled(false);
613 return __pSearchBarPresenter->SetModeLocked(modeLocked);
617 _SearchBar::GetButtonActionId(void) const
619 Variant actionId = GetProperty("buttonActionId");
621 return actionId.ToInt();
625 _SearchBar::GetButtonColor(SearchBarButtonStatus status) const
631 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
632 buttonColor = GetProperty("buttonNormalColor");
634 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
635 buttonColor = GetProperty("buttonPressedColor");
637 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
638 buttonColor = GetProperty("buttonHighlightedColor");
640 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
641 buttonColor = GetProperty("buttonDisabledColor");
647 return buttonColor.ToColor();
651 _SearchBar::GetButtonTextColor(SearchBarButtonStatus status) const
653 Variant buttonTextColor;
657 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
658 buttonTextColor = GetProperty("buttonNormalTextColor");
660 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
661 buttonTextColor = GetProperty("buttonPressedTextColor");
663 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
664 buttonTextColor = GetProperty("buttonHighlightedTextColor");
666 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
667 buttonTextColor = GetProperty("buttonDisabledTextColor");
673 return buttonTextColor.ToColor();
676 SearchBarButtonStatus
677 _SearchBar::GetButtonStatus(void) const
679 SysTryReturn(NID_UI_CTRL, __pCancelButton, SEARCH_BAR_BUTTON_STATUS_NORMAL, E_SYSTEM,
680 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
682 SearchBarButtonStatus buttonStatus = SEARCH_BAR_BUTTON_STATUS_NORMAL;
684 if (__isButtonEnabled == false)
686 buttonStatus = SEARCH_BAR_BUTTON_STATUS_DISABLED;
693 _SearchBar::SetButtonText(const String& text)
695 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
696 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
698 result r = E_SUCCESS;
700 r = __pCancelButton->SetText(text);
701 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
702 "[E_SYSTEM] A system error has occurred. Failed to set text.");
704 __isButtonTextChangedByApp = true;
710 _SearchBar::SetButtonActionId(int actionId)
712 return SetProperty("buttonActionId", Variant(actionId));
716 _SearchBar::SetButtonEnabled(bool enabled)
718 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
719 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
721 __pCancelButton->SetEnableState(enabled);
723 __isButtonEnabled = enabled;
729 _SearchBar::SetButtonColor(SearchBarButtonStatus status, const Color& color)
731 result r = E_SUCCESS;
735 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
736 r = SetProperty("buttonNormalColor", Variant(color));
738 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
739 r = SetProperty("buttonPressedColor", Variant(color));
741 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
742 r = SetProperty("buttonHighlightedColor", Variant(color));
744 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
745 r = SetProperty("buttonDisabledColor", Variant(color));
755 _SearchBar::SetButtonTextColor(SearchBarButtonStatus status, const Color& color)
757 result r = E_SUCCESS;
761 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
762 r = SetProperty("buttonNormalTextColor", Variant(color));
764 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
765 r = SetProperty("buttonPressedTextColor", Variant(color));
767 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
768 r = SetProperty("buttonHighlightedTextColor", Variant(color));
770 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
771 r = SetProperty("buttonDisabledTextColor", Variant(color));
781 _SearchBar::AppendCharacter(const Character& character)
783 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
784 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
785 SysTryReturn(NID_UI_CTRL, character.CompareTo(null), E_SYSTEM, E_SYSTEM,
786 "[E_SYSTEM] A system error has occurred. The character is null.");
788 result r = E_SUCCESS;
790 r = __pEdit->AppendCharacter(character);
791 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
792 "[E_SYSTEM] A system error has occurred. Failed to set character.");
798 _SearchBar::AppendText(const String& text)
800 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
801 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
802 SysTryReturn(NID_UI_CTRL, text.IsEmpty() == false, E_SYSTEM, E_SYSTEM,
803 "[E_SYSTEM] A system error has occurred. The text is empty.");
805 result r = E_SUCCESS;
807 r = __pEdit->AppendText(text);
808 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
809 "[E_SYSTEM] A system error has occurred. Failed to set text.");
815 _SearchBar::SetText(const String& text)
817 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
818 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
820 result r = E_SUCCESS;
822 int limitLength = __pEdit->GetTextLimitLength();
823 int textLength = text.GetLength();
824 SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_SYSTEM, E_SYSTEM,
825 "[E_SYSTEM] A system error has occurred. textLength exceeds the limitLength");
827 r = __pEdit->SetText(text);
828 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
829 "[E_SYSTEM] A system error has occurred. Failed to set text.");
835 _SearchBar::InsertCharacterAt(int index, const Character& character)
837 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
838 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
839 SysTryReturn(NID_UI_CTRL, index > -1, E_OUT_OF_RANGE, E_OUT_OF_RANGE,
840 "[E_OUT_OF_RANGE] index(%d) is out of range.", index);
841 SysTryReturn(NID_UI_CTRL, character.CompareTo(null), E_SYSTEM, E_SYSTEM,
842 "[E_SYSTEM] A system error has occurred. The character is null.");
844 result r = E_SUCCESS;
848 limitLength = __pEdit->GetTextLimitLength();
849 textLength = __pEdit->GetTextLength() + 1;
851 SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED,
852 "[E_MAX_EXCEEDED] limitLength(%d) exceeds the maximum limit textLength(%d).", limitLength, textLength);
854 SysTryReturn(NID_UI_CTRL, index <= __pEdit->GetTextLength(), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
855 "[E_OUT_OF_RANGE] index(%d) is out of range of current textLength(%d).", index, __pEdit->GetTextLength());
857 r = __pEdit->InsertCharacterAt(index, character);
858 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
859 "[E_SYSTEM] A system error has occurred. Failed to set text.");
865 _SearchBar::InsertTextAt(int index, const String& text)
867 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
868 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
869 SysTryReturn(NID_UI_CTRL, index > -1, E_OUT_OF_RANGE, E_OUT_OF_RANGE,
870 "[E_OUT_OF_RANGE] index(%d) is out of range.", index);
872 result r = E_SUCCESS;
876 limitLength = __pEdit->GetTextLimitLength();
877 textLength = __pEdit->GetTextLength() + text.GetLength();
879 SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED,
880 "[E_MAX_EXCEEDED] limitLength(%d) exceeds the maximum limit textLength(%d).", limitLength, textLength);
881 SysTryReturn(NID_UI_CTRL, index <= __pEdit->GetTextLength(), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
882 "[E_OUT_OF_RANGE] index(%d) is out of range of current textLength(%d).", index, __pEdit->GetTextLength());
884 r = __pEdit->InsertTextAt(index, text);
885 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
886 "[E_SYSTEM] A system error has occurred. Failed to insert text.");
892 _SearchBar::DeleteCharacterAt(int index)
894 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
895 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
896 SysTryReturn(NID_UI_CTRL, index > -1, E_INVALID_ARG, E_INVALID_ARG,
897 "[E_INVALID_ARG] Invalid argument(s) is used. index = %d", index);
899 result r = E_SUCCESS;
901 textLength = __pEdit->GetTextLength();
903 SysTryReturn(NID_UI_CTRL, textLength > index, E_OUT_OF_RANGE, E_OUT_OF_RANGE,
904 "[E_OUT_OF_RANGE] index(%d) is out of range. textLength(%d)", index, textLength);
906 r = __pEdit->DeleteCharacterAt(index);
907 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM,
908 "[E_SYSTEM] A system error has occured. Failed to delete character.");
914 _SearchBar::Clear(void)
916 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
917 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
919 return __pEdit->ClearText();
923 _SearchBar::GetTextLength(void) const
925 SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM,
926 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
928 return __pEdit->GetTextLength();
932 _SearchBar::GetText(void) const
934 SysTryReturn(NID_UI_CTRL, __pEdit, String(), E_SYSTEM,
935 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
937 return __pEdit->GetText();
941 _SearchBar::GetText(int start, int end) const
943 SysTryReturn(NID_UI_CTRL, __pEdit, String(), E_SYSTEM,
944 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
946 return __pEdit->GetText(start, end);
950 _SearchBar::GetLimitLength(void) const
952 SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM,
953 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
955 return __pEdit->GetTextLimitLength();
959 _SearchBar::SetLimitLength(int limitLength)
961 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
962 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
963 SysTryReturn(NID_UI_CTRL, limitLength > 0, E_INVALID_ARG, E_INVALID_ARG,
964 "[E_INVALID_ARG] Invalid argument(s) is used.limitLength = %d", limitLength);
966 String tempString = GetText();
968 int textLength = tempString.GetLength();
969 SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_INVALID_ARG, E_INVALID_ARG,
970 "[E_INVALID_ARG] Invalid argument(s) is used. limitLength = %d, textLength = %d", limitLength, textLength);
972 result r = __pEdit->SetLimitLength(limitLength);
973 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
975 r = SetText(tempString);
976 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, r, "[%s] Propagating.", GetErrorMessage(r));
982 _SearchBar::ShowKeypad(void) const
984 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
985 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
987 SearchBarMode mode = __pSearchBarPresenter->GetMode();
988 SysTryReturn(NID_UI_CTRL, mode == SEARCH_BAR_MODE_INPUT, E_INVALID_STATE, E_INVALID_STATE,
989 "[E_INVALID_STATE] The SearchBar is currently in Normal mode.");
990 return __pEdit->ShowKeypad();
994 _SearchBar::HideKeypad(void)
996 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
997 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
999 SearchBarMode mode = __pSearchBarPresenter->GetMode();
1000 SysTryReturn(NID_UI_CTRL, mode == SEARCH_BAR_MODE_INPUT, E_SYSTEM, E_SYSTEM,
1001 "[E_SYSTEM] A system error has occurred. The SearchBar is currently in Normal mode.");
1003 result r = __pEdit->HideKeypad();
1011 _SearchBar::GetSearchFieldTextSizeF(void) const
1013 SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM,
1014 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1016 return __pEdit->GetTextSizeF();
1020 _SearchBar::SetSearchFieldTextSize(float size)
1022 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1023 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1025 return __pEdit->SetTextSize(size);
1029 _SearchBar::GetBlockRange(int& start, int& end) const
1031 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1032 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1034 int startIndex = -1;
1037 __pEdit->GetBlockRange(startIndex, endIndex);
1038 SysTryReturn(NID_UI_CTRL, (startIndex > -1 && endIndex > 0), E_SYSTEM, E_SYSTEM,
1039 "[E_SYSTEM] A system error has occurred. Failed to get text block range.");
1048 _SearchBar::ReleaseBlock(void)
1050 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1051 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1053 result r = E_SUCCESS;
1058 r = GetBlockRange(start, end);
1059 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1061 return __pEdit->ReleaseTextBlock();
1065 _SearchBar::SetBlockRange(int start, int end)
1067 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1068 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1070 result r = E_SUCCESS;
1073 textLength = __pEdit->GetTextLength();
1075 SysTryReturn(NID_UI_CTRL, (start < end && start >= 0 && textLength >= end), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
1076 "[E_OUT_OF_RANGE] start (%d) and end (%d) is out of range.", start, end - 1);
1078 r = SetCursorPosition(start);
1079 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1081 r = __pEdit->BeginTextBlock();
1082 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
1083 "[E_SYSTEM] A system error has occurred. Failed to set text block range.");
1085 r = SetCursorPosition(end);
1086 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
1087 "[E_SYSTEM] A system error has occurred. Failed to set cursor position.");
1093 _SearchBar::RemoveTextBlock(void)
1095 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1096 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1098 result r = E_SUCCESS;
1100 r = __pEdit->RemoveTextBlock();
1101 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1107 _SearchBar::GetColor(void) const
1109 Variant backgroundColor = GetProperty("color");
1111 return backgroundColor.ToColor();
1115 _SearchBar::GetSearchFieldColor(SearchFieldStatus status) const
1117 Variant searchFieldColor;
1121 case SEARCH_FIELD_STATUS_NORMAL:
1122 searchFieldColor = GetProperty("searchFieldNormalColor");
1124 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
1125 searchFieldColor = GetProperty("searchFieldHighlightedColor");
1127 case SEARCH_FIELD_STATUS_DISABLED:
1128 searchFieldColor = GetProperty("searchFieldDisabledColor");
1134 return searchFieldColor.ToColor();
1139 _SearchBar::GetSearchFieldTextColor(SearchFieldStatus status) const
1141 Variant searchFieldTextColor;
1145 case SEARCH_FIELD_STATUS_NORMAL:
1146 searchFieldTextColor = GetProperty("searchFieldNormalTextColor");
1148 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
1149 searchFieldTextColor = GetProperty("searchFieldHighlightedTextColor");
1151 case SEARCH_FIELD_STATUS_DISABLED:
1152 searchFieldTextColor = GetProperty("searchFieldDisabledTextColor");
1158 return searchFieldTextColor.ToColor();
1163 _SearchBar::SetBackgroundBitmap(const Bitmap& bitmap)
1165 Bitmap* pNewBitmap = _BitmapImpl::CloneN(bitmap);
1166 SysTryReturn(NID_UI_CTRL, pNewBitmap, E_SYSTEM, E_SYSTEM,
1167 "[E_SYSTEM] A system error has occurred. The creation of bitmap failed.");
1169 delete __pBackgroundBitmap;
1170 __pBackgroundBitmap = null;
1172 __pBackgroundBitmap = pNewBitmap;
1178 _SearchBar::GetBackgroundBitmap(void) const
1180 return __pBackgroundBitmap;
1184 _SearchBar::SetColor(const Color& color)
1186 return SetProperty("color", Variant(color));
1190 _SearchBar::SetSearchFieldColor(SearchFieldStatus status, const Color& color)
1192 result r = E_SUCCESS;
1196 case SEARCH_FIELD_STATUS_NORMAL:
1197 r = SetProperty("searchFieldNormalColor", Variant(color));
1199 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
1200 r = SetProperty("searchFieldHighlightedColor", Variant(color));
1202 case SEARCH_FIELD_STATUS_DISABLED:
1203 r = SetProperty("searchFieldDisabledColor", Variant(color));
1214 _SearchBar::SetSearchFieldTextColor(SearchFieldStatus status, const Color& color)
1216 result r = E_SUCCESS;
1220 case SEARCH_FIELD_STATUS_NORMAL:
1221 r = SetProperty("searchFieldNormalTextColor", Variant(color));
1223 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
1224 r = SetProperty("searchFieldHighlightedTextColor", Variant(color));
1226 case SEARCH_FIELD_STATUS_DISABLED:
1227 r = SetProperty("searchFieldDisabledTextColor", Variant(color));
1238 _SearchBar::GetGuideText(void) const
1240 SysTryReturn(NID_UI_CTRL, __pEdit, String(), E_SYSTEM,
1241 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1243 return __pEdit->GetGuideText();
1247 _SearchBar::SetGuideText(const String& guideText)
1249 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1250 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1252 __pEdit->SetGuideText(guideText);
1258 _SearchBar::GetGuideTextColor(void) const
1260 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1261 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1263 return __pEdit->GetGuideTextColor();
1267 _SearchBar::SetGuideTextColor(const Color& color)
1269 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1270 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1272 __isUserGuideTextColor = true;
1273 return __pEdit->SetGuideTextColor(color);
1277 _SearchBar::GetCursorPosition(void) const
1279 SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM,
1280 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1282 return __pEdit->GetCursorPosition();
1286 _SearchBar::SetCursorPosition(int index)
1288 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1289 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1290 SysTryReturn(NID_UI_CTRL, index > -1, E_OUT_OF_RANGE, E_OUT_OF_RANGE,
1291 "[E_OUT_OF_RANGE] index(%d) is out of range.", GetErrorMessage(E_OUT_OF_RANGE), index);
1293 int textLength = -1;
1294 textLength = __pEdit->GetTextLength();
1296 SysTryReturn(NID_UI_CTRL, (index > -1 && index <= textLength), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
1297 "[E_OUT_OF_RANGE] index(%d) is out of range.", index);
1299 return __pEdit->SetCursorPosition(index);
1303 _SearchBar::IsLowerCaseModeEnabled(void) const
1305 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1306 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1308 return __pEdit->IsLowerCaseModeEnabled();
1312 _SearchBar::SetLowerCaseModeEnabled(bool enable)
1314 SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM,
1315 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1317 __pEdit->SetLowerCaseModeEnabled(enable);
1321 _SearchBar::GetEllipsisPosition(void) const
1323 SysTryReturn(NID_UI_CTRL, __pEdit, ELLIPSIS_POSITION_START, E_SYSTEM,
1324 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1326 return __pEdit->GetEllipsisPosition();
1330 _SearchBar::SetEllipsisPosition(EllipsisPosition position)
1332 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1333 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1334 __pEdit->SetEllipsisPosition(position);
1340 _SearchBar::GetKeypadAction(void) const
1342 return __keypadAction;
1346 _SearchBar::IsTextPredictionEnabled(void) const
1348 SysTryReturn(NID_UI_CTRL, __pEdit, false, E_SYSTEM,
1349 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1350 return __pEdit->IsTextPredictionEnabled();
1354 _SearchBar::SetTextPredictionEnabled(bool enable)
1356 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
1357 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
1358 return __pEdit->SetTextPredictionEnabled(enable);
1362 _SearchBar::SetCurrentLanguage(LanguageCode languageCode)
1364 return __pEdit->SetCurrentLanguage(languageCode);
1368 _SearchBar::GetCurrentLanguage(LanguageCode& language) const
1370 return __pEdit->GetCurrentLanguage(language);
1374 _SearchBar::AddActionEventListener(const _IActionEventListener& listener)
1376 result r = E_SUCCESS;
1378 if (__pActionEvent == null)
1380 __pActionEvent = _ActionEvent::CreateInstanceN(*this);
1381 r = GetLastResult();
1382 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1384 __pActionEvent->AddListener(listener);
1391 _SearchBar::RemoveActionEventListener(const _IActionEventListener& listener)
1393 SysTryReturn(NID_UI_CTRL, __pActionEvent, E_SYSTEM, E_SYSTEM,
1394 "[E_SYSTEM] A system error has occurred. The action event instance is null.");
1395 result r = E_SUCCESS;
1397 r = __pActionEvent->RemoveListener(listener);
1398 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1404 _SearchBar::AddKeypadEventListener(const _IKeypadEventListener& listener)
1406 result r = E_SUCCESS;
1408 if (__pKeypadEvent == null)
1410 __pKeypadEvent = _KeypadEvent::CreateInstanceN(*this);
1411 r = GetLastResult();
1412 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1414 r = __pKeypadEvent->AddListener(listener);
1415 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1422 _SearchBar::RemoveKeypadEventListener(const _IKeypadEventListener& listener)
1424 SysTryReturn(NID_UI_CTRL, __pKeypadEvent, E_SYSTEM, E_SYSTEM,
1425 "[E_SYSTEM] A system error has occurred. The keypad event instance is null.");
1426 result r = E_SUCCESS;
1428 r = __pKeypadEvent->RemoveListener(listener);
1429 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1435 _SearchBar::AddTextBlockEventListener(const _ITextBlockEventListener& listener)
1437 result r = E_SUCCESS;
1439 if (__pTextBlockEvent == null)
1441 __pTextBlockEvent = _TextBlockEvent::CreateInstanceN(*this);
1442 r = GetLastResult();
1443 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1445 r = __pTextBlockEvent->AddListener(listener);
1446 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1454 _SearchBar::RemoveTextBlockEventListener(const _ITextBlockEventListener& listener)
1456 SysTryReturn(NID_UI_CTRL, __pTextBlockEvent, E_SYSTEM, E_SYSTEM,
1457 "[E_SYSTEM] A system error has occurred. The text block event instance is null.");
1458 result r = E_SUCCESS;
1460 r = __pTextBlockEvent->RemoveListener(listener);
1461 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1468 _SearchBar::AddTextEventListener(const _ITextEventListener& listener)
1470 result r = E_SUCCESS;
1472 if (__pTextEvent == null)
1474 __pTextEvent = _TextEvent::CreateInstanceN(*this);
1475 r = GetLastResult();
1476 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1478 r = __pTextEvent->AddListener(listener);
1479 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1486 _SearchBar::RemoveTextEventListener(const _ITextEventListener& listener)
1488 SysTryReturn(NID_UI_CTRL, __pTextEvent, E_SYSTEM, E_SYSTEM,
1489 "[E_SYSTEM] A system error has occurred. The text event instance is null.");
1490 result r = E_SUCCESS;
1492 r = __pTextEvent->RemoveListener(listener);
1493 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1499 _SearchBar::AddSearchBarEventListener(const _ISearchBarEventListener& listener)
1501 result r = E_SUCCESS;
1503 if (__pSearchBarEvent == null)
1505 __pSearchBarEvent = _SearchBarEvent::CreateInstanceN(*this);
1506 r = GetLastResult();
1507 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1509 r = __pSearchBarEvent->AddListener(listener);
1510 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1517 _SearchBar::RemoveSearchBarEventListener(const _ISearchBarEventListener& listener)
1519 SysTryReturn(NID_UI_CTRL, __pSearchBarEvent, E_SYSTEM, E_SYSTEM,
1520 "[E_SYSTEM] A system error has occurred. The searchbar event instance is null.");
1521 result r = E_SUCCESS;
1523 r = __pSearchBarEvent->RemoveListener(listener);
1524 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1530 _SearchBar::AddLanguageEventListener(const _ILanguageEventListener& listener)
1532 result r = E_SUCCESS;
1534 if (__pLanguageEvent == null)
1536 __pLanguageEvent = _LanguageEvent::CreateInstanceN(*this);
1537 r = GetLastResult();
1538 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1540 r = __pLanguageEvent->AddListener(listener);
1541 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1548 _SearchBar::RemoveLanguageEventListener(const _ILanguageEventListener& listener)
1550 SysTryReturn(NID_UI_CTRL, __pLanguageEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1551 result r = E_SUCCESS;
1553 __pLanguageEvent->RemoveListener(listener);
1554 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1560 _SearchBar::OnBoundsChanged(void)
1562 if (__pSearchBarPresenter != null)
1564 __isupdateContentBounds = true;
1565 __pSearchBarPresenter->OnBoundsChanged();
1568 if (__pAccessibilitySearchBarElement)
1570 __pAccessibilitySearchBarElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
1576 _SearchBar::OnChangeLayout(_ControlOrientation orientation)
1578 __isupdateContentBounds = true;
1583 _SearchBar::OnDraw(void)
1585 if (!__isUserGuideTextColor)
1587 SearchFieldStatus status = GetCurrentStatus();
1588 __pEdit->SetGuideTextColor(__guideTextColor[status]);
1591 if (__isupdateContentBounds)
1594 __isupdateContentBounds = false;
1596 __pSearchBarPresenter->Draw();
1600 _UiTouchEventDelivery
1601 _SearchBar::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1603 _Edit* pEdit = dynamic_cast <_Edit*>(const_cast <_Control*>(&source));
1606 return _UI_TOUCH_EVENT_DELIVERY_YES;
1609 if (pEdit->IsClearIconPressed())
1611 return _UI_TOUCH_EVENT_DELIVERY_YES;
1614 SetContentAreaVisible(__contentVisibilitySetByApp); //When a touch happens on SearchField
1615 SetFocusCallbackParameter(true);
1616 SetMode(SEARCH_BAR_MODE_INPUT);
1618 return _UI_TOUCH_EVENT_DELIVERY_YES;
1622 _SearchBar::OnActionPerformed(const _Control& source, int actionId)
1624 if (__actionId == actionId)
1626 __isCancelActionInProgress = true;
1627 SetFocusCallbackParameter(true);
1628 SetMode(SEARCH_BAR_MODE_NORMAL);
1634 IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(__actionId);
1635 result r = GetLastResult();
1636 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1638 __pActionEvent->Fire(*pEventArg);
1640 __isCancelActionInProgress = false;
1647 _SearchBar::OnKeypadWillOpen(void)
1649 if (!__isKeypadOpening)
1653 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_CREATED);
1654 result r = GetLastResult();
1655 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1657 __pKeypadEvent->Fire(*pEventArg);
1661 __isKeypadOpening = true;
1666 _SearchBar::OnKeypadOpened(void)
1670 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_OPEN);
1671 result r = GetLastResult();
1672 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1674 __pKeypadEvent->Fire(*pEventArg);
1677 __isKeypadOpening = false;
1683 _SearchBar::OnKeypadClosed(void)
1687 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_CLOSE);
1688 result r = GetLastResult();
1689 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1691 __pKeypadEvent->Fire(*pEventArg);
1694 __isKeypadOpening = false;
1701 _SearchBar::OnKeypadBoundsChanged(void)
1705 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
1706 result r = GetLastResult();
1707 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1709 __pKeypadEvent->Fire(*pEventArg);
1717 _SearchBar::OnKeypadActionPerformed(CoreKeypadAction keypadAction)
1721 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(keypadAction, CORE_KEYPAD_EVENT_STATUS_ENTERACTION);
1722 result r = GetLastResult();
1723 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1725 __pKeypadEvent->Fire(*pEventArg);
1730 // TextBlock callbacks
1732 _SearchBar::OnTextBlockSelected(_Control& source, int start, int end)
1734 if (__pTextBlockEvent)
1736 IEventArg* pEventArg = _TextBlockEvent::CreateTextBlockEventArgN(start, end);
1737 result r = GetLastResult();
1738 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1740 __pTextBlockEvent->Fire(*pEventArg);
1747 _SearchBar::OnTextValueChanged(const _Control& source)
1749 if (GetTextLength())
1751 SetContentAreaVisible(__contentVisibilitySetByApp);
1754 if (!__isCancelActionInProgress)
1756 SetContentDimming();
1757 if (__pTextEvent != null)
1759 IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(CORE_TEXT_EVENT_CHANGED);
1760 result r = GetLastResult();
1761 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1763 __pTextEvent->Fire(*pEventArg);
1770 _SearchBar::OnTextValueChangeCanceled(const _Control& source)
1772 if (__pTextEvent != null)
1774 IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(CORE_TEXT_EVENT_CANCELED);
1775 result r = GetLastResult();
1776 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1778 __pTextEvent->Fire(*pEventArg);
1784 _SearchBar::OnAttachedToMainTree(void)
1791 _SearchBar::OnFontChanged(Font* pFont)
1793 __pCancelButton->SetFont(pFont->GetFaceName());
1794 __pEdit->SetFont(*pFont);
1799 _SearchBar::OnFontInfoRequested(unsigned long& style, int& size)
1801 style = FONT_STYLE_PLAIN;
1802 size = __pCancelButton->GetTextSize();
1808 _SearchBar::OnFocusGained(const _Control& source)
1810 return _Control::OnFocusGained(source);
1814 _SearchBar::OnFocusLost(const _Control &source)
1816 return _Control::OnFocusLost(source);
1820 _SearchBar::OnDrawFocus(void)
1822 __isInFocusMode = true;
1823 __pEdit->SetSearchFieldFocus(true);
1824 _Control::OnDrawFocus();
1830 _SearchBar::OnFocusModeStateChanged(void)
1832 __isInFocusMode = false;
1834 if (__pEdit->IsFocused())
1836 __pEdit->SetSearchFieldFocus(false);
1837 __pEdit->Invalidate();
1840 if (__pCancelButton->IsFocused())
1842 __pCancelButton->OnFocusModeStateChanged();
1849 _SearchBar::IsChildControlFocusManage(void) const
1855 _SearchBar::OnPreviewKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
1857 if (!__pEdit->IsUsbKeyboardConnected())
1862 _KeyCode keyCode = keyInfo.GetKeyCode();
1869 SetFocusCallbackParameter(true);
1870 if ((__pContentControl && __pContentControl->IsVisible() == false) || !__pContentControl)
1872 SetContentAreaVisible(false);
1883 _SearchBar::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
1885 if (!__pEdit->IsUsbKeyboardConnected())
1890 if (!__isInFocusMode)
1895 _KeyCode keyCode = keyInfo.GetKeyCode();
1900 if (&source == this)
1902 SetContentAreaVisible(__contentVisibilitySetByApp);
1903 SetFocusCallbackParameter(true);
1904 SetMode(SEARCH_BAR_MODE_INPUT);
1905 __pEdit->SetFocused();
1908 SetFocusCallbackParameter(false);
1910 if (&source == __pEdit)
1912 if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->IsVisible() && __pContentControl->GetEnableState())
1914 __pContentControl->SetFocused();
1915 __pContentControl->OnDrawFocus();
1919 else if (__isButtonEnabled && __isUsableCancelButton)
1921 __pCancelButton->SetFocused();
1927 if (&source == __pCancelButton && __pContentControl && __pContentControl->IsVisible() && __pContentControl->GetEnableState())
1929 __pContentControl->SetFocused();
1930 __pContentControl->OnDrawFocus();
1938 if (&source == __pCancelButton)
1940 __pEdit->SetFocused();
1944 if (&source == __pContentControl)
1946 if ((__isButtonEnabled && __isUsableCancelButton))
1948 __pCancelButton->SetFocused();
1952 __pEdit->SetFocused();
1960 if (&source == __pCancelButton)
1962 SetFocusCallbackParameter(true);
1963 SetMode(SEARCH_BAR_MODE_NORMAL);
1965 _Control::OnDrawFocus();
1980 _SearchBar::OnSettingChanged(Tizen::Base::String& key)
1982 if (__isButtonTextChangedByApp || !__isUsableCancelButton)
1987 if (key.Equals(L"http://tizen.org/setting/locale.language", false))
1990 GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_CANCEL_ABB, cancelText);
1991 __pCancelButton->SetText(cancelText);
1992 __pCancelButton->Invalidate();
1999 _SearchBar::OnCanvasRequestedN(const FloatRectangle& bounds)
2001 return __pSearchBarPresenter->OnCanvasRequestedN(bounds);
2005 _SearchBar::GetParentForm(void) const
2007 _Form* pForm = null;
2008 _Control* pControlCore = GetParent();
2012 if (pControlCore == null)
2014 SysLog(NID_UI_CTRL,"[E_SYSTEM] The parent form is null.");
2019 pForm = dynamic_cast <_Form*>(pControlCore);
2026 pControlCore = pControlCore->GetParent();
2029 return pControlCore;
2033 _SearchBar::GetSearchBarButton(void) const
2035 return __pCancelButton;
2039 _SearchBar::GetSearchField(void)
2045 _SearchBar::GetSearchBarContainer(void) const
2047 return __pContainer;
2051 _SearchBar::GetClippedGroupControl(void) const
2053 return __pClippedGroupControl;
2057 _SearchBar::IsUsableCancelButton(void) const
2059 return __isUsableCancelButton;
2063 _SearchBar::ConvertSearchBarStatus(SearchFieldStatus status)
2065 EditStatus editStatus = EDIT_STATUS_NORMAL;
2068 case SEARCH_FIELD_STATUS_NORMAL:
2069 editStatus = EDIT_STATUS_NORMAL;
2072 case SEARCH_FIELD_STATUS_DISABLED:
2073 editStatus = EDIT_STATUS_DISABLED;
2076 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
2077 editStatus = EDIT_STATUS_HIGHLIGHTED;
2087 _SearchBar::ConvertSearchBarButtonStatus(SearchBarButtonStatus status)
2089 _ButtonStatus buttonStatus = _BUTTON_STATUS_NORMAL;
2093 case SEARCH_BAR_BUTTON_STATUS_NORMAL:
2094 buttonStatus = _BUTTON_STATUS_NORMAL;
2097 case SEARCH_BAR_BUTTON_STATUS_PRESSED:
2098 buttonStatus = _BUTTON_STATUS_PRESSED;
2101 case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
2102 buttonStatus = _BUTTON_STATUS_HIGHLIGHTED;
2105 case SEARCH_BAR_BUTTON_STATUS_DISABLED:
2106 buttonStatus = _BUTTON_STATUS_DISABLED;
2112 return buttonStatus;
2116 _SearchBar::SendSearchBarEvent(_SearchBarEventStatus status)
2118 result r = E_SUCCESS;
2119 if (__pSearchBarEvent)
2121 IEventArg* pEventArg = _SearchBarEvent::CreateSearchBarEventArgN(status);
2122 r = GetLastResult();
2123 SysTryReturn(NID_UI_CTRL, pEventArg, r, r, "[%s] Propagating.", GetErrorMessage(r));
2125 if (IsContentAreaVisible() == false)
2127 SetContentAreaVisible(false);
2130 __pSearchBarEvent->Fire(*pEventArg);
2137 _SearchBar::SetHeaderVisibleState(bool visible)
2139 if (__pSearchBarPresenter != null)
2141 __pSearchBarPresenter->SetHeaderVisibleState(visible);
2147 _SearchBar::SetPropertyButtonActionId(const Variant& actionId)
2149 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2150 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2151 SysTryReturn(NID_UI_CTRL, actionId.ToInt() > -1, E_INVALID_ARG, E_INVALID_ARG,
2152 "[E_INVALID_ARG] Invalid argument(s) is used. actionId.ToInt() = %d", actionId.ToInt());
2154 result r = E_SUCCESS;
2156 r = __pCancelButton->SetPropertyActionId(actionId);
2157 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2158 "[%s] A system error has occurred. Failed to set actionId.", GetErrorMessage(E_SYSTEM));
2160 __actionId = actionId.ToInt();
2166 _SearchBar::GetPropertyButtonActionId(void) const
2168 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(-1), E_SYSTEM,
2169 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2171 return Variant(__actionId);
2175 _SearchBar::SetPropertyButtonDisabledColor(const Variant& color)
2177 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2178 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2180 result r = E_SUCCESS;
2182 r = __pCancelButton->SetPropertyDisabledColor(color);
2183 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2184 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2186 __buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED] = color.ToColor();
2192 _SearchBar::GetPropertyButtonDisabledColor(void) const
2194 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2195 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2197 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
2201 _SearchBar::SetPropertyButtonHighlightedColor(const Variant& color)
2203 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2204 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2206 result r = E_SUCCESS;
2208 r = __pCancelButton->SetPropertyHighlightedColor(color);
2209 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2210 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2212 __buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED] = color.ToColor();
2218 _SearchBar::GetPropertyButtonHighlightedColor(void) const
2220 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2221 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2223 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
2227 _SearchBar::SetPropertyButtonNormalColor(const Variant& color)
2229 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2230 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2232 result r = E_SUCCESS;
2234 r = __pCancelButton->SetPropertyNormalColor(color);
2235 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2236 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2238 __buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL] = color.ToColor();
2244 _SearchBar::GetPropertyButtonNormalColor(void) const
2246 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2247 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2249 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
2253 _SearchBar::SetPropertyButtonPressedColor(const Variant& color)
2255 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2256 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2258 result r = E_SUCCESS;
2260 r = __pCancelButton->SetPropertyPressedColor(color);
2261 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2262 "[E_SYSTEM] A system error has occurred. Failed to set button color.");
2264 __buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED] = color.ToColor();
2270 _SearchBar::GetPropertyButtonPressedColor(void) const
2272 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2273 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2275 return Variant(__buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
2279 _SearchBar::SetPropertyButtonDisabledTextColor(const Variant& textColor)
2281 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2282 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2284 result r = E_SUCCESS;
2286 r = __pCancelButton->SetPropertyDisabledTextColor(textColor);
2287 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2288 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2290 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_DISABLED] = textColor.ToColor();
2296 _SearchBar::GetPropertyButtonDisabledTextColor(void) const
2298 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2299 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2301 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]);
2305 _SearchBar::SetPropertyButtonHighlightedTextColor(const Variant& textColor)
2307 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2308 "[E_SYSTEM]] A system error has occurred. The cancel button instance is null.");
2310 result r = E_SUCCESS;
2312 r = __pCancelButton->SetPropertyHighlightedTextColor(textColor);
2313 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2314 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2316 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED] = textColor.ToColor();
2322 _SearchBar::GetPropertyButtonHighlightedTextColor(void) const
2324 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2325 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2327 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]);
2331 _SearchBar::SetPropertyButtonNormalTextColor(const Variant& textColor)
2333 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2334 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2336 result r = E_SUCCESS;
2338 r = __pCancelButton->SetPropertyNormalTextColor(textColor);
2339 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2340 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2342 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL] = textColor.ToColor();
2348 _SearchBar::GetPropertyButtonNormalTextColor(void) const
2350 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2351 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2353 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]);
2357 _SearchBar::SetPropertyButtonPressedTextColor(const Variant& textColor)
2359 SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
2360 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2362 result r = E_SUCCESS;
2364 r = __pCancelButton->SetPropertyPressedTextColor(textColor);
2365 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2366 "[E_SYSTEM] A system error has occurred. Failed to set button text color.");
2368 __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED] = textColor.ToColor();
2374 _SearchBar::GetPropertyButtonPressedTextColor(void) const
2376 SysTryReturn(NID_UI_CTRL, __pCancelButton, Variant(Color()), E_SYSTEM,
2377 "[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
2379 return Variant(__buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]);
2383 _SearchBar::SetPropertySearchFieldDisabledColor(const Variant& color)
2385 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2386 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2388 result r = E_SUCCESS;
2390 r = __pEdit->SetPropertyDisabledColor(color);
2391 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2392 "[E_SYSTEM] A system error has occurred. Failed to set the edit disabled color.");
2394 __color[SEARCH_FIELD_STATUS_DISABLED] = color.ToColor();
2400 _SearchBar::GetPropertySearchFieldDisabledColor(void) const
2402 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2403 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2405 return Variant(__color[SEARCH_FIELD_STATUS_DISABLED]);
2409 _SearchBar::SetPropertySearchFieldHighlightedColor(const Variant& color)
2411 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2412 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2414 result r = E_SUCCESS;
2416 r = __pEdit->SetPropertyHighlightedColor(color);
2417 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2418 "[E_SYSTEM] A system error has occurred. Failed to set the edit highlighted color.");
2420 __color[SEARCH_FIELD_STATUS_HIGHLIGHTED] = color.ToColor();
2426 _SearchBar::GetPropertySearchFieldHighlightedColor(void) const
2428 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2429 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2431 return Variant(__color[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
2435 _SearchBar::SetPropertySearchFieldNormalColor(const Variant& color)
2437 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2438 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2440 result r = E_SUCCESS;
2442 r = __pEdit->SetPropertyNormalColor(color);
2443 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2444 "[E_SYSTEM] A system error has occurred. Failed to set edit normal color.");
2446 __color[SEARCH_FIELD_STATUS_NORMAL] = color.ToColor();
2452 _SearchBar::GetPropertySearchFieldNormalColor(void) const
2454 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2455 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2457 return Variant(__color[SEARCH_FIELD_STATUS_NORMAL]);
2461 _SearchBar::SetPropertySearchFieldDisabledTextColor(const Variant& textColor)
2463 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2464 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2466 result r = E_SUCCESS;
2468 r = __pEdit->SetPropertyDisabledTextColor(textColor);
2469 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2470 "[E_SYSTEM] A system error has occurred. Failed to set edit disabled text color.");
2472 __textColor[SEARCH_FIELD_STATUS_DISABLED] = textColor.ToColor();
2478 _SearchBar::GetPropertySearchFieldDisabledTextColor(void) const
2480 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2481 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2483 return Variant(__textColor[SEARCH_FIELD_STATUS_DISABLED]);
2487 _SearchBar::SetPropertySearchFieldHighlightedTextColor(const Variant& textColor)
2489 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2490 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2492 result r = E_SUCCESS;
2494 r = __pEdit->SetPropertyHighlightedTextColor(textColor);
2495 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2496 "[E_SYSTEM] A system error has occurred. Failed to set edit highlighted text color.");
2498 __textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED] = textColor.ToColor();
2504 _SearchBar::GetPropertySearchFieldHighlightedTextColor(void) const
2506 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2507 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2509 return Variant(__textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
2513 _SearchBar::SetPropertySearchFieldNormalTextColor(const Variant& textColor)
2515 SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
2516 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2518 result r = E_SUCCESS;
2520 r = __pEdit->SetPropertyNormalTextColor(textColor);
2521 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
2522 "[E_SYSTEM] A system error has occurred. Failed to set edit normal text color.");
2524 __textColor[SEARCH_FIELD_STATUS_NORMAL] = textColor.ToColor();
2530 _SearchBar::GetPropertySearchFieldNormalTextColor(void) const
2532 SysTryReturn(NID_UI_CTRL, __pEdit, Variant(Color()), E_SYSTEM,
2533 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2535 return Variant(__textColor[SEARCH_FIELD_STATUS_NORMAL]);
2539 _SearchBar::SetPropertyColor(const Variant& color)
2541 __backgroundColor = color.ToColor();
2547 _SearchBar::GetPropertyColor(void) const
2549 return Variant(__backgroundColor);
2553 _SearchBar::SetPropertyContentAreaSize(const Variant& size)
2555 FloatDimension contentAreaSize = size.ToFloatDimension();
2556 SysTryReturn(NID_UI_CTRL, contentAreaSize.width >= 0 && contentAreaSize.height >= 0, E_INVALID_ARG, E_INVALID_ARG,
2557 "[E_INVALID_ARG] Invalid argument(s) is used. contentAreaSize.width = %f, contenAreaSize.height = %f",
2558 contentAreaSize.width, contentAreaSize.height);
2560 result r = E_SUCCESS;
2563 FloatRectangle bounds = GetBoundsF();
2564 FloatRectangle contentAreaBounds(0.0f, 0.0f, 0.0f, 0.0f);
2566 contentAreaBounds.x = 0.0f;
2567 contentAreaBounds.y = bounds.height;
2568 contentAreaBounds.width = contentAreaSize.width;
2569 contentAreaBounds.height = contentAreaSize.height;
2571 __contentAreaBounds = contentAreaBounds;
2572 __isUserContainerBounds = true;
2577 r = __pContainer->SetBounds(__contentAreaBounds);
2578 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
2585 _SearchBar::GetPropertyContentAreaSize(void) const
2587 FloatDimension contentAreaSize(__contentAreaBounds.width, __contentAreaBounds.height);
2589 return Variant(contentAreaSize);
2593 _SearchBar::CreateClippedGroupControl(void)
2595 result r = E_SUCCESS;
2596 FloatRectangle clippedGroupControlBounds(FloatPoint(0.0f, 0.0f), GetSizeF());
2597 __pClippedGroupControl = _Control::CreateControlN();
2598 r = GetLastResult();
2599 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
2601 r = AttachChild(*__pClippedGroupControl);
2602 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM,
2603 "[E_SYSTEM] A system error has occurred. Failed to attach the parent of clipped control.");
2605 r = __pClippedGroupControl->SetBounds(clippedGroupControlBounds);
2606 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
2608 __pClippedGroupControl->SetBackgroundColor(Color(0));
2610 __pClippedGroupControl->SetClipChildrenEnabled(true);
2615 delete __pClippedGroupControl;
2616 __pClippedGroupControl = null;
2622 _SearchBar::InitializeAccessibility(void)
2624 _AccessibilityContainer* pSBContainer = null;
2625 pSBContainer = GetAccessibilityContainer();
2627 _AccessibilityContainer* pEditContainer = null;
2628 pEditContainer = __pEdit->GetAccessibilityContainer();
2629 pSBContainer->AddChildContainer(*pEditContainer);
2631 _AccessibilityContainer* pButtonContainer = null;
2632 pButtonContainer = __pCancelButton->GetAccessibilityContainer();
2634 if (__isUsableCancelButton)
2636 pSBContainer->AddChildContainer(*pButtonContainer);
2639 _AccessibilityElement* pEditElement = __pEdit->GetTextAccessibilityElement();
2641 pEditElement->SetHint("Double Tap To Type Search Text");
2642 pEditElement->SetTrait("SearchBar");
2643 pEditElement->SetName("SearchField");
2645 pSBContainer->Activate(false);
2651 _SearchBar::SetContentDimming(void)
2653 if (__pContainer != NULL)
2655 if (!GetTextLength())
2657 __contentColor.SetAlpha(_SEARCH_CONTENT_DIM_OPACITY);
2661 __contentColor.SetAlpha(0);
2663 __pContainer->SetBackgroundColor(__contentColor);
2669 _SearchBar::IsContentAttachable(const _Control* pContent)
2671 const _Window* pWindow = dynamic_cast <const _Window*>(pContent);
2672 const _ColorPicker* pColorPicker = dynamic_cast <const _ColorPicker*>(pContent);
2673 const _Form* pForm = dynamic_cast <const _Form*>(pContent);
2674 const _Keypad* pKeypad = dynamic_cast <const _Keypad*>(pContent);
2675 const _OverlayPanel* pOverlayPanel = dynamic_cast <const _OverlayPanel*>(pContent);
2677 bool isContentAttachable = true;
2679 isContentAttachable = ((pWindow == null) && (pColorPicker == null) &&
2680 (pForm == null) && (pKeypad == null) && (pOverlayPanel == null));
2681 return isContentAttachable;
2685 _SearchBar::ResizeCancelButton(void)
2687 result r = E_SUCCESS;
2689 float horizontalMargin = 0.0f;
2690 float buttonLeftMargin = 0.0f;
2691 float buttonRightMargin = 0.0f;
2692 float buttonMinWidth = 0.0f;
2693 float searchFieldMinWidth = 0.0f;
2694 float buttonVerticalMargin = 0.0f;
2695 float searchBarMinHeight = 0.0f;
2696 float buttonWidth = 0.0f;
2697 float buttonHeight = 0.0f;
2699 FloatRectangle cancelButtonBounds;
2700 FloatRectangle searchBarBounds = GetBoundsF();
2702 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
2704 GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
2705 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_LEFT_MARGIN, orientation, buttonLeftMargin);
2706 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_RIGHT_MARGIN, orientation, buttonRightMargin);
2707 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
2708 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_HEIGHT, orientation, buttonHeight);
2709 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_MIN_WIDTH, orientation, buttonMinWidth);
2710 GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
2711 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin);
2712 GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
2714 cancelButtonBounds.width = buttonWidth;
2715 cancelButtonBounds.height = buttonHeight;
2717 float buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth +
2718 cancelButtonBounds.width + buttonLeftMargin + buttonRightMargin);
2720 if (searchBarBounds.width < buttonResizableSearchBarWidth)
2722 cancelButtonBounds.width = searchBarBounds.width -(searchFieldMinWidth + buttonLeftMargin
2723 + buttonRightMargin + horizontalMargin);
2726 cancelButtonBounds.x = searchBarBounds.width - cancelButtonBounds.width - buttonRightMargin;
2727 cancelButtonBounds.y = (searchBarBounds.height - cancelButtonBounds.height)/2.0f;
2729 cancelButtonBounds.y = cancelButtonBounds.y < 0.0f ? 0.0f:cancelButtonBounds.y;
2731 if (cancelButtonBounds.width < buttonMinWidth)
2733 cancelButtonBounds.width = buttonMinWidth;
2736 cancelButtonBounds.width = (cancelButtonBounds.width > 0.0f) ? cancelButtonBounds.width : 0.0f;
2737 cancelButtonBounds.height = (cancelButtonBounds.height > 0.0f) ? cancelButtonBounds.height : 0.0f;
2738 r = __pCancelButton->SetBounds(cancelButtonBounds);
2744 _SearchBar::RecalculateButtonBounds(void)
2746 result r = E_SUCCESS;
2748 float horizontalMargin = 0.0f;
2749 float verticalMargin = 0.0f;
2750 float buttonLeftMargin = 0.0f;
2751 float buttonRightMargin = 0.0f;
2752 float buttonMinWidth = 0.0f;
2753 float searchFieldMinWidth = 0.0f;
2754 float buttonVerticalMargin = 0.0f;
2755 float searchBarMinHeight = 0.0f;
2756 float buttonWidth = 0.0f;
2757 float buttonHeight = 0.0f;
2758 float cancelButtonWidth = 0.0f;
2760 FloatRectangle cancelButtonBounds;
2761 FloatRectangle editBounds;
2762 FloatRectangle searchBarBounds = GetBoundsF();
2764 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
2766 GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
2767 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, verticalMargin);
2768 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_LEFT_MARGIN, orientation, buttonLeftMargin);
2769 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_RIGHT_MARGIN, orientation, buttonRightMargin);
2770 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
2771 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_HEIGHT, orientation, buttonHeight);
2772 GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_MIN_WIDTH, orientation, buttonMinWidth);
2773 GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
2774 GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin);
2775 GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
2777 cancelButtonBounds.height = buttonHeight;
2779 float searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2.0f);
2780 cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
2781 editBounds.x = horizontalMargin;
2783 if (searchBarBounds.height < searchBarMinHeight)
2785 verticalMargin = (searchBarBounds.height - searchFieldMinHeight)/2.0f;
2786 if (verticalMargin < 0.0f)
2788 verticalMargin = 0.0f;
2792 editBounds.y = verticalMargin;
2793 editBounds.height = searchBarBounds.height - (editBounds.y * 2.0f);
2795 editBounds.height = (editBounds.height > searchFieldMinHeight) ? editBounds.height : searchFieldMinHeight;
2797 editBounds.width = searchBarBounds.width - cancelButtonWidth - horizontalMargin - buttonLeftMargin - buttonRightMargin;
2799 if (editBounds.width < searchFieldMinWidth)
2801 editBounds.width = searchFieldMinWidth;
2804 cancelButtonBounds.x = editBounds.width + horizontalMargin + buttonLeftMargin;
2805 cancelButtonBounds.y = (searchBarBounds.height - cancelButtonBounds.height)/2.0f;
2807 cancelButtonBounds.y = cancelButtonBounds.y < 0.0f ? 0.0f:cancelButtonBounds.y;
2809 float remainingWidth = searchBarBounds.width - editBounds.width - horizontalMargin - buttonLeftMargin - buttonRightMargin;
2811 if (remainingWidth < buttonMinWidth)
2813 cancelButtonBounds.width = buttonMinWidth;
2817 cancelButtonBounds.width = searchBarBounds.width - cancelButtonBounds.x - buttonRightMargin;
2820 cancelButtonBounds.width = (cancelButtonBounds.width > 0.0f) ? cancelButtonBounds.width : 0.0f;
2821 cancelButtonBounds.height = (cancelButtonBounds.height > 0.0f) ? cancelButtonBounds.height : 0.0f;
2823 r = __pCancelButton->SetBounds(cancelButtonBounds);
2824 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
2825 r = __pEdit->SetBounds(editBounds);
2826 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
2832 _SearchBar::GetCurrentStatus(void)
2834 SearchFieldStatus searchFieldStatus = SEARCH_FIELD_STATUS_NORMAL;
2838 if (__pEdit->IsFocused())
2840 searchFieldStatus = SEARCH_FIELD_STATUS_HIGHLIGHTED;
2845 searchFieldStatus = SEARCH_FIELD_STATUS_DISABLED;
2848 return searchFieldStatus;
2852 _SearchBar::SetEditTextFilter(IEditTextFilter* pFilter)
2854 SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM,
2855 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2857 __pEdit->SetEditTextFilter(pFilter);
2863 _SearchBar::SendOpaqueCommand(const String& command)
2865 SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM,
2866 "[E_SYSTEM] A system error has occurred. The edit instance is null.");
2868 __pEdit->SendOpaqueCommand(command);
2874 _SearchBar::SetFocusCallbackParameter(bool state)
2876 __isFocusCallbackToBeFired = state;
2881 _SearchBar::IsFocusCallbackToBeFired(void) const
2883 return __isFocusCallbackToBeFired;
2885 }}} // Tizen::Ui::Controls