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 FUiCtrlSearchBar.cpp
20 * @brief This is the implementation file for SearchBar class.
23 #include <FBaseSysLog.h>
24 #include <FLclLocale.h>
25 #include <FUiCtrlSearchBar.h>
26 #include "FUiCtrl_SearchBarImpl.h"
28 using namespace Tizen::Base;
29 using namespace Tizen::Graphics;
30 using namespace Tizen::Locales;
31 using namespace Tizen::Ui;
33 namespace Tizen { namespace Ui { namespace Controls {
35 SearchBar::SearchBar(void)
39 SearchBar::~SearchBar(void)
44 SearchBar::Construct(const Rectangle& rect, bool searchBarButton, KeypadAction keypadAction)
48 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
49 SysAssertf(pSearchBarImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
51 pSearchBarImpl = _SearchBarImpl::CreateSearchBarImplN(this, rect, searchBarButton, keypadAction);
53 SysTryReturn(NID_UI_CTRL, pSearchBarImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
55 _pControlImpl = pSearchBarImpl;
61 SearchBar::Construct(const FloatRectangle& rect, bool searchBarButton, KeypadAction keypadAction)
65 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
66 SysAssertf(pSearchBarImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
68 pSearchBarImpl = _SearchBarImpl::CreateSearchBarImplFN(this, rect, searchBarButton, keypadAction);
70 SysTryReturn(NID_UI_CTRL, pSearchBarImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
72 _pControlImpl = pSearchBarImpl;
78 SearchBar::GetContent(void) const
80 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
81 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
83 return pSearchBarImpl->GetContent();
87 SearchBar::SetContent(const Control* pContent)
89 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
90 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
92 return pSearchBarImpl->SetContent(pContent);
96 SearchBar::UpdateContentArea(bool invalidate)
98 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
99 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
101 return pSearchBarImpl->UpdateContentArea(invalidate);
105 SearchBar::SetContentAreaVisible(bool visible)
107 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
108 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
110 return pSearchBarImpl->SetContentAreaVisible(visible);
114 SearchBar::IsContentAreaVisible(void) const
116 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
117 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
119 return pSearchBarImpl->IsContentAreaVisible();
123 SearchBar::SetContentAreaSize(const Dimension& size)
125 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
126 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
128 return pSearchBarImpl->SetContentAreaSize(size);
132 SearchBar::SetContentAreaSize(const FloatDimension& size)
134 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
135 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
137 return pSearchBarImpl->SetContentAreaSize(size);
141 SearchBar::GetContentAreaSize(void) const
143 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
144 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
146 return pSearchBarImpl->GetContentAreaSize();
150 SearchBar::GetContentAreaSizeF(void) const
152 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
153 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
155 return pSearchBarImpl->GetContentAreaSizeF();
159 SearchBar::GetMode(void) const
161 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
162 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
164 return pSearchBarImpl->GetMode();
168 SearchBar::IsModeLocked(void) const
170 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
171 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
173 return pSearchBarImpl->IsModeLocked();
177 SearchBar::SetMode(SearchBarMode mode)
179 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
180 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
182 return pSearchBarImpl->SetMode(mode);
186 SearchBar::SetModeLocked(bool modeLocked)
188 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
189 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
191 return pSearchBarImpl->SetModeLocked(modeLocked);
195 SearchBar::GetButtonActionId(void) const
197 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
198 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
200 return pSearchBarImpl->GetButtonActionId();
204 SearchBar::GetButtonColor(SearchBarButtonStatus status) const
206 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
207 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
209 return pSearchBarImpl->GetButtonColor(status);
213 SearchBar::GetButtonTextColor(SearchBarButtonStatus status) const
215 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
216 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
218 return pSearchBarImpl->GetButtonTextColor(status);
221 SearchBarButtonStatus
222 SearchBar::GetButtonStatus(void) const
224 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
225 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
227 return pSearchBarImpl->GetButtonStatus();
231 SearchBar::SetButton(const String& text, int actionId)
233 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
234 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
236 return pSearchBarImpl->SetButton(text, actionId);
240 SearchBar::SetButtonEnabled(bool enabled)
242 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
243 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
245 return pSearchBarImpl->SetButtonEnabled(enabled);
249 SearchBar::SetButtonColor(SearchBarButtonStatus status, const Color& color)
251 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
252 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
254 return pSearchBarImpl->SetButtonColor(status, color);
258 SearchBar::SetButtonTextColor(SearchBarButtonStatus status, const Color& color)
260 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
261 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
263 return pSearchBarImpl->SetButtonTextColor(status, color);
267 SearchBar::AppendCharacter(const Character& character)
269 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
270 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
272 return pSearchBarImpl->AppendCharacter(character);
276 SearchBar::AppendText(const String& text)
278 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
279 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
281 return pSearchBarImpl->AppendText(text);
285 SearchBar::SetText(const String& text)
287 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
288 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
290 return pSearchBarImpl->SetText(text);
294 SearchBar::InsertCharacterAt(int index, const Character& character)
296 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
297 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
299 return pSearchBarImpl->InsertCharacterAt(index, character);
303 SearchBar::InsertTextAt(int index, const String& text)
305 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
306 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
308 return pSearchBarImpl->InsertTextAt(index, text);
312 SearchBar::DeleteCharacterAt(int index)
314 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
315 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
317 return pSearchBarImpl->DeleteCharacterAt(index);
321 SearchBar::Clear(void)
323 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
324 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
326 return pSearchBarImpl->Clear();
330 SearchBar::GetTextLength(void) const
332 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
333 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
335 return pSearchBarImpl->GetTextLength();
339 SearchBar::GetText(void) const
341 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
342 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
344 return pSearchBarImpl->GetText();
348 SearchBar::GetText(int start, int end) const
350 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
351 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
353 return pSearchBarImpl->GetText(start, end);
357 SearchBar::GetLimitLength(void) const
359 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
360 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
362 return pSearchBarImpl->GetLimitLength();
366 SearchBar::SetLimitLength(int limitLength)
368 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
369 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
371 return pSearchBarImpl->SetLimitLength(limitLength);
375 SearchBar::ShowKeypad(void) const
377 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
378 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
380 return pSearchBarImpl->ShowKeypad();
384 SearchBar::HideKeypad(void) const
386 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
387 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
389 return pSearchBarImpl->HideKeypad();
393 SearchBar::GetSearchFieldTextSize(void) const
395 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
396 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
398 return pSearchBarImpl->GetSearchFieldTextSize();
402 SearchBar::GetSearchFieldTextSizeF(void) const
404 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
405 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
407 return pSearchBarImpl->GetSearchFieldTextSizeF();
411 SearchBar::SetSearchFieldTextSize(int size)
413 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
414 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
416 return pSearchBarImpl->SetSearchFieldTextSize(size);
420 SearchBar::SetSearchFieldTextSize(float size)
422 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
423 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
425 return pSearchBarImpl->SetSearchFieldTextSize(size);
429 SearchBar::GetBlockRange(int& start, int& end) const
431 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
432 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
434 return pSearchBarImpl->GetBlockRange(start, end);
438 SearchBar::ReleaseBlock(void)
440 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
441 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
443 return pSearchBarImpl->ReleaseBlock();
447 SearchBar::SetBlockRange(int start, int end)
449 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
450 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
452 return pSearchBarImpl->SetBlockRange(start, end);
456 SearchBar::RemoveTextBlock(void)
458 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
459 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
461 return pSearchBarImpl->RemoveTextBlock();
465 SearchBar::GetColor(void) const
467 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
468 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
470 return pSearchBarImpl->GetColor();
474 SearchBar::GetSearchFieldColor(SearchFieldStatus status) const
476 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
477 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
479 return pSearchBarImpl->GetSearchFieldColor(status);
483 SearchBar::GetSearchFieldTextColor(SearchFieldStatus status) const
485 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
486 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
488 return pSearchBarImpl->GetSearchFieldTextColor(status);
492 SearchBar::SetBackgroundBitmap(const Bitmap& bitmap)
494 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
495 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
497 return pSearchBarImpl->SetBackgroundBitmap(bitmap);
501 SearchBar::SetColor(const Color& color)
503 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
504 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
506 return pSearchBarImpl->SetColor(color);
510 SearchBar::SetSearchFieldColor(SearchFieldStatus status, const Color& color)
512 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
513 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
515 return pSearchBarImpl->SetSearchFieldColor(status, color);
519 SearchBar::SetSearchFieldTextColor(SearchFieldStatus status, const Color& color)
521 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
522 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
524 return pSearchBarImpl->SetSearchFieldTextColor(status, color);
528 SearchBar::GetGuideText(void) const
530 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
531 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
533 return pSearchBarImpl->GetGuideText();
537 SearchBar::SetGuideText(const String& guideText)
539 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
540 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
542 return pSearchBarImpl->SetGuideText(guideText);
546 SearchBar::GetGuideTextColor(void) const
548 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
549 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
551 return pSearchBarImpl->GetGuideTextColor();
555 SearchBar::SetGuideTextColor(const Color& color)
557 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
558 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
560 return pSearchBarImpl->SetGuideTextColor(color);
564 SearchBar::GetCursorPosition(void) const
566 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
567 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
569 return pSearchBarImpl->GetCursorPosition();
573 SearchBar::SetCursorPosition(int index)
575 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
576 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
578 return pSearchBarImpl->SetCursorPosition(index);
582 SearchBar::IsLowerCaseModeEnabled(void) const
584 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
585 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
587 return pSearchBarImpl->IsLowerCaseModeEnabled();
591 SearchBar::SetLowerCaseModeEnabled(bool enable)
593 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
594 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
596 pSearchBarImpl->SetLowerCaseModeEnabled(enable);
602 SearchBar::GetEllipsisPosition(void) const
604 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
605 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
607 return pSearchBarImpl->GetEllipsisPosition();
611 SearchBar::SetEllipsisPosition(EllipsisPosition position)
613 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
614 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
616 return pSearchBarImpl->SetEllipsisPosition(position);
620 SearchBar::GetKeypadAction(void) const
622 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
623 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
625 return pSearchBarImpl->GetKeypadAction();
629 SearchBar::IsTextPredictionEnabled(void) const
631 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
632 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
634 return pSearchBarImpl->IsTextPredictionEnabled();
638 SearchBar::SetTextPredictionEnabled(bool enable)
640 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
641 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
643 return pSearchBarImpl->SetTextPredictionEnabled(enable);
647 SearchBar::SetCurrentLanguage(LanguageCode languageCode)
649 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
650 SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
652 return pSearchBarImpl->SetCurrentLanguage(languageCode);
656 SearchBar::GetCurrentLanguage(LanguageCode& language) const
658 const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
659 SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
661 return pSearchBarImpl->GetCurrentLanguage(language);
665 SearchBar::AddActionEventListener(IActionEventListener& listener)
667 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
668 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
670 result r = pSearchBarImpl->AddActionEventListener(listener);
671 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
677 SearchBar::RemoveActionEventListener(IActionEventListener& listener)
679 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
680 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
682 result r = pSearchBarImpl->RemoveActionEventListener(listener);
683 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
689 SearchBar::AddTextEventListener(ITextEventListener& listener)
691 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
692 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
694 result r = pSearchBarImpl->AddTextEventListener(listener);
695 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
701 SearchBar::RemoveTextEventListener(ITextEventListener& listener)
703 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
704 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
706 result r = pSearchBarImpl->RemoveTextEventListener(listener);
707 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
713 SearchBar::AddSearchBarEventListener(ISearchBarEventListener& listener)
715 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
716 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
718 result r = pSearchBarImpl->AddSearchBarEventListener(listener);
719 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
725 SearchBar::RemoveSearchBarEventListener(ISearchBarEventListener& listener)
727 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
728 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
730 result r = pSearchBarImpl->RemoveSearchBarEventListener(listener);
731 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
737 SearchBar::AddTextBlockEventListener(ITextBlockEventListener& listener)
739 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
740 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
742 result r = pSearchBarImpl->AddTextBlockEventListener(listener);
743 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
749 SearchBar::RemoveTextBlockEventListener(ITextBlockEventListener& listener)
751 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
752 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
754 result r = pSearchBarImpl->RemoveTextBlockEventListener(listener);
755 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
761 SearchBar::AddKeypadEventListener(IKeypadEventListener& listener)
763 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
764 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
766 result r = pSearchBarImpl->AddKeypadEventListener(listener);
767 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
773 SearchBar::RemoveKeypadEventListener(IKeypadEventListener& listener)
775 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
776 SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
778 result r = pSearchBarImpl->RemoveKeypadEventListener(listener);
779 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
785 SearchBar::AddLanguageEventListener(ILanguageEventListener& listener)
787 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
788 SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
790 result r = pSearchBarImpl->AddLanguageEventListener(listener);
791 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
797 SearchBar::RemoveLanguageEventListener(ILanguageEventListener& listener)
799 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
800 SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
802 result r = pSearchBarImpl->RemoveLanguageEventListener(listener);
803 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
809 SearchBar::SetEditTextFilter(IEditTextFilter* pFilter)
811 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
812 SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
814 pSearchBarImpl->SetEditTextFilter(pFilter);
820 SearchBar::SendOpaqueCommand (const String& command)
822 _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
823 SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
825 pSearchBarImpl->SendOpaqueCommand(command);
830 }}} // Tizen::Ui::Controls