Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrlSearchBar.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         FUiCtrlSearchBar.cpp
20 * @brief        This is the implementation file for SearchBar class.
21 */
22
23 #include <FBaseSysLog.h>
24 #include <FLclLocale.h>
25 #include <FUiCtrlSearchBar.h>
26 #include "FUiCtrl_SearchBarImpl.h"
27
28 using namespace Tizen::Base;
29 using namespace Tizen::Graphics;
30 using namespace Tizen::Locales;
31 using namespace Tizen::Ui;
32
33 namespace Tizen { namespace Ui { namespace Controls {
34
35 SearchBar::SearchBar(void)
36 {
37 }
38
39 SearchBar::~SearchBar(void)
40 {
41 }
42
43 result
44 SearchBar::Construct(const Rectangle& rect, bool searchBarButton, KeypadAction keypadAction)
45 {
46         result r = E_SUCCESS;
47
48         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
49         SysAssertf(pSearchBarImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
50
51         pSearchBarImpl = _SearchBarImpl::CreateSearchBarImplN(this, rect, searchBarButton, keypadAction);
52         r = GetLastResult();
53         SysTryReturn(NID_UI_CTRL, pSearchBarImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
54
55         _pControlImpl = pSearchBarImpl;
56
57         return r;
58 }
59
60 result
61 SearchBar::Construct(const FloatRectangle& rect, bool searchBarButton, KeypadAction keypadAction)
62 {
63         result r = E_SUCCESS;
64
65         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
66         SysAssertf(pSearchBarImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
67
68         pSearchBarImpl = _SearchBarImpl::CreateSearchBarImplFN(this, rect, searchBarButton, keypadAction);
69         r = GetLastResult();
70         SysTryReturn(NID_UI_CTRL, pSearchBarImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
71
72         _pControlImpl = pSearchBarImpl;
73
74         return r;
75 }
76
77 Control*
78 SearchBar::GetContent(void) const
79 {
80         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
81         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
82
83         return pSearchBarImpl->GetContent();
84 }
85
86 result
87 SearchBar::SetContent(const Control* pContent)
88 {
89         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
90         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
91
92         return pSearchBarImpl->SetContent(pContent);
93 }
94
95 result
96 SearchBar::UpdateContentArea(bool invalidate)
97 {
98         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
99         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
100
101         return pSearchBarImpl->UpdateContentArea(invalidate);
102 }
103
104 result
105 SearchBar::SetContentAreaVisible(bool visible)
106 {
107         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
108         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
109
110         return pSearchBarImpl->SetContentAreaVisible(visible);
111 }
112
113 bool
114 SearchBar::IsContentAreaVisible(void) const
115 {
116         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
117         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
118
119         return pSearchBarImpl->IsContentAreaVisible();
120 }
121
122 result
123 SearchBar::SetContentAreaSize(const Dimension& size)
124 {
125         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
126         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
127
128         return pSearchBarImpl->SetContentAreaSize(size);
129 }
130
131 result
132 SearchBar::SetContentAreaSize(const FloatDimension& size)
133 {
134         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
135         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
136
137         return pSearchBarImpl->SetContentAreaSize(size);
138 }
139
140 Dimension
141 SearchBar::GetContentAreaSize(void) const
142 {
143         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
144         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
145
146         return pSearchBarImpl->GetContentAreaSize();
147 }
148
149 FloatDimension
150 SearchBar::GetContentAreaSizeF(void) const
151 {
152         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
153         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
154
155         return pSearchBarImpl->GetContentAreaSizeF();
156 }
157
158 SearchBarMode
159 SearchBar::GetMode(void) const
160 {
161         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
162         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
163
164         return pSearchBarImpl->GetMode();
165 }
166
167 bool
168 SearchBar::IsModeLocked(void) const
169 {
170         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
171         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
172
173         return pSearchBarImpl->IsModeLocked();
174 }
175
176 result
177 SearchBar::SetMode(SearchBarMode mode)
178 {
179         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
180         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
181
182         return pSearchBarImpl->SetMode(mode);
183 }
184
185 result
186 SearchBar::SetModeLocked(bool modeLocked)
187 {
188         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
189         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
190
191         return pSearchBarImpl->SetModeLocked(modeLocked);
192 }
193
194 int
195 SearchBar::GetButtonActionId(void) const
196 {
197         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
198         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
199
200         return pSearchBarImpl->GetButtonActionId();
201 }
202
203 Color
204 SearchBar::GetButtonColor(SearchBarButtonStatus status) const
205 {
206         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
207         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
208
209         return pSearchBarImpl->GetButtonColor(status);
210 }
211
212 Color
213 SearchBar::GetButtonTextColor(SearchBarButtonStatus status) const
214 {
215         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
216         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
217
218         return pSearchBarImpl->GetButtonTextColor(status);
219 }
220
221 SearchBarButtonStatus
222 SearchBar::GetButtonStatus(void) const
223 {
224         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
225         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
226
227         return pSearchBarImpl->GetButtonStatus();
228 }
229
230 result
231 SearchBar::SetButton(const String& text, int actionId)
232 {
233         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
234         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
235
236         return pSearchBarImpl->SetButton(text, actionId);
237 }
238
239 result
240 SearchBar::SetButtonEnabled(bool enabled)
241 {
242         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
243         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
244
245         return pSearchBarImpl->SetButtonEnabled(enabled);
246 }
247
248 result
249 SearchBar::SetButtonColor(SearchBarButtonStatus status, const Color& color)
250 {
251         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
252         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
253
254         return pSearchBarImpl->SetButtonColor(status, color);
255 }
256
257 result
258 SearchBar::SetButtonTextColor(SearchBarButtonStatus status, const Color& color)
259 {
260         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
261         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
262
263         return pSearchBarImpl->SetButtonTextColor(status, color);
264 }
265
266 result
267 SearchBar::AppendCharacter(const Character& character)
268 {
269         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
270         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
271
272         return pSearchBarImpl->AppendCharacter(character);
273 }
274
275 result
276 SearchBar::AppendText(const String& text)
277 {
278         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
279         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
280
281         return pSearchBarImpl->AppendText(text);
282 }
283
284 result
285 SearchBar::SetText(const String& text)
286 {
287         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
288         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
289
290         return pSearchBarImpl->SetText(text);
291 }
292
293 result
294 SearchBar::InsertCharacterAt(int index, const Character& character)
295 {
296         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
297         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
298
299         return pSearchBarImpl->InsertCharacterAt(index, character);
300 }
301
302 result
303 SearchBar::InsertTextAt(int index, const String& text)
304 {
305         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
306         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
307
308         return pSearchBarImpl->InsertTextAt(index, text);
309 }
310
311 result
312 SearchBar::DeleteCharacterAt(int index)
313 {
314         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
315         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
316
317         return pSearchBarImpl->DeleteCharacterAt(index);
318 }
319
320 result
321 SearchBar::Clear(void)
322 {
323         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
324         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
325
326         return pSearchBarImpl->Clear();
327 }
328
329 int
330 SearchBar::GetTextLength(void) const
331 {
332         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
333         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
334
335         return pSearchBarImpl->GetTextLength();
336 }
337
338 String
339 SearchBar::GetText(void) const
340 {
341         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
342         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
343
344         return pSearchBarImpl->GetText();
345 }
346
347 String
348 SearchBar::GetText(int start, int end) const
349 {
350         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
351         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
352
353         return pSearchBarImpl->GetText(start, end);
354 }
355
356 int
357 SearchBar::GetLimitLength(void) const
358 {
359         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
360         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
361
362         return pSearchBarImpl->GetLimitLength();
363 }
364
365 result
366 SearchBar::SetLimitLength(int limitLength)
367 {
368         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
369         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
370
371         return pSearchBarImpl->SetLimitLength(limitLength);
372 }
373
374 result
375 SearchBar::ShowKeypad(void) const
376 {
377         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
378         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
379
380         return pSearchBarImpl->ShowKeypad();
381 }
382
383 result
384 SearchBar::HideKeypad(void) const
385 {
386         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
387         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
388
389         return pSearchBarImpl->HideKeypad();
390 }
391
392 int
393 SearchBar::GetSearchFieldTextSize(void) const
394 {
395         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
396         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
397
398         return pSearchBarImpl->GetSearchFieldTextSize();
399 }
400
401 float
402 SearchBar::GetSearchFieldTextSizeF(void) const
403 {
404         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
405         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
406
407         return pSearchBarImpl->GetSearchFieldTextSizeF();
408 }
409
410 result
411 SearchBar::SetSearchFieldTextSize(int size)
412 {
413         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
414         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
415
416         return pSearchBarImpl->SetSearchFieldTextSize(size);
417 }
418
419 result
420 SearchBar::SetSearchFieldTextSize(float size)
421 {
422         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
423         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
424
425         return pSearchBarImpl->SetSearchFieldTextSize(size);
426 }
427
428 result
429 SearchBar::GetBlockRange(int& start, int& end) const
430 {
431         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
432         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
433
434         return pSearchBarImpl->GetBlockRange(start, end);
435 }
436
437 result
438 SearchBar::ReleaseBlock(void)
439 {
440         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
441         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
442
443         return pSearchBarImpl->ReleaseBlock();
444 }
445
446 result
447 SearchBar::SetBlockRange(int start, int end)
448 {
449         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
450         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
451
452         return pSearchBarImpl->SetBlockRange(start, end);
453 }
454
455 result
456 SearchBar::RemoveTextBlock(void)
457 {
458         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
459         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
460
461         return pSearchBarImpl->RemoveTextBlock();
462 }
463
464 Color
465 SearchBar::GetColor(void) const
466 {
467         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
468         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
469
470         return pSearchBarImpl->GetColor();
471 }
472
473 Color
474 SearchBar::GetSearchFieldColor(SearchFieldStatus status) const
475 {
476         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
477         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
478
479         return pSearchBarImpl->GetSearchFieldColor(status);
480 }
481
482 Color
483 SearchBar::GetSearchFieldTextColor(SearchFieldStatus status) const
484 {
485         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
486         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
487
488         return pSearchBarImpl->GetSearchFieldTextColor(status);
489 }
490
491 result
492 SearchBar::SetBackgroundBitmap(const Bitmap& bitmap)
493 {
494         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
495         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
496
497         return pSearchBarImpl->SetBackgroundBitmap(bitmap);
498 }
499
500 result
501 SearchBar::SetColor(const Color& color)
502 {
503         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
504         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
505
506         return pSearchBarImpl->SetColor(color);
507 }
508
509 result
510 SearchBar::SetSearchFieldColor(SearchFieldStatus status, const Color& color)
511 {
512         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
513         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
514
515         return pSearchBarImpl->SetSearchFieldColor(status, color);
516 }
517
518 result
519 SearchBar::SetSearchFieldTextColor(SearchFieldStatus status, const Color& color)
520 {
521         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
522         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
523
524         return pSearchBarImpl->SetSearchFieldTextColor(status, color);
525 }
526
527 String
528 SearchBar::GetGuideText(void) const
529 {
530         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
531         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
532
533         return pSearchBarImpl->GetGuideText();
534 }
535
536 result
537 SearchBar::SetGuideText(const String& guideText)
538 {
539         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
540         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
541
542         return pSearchBarImpl->SetGuideText(guideText);
543 }
544
545 Color
546 SearchBar::GetGuideTextColor(void) const
547 {
548         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
549         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
550
551         return pSearchBarImpl->GetGuideTextColor();
552 }
553
554 result
555 SearchBar::SetGuideTextColor(const Color& color)
556 {
557         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
558         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
559
560         return pSearchBarImpl->SetGuideTextColor(color);
561 }
562
563 int
564 SearchBar::GetCursorPosition(void) const
565 {
566         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
567         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
568
569         return pSearchBarImpl->GetCursorPosition();
570 }
571
572 result
573 SearchBar::SetCursorPosition(int index)
574 {
575         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
576         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
577
578         return pSearchBarImpl->SetCursorPosition(index);
579 }
580
581 bool
582 SearchBar::IsLowerCaseModeEnabled(void) const
583 {
584         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
585         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
586
587         return pSearchBarImpl->IsLowerCaseModeEnabled();
588 }
589
590 void
591 SearchBar::SetLowerCaseModeEnabled(bool enable)
592 {
593         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
594         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
595
596         pSearchBarImpl->SetLowerCaseModeEnabled(enable);
597
598         return;
599 }
600
601 EllipsisPosition
602 SearchBar::GetEllipsisPosition(void) const
603 {
604         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
605         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
606
607         return pSearchBarImpl->GetEllipsisPosition();
608 }
609
610 result
611 SearchBar::SetEllipsisPosition(EllipsisPosition position)
612 {
613         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
614         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
615
616         return pSearchBarImpl->SetEllipsisPosition(position);
617 }
618
619 KeypadAction
620 SearchBar::GetKeypadAction(void) const
621 {
622         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
623         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
624
625         return pSearchBarImpl->GetKeypadAction();
626 }
627
628 bool
629 SearchBar::IsTextPredictionEnabled(void) const
630 {
631         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
632         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
633
634         return pSearchBarImpl->IsTextPredictionEnabled();
635 }
636
637 result
638 SearchBar::SetTextPredictionEnabled(bool enable)
639 {
640         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
641         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
642
643         return pSearchBarImpl->SetTextPredictionEnabled(enable);
644 }
645
646 result
647 SearchBar::SetCurrentLanguage(LanguageCode languageCode)
648 {
649         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
650         SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
651
652         return pSearchBarImpl->SetCurrentLanguage(languageCode);
653 }
654
655 result
656 SearchBar::GetCurrentLanguage(LanguageCode& language) const
657 {
658         const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
659         SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
660
661         return pSearchBarImpl->GetCurrentLanguage(language);
662 }
663
664 void
665 SearchBar::AddActionEventListener(IActionEventListener& listener)
666 {
667         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
668         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
669
670         result r = pSearchBarImpl->AddActionEventListener(listener);
671         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
672
673         return;
674 }
675
676 void
677 SearchBar::RemoveActionEventListener(IActionEventListener& listener)
678 {
679         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
680         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
681
682         result r = pSearchBarImpl->RemoveActionEventListener(listener);
683         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
684
685         return;
686 }
687
688 void
689 SearchBar::AddTextEventListener(ITextEventListener& listener)
690 {
691         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
692         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
693
694         result r = pSearchBarImpl->AddTextEventListener(listener);
695         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
696
697         return;
698 }
699
700 void
701 SearchBar::RemoveTextEventListener(ITextEventListener& listener)
702 {
703         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
704         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
705
706         result r = pSearchBarImpl->RemoveTextEventListener(listener);
707         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
708
709         return;
710 }
711
712 void
713 SearchBar::AddSearchBarEventListener(ISearchBarEventListener& listener)
714 {
715         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
716         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
717
718         result r = pSearchBarImpl->AddSearchBarEventListener(listener);
719         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
720
721         return;
722 }
723
724 void
725 SearchBar::RemoveSearchBarEventListener(ISearchBarEventListener& listener)
726 {
727         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
728         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
729
730         result r = pSearchBarImpl->RemoveSearchBarEventListener(listener);
731         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
732
733         return;
734 }
735
736 void
737 SearchBar::AddTextBlockEventListener(ITextBlockEventListener& listener)
738 {
739         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
740         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
741
742         result r = pSearchBarImpl->AddTextBlockEventListener(listener);
743         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
744
745         return;
746 }
747
748 void
749 SearchBar::RemoveTextBlockEventListener(ITextBlockEventListener& listener)
750 {
751         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
752         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
753
754         result r = pSearchBarImpl->RemoveTextBlockEventListener(listener);
755         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
756
757         return;
758 }
759
760 void
761 SearchBar::AddKeypadEventListener(IKeypadEventListener& listener)
762 {
763         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
764         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
765
766         result r = pSearchBarImpl->AddKeypadEventListener(listener);
767         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
768
769         return;
770 }
771
772 void
773 SearchBar::RemoveKeypadEventListener(IKeypadEventListener& listener)
774 {
775         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
776         SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use.");
777
778         result r = pSearchBarImpl->RemoveKeypadEventListener(listener);
779         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
780
781         return;
782 }
783
784 void
785 SearchBar::AddLanguageEventListener(ILanguageEventListener& listener)
786 {
787         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
788         SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
789
790         result r = pSearchBarImpl->AddLanguageEventListener(listener);
791         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
792
793         return;
794 }
795
796 void
797 SearchBar::RemoveLanguageEventListener(ILanguageEventListener& listener)
798 {
799         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
800         SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
801
802         result r = pSearchBarImpl->RemoveLanguageEventListener(listener);
803         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
804
805         return;
806 }
807
808 void
809 SearchBar::SetEditTextFilter(IEditTextFilter* pFilter)
810 {
811         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
812         SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
813
814         pSearchBarImpl->SetEditTextFilter(pFilter);
815
816         return;
817 }
818
819 void
820 SearchBar::SendOpaqueCommand (const String& command)
821 {
822         _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this);
823         SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use.");
824
825         pSearchBarImpl->SendOpaqueCommand(command);
826
827         return;
828 }
829
830 }}} // Tizen::Ui::Controls