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