Merge "Revert "Modified the bitmap scaling"" into tizen_2.2
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_SearchBarImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17
18 /**
19  * @file        FUiCtrl_SearchBarImpl.cpp
20  * @brief       This is the implementation file for _SearchBarImpl class.
21  */
22
23 #include <FApp_AppInfo.h>
24 #include <FBaseSysLog.h>
25 #include <FBase_LocalizedNumParser.h>
26 #include <FLclLocale.h>
27 #include <FUiAccessibilityContainer.h>
28 #include <FUiAccessibilityElement.h>
29 #include "FUi_ResourceSizeInfo.h"
30 #include "FUi_ResourceManager.h"
31 #include "FUi_UiBuilder.h"
32 #include "FUiCtrl_PublicActionEvent.h"
33 #include "FUiCtrl_PublicTextBlockEvent.h"
34 #include "FUiCtrl_PublicTextEvent.h"
35 #include "FUiCtrl_SearchBarImpl.h"
36 #include "FUi_CoordinateSystemUtils.h"
37 #include "FUiCtrl_EditFieldImpl.h"
38 #include "FUiCtrl_ButtonImpl.h"
39
40 using namespace Tizen::App;
41 using namespace Tizen::Base;
42 using namespace Tizen::Base::Runtime;
43 using namespace Tizen::Locales;
44 using namespace Tizen::Graphics;
45 using namespace Tizen::Ui;
46
47 namespace Tizen { namespace Ui { namespace Controls
48 {
49
50 _SearchBarImpl::_SearchBarImpl(SearchBar* pPublic, _SearchBar* pCore)
51         : _ControlImpl(pPublic, pCore)
52         , __pSearchBar(pCore)
53         , __pEditField(null)
54         , __pButton(null)
55         , __pContentControl(null)
56         , __pPublicActionEvent(null)
57         , __pPublicKeypadEvent(null)
58         , __pPublicTextBlockEvent(null)
59         , __pPublicTextEvent(null)
60         , __pPublicSearchBarEvent(null)
61         , __pPublicLanguageEvent(null)
62         , __pPublicFocusEventListeners(null)
63 {
64         ClearLastResult();
65 }
66
67 _SearchBarImpl::~_SearchBarImpl(void)
68 {
69         if (__pSearchBar)
70         {
71                 SetContent(null);
72         }
73
74         if (__pPublicActionEvent)
75         {
76                 delete __pPublicActionEvent;
77                 __pPublicActionEvent = null;
78         }
79
80         if (__pPublicKeypadEvent)
81         {
82                 delete __pPublicKeypadEvent;
83                 __pPublicKeypadEvent = null;
84         }
85
86         if (__pPublicTextBlockEvent)
87         {
88                 delete __pPublicTextBlockEvent;
89                 __pPublicTextBlockEvent = null;
90         }
91
92         if (__pPublicTextEvent)
93         {
94                 delete __pPublicTextEvent;
95                 __pPublicTextEvent = null;
96         }
97
98         if (__pPublicSearchBarEvent)
99         {
100                 delete __pPublicSearchBarEvent;
101                 __pPublicSearchBarEvent = null;
102         }
103
104         if (__pSearchBar)
105         {
106                 if (__pSearchBar->GetClippedGroupControl())
107                 {
108                         _Control* pControl = __pSearchBar->GetClippedGroupControl();
109                         pControl->DetachAllChildren();
110                 }
111         }
112
113         if (__pEditField)
114         {
115                 delete __pEditField;
116                 __pEditField = null;
117         }
118
119         if (__pButton)
120         {
121                 delete __pButton;
122                 __pButton = null;
123         }
124
125         if (__pPublicFocusEventListeners)
126         {
127                 delete __pPublicFocusEventListeners;
128                 __pPublicFocusEventListeners = null;
129         }
130 }
131
132 _SearchBarImpl*
133 _SearchBarImpl::CreateSearchBarImplN(SearchBar* pControl, const Rectangle& bounds, bool enableSearchBarButton, KeypadAction keypadAction)
134 {
135         ClearLastResult();
136         result r = E_SUCCESS;
137
138         r = GET_SIZE_INFO(SearchBar).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT);
139         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG,
140                      "[E_INVALID_ARG] Invalid argument(s) is used. The given size is not valid.");
141
142         _SearchBar* pCore = _SearchBar::CreateSearchBarN();
143         r = GetLastResult();
144         SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r));
145
146         _SearchBarImpl* pImpl = new (std::nothrow) _SearchBarImpl(pControl, pCore);
147
148         r = CheckConstruction(pCore, pImpl);
149         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
150
151         r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(SearchBar), bounds, pCore->GetOrientation());
152         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
153
154         r = pImpl->Initialize(enableSearchBarButton, keypadAction);
155         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
156
157         return pImpl;
158 CATCH:
159         delete pImpl;
160         return null;
161 }
162
163 _SearchBarImpl*
164 _SearchBarImpl::CreateSearchBarImplFN(SearchBar* pControl, const FloatRectangle& bounds, bool enableSearchBarButton, KeypadAction keypadAction)
165 {
166         ClearLastResult();
167         result r = E_SUCCESS;
168
169         r = GET_SIZE_INFO(SearchBar).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT);
170         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG,
171                      "[E_INVALID_ARG] Invalid argument(s) is used. The given size is not valid.");
172
173         _SearchBar* pCore = _SearchBar::CreateSearchBarN();
174         r = GetLastResult();
175         SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r));
176
177         _SearchBarImpl* pImpl = new (std::nothrow) _SearchBarImpl(pControl, pCore);
178
179         r = CheckConstruction(pCore, pImpl);
180         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
181
182         r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(SearchBar), bounds, pCore->GetOrientation());
183         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
184
185         r = pImpl->Initialize(enableSearchBarButton, keypadAction);
186         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
187
188         return pImpl;
189 CATCH:
190         delete pImpl;
191         return null;
192 }
193
194 const char*
195 _SearchBarImpl::GetPublicClassName(void) const
196 {
197         return "Tizen::Ui::Controls::SearchBar";
198 }
199
200 const SearchBar&
201 _SearchBarImpl::GetPublic(void) const
202 {
203         return static_cast <const SearchBar&>(_ControlImpl::GetPublic());
204 }
205
206 SearchBar&
207 _SearchBarImpl::GetPublic(void)
208 {
209         return static_cast <SearchBar&>(_ControlImpl::GetPublic());
210 }
211
212 const _SearchBar&
213 _SearchBarImpl::GetCore(void) const
214 {
215         return static_cast <const _SearchBar&>(_ControlImpl::GetCore());
216 }
217
218 _SearchBar&
219 _SearchBarImpl::GetCore(void)
220 {
221         return static_cast <_SearchBar&>(_ControlImpl::GetCore());
222 }
223
224 _SearchBarImpl*
225 _SearchBarImpl::GetInstance(SearchBar& searchBar)
226 {
227         return (static_cast<_SearchBarImpl*>(searchBar._pControlImpl));
228 }
229
230 const _SearchBarImpl*
231 _SearchBarImpl::GetInstance(const SearchBar& searchBar)
232 {
233         return (static_cast<const _SearchBarImpl*>(searchBar._pControlImpl));
234 }
235
236
237 result
238 _SearchBarImpl::Initialize(bool enableSearchBarButton, KeypadAction keypadAction)
239 {
240         ClearLastResult();
241
242         result r = E_SUCCESS;
243
244         CoreKeypadAction coreKeypadAction = CORE_KEYPAD_ACTION_SEARCH;
245         switch (keypadAction)
246         {
247         case KEYPAD_ACTION_ENTER:
248                 coreKeypadAction = CORE_KEYPAD_ACTION_ENTER;
249                 break;
250
251         case KEYPAD_ACTION_GO:
252                 coreKeypadAction = CORE_KEYPAD_ACTION_GO;
253                 break;
254
255         case KEYPAD_ACTION_NEXT:
256                 coreKeypadAction = CORE_KEYPAD_ACTION_NEXT;
257                 break;
258
259         case KEYPAD_ACTION_SEND:
260                 coreKeypadAction = CORE_KEYPAD_ACTION_SEND;
261                 break;
262
263         case KEYPAD_ACTION_SEARCH:
264                 coreKeypadAction = CORE_KEYPAD_ACTION_SEARCH;
265                 break;
266
267         case KEYPAD_ACTION_LOGIN:
268                 coreKeypadAction = CORE_KEYPAD_ACTION_LOGIN;
269                 break;
270
271         case KEYPAD_ACTION_SIGN_IN:
272                 coreKeypadAction = CORE_KEYPAD_ACTION_SIGN_IN;
273                 break;
274
275         case KEYPAD_ACTION_JOIN:
276                 coreKeypadAction = CORE_KEYPAD_ACTION_JOIN;
277                 break;
278
279         case KEYPAD_ACTION_DONE:
280                 coreKeypadAction = CORE_KEYPAD_ACTION_DONE;
281                 break;
282
283         default:
284                 break;
285         }
286
287         __pEditField = new (std::nothrow) EditField();
288         SysTryReturnResult(NID_UI_CTRL, __pEditField, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocate memory.");
289
290         r = __pEditField->Construct(GetBoundsF(), EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY, EDIT_FIELD_TITLE_STYLE_NONE, true);
291         SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
292
293         __pEditField->AddFocusEventListener(*this);
294         SysTryReturnResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
295
296         __pEditField->AddKeyEventListener(*this);
297         SysTryReturnResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
298
299         __pEditFieldImpl = _EditFieldImpl::GetInstance(*__pEditField);
300         SysTryReturnResult(NID_UI_CTRL, __pEditFieldImpl != null, E_SYSTEM,
301                            "[E_SYSTEM] A system error has occured. Failed to EditFieldImpl instance");
302
303         String cancelButtonText;
304         GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_CANCEL_ABB, cancelButtonText);
305
306         __pButton = new (std::nothrow) Button();
307         SysTryReturnResult(NID_UI_CTRL, __pButton, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocate memory.");
308
309         r = __pButton->Construct(GetBoundsF(), cancelButtonText);
310         SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
311
312         __pButton->AddFocusEventListener(*this);
313         SysTryReturnResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
314
315         __pButtonImpl = _ButtonImpl::GetInstance(*__pButton);
316         SysTryReturnResult(NID_UI_CTRL, __pButtonImpl != null, E_SYSTEM,
317                            "[E_SYSTEM] A system error has occured. Failed to ButtonImpl instance");
318
319         r = __pSearchBar->Initialize(enableSearchBarButton, coreKeypadAction);
320         SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
321
322         __pPublicActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
323         r = GetLastResult();
324         SysTryReturn(NID_UI_CTRL, __pPublicActionEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
325
326         r = __pSearchBar->AddActionEventListener(*this);
327         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
328
329         __pPublicKeypadEvent = _PublicKeypadEvent::CreateInstanceN(GetPublic());
330         r = GetLastResult();
331         SysTryReturn(NID_UI_CTRL, __pPublicKeypadEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
332
333         r = __pSearchBar->AddKeypadEventListener(*this);
334         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
335
336         __pPublicTextBlockEvent = _PublicTextBlockEvent::CreateInstanceN(GetPublic());
337         r = GetLastResult();
338         SysTryReturn(NID_UI_CTRL, __pPublicTextBlockEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
339
340         r = __pSearchBar->AddTextBlockEventListener(*this);
341         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
342
343         __pPublicTextEvent = _PublicTextEvent::CreateInstanceN(GetPublic());
344         r = GetLastResult();
345         SysTryReturn(NID_UI_CTRL, __pPublicTextEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
346
347         r = __pSearchBar->AddTextEventListener(*this);
348         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
349
350         __pPublicSearchBarEvent = _PublicSearchBarEvent::CreateInstanceN(GetPublic());
351         r = GetLastResult();
352         SysTryReturn(NID_UI_CTRL, __pPublicSearchBarEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
353
354         r = __pSearchBar->AddSearchBarEventListener(*this);
355         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
356
357         __pPublicLanguageEvent = _PublicLanguageEvent::CreateInstanceN(GetPublic());
358         r = GetLastResult();
359         SysTryReturn(NID_UI_CTRL, __pPublicLanguageEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
360
361         r = __pSearchBar->AddLanguageEventListener(*this);
362         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
363
364         __pPublicFocusEventListeners = CreatePublicEventListenerListN();
365         r = GetLastResult();
366         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
367
368         return r;
369 }
370
371 Control*
372 _SearchBarImpl::GetContent(void) const
373 {
374         ClearLastResult();
375
376         return __pContentControl;
377 }
378
379 result
380 _SearchBarImpl::SetContent(const Control* pContent)
381 {
382         ClearLastResult();
383
384         result r = E_SUCCESS;
385         if (pContent != null)
386         {
387                 const _Control& content = _ControlImpl::GetInstance(*pContent)->GetCore();
388                 bool isContentAttachable = __pSearchBar->IsContentAttachable(&content);
389                 SysTryReturn(NID_UI_CTRL, isContentAttachable, E_INVALID_ARG, E_INVALID_ARG,
390                              "[E_INVALID_ARG] Invalid argument(s) is used. The content cannot be set.");
391         }
392
393         if (pContent != null && __pContentControl == null)
394         {
395                 __pContentControl = const_cast <Control*>(pContent);
396                 _Control& control = _ControlImpl::GetInstance(*__pContentControl)->GetCore();
397
398                 r = __pSearchBar->SetContent(&control);
399         }
400
401         return r;
402 }
403
404 result
405 _SearchBarImpl::UpdateContentArea(bool invalidate)
406 {
407         ClearLastResult();
408
409         return __pSearchBar->UpdateContentArea(invalidate);
410 }
411
412 result
413 _SearchBarImpl::SetContentAreaVisible(bool visible)
414 {
415         ClearLastResult();
416
417         return __pSearchBar->SetContentAreaVisible(visible, true);
418 }
419
420 bool
421 _SearchBarImpl::IsContentAreaVisible(void) const
422 {
423         ClearLastResult();
424
425         return __pSearchBar->IsContentAreaVisible();
426 }
427
428 result
429 _SearchBarImpl::SetContentAreaSize(const Dimension& size)
430 {
431         ClearLastResult();
432
433         FloatDimension contentSize;
434         contentSize = _CoordinateSystemUtils::ConvertToFloat(size);
435         Variant var(contentSize);
436
437         return __pSearchBar->SetPropertyContentAreaSize(var);
438 }
439
440 result
441 _SearchBarImpl::SetContentAreaSize(const FloatDimension& size)
442 {
443         ClearLastResult();
444
445         Variant var(size);
446         return __pSearchBar->SetPropertyContentAreaSize(var);
447 }
448
449 Dimension
450 _SearchBarImpl::GetContentAreaSize(void) const
451 {
452         ClearLastResult();
453
454         Dimension size;
455         size = _CoordinateSystemUtils::ConvertToInteger(__pSearchBar->GetPropertyContentAreaSize().ToFloatDimension());
456
457         return size;
458 }
459
460 FloatDimension
461 _SearchBarImpl::GetContentAreaSizeF(void) const
462 {
463         ClearLastResult();
464
465         return __pSearchBar->GetPropertyContentAreaSize().ToFloatDimension();
466 }
467
468 SearchBarMode
469 _SearchBarImpl::GetMode(void) const
470 {
471         ClearLastResult();
472
473         return __pSearchBar->GetMode();
474 }
475
476 bool
477 _SearchBarImpl::IsModeLocked(void) const
478 {
479         ClearLastResult();
480
481         return __pSearchBar->IsModeLocked();
482 }
483
484 result
485 _SearchBarImpl::SetMode(SearchBarMode mode)
486 {
487         ClearLastResult();
488
489         return __pSearchBar->SetMode(mode);
490 }
491
492 result
493 _SearchBarImpl::SetModeLocked(bool modeLocked)
494 {
495         ClearLastResult();
496
497         return __pSearchBar->SetModeLocked(modeLocked);
498 }
499
500 int
501 _SearchBarImpl::GetButtonActionId(void) const
502 {
503         ClearLastResult();
504
505         return __pSearchBar->GetPropertyButtonActionId().ToInt();
506 }
507
508 Color
509 _SearchBarImpl::GetButtonColor(SearchBarButtonStatus status) const
510 {
511         ClearLastResult();
512
513         Variant buttonColor;
514
515         switch (status)
516         {
517         case SEARCH_BAR_BUTTON_STATUS_NORMAL:
518                 buttonColor = __pSearchBar->GetPropertyButtonNormalColor();
519                 break;
520         case SEARCH_BAR_BUTTON_STATUS_PRESSED:
521                 buttonColor = __pSearchBar->GetPropertyButtonPressedColor();
522                 break;
523         case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
524                 buttonColor = __pSearchBar->GetPropertyButtonHighlightedColor();
525                 break;
526         case SEARCH_BAR_BUTTON_STATUS_DISABLED:
527                 buttonColor = __pSearchBar->GetPropertyButtonDisabledColor();
528                 break;
529         default:
530                 break;
531         }
532
533         return buttonColor.ToColor();
534 }
535
536 Color
537 _SearchBarImpl::GetButtonTextColor(SearchBarButtonStatus status) const
538 {
539         ClearLastResult();
540
541         Variant buttonTextColor;
542
543         switch (status)
544         {
545         case SEARCH_BAR_BUTTON_STATUS_NORMAL:
546                 buttonTextColor = __pSearchBar->GetPropertyButtonNormalTextColor();
547                 break;
548         case SEARCH_BAR_BUTTON_STATUS_PRESSED:
549                 buttonTextColor = __pSearchBar->GetPropertyButtonPressedTextColor();
550                 break;
551         case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
552                 buttonTextColor = __pSearchBar->GetPropertyButtonHighlightedTextColor();
553                 break;
554         case SEARCH_BAR_BUTTON_STATUS_DISABLED:
555                 buttonTextColor = __pSearchBar->GetPropertyButtonDisabledTextColor();
556                 break;
557         default:
558                 break;
559         }
560
561         return buttonTextColor.ToColor();
562 }
563
564 SearchBarButtonStatus
565 _SearchBarImpl::GetButtonStatus(void) const
566 {
567         ClearLastResult();
568
569         return __pSearchBar->GetButtonStatus();
570 }
571
572 result
573 _SearchBarImpl::SetButton(const String& text, int actionId)
574 {
575         ClearLastResult();
576
577         result r = E_SUCCESS;
578         Variant var(actionId);
579
580         r = __pSearchBar->SetButtonText(text);
581         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
582
583         r = __pSearchBar->SetPropertyButtonActionId(var);
584
585         return r;
586 }
587
588 result
589 _SearchBarImpl::SetButtonEnabled(bool enabled)
590 {
591         ClearLastResult();
592
593         return __pSearchBar->SetButtonEnabled(enabled);
594 }
595
596 result
597 _SearchBarImpl::SetButtonColor(SearchBarButtonStatus status, const Color& color)
598 {
599         ClearLastResult();
600
601         result r = E_SUCCESS;
602         Variant var(color);
603
604         switch (status)
605         {
606         case SEARCH_BAR_BUTTON_STATUS_NORMAL:
607                 r = __pSearchBar->SetPropertyButtonNormalColor(var);
608                 break;
609         case SEARCH_BAR_BUTTON_STATUS_PRESSED:
610                 r = __pSearchBar->SetPropertyButtonPressedColor(var);
611                 break;
612         case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
613                 r = __pSearchBar->SetPropertyButtonHighlightedColor(var);
614                 break;
615         case SEARCH_BAR_BUTTON_STATUS_DISABLED:
616                 r = __pSearchBar->SetPropertyButtonDisabledColor(var);
617                 break;
618         default:
619                 break;
620         }
621
622         return r;
623 }
624
625 result
626 _SearchBarImpl::SetButtonTextColor(SearchBarButtonStatus status, const Color& color)
627 {
628         ClearLastResult();
629
630         result r = E_SUCCESS;
631         Variant var(color);
632
633         switch (status)
634         {
635         case SEARCH_BAR_BUTTON_STATUS_NORMAL:
636                 r = __pSearchBar->SetPropertyButtonNormalTextColor(var);
637                 break;
638         case SEARCH_BAR_BUTTON_STATUS_PRESSED:
639                 r = __pSearchBar->SetPropertyButtonPressedTextColor(var);
640                 break;
641         case SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED:
642                 r = __pSearchBar->SetPropertyButtonHighlightedTextColor(var);
643                 break;
644         case SEARCH_BAR_BUTTON_STATUS_DISABLED:
645                 r = __pSearchBar->SetPropertyButtonDisabledTextColor(var);
646                 break;
647         default:
648                 break;
649         }
650
651         return r;
652 }
653
654 result
655 _SearchBarImpl::AppendCharacter(const Character& character)
656 {
657         ClearLastResult();
658
659         return __pSearchBar->AppendCharacter(character);
660 }
661
662 result
663 _SearchBarImpl::AppendText(const String& text)
664 {
665         ClearLastResult();
666
667         return __pSearchBar->AppendText(text);
668 }
669
670 result
671 _SearchBarImpl::SetText(const String& text)
672 {
673         ClearLastResult();
674
675         return __pSearchBar->SetText(text);
676 }
677
678 result
679 _SearchBarImpl::InsertCharacterAt(int index, const Character& character)
680 {
681         ClearLastResult();
682
683         return __pSearchBar->InsertCharacterAt(index, character);
684 }
685
686 result
687 _SearchBarImpl::InsertTextAt(int index, const String& text)
688 {
689         ClearLastResult();
690
691         return __pSearchBar->InsertTextAt(index, text);
692 }
693
694 result
695 _SearchBarImpl::DeleteCharacterAt(int index)
696 {
697         ClearLastResult();
698
699         return __pSearchBar->DeleteCharacterAt(index);
700 }
701
702 result
703 _SearchBarImpl::Clear(void)
704 {
705         ClearLastResult();
706
707         result r = E_SUCCESS;
708         r = __pSearchBar->Clear();
709
710         SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM,
711                            "[E_SYSTEM] A system error has occured. Failed to clear the text.");
712         return r;
713 }
714
715 int
716 _SearchBarImpl::GetTextLength(void) const
717 {
718         ClearLastResult();
719
720         return __pSearchBar->GetTextLength();
721 }
722
723 String
724 _SearchBarImpl::GetText(void) const
725 {
726         ClearLastResult();
727
728         return __pSearchBar->GetText();
729 }
730
731 String
732 _SearchBarImpl::GetText(int start, int end) const
733 {
734         ClearLastResult();
735
736         return __pSearchBar->GetText(start, end);
737 }
738
739 int
740 _SearchBarImpl::GetLimitLength(void) const
741 {
742         ClearLastResult();
743
744         return __pSearchBar->GetLimitLength();
745 }
746
747 result
748 _SearchBarImpl::SetLimitLength(int limitLength)
749 {
750         ClearLastResult();
751
752         return __pSearchBar->SetLimitLength(limitLength);
753 }
754
755 result
756 _SearchBarImpl::ShowKeypad(void) const
757 {
758         ClearLastResult();
759
760         return __pSearchBar->ShowKeypad();
761 }
762
763 result
764 _SearchBarImpl::HideKeypad(void) const
765 {
766         ClearLastResult();
767
768         return __pSearchBar->HideKeypad();
769 }
770
771 int
772 _SearchBarImpl::GetSearchFieldTextSize(void) const
773 {
774         ClearLastResult();
775
776         int textSize = _CoordinateSystemUtils::ConvertToInteger(__pSearchBar->GetSearchFieldTextSizeF());
777         return textSize;
778 }
779
780 float
781 _SearchBarImpl::GetSearchFieldTextSizeF(void) const
782 {
783         ClearLastResult();
784
785         return __pSearchBar->GetSearchFieldTextSizeF();
786 }
787
788 result
789 _SearchBarImpl::SetSearchFieldTextSize(int size)
790 {
791         ClearLastResult();
792
793         float textSize = _CoordinateSystemUtils::ConvertToFloat(size);
794         return SetSearchFieldTextSize(textSize);
795 }
796
797 result
798 _SearchBarImpl::SetSearchFieldTextSize(float size)
799 {
800         ClearLastResult();
801
802         return __pSearchBar->SetSearchFieldTextSize(size);
803 }
804
805 result
806 _SearchBarImpl::GetBlockRange(int& start, int& end) const
807 {
808         ClearLastResult();
809
810         return __pSearchBar->GetBlockRange(start, end);
811 }
812
813 result
814 _SearchBarImpl::ReleaseBlock(void)
815 {
816         ClearLastResult();
817
818         return __pSearchBar->ReleaseBlock();
819 }
820
821 result
822 _SearchBarImpl::SetBlockRange(int start, int end)
823 {
824         ClearLastResult();
825
826         return __pSearchBar->SetBlockRange(start, end + 1);
827 }
828
829 result
830 _SearchBarImpl::RemoveTextBlock(void)
831 {
832         ClearLastResult();
833         result r = __pSearchBar->RemoveTextBlock();
834         SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
835                      "[E_SYSTEM] A system error has occured. Unable to remove the text block.");
836
837         return r;
838 }
839
840 Color
841 _SearchBarImpl::GetColor(void) const
842 {
843         ClearLastResult();
844
845         return __pSearchBar->GetPropertyColor().ToColor();
846 }
847
848 Color
849 _SearchBarImpl::GetSearchFieldColor(SearchFieldStatus status) const
850 {
851         ClearLastResult();
852
853         Variant searchFieldColor;
854
855         switch (status)
856         {
857         case SEARCH_FIELD_STATUS_NORMAL:
858                 searchFieldColor = __pSearchBar->GetPropertySearchFieldNormalColor();
859                 break;
860         case SEARCH_FIELD_STATUS_HIGHLIGHTED:
861                 searchFieldColor = __pSearchBar->GetPropertySearchFieldHighlightedColor();
862                 break;
863         case SEARCH_FIELD_STATUS_DISABLED:
864                 searchFieldColor = __pSearchBar->GetPropertySearchFieldDisabledColor();
865                 break;
866         default:
867                 break;
868         }
869
870         return searchFieldColor.ToColor();
871 }
872
873 Color
874 _SearchBarImpl::GetSearchFieldTextColor(SearchFieldStatus status) const
875 {
876         ClearLastResult();
877
878         Color color;
879         _Edit* pEdit = __pSearchBar->GetSearchField();
880         if (pEdit)
881         {
882                 switch (status)
883                 {
884                 case SEARCH_FIELD_STATUS_NORMAL:
885                         color = pEdit->GetTextColor(EDIT_TEXT_COLOR_NORMAL);
886                         break;
887                 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
888                         color = pEdit->GetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED);
889                         break;
890                 case SEARCH_FIELD_STATUS_DISABLED:
891                         color = pEdit->GetTextColor(EDIT_TEXT_COLOR_DISABLED);
892                         break;
893                 default:
894                         break;
895                 }
896         }
897         return color;
898 }
899
900 result
901 _SearchBarImpl::SetBackgroundBitmap(const Bitmap& bitmap)
902 {
903         ClearLastResult();
904
905         return __pSearchBar->SetBackgroundBitmap(bitmap);
906 }
907
908 result
909 _SearchBarImpl::SetColor(const Color& color)
910 {
911         ClearLastResult();
912
913         Variant var(color);
914
915         return __pSearchBar->SetPropertyColor(var);
916 }
917
918 result
919 _SearchBarImpl::SetSearchFieldColor(SearchFieldStatus status, const Color& color)
920 {
921         ClearLastResult();
922
923         result r = E_SUCCESS;
924         Variant var(color);
925
926         switch (status)
927         {
928         case SEARCH_FIELD_STATUS_NORMAL:
929                 r = __pSearchBar->SetPropertySearchFieldNormalColor(var);
930                 break;
931         case SEARCH_FIELD_STATUS_HIGHLIGHTED:
932                 r = __pSearchBar->SetPropertySearchFieldHighlightedColor(var);
933                 break;
934         case SEARCH_FIELD_STATUS_DISABLED:
935                 r = __pSearchBar->SetPropertySearchFieldDisabledColor(var);
936                 break;
937         default:
938                 break;
939         }
940
941         return r;
942 }
943
944 result
945 _SearchBarImpl::SetSearchFieldTextColor(SearchFieldStatus status, const Color& color)
946 {
947         ClearLastResult();
948
949         result r = E_SUCCESS;
950         _Edit* pEdit = __pSearchBar->GetSearchField();
951         if (pEdit)
952         {
953                 switch (status)
954                 {
955                 case SEARCH_FIELD_STATUS_NORMAL:
956                         r = pEdit->SetTextColor(EDIT_TEXT_COLOR_NORMAL, color);
957                         break;
958                 case SEARCH_FIELD_STATUS_HIGHLIGHTED:
959                         r = pEdit->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, color);
960                         break;
961                 case SEARCH_FIELD_STATUS_DISABLED:
962                         r = pEdit->SetTextColor(EDIT_TEXT_COLOR_DISABLED, color);
963                         break;
964                 default:
965                         break;
966                 }
967         }
968
969         return r;
970 }
971
972 String
973 _SearchBarImpl::GetGuideText(void) const
974 {
975         ClearLastResult();
976
977         return __pSearchBar->GetGuideText();
978 }
979
980 result
981 _SearchBarImpl::SetGuideText(const String& guideText)
982 {
983         ClearLastResult();
984
985         return __pSearchBar->SetGuideText(guideText);
986 }
987
988 Color
989 _SearchBarImpl::GetGuideTextColor(void) const
990 {
991         ClearLastResult();
992
993         return __pSearchBar->GetGuideTextColor();
994 }
995
996 result
997 _SearchBarImpl::SetGuideTextColor(const Color& color)
998 {
999         ClearLastResult();
1000
1001         return __pSearchBar->SetGuideTextColor(color);
1002 }
1003
1004 int
1005 _SearchBarImpl::GetCursorPosition(void) const
1006 {
1007         ClearLastResult();
1008
1009         return __pSearchBar->GetCursorPosition();
1010 }
1011
1012 result
1013 _SearchBarImpl::SetCursorPosition(int index)
1014 {
1015         ClearLastResult();
1016
1017         return __pSearchBar->SetCursorPosition(index);
1018 }
1019
1020 bool
1021 _SearchBarImpl::IsLowerCaseModeEnabled(void) const
1022 {
1023         ClearLastResult();
1024
1025         return __pSearchBar->IsLowerCaseModeEnabled();
1026 }
1027
1028 void
1029 _SearchBarImpl::SetLowerCaseModeEnabled(bool enable)
1030 {
1031         ClearLastResult();
1032
1033         return __pSearchBar->SetLowerCaseModeEnabled(enable);
1034 }
1035
1036 EllipsisPosition
1037 _SearchBarImpl::GetEllipsisPosition(void) const
1038 {
1039         ClearLastResult();
1040
1041         return __pSearchBar->GetEllipsisPosition();
1042 }
1043
1044 result
1045 _SearchBarImpl::SetEllipsisPosition(EllipsisPosition position)
1046 {
1047         ClearLastResult();
1048
1049         return __pSearchBar->SetEllipsisPosition(position);
1050 }
1051
1052 KeypadAction
1053 _SearchBarImpl::GetKeypadAction(void) const
1054 {
1055         ClearLastResult();
1056
1057         CoreKeypadAction coreKeypadAction = __pSearchBar->GetKeypadAction();
1058         KeypadAction publicKeypadAction = ConvertKeypadAction(coreKeypadAction);
1059
1060         return publicKeypadAction;
1061 }
1062
1063 bool
1064 _SearchBarImpl::IsTextPredictionEnabled(void) const
1065 {
1066         return __pSearchBar->IsTextPredictionEnabled();
1067 }
1068
1069 result
1070 _SearchBarImpl::SetTextPredictionEnabled(bool enable)
1071 {
1072         return __pSearchBar->SetTextPredictionEnabled(enable);
1073 }
1074
1075 result
1076 _SearchBarImpl::SetCurrentLanguage(LanguageCode languageCode)
1077 {
1078         return __pSearchBar->SetCurrentLanguage(languageCode);
1079 }
1080
1081 result
1082 _SearchBarImpl::GetCurrentLanguage(LanguageCode& language) const
1083 {
1084         return __pSearchBar->GetCurrentLanguage(language);
1085 }
1086
1087 result
1088 _SearchBarImpl::AddActionEventListener(IActionEventListener& listener)
1089 {
1090         ClearLastResult();
1091
1092         SysTryReturn(NID_UI_CTRL, __pPublicActionEvent, E_SYSTEM, E_SYSTEM,
1093                      "[E_SYSTEM] A system error has occurred.");
1094
1095         result r = __pPublicActionEvent->AddListener(listener);
1096         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1097                            "A system error has occurred. The same listener instance already exists in the event listener list.");
1098         return r;
1099 }
1100
1101 result
1102 _SearchBarImpl::RemoveActionEventListener(IActionEventListener& listener)
1103 {
1104         ClearLastResult();
1105
1106         SysTryReturn(NID_UI_CTRL, __pPublicActionEvent, E_SYSTEM, E_SYSTEM,
1107                      "[E_SYSTEM] A system error has occurred.");
1108
1109         result r = __pPublicActionEvent->RemoveListener(listener);
1110         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1111                            "A system error has occurred. The specified listener does not exist in the event listener list.");
1112         return r;
1113 }
1114
1115 result
1116 _SearchBarImpl::AddKeypadEventListener(IKeypadEventListener& listener)
1117 {
1118         ClearLastResult();
1119
1120         SysTryReturn(NID_UI_CTRL, __pPublicKeypadEvent, E_SYSTEM, E_SYSTEM,
1121                      "[E_SYSTEM] A system error has occurred.");
1122
1123         result r = __pPublicKeypadEvent->AddListener(listener);
1124         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1125                            "A system error has occurred. The same listener instance already exists in the event listener list.");
1126
1127         return r;
1128 }
1129
1130 result
1131 _SearchBarImpl::RemoveKeypadEventListener(IKeypadEventListener& listener)
1132 {
1133         ClearLastResult();
1134
1135         SysTryReturn(NID_UI_CTRL, __pPublicKeypadEvent, E_SYSTEM, E_SYSTEM,
1136                      "[E_SYSTEM] A system error has occurred.");
1137
1138         result r = __pPublicKeypadEvent->RemoveListener(listener);
1139         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1140                            "A system error has occurred. The specified listener does not exist in the event listener list.");
1141
1142         return r;
1143 }
1144
1145 result
1146 _SearchBarImpl::AddTextBlockEventListener(ITextBlockEventListener& listener)
1147 {
1148         ClearLastResult();
1149
1150         SysTryReturn(NID_UI_CTRL, __pPublicTextBlockEvent, E_SYSTEM, E_SYSTEM,
1151                      "[E_SYSTEM] A system error has occurred.");
1152
1153         result r = __pPublicTextBlockEvent->AddListener(listener);
1154         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1155                            "A system error has occurred. The same listener instance already exists in the event listener list.");
1156
1157         return r;
1158 }
1159
1160 result
1161 _SearchBarImpl::RemoveTextBlockEventListener(ITextBlockEventListener& listener)
1162 {
1163         ClearLastResult();
1164
1165         SysTryReturn(NID_UI_CTRL, __pPublicTextBlockEvent, E_SYSTEM, E_SYSTEM,
1166                      "[E_SYSTEM] A system error has occurred.");
1167
1168         result r = __pPublicTextBlockEvent->RemoveListener(listener);
1169         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1170                            "A system error has occurred. The specified listener does not exist in the event listener list.");
1171
1172         return r;
1173 }
1174
1175
1176 result
1177 _SearchBarImpl::AddTextEventListener(ITextEventListener& listener)
1178 {
1179         ClearLastResult();
1180
1181         SysTryReturn(NID_UI_CTRL, __pPublicTextEvent, E_SYSTEM, E_SYSTEM,
1182                      "[E_SYSTEM] A system error has occurred.");
1183
1184         result r = __pPublicTextEvent->AddListener(listener);
1185         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1186                            "A system error has occurred. The same listener instance already exists in the event listener list.");
1187
1188         return r;
1189 }
1190
1191 result
1192 _SearchBarImpl::RemoveTextEventListener(ITextEventListener& listener)
1193 {
1194         ClearLastResult();
1195
1196         SysTryReturn(NID_UI_CTRL, __pPublicTextEvent, E_SYSTEM, E_SYSTEM,
1197                      "[E_SYSTEM] A system error has occurred.");
1198
1199         result r = __pPublicTextEvent->RemoveListener(listener);
1200         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1201                            "A system error has occurred. The specified listener does not exist in the event listener list.");
1202
1203         return r;
1204 }
1205
1206 result
1207 _SearchBarImpl::AddSearchBarEventListener(const ISearchBarEventListener& listener)
1208 {
1209         ClearLastResult();
1210
1211         SysTryReturn(NID_UI_CTRL, __pPublicSearchBarEvent, E_SYSTEM, E_SYSTEM,
1212                      "[E_SYSTEM] A system error has occurred.");
1213
1214         result r = __pPublicSearchBarEvent->AddListener(listener);
1215         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_ALREADY_EXIST, E_SYSTEM,
1216                            "A system error has occurred. The same listener instance already exists in the event listener list.");
1217
1218         return r;
1219 }
1220
1221 result
1222 _SearchBarImpl::RemoveSearchBarEventListener(const ISearchBarEventListener& listener)
1223 {
1224         ClearLastResult();
1225
1226         SysTryReturn(NID_UI_CTRL, __pPublicSearchBarEvent, E_SYSTEM, E_SYSTEM,
1227                      "[E_SYSTEM] A system error has occurred.");
1228
1229         result r = __pPublicSearchBarEvent->RemoveListener(listener);
1230         SysTryReturnResult(NID_UI_CTRL, r != E_OBJ_NOT_FOUND, E_SYSTEM,
1231                            "A system error has occurred. The specified listener does not exist in the event listener list.");
1232
1233         return r;
1234 }
1235
1236 result
1237 _SearchBarImpl::AddLanguageEventListener(ILanguageEventListener& listener)
1238 {
1239         ClearLastResult();
1240
1241         SysAssertf(__pPublicLanguageEvent != null, "Not yet constructed. Construct() should be called before use.");
1242
1243         return __pPublicLanguageEvent->AddListener(listener);
1244 }
1245
1246 result
1247 _SearchBarImpl::RemoveLanguageEventListener(ILanguageEventListener& listener)
1248 {
1249         ClearLastResult();
1250
1251         SysAssertf(__pPublicLanguageEvent != null, "Not yet constructed. Construct() should be called before use.");
1252
1253         return __pPublicLanguageEvent->RemoveListener(listener);
1254 }
1255
1256 void
1257 _SearchBarImpl::SetEditTextFilter(IEditTextFilter* pFilter)
1258 {
1259         __pSearchBar->SetEditTextFilter(pFilter);
1260
1261         return;
1262 }
1263
1264 void
1265 _SearchBarImpl::SendOpaqueCommand (const String& command)
1266 {
1267         __pSearchBar->SendOpaqueCommand(command);
1268
1269         return;
1270 }
1271
1272 void
1273 _SearchBarImpl::OnActionPerformed(const _Control& source, int actionId)
1274 {
1275         ClearLastResult();
1276
1277         if (__pPublicActionEvent != null)
1278         {
1279                 IEventArg* pEventArg = _PublicActionEvent::CreateActionEventArgN(actionId);
1280                 result r = GetLastResult();
1281                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1282
1283                 __pPublicActionEvent->Fire(*pEventArg);
1284         }
1285         return;
1286 }
1287
1288 void
1289 _SearchBarImpl::OnKeypadWillOpen(void)
1290 {
1291         ClearLastResult();
1292
1293         if (__pPublicKeypadEvent != null)
1294         {
1295                 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1296                         GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_CREATED);
1297                 result r = GetLastResult();
1298                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1299
1300                 __pPublicKeypadEvent->Fire(*pEventArg);
1301         }
1302         return;
1303 }
1304
1305 void
1306 _SearchBarImpl::OnKeypadOpened(void)
1307 {
1308         ClearLastResult();
1309
1310         if (__pPublicKeypadEvent != null)
1311         {
1312                 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1313                         GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_OPEN);
1314                 result r = GetLastResult();
1315                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1316
1317                 __pPublicKeypadEvent->Fire(*pEventArg);
1318         }
1319         return;
1320 }
1321
1322
1323 void
1324 _SearchBarImpl::OnKeypadClosed(void)
1325 {
1326         ClearLastResult();
1327
1328         if (__pPublicKeypadEvent != null)
1329         {
1330                 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1331                         GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_CLOSE);
1332                 result r = GetLastResult();
1333                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1334
1335                 __pPublicKeypadEvent->Fire(*pEventArg);
1336         }
1337         return;
1338 }
1339
1340 void
1341 _SearchBarImpl::OnKeypadBoundsChanged(void)
1342 {
1343         ClearLastResult();
1344
1345         if (__pPublicKeypadEvent != null)
1346         {
1347                 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1348                         GetPublic(), KEYPAD_ACTION_SEARCH, KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
1349                 result r = GetLastResult();
1350                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1351
1352                 __pPublicKeypadEvent->Fire(*pEventArg);
1353         }
1354         return;
1355 }
1356
1357 void
1358 _SearchBarImpl::OnKeypadActionPerformed(CoreKeypadAction keypadAction)
1359 {
1360         ClearLastResult();
1361
1362         if (__pPublicKeypadEvent != null)
1363         {
1364                 KeypadAction publicKeypadAction = ConvertKeypadAction(keypadAction);
1365
1366                 IEventArg* pEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
1367                         GetPublic(), publicKeypadAction, KEYPAD_EVENT_STATUS_ENTERACTION);
1368                 result r = GetLastResult();
1369                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1370
1371                 __pPublicKeypadEvent->Fire(*pEventArg);
1372         }
1373         return;
1374 }
1375
1376 void
1377 _SearchBarImpl::OnTextBlockSelected(_Control& source, int start, int end)
1378 {
1379         ClearLastResult();
1380
1381         if (__pPublicTextBlockEvent != null)
1382         {
1383                 IEventArg* pEventArg = _PublicTextBlockEvent::CreateTextBlockEventArgN(start, end);
1384                 result r = GetLastResult();
1385                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1386
1387                 __pPublicTextBlockEvent->Fire(*pEventArg);
1388         }
1389         return;
1390 }
1391
1392 void
1393 _SearchBarImpl::OnTextValueChanged(const _Control& source)
1394 {
1395         ClearLastResult();
1396
1397         if (__pPublicTextEvent != null)
1398         {
1399                 IEventArg* pEventArg = _PublicTextEvent::CreateTextEventArgN(TEXT_EVENT_CHANGED);
1400                 result r = GetLastResult();
1401                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1402
1403                 __pPublicTextEvent->Fire(*pEventArg);
1404         }
1405         return;
1406 }
1407
1408 void
1409 _SearchBarImpl::OnTextValueChangeCanceled(const _Control& source)
1410 {
1411         ClearLastResult();
1412
1413         if (__pPublicTextEvent != null)
1414         {
1415                 IEventArg* pEventArg = _PublicTextEvent::CreateTextEventArgN(TEXT_EVENT_CANCELED);
1416                 result r = GetLastResult();
1417                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1418
1419                 __pPublicTextEvent->Fire(*pEventArg);
1420         }
1421         return;
1422 }
1423
1424 void
1425 _SearchBarImpl::OnSearchBarModeChanged(_SearchBar& source, SearchBarMode mode)
1426 {
1427         ClearLastResult();
1428
1429         if ((_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) && __pSearchBar != null)
1430         {
1431                 if (mode == SEARCH_BAR_MODE_NORMAL)
1432                 {
1433                         __pSearchBar->SetHeaderVisibleState(true);
1434                 }
1435                 else
1436                 {
1437                         __pSearchBar->SetHeaderVisibleState(false);
1438                 }
1439                 __pSearchBar->SetContentsArea();
1440         }
1441
1442         if (__pPublicSearchBarEvent != null)
1443         {
1444                 IEventArg* pEventArg = _PublicSearchBarEvent::CreateSearchBarEventArgN(SEARCH_BAR_EVENT_MODE_CHANGE);
1445                 result r = GetLastResult();
1446                 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1447
1448                 __pPublicSearchBarEvent->Fire(*pEventArg);
1449         }
1450         return;
1451 }
1452
1453 void
1454 _SearchBarImpl::OnLanguageChanged(LanguageCode oldLanguage, LanguageCode newLanguage)
1455 {
1456         if (__pPublicLanguageEvent)
1457         {
1458                 IEventArg* pKLanguageEventArg = _PublicLanguageEvent::CreateLanguageEventArgN(GetPublic(), oldLanguage, newLanguage);
1459                 result r = GetLastResult();
1460                 SysTryReturnVoidResult(NID_UI_CTRL, pKLanguageEventArg, r, "[%s] Propagating.", GetErrorMessage(r));
1461
1462                 __pPublicLanguageEvent->Fire(*pKLanguageEventArg);
1463         }
1464         else
1465         {
1466                 SysLog(NID_UI_CTRL, "Event is not created.");
1467         }
1468         return;
1469 }
1470
1471 void
1472 _SearchBarImpl::OnFocusEventListenerAdded(IFocusEventListener& listener)
1473 {
1474         ClearLastResult();
1475         SysTryReturnVoidResult(NID_UI,
1476                                 __pPublicFocusEventListeners->Add(const_cast <IFocusEventListener*>(&listener)) == E_SUCCESS, E_SYSTEM,
1477                                 "[E_SYSTEM] A system error has occured. Failed to add listener.");
1478 }
1479
1480 void
1481 _SearchBarImpl::OnFocusEventListenerRemoved(IFocusEventListener& listener)
1482 {
1483         ClearLastResult();
1484         SysTryReturnVoidResult(NID_UI,
1485                                 __pPublicFocusEventListeners->Remove(&listener) == E_SUCCESS, E_SYSTEM,
1486                                 "[E_SYSTEM] A system error has occured. Failed to remove listener.");
1487 }
1488
1489 void
1490 _SearchBarImpl::OnFocusGained(const Tizen::Ui::Control& source)
1491 {
1492         if (!__pSearchBar->IsFocusCallbackToBeFired())
1493         {
1494                 return;
1495         }
1496
1497         IEnumeratorT<IEventListener*>* pEnumerator = __pPublicFocusEventListeners->GetEnumeratorN();
1498
1499         if (pEnumerator)
1500         {
1501                 while (pEnumerator->MoveNext() == E_SUCCESS)
1502                 {
1503                         IEventListener* pListener = null;
1504                         pEnumerator->GetCurrent(pListener);
1505
1506                         IFocusEventListener* pFocusEventListener = dynamic_cast <IFocusEventListener*>(pListener);
1507
1508                         if (pFocusEventListener != null )
1509                         {
1510                                 pFocusEventListener->OnFocusGained(GetPublic());
1511                         }
1512                 }
1513
1514                 delete pEnumerator;
1515         }
1516
1517         return;
1518 }
1519
1520 void
1521 _SearchBarImpl::OnFocusLost(const Tizen::Ui::Control& source)
1522 {
1523         if (!__pSearchBar->IsFocusCallbackToBeFired())
1524         {
1525                 return;
1526         }
1527
1528         IEnumeratorT<IEventListener*>* pEnumerator = __pPublicFocusEventListeners->GetEnumeratorN();
1529         if (pEnumerator)
1530         {
1531                 while (pEnumerator->MoveNext() == E_SUCCESS)
1532                 {
1533                         IEventListener* pListener = null;
1534                         pEnumerator->GetCurrent(pListener);
1535
1536                         IFocusEventListener* pFocusEventListener = dynamic_cast <IFocusEventListener*>(pListener);
1537
1538                         if (pFocusEventListener != null )
1539                         {
1540                                 pFocusEventListener->OnFocusLost(GetPublic());
1541                         }
1542                 }
1543
1544                 delete pEnumerator;
1545         }
1546
1547         return;
1548 }
1549
1550 void
1551 _SearchBarImpl::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
1552 {
1553         IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
1554         if (pEnumerator)
1555         {
1556                 while (pEnumerator->MoveNext() == E_SUCCESS)
1557                 {
1558                         IEventListener* pListener = null;
1559                         pEnumerator->GetCurrent(pListener);
1560
1561                         IKeyEventListener* pKeyEventListener = dynamic_cast <IKeyEventListener*>(pListener);
1562
1563                         if (pKeyEventListener != null )
1564                         {
1565                                 pKeyEventListener->OnKeyPressed(GetPublic(), keyCode);
1566                         }
1567                 }
1568
1569                 delete pEnumerator;
1570         }
1571
1572         return;
1573 }
1574
1575 void
1576 _SearchBarImpl::OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
1577 {
1578         IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
1579         if (pEnumerator)
1580         {
1581                 while (pEnumerator->MoveNext() == E_SUCCESS)
1582                 {
1583                         IEventListener* pListener = null;
1584                         pEnumerator->GetCurrent(pListener);
1585
1586                         IKeyEventListener* pKeyEventListener = dynamic_cast <IKeyEventListener*>(pListener);
1587
1588                         if (pKeyEventListener != null )
1589                         {
1590                                 pKeyEventListener->OnKeyReleased(GetPublic(), keyCode);
1591                         }
1592                 }
1593
1594                 delete pEnumerator;
1595         }
1596
1597         return;
1598 }
1599
1600 void
1601 _SearchBarImpl::OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
1602 {
1603         IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
1604         if (pEnumerator)
1605         {
1606                 while (pEnumerator->MoveNext() == E_SUCCESS)
1607                 {
1608                         IEventListener* pListener = null;
1609                         pEnumerator->GetCurrent(pListener);
1610
1611                         IKeyEventListener* pKeyEventListener = dynamic_cast <IKeyEventListener*>(pListener);
1612
1613                         if (pKeyEventListener != null )
1614                         {
1615                                 pKeyEventListener->OnKeyLongPressed(GetPublic(), keyCode);
1616                         }
1617                 }
1618
1619                 delete pEnumerator;
1620         }
1621
1622         return;
1623 }
1624
1625 KeypadAction
1626 _SearchBarImpl::ConvertKeypadAction(CoreKeypadAction keypadAction) const
1627 {
1628         KeypadAction publicKeypadAction = KEYPAD_ACTION_SEARCH;
1629         switch (keypadAction)
1630         {
1631         case CORE_KEYPAD_ACTION_ENTER:
1632                 publicKeypadAction = KEYPAD_ACTION_ENTER;
1633                 break;
1634
1635         case CORE_KEYPAD_ACTION_GO:
1636                 publicKeypadAction = KEYPAD_ACTION_GO;
1637                 break;
1638
1639         case CORE_KEYPAD_ACTION_NEXT:
1640                 publicKeypadAction = KEYPAD_ACTION_NEXT;
1641                 break;
1642
1643         case CORE_KEYPAD_ACTION_SEND:
1644                 publicKeypadAction = KEYPAD_ACTION_SEND;
1645                 break;
1646
1647         case CORE_KEYPAD_ACTION_SEARCH:
1648                 publicKeypadAction = KEYPAD_ACTION_SEARCH;
1649                 break;
1650
1651         case CORE_KEYPAD_ACTION_LOGIN:
1652                 publicKeypadAction = KEYPAD_ACTION_LOGIN;
1653                 break;
1654
1655         case CORE_KEYPAD_ACTION_SIGN_IN:
1656                 publicKeypadAction = KEYPAD_ACTION_SIGN_IN;
1657                 break;
1658
1659         case CORE_KEYPAD_ACTION_JOIN:
1660                 publicKeypadAction = KEYPAD_ACTION_JOIN;
1661                 break;
1662
1663         case CORE_KEYPAD_ACTION_DONE:
1664                 publicKeypadAction = KEYPAD_ACTION_DONE;
1665                 break;
1666
1667         default:
1668                 break;
1669         }
1670
1671         return publicKeypadAction;
1672 }
1673
1674 _EditFieldImpl*
1675 _SearchBarImpl::GetEditFieldImpl(void) const
1676 {
1677         return __pEditFieldImpl;
1678 }
1679
1680 _ButtonImpl*
1681 _SearchBarImpl::GetButtonImpl(void) const
1682 {
1683         return __pButtonImpl;
1684 }
1685
1686 class _SearchBarMaker
1687         : public _UiBuilderControlMaker
1688 {
1689 public:
1690         _SearchBarMaker(_UiBuilder* pUibuilder)
1691                 : _UiBuilderControlMaker(pUibuilder){}
1692         virtual ~_SearchBarMaker(void){}
1693         static _UiBuilderControlMaker*
1694         GetInstance(_UiBuilder* pUibuilder)
1695         {
1696                 _SearchBarMaker* pSearchBarMaker = new (std::nothrow) _SearchBarMaker(pUibuilder);
1697                 return pSearchBarMaker;
1698         };
1699
1700 protected:
1701         virtual Control*
1702         Make(_UiBuilderControl* pControl)
1703         {
1704                 result r = E_SUCCESS;
1705
1706                 FloatRectangle rect;
1707                 SearchBar* pSearchBar = null;
1708                 _UiBuilderControlLayout* pControlProperty = null;
1709                 bool showSearchBarButton = true;
1710                 KeypadAction keypadAction = KEYPAD_ACTION_ENTER;
1711                 Color color;
1712                 int opacity = SEARCHBAR_DEFAULT_OPACITY;
1713                 EllipsisPosition ellipsisPosition = ELLIPSIS_POSITION_END;
1714                 String text;
1715                 String guideText;
1716                 int limitLength = SEARCHBAR_TEXT_LENGTH_MAX;
1717                 int buttonActionId = -1;
1718                 String buttonText;
1719                 float searchFieldTextSize = 0.0f;
1720                 bool lowercaseEnable = false;
1721                 String elementString;
1722
1723                 GetProperty(pControl, &pControlProperty);
1724                 if (pControlProperty == null)
1725                 {
1726                         return null;
1727                 }
1728
1729                 pSearchBar = new (std::nothrow) SearchBar;
1730                 if (pSearchBar == null)
1731                 {
1732                         return null;
1733                 }
1734
1735                 rect = pControlProperty->GetRectF();
1736                 if (pControl->GetElement("showSearchBarButton", elementString))
1737                 {
1738                         if (elementString.Equals(L"false", false))
1739                         {
1740                                 showSearchBarButton = false;
1741                         }
1742                 }
1743
1744                 if (pControl->GetElement("keypadAction", elementString))
1745                 {
1746                         if (elementString.Equals(L"KEYPAD_ACTION_ENTER", false))
1747                         {
1748                                 keypadAction = KEYPAD_ACTION_ENTER;
1749                         }
1750                         else if (elementString.Equals(L"KEYPAD_ACTION_GO", false))
1751                         {
1752                                 keypadAction = KEYPAD_ACTION_GO;
1753                         }
1754                         else if (elementString.Equals(L"KEYPAD_ACTION_NEXT", false))
1755                         {
1756                                 keypadAction = KEYPAD_ACTION_NEXT;
1757                         }
1758                         else if (elementString.Equals(L"KEYPAD_ACTION_SEND", false))
1759                         {
1760                                 keypadAction = KEYPAD_ACTION_SEND;
1761                         }
1762                         else if (elementString.Equals(L"KEYPAD_ACTION_SEARCH", false))
1763                         {
1764                                 keypadAction = KEYPAD_ACTION_SEARCH;
1765                         }
1766                         else if (elementString.Equals(L"KEYPAD_ACTION_LOGIN", false))
1767                         {
1768                                 keypadAction = KEYPAD_ACTION_LOGIN;
1769                         }
1770                         else if (elementString.Equals(L"KEYPAD_ACTION_SIGN_IN", false))
1771                         {
1772                                 keypadAction = KEYPAD_ACTION_SIGN_IN;
1773                         }
1774                         else if (elementString.Equals(L"KEYPAD_ACTION_JOIN", false))
1775                         {
1776                                 keypadAction = KEYPAD_ACTION_JOIN;
1777                         }
1778                         else if (elementString.Equals(L"KEYPAD_ACTION_DONE", false))
1779                         {
1780                                 keypadAction = KEYPAD_ACTION_DONE;
1781                         }
1782                 }
1783
1784                 r = pSearchBar->Construct(rect, showSearchBarButton, keypadAction);
1785                 if (r != E_SUCCESS)
1786                 {
1787                         delete pSearchBar;
1788                         return null;
1789                 }
1790
1791                 if (showSearchBarButton)
1792                 {
1793                         if (pControl->GetElement("buttonActionId", elementString))
1794                         {
1795                                 Base::Integer::Parse(elementString, buttonActionId);
1796                         }
1797
1798                         if (pControl->GetElement("buttonText", elementString))
1799                         {
1800                                 r = pSearchBar->SetButton(elementString, buttonActionId);
1801                         }
1802                 }
1803
1804                 if (pControl->GetElement("text", elementString))
1805                 {
1806                         r = pSearchBar->SetText(elementString);
1807                 }
1808
1809                 if (pControl->GetElement("guideText", elementString))
1810                 {
1811                         r = pSearchBar->SetGuideText(elementString);
1812                 }
1813
1814                 if (pControl->GetElement("searchFieldTextSize", elementString))
1815                 {
1816                         searchFieldTextSize = _LocalizedNumParser::ToDouble(elementString, "C");
1817                         _ICoordinateSystemTransformer* pTransform = GetTransformer();
1818                         if (pTransform)
1819                         {
1820                                 searchFieldTextSize = pTransform->Transform(searchFieldTextSize);
1821                         }
1822                         r = pSearchBar->SetSearchFieldTextSize(searchFieldTextSize);
1823                 }
1824
1825                 if (pControl->GetElement("limitLength", elementString))
1826                 {
1827                         Base::Integer::Parse(elementString, limitLength);
1828                         r = pSearchBar->SetLimitLength(limitLength);
1829                 }
1830
1831                 if (pControl->GetElement("lowerCaseMode", elementString))
1832                 {
1833                         if (elementString.Equals(L"true", false))
1834                         {
1835                                 lowercaseEnable = true;
1836                         }
1837                         else
1838                         {
1839                                 lowercaseEnable = false;
1840                         }
1841
1842                         pSearchBar->SetLowerCaseModeEnabled(lowercaseEnable);
1843                 }
1844
1845                 if (pControl->GetElement("ellipsisPosition", elementString))
1846                 {
1847                         if (elementString.Equals(L"ELLIPSIS_POSITION_START", false))
1848                         {
1849                                 ellipsisPosition = ELLIPSIS_POSITION_START;
1850                         }
1851                         else if (elementString.Equals(L"ELLIPSIS_POSITION_MIDDLE", false))
1852                         {
1853                                 ellipsisPosition = ELLIPSIS_POSITION_MIDDLE;
1854                         }
1855                         else
1856                         {
1857                                 ellipsisPosition = ELLIPSIS_POSITION_END;
1858                         }
1859
1860                         r = pSearchBar->SetEllipsisPosition(ellipsisPosition);
1861                 }
1862
1863                 if (pControl->GetElement("backgroundBitmapPath", elementString))
1864                 {
1865                         Bitmap* pBackgroundBitmap = null;
1866                         pBackgroundBitmap = LoadBitmapN(elementString);
1867                         if (pBackgroundBitmap != null)
1868                         {
1869                                 pSearchBar->SetBackgroundBitmap(*pBackgroundBitmap);
1870                                 delete pBackgroundBitmap;
1871                         }
1872                 }
1873
1874                 if (pControl->GetElement("colorOpacity", elementString))
1875                 {
1876                         Base::Integer::Parse(elementString, opacity);
1877                 }
1878                 if (pControl->GetElement("color", elementString))
1879                 {
1880                         ConvertStringToColor32(elementString, opacity, color);
1881                         r = pSearchBar->SetColor(color);
1882                 }
1883
1884                 opacity = SEARCHBAR_DEFAULT_OPACITY;
1885                 if (pControl->GetElement("normalButtonColor", elementString))
1886                 {
1887                         ConvertStringToColor32(elementString, opacity, color);
1888                         r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_NORMAL, color);
1889                 }
1890
1891                 if (pControl->GetElement("normalButtonTextColor", elementString))
1892                 {
1893                         ConvertStringToColor32(elementString, opacity, color);
1894                         r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_NORMAL, color);
1895                 }
1896
1897                 if (pControl->GetElement("normalSearchFieldColor", elementString))
1898                 {
1899                         ConvertStringToColor32(elementString, opacity, color);
1900                         r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_NORMAL, color);
1901                 }
1902
1903                 if (pControl->GetElement("normalSearchFieldTextColor", elementString))
1904                 {
1905                         ConvertStringToColor32(elementString, opacity, color);
1906                         r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_NORMAL, color);
1907                 }
1908
1909                 if (pControl->GetElement("disabledButtonColor", elementString))
1910                 {
1911                         ConvertStringToColor32(elementString, opacity, color);
1912                         r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_DISABLED, color);
1913                 }
1914
1915                 if (pControl->GetElement("disabledButtonTextColor", elementString))
1916                 {
1917                         ConvertStringToColor32(elementString, opacity, color);
1918                         r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_DISABLED, color);
1919                 }
1920
1921                 if (pControl->GetElement("disabledSearchFieldColor", elementString))
1922                 {
1923                         ConvertStringToColor32(elementString, opacity, color);
1924                         r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_DISABLED, color);
1925                 }
1926
1927                 if (pControl->GetElement("disabledSearchFieldTextColor", elementString))
1928                 {
1929                         ConvertStringToColor32(elementString, opacity, color);
1930                         r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_DISABLED, color);
1931                 }
1932
1933                 if (pControl->GetElement("highlightedButtonColor", elementString))
1934                 {
1935                         ConvertStringToColor32(elementString, opacity, color);
1936                         r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED, color);
1937                 }
1938
1939                 if (pControl->GetElement("highlightedButtonTextColor", elementString))
1940                 {
1941                         ConvertStringToColor32(elementString, opacity, color);
1942                         r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED, color);
1943                 }
1944
1945                 if (pControl->GetElement("highlightedSearchFieldColor", elementString))
1946                 {
1947                         ConvertStringToColor32(elementString, opacity, color);
1948                         r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_HIGHLIGHTED, color);
1949                 }
1950
1951                 if (pControl->GetElement("highlightedSearchFieldTextColor", elementString))
1952                 {
1953                         ConvertStringToColor32(elementString, opacity, color);
1954                         r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_HIGHLIGHTED, color);
1955                 }
1956
1957                 if (pControl->GetElement("pressedButtonColor", elementString))
1958                 {
1959                         ConvertStringToColor32(elementString, opacity, color);
1960                         r = pSearchBar->SetButtonColor(SEARCH_BAR_BUTTON_STATUS_PRESSED, color);
1961                 }
1962
1963                 if (pControl->GetElement("pressedButtonTextColor", elementString))
1964                 {
1965                         ConvertStringToColor32(elementString, opacity, color);
1966                         r = pSearchBar->SetButtonTextColor(SEARCH_BAR_BUTTON_STATUS_PRESSED, color);
1967                 }
1968
1969                 if (pControl->GetElement("guideTextColor", elementString))
1970                 {
1971                         ConvertStringToColor32(elementString, opacity, color);
1972                         r = pSearchBar->SetGuideTextColor(color);
1973                 }
1974
1975                 if (pControl->GetElement(L"accessibilityHint", elementString))
1976                 {
1977                         AccessibilityContainer* pContainer = pSearchBar->GetAccessibilityContainer();
1978                         if (pContainer)
1979                         {
1980                                 AccessibilityElement* pElement = pContainer->GetElement(L"EditText");
1981                                 if (pElement)
1982                                 {
1983                                         pElement->SetHint(elementString);
1984                                 }
1985                         }
1986                 }
1987
1988                 return pSearchBar;
1989         }
1990 };
1991
1992 _SearchBarRegister::_SearchBarRegister(void)
1993 {
1994         _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
1995         pUiBuilderControlTableManager->RegisterControl(L"SearchBar", _SearchBarMaker::GetInstance);
1996 }
1997
1998 _SearchBarRegister::~_SearchBarRegister(void)
1999 {
2000         _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
2001         pUiBuilderControlTableManager->UnregisterControl(L"SearchBar");
2002 }
2003 static _SearchBarRegister SearchBarRegisterToUiBuilder;
2004 }}} // Tizen::Ui::Controls