Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiCtrlSearchBar.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.h
20  * @brief       This is the header file for the %SearchBar class.
21  *
22  * This header file contains the declarations of the %SearchBar class.
23  */
24
25 #ifndef _FUI_CTRL_SEARCH_BAR_H_
26 #define _FUI_CTRL_SEARCH_BAR_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FBaseString.h>
31 #include <FUiControl.h>
32 #include <FUiCtrlEditTypes.h>
33 #include <FUiIActionEventListener.h>
34 #include <FUiIKeypadEventListener.h>
35 #include <FUiILanguageEventListener.h>
36 #include <FUiITextBlockEventListener.h>
37 #include <FUiITextEventListener.h>
38
39 namespace Tizen { namespace Graphics
40 {
41 class Rectangle;
42 }} // Tizen::Graphics
43
44 namespace Tizen { namespace Ui { namespace Controls
45 {
46
47 class ISearchBarEventListener;
48
49 /**
50  * @enum    SearchFieldStatus
51  *
52  * Defines the possible states of the search field of the search bar.
53  *
54  * @since       2.0
55  */
56 enum SearchFieldStatus
57 {
58         SEARCH_FIELD_STATUS_NORMAL,         /**< The normal state */
59         SEARCH_FIELD_STATUS_HIGHLIGHTED,    /**< The focus-highlighted state */
60         SEARCH_FIELD_STATUS_DISABLED        /**< The disabled state */
61 };
62
63 /**
64  * @enum    SearchBarButtonStatus
65  *
66  * Defines the possible states of the search bar button.
67  *
68  * @since       2.0
69  */
70 enum SearchBarButtonStatus
71 {
72         SEARCH_BAR_BUTTON_STATUS_NORMAL = 0,        /**< The normal status */
73         SEARCH_BAR_BUTTON_STATUS_PRESSED,           /**< The selected status */
74         SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED,       /**< The highlighted status */
75         SEARCH_BAR_BUTTON_STATUS_DISABLED           /**< The disabled status */
76 };
77
78 /**
79  * @enum        SearchBarMode
80  *
81  * Defines the possible modes of the search bar.
82  *
83  * @since       2.0
84  */
85 enum SearchBarMode
86 {
87         SEARCH_BAR_MODE_NORMAL,     /**< The normal mode */
88         SEARCH_BAR_MODE_INPUT       /**< The input mode */
89 };
90
91 /**
92  * @class       SearchBar
93  * @brief       This class is an implementation of a search bar.
94  *
95  * @since       2.0
96  *
97  * The %SearchBar class displays an editable search field for entering keywords and an optional button that is displayed in the
98  * input mode.
99  *
100  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_searchbar.htm">SearchBar</a>.
101  *
102  * The following example demonstrates how to use the %SearchBar class.
103  *
104  * @code
105 // Sample code for SearchBarSample.h
106 #include <FUi.h>
107
108 class SearchBarSample
109         : public Tizen::Ui::Controls::Form
110         , public Tizen::Ui::Controls::ISearchBarEventListener
111         , public Tizen::Ui::Controls::IListViewItemEventListener
112         , public Tizen::Ui::Controls::IListViewItemProvider
113         , public Tizen::Ui::ITextEventListener
114 {
115 public:
116         SearchBarSample(void)
117         : __pSearchBar(null)
118         , __pSearchBarListView(null){}
119
120         bool Initialize(void);
121         virtual result OnInitializing(void);
122
123         // ISearchBarEventListener
124         virtual void OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source, Tizen::Ui::Controls::SearchBarMode mode);
125         virtual void OnSearchBarContentAreaResized(Tizen::Ui::Controls::SearchBar& source, Tizen::Graphics::Dimension& size) {};
126         virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
127         virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source){};
128
129         // IListViewItemEventListener
130         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
131         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
132         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView &listView, int index, Tizen::Ui::Controls::SweepDirection direction);
133
134         //IListViewItemProvider
135         virtual Tizen::Ui::Controls::ListItemBase* CreateItem (int index, int itemWidth);
136         virtual bool DeleteItem (int index, Tizen::Ui::Controls::ListItemBase *pItem, int itemWidth);
137         virtual int GetItemCount(void);
138
139 private:
140         static const int ID_FORMAT_STRING = 500;
141
142         Tizen::Ui::Controls::SearchBar* __pSearchBar;
143         Tizen::Ui::Controls::ListView*  __pSearchBarListView;
144 };
145  * @endcode
146  *
147  * @code
148 // Sample code for SearchBarSample.cpp
149 #include <FApp.h>
150 #include <FGraphics.h>
151
152 #include "SearchBarSample.h"
153
154 using namespace Tizen::Base;
155 using namespace Tizen::Base::Collection;
156 using namespace Tizen::Graphics;
157 using namespace Tizen::Ui;
158 using namespace Tizen::Ui::Controls;
159
160 bool
161 SearchBarSample::Initialize(void)
162 {
163         Construct(FORM_STYLE_NORMAL);
164         return true;
165 }
166
167 result
168 SearchBarSample::OnInitializing(void)
169 {
170         result r = E_SUCCESS;
171
172         // Creates an instance of SearchBar
173         __pSearchBar = new SearchBar();
174         __pSearchBar->Construct(Rectangle(0, 0, GetClientAreaBounds().width, 110));
175         __pSearchBar->SetText(L"Click here! ");
176         __pSearchBar->AddSearchBarEventListener(*this);
177         __pSearchBar->AddTextEventListener(*this);
178
179         // Creates an instance of ListView
180         __pSearchBarListView = new ListView();
181         __pSearchBarListView->Construct(Rectangle(0, 110, GetClientAreaBounds().width, GetClientAreaBounds().height - 110), true, false);
182         __pSearchBarListView->SetItemProvider(*this);
183         __pSearchBarListView->AddListViewItemEventListener(*this);
184         __pSearchBarListView->SetTextOfEmptyList(L"No search result");
185         __pSearchBarListView->SetShowState(false);
186         __pSearchBar->SetContent(__pSearchBarListView);
187
188         // Adds controls to the form
189         AddControl(*__pSearchBar);
190
191         return r;
192 }
193
194 // ISearchBarEventListener implementation
195 void
196 SearchBarSample::OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source, Tizen::Ui::Controls::SearchBarMode mode)
197 {
198         Rectangle clientRect = GetClientAreaBounds();
199         __pSearchBar->SetText(L"");
200
201         if(mode == SEARCH_BAR_MODE_INPUT)
202         {
203                 SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
204                 __pSearchBar->SetContentAreaSize(Dimension(clientRect.width, clientRect.height));
205                 __pSearchBarListView->SetSize(Dimension(clientRect.width, clientRect.height));
206                 __pSearchBarListView->UpdateList();
207         }
208         else
209         {
210                 SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
211                 __pSearchBarListView->UpdateList();
212                 __pSearchBarListView->SetShowState(false);
213                 __pSearchBar->SetText(L"Click here!");
214         }
215         Invalidate(true);
216 }
217
218 void
219 SearchBarSample::OnTextValueChanged(const Tizen::Ui::Control& source)
220 {
221         if(__pSearchBarListView)
222         {
223                 __pSearchBarListView->UpdateList();
224                 __pSearchBarListView->ScrollToItem(0);
225                 __pSearchBarListView->SetShowState(true);
226         }
227         Invalidate(true);
228 }
229
230 // IListViewItemEventListener implementation
231  void
232  SearchBarSample::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
233  {
234         // ....
235  }
236
237  void
238  SearchBarSample::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
239  {
240         // ....
241  }
242
243  void
244  SearchBarSample::OnListViewItemSwept(Tizen::Ui::Controls::ListView &listView, int index, Tizen::Ui::Controls::SweepDirection direction)
245  {
246         // ....
247  }
248
249 //IListViewItemProvider
250 ListItemBase*
251 SearchBarSample::CreateItem (int index, int itemWidth)
252 {
253         // Creates an instance of CustomItem
254         CustomItem* pItem = new CustomItem();
255         ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
256
257         // Gets texts of the search bar
258         String inputText = null;
259         inputText = __pSearchBar->GetText();
260
261         if(inputText.CompareTo(L"a") == 0 || inputText.CompareTo(L"A") == 0 )
262         {
263                 switch (index % 3)
264                 {
265                 case 0:
266                         {
267                                 pItem->Construct(Dimension(itemWidth,100), style);
268                                 pItem->AddElement(Rectangle(80, 25, 200, 50), ID_FORMAT_STRING, L"ajo", true);
269                         }
270                         break;
271                 case 1:
272                         {
273                                 pItem->Construct(Dimension(itemWidth,100), style);
274                                 pItem->AddElement(Rectangle(80, 25, 200, 50), ID_FORMAT_STRING, L"aeun", true);
275                         }
276                         break;
277                 case 2:
278                         {
279                                 pItem->Construct(Dimension(itemWidth,100), style);
280                                 pItem->AddElement(Rectangle(80, 25, 200, 50), ID_FORMAT_STRING, L"abee", true);
281                         }
282                         break;
283                 default:
284                         break;
285                 }
286         }
287         else if (inputText.CompareTo(L"b") == 0 || inputText.CompareTo(L"B") == 0)
288         {
289                 switch (index%3)
290                 {
291                 case 0:
292                         {
293                                 pItem->Construct(Dimension(itemWidth,100), style);
294                                 pItem->AddElement(Rectangle(80, 25, 200, 50), ID_FORMAT_STRING, L"bonge", true);
295                         }
296                         break;
297                 case 1:
298                         {
299                                 pItem->Construct(Dimension(itemWidth,100), style);
300                                 pItem->AddElement(Rectangle(80, 25, 200, 50), ID_FORMAT_STRING, L"bnpyo", true);
301                         }
302                         break;
303                 case 2:
304                         {
305                                 pItem->Construct(Dimension(itemWidth,100), style);
306                                 pItem->AddElement(Rectangle(80, 25, 200, 50), ID_FORMAT_STRING, L"bkueon", true);
307                         }
308                         break;
309                 default:
310                         break;
311                 }
312         }
313         else
314         {
315                 pItem->Construct(Dimension(itemWidth,100), style);
316                 pItem->AddElement(Rectangle(80, 25, 200, 50), ID_FORMAT_STRING, L"default", true);
317         }
318
319         return pItem;
320 }
321
322 bool
323 SearchBarSample::DeleteItem (int index, Tizen::Ui::Controls::ListItemBase *pItem, int itemWidth)
324 {
325         delete pItem;
326         pItem = null;
327         return true;
328 }
329
330 int
331 SearchBarSample::GetItemCount(void)
332 {
333         return 3;
334 }
335  * @endcode
336  *
337  */
338
339 class _OSP_EXPORT_ SearchBar
340         : public Tizen::Ui::Control
341 {
342 public:
343         /**
344          * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
345          *
346          * @since       2.0
347          */
348         SearchBar(void);
349
350         /**
351          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
352          *
353          * @since       2.0
354          */
355         virtual ~SearchBar(void);
356
357         /**
358          * Initializes this instance of the %SearchBar control with the specified parameters.
359          *
360          * @since               2.0
361          *
362          * @return              An error code
363          * @param[in]   rect                    An instance of the Graphics::Rectangle class @n
364          *                                                              This instance represents the x and y coordinates of the top-left corner of the created window along with
365          *                                                              the width and height of the control.
366          * @param[in]   searchBarButton Set to @c true to display the search bar button, @n
367          *                              else @c false
368          * @param[in]   keypadAction    The keypad action
369          * @exception   E_SUCCESS               The method is successful.
370          * @exception   E_INVALID_ARG   A specified input parameter is invalid, or @n
371          *                                                              the action ID of the specified item must be a positive integer.
372          * @exception   E_SYSTEM                A system error has occurred.
373          * @remarks     It is recommended that %SearchBar should be placed at the top-left corner of Form's client area.
374          * @remarks     By default, a "Cancel" button is displayed if @c searchBarButton is set to @c true. When the user presses the cancel button,
375          *              the %SearchBar control returns to SEARCH_BAR_MODE_NORMAL automatically.
376          */
377         result Construct(const Tizen::Graphics::Rectangle& rect, bool searchBarButton = true, KeypadAction keypadAction = KEYPAD_ACTION_SEARCH);
378
379         /**
380          * Gets the content of Control.
381          *
382          * @since               2.0
383          *
384          * @return              The control that is displayed in the content area of %SearchBar in the SEARCH_BAR_MODE_INPUT mode, @n
385          *                              else @c null if an error occurs
386          * @exception   E_SUCCESS                       The method is successful.
387          * @remarks             The specific error code can be accessed using the GetLastResult() method.
388          */
389         Tizen::Ui::Control* GetContent(void) const;
390
391         /**
392          * Sets the content control.
393          *
394          * @if OSPCOMPAT
395          * @brief <i> [Compatibility] </i>
396          * @endif
397          * @since               2.0
398          * @if OSPCOMPAT
399          * @compatibility This method has compatibility issues with OSP compatible applications. @n
400          *                                              For more information, see @ref CompSetContentPage "here"
401          * @endif
402          * @return      An error code
403          * @param[in]   pContent                        The control that is to be displayed in the content area of the search bar
404          * @exception   E_SUCCESS                       The method is successful.
405          * @exception   E_INVALID_ARG           A specified input parameter is invalid. @n
406          *                                                                      The following controls cannot be set as the content: @n
407          *                                                                      @li All classes derived from the Window class
408          *                                                                      @li All picker classes (For example, DateTimePicker)
409          *                                                                      @li Form
410          *                                                                      @li Keypad
411          *                                                                      @li OverlayPanel
412          * @exception   E_SYSTEM                        A system error has occurred.
413          * @remarks             The specified content control is displayed when the mode of the %SearchBar control is changed to SEARCH_BAR_MODE_INPUT.
414          * @see                 GetContentAreaSize()
415          * @see                 AddSearchBarEventListener()
416          * @see                 ISearchBarEventListener
417          */
418         result SetContent(const Tizen::Ui::Control* pContent);
419         /**
420          * @page               CompSetContentPage        Compatibility for SetContent()
421          * @section            CompSetContentPage IssueSection          Issues
422          * Implementing this method in OSP compatible applications has the following issue: @n
423          * SetContent() method passes the ownership of Content control to SearchBar in OSP,
424          * whereas the Content control ownership remains with the caller in Tizen.
425          *
426          * @section            CompSetContentPage SolutionSection               Resolutions
427          * In Tizen, the caller should delete the previous Content control, if this method is called more than once.
428          */
429
430         /**
431          * Updates the content area of the %SearchBar control.
432          *
433          * @since               2.0
434          *
435          * @return              An error code
436          * @param[in]   show                                    Set to @c true to perform show on the content area, @n
437          *                                                                              else @c false
438          * @exception   E_SUCCESS                               The method is successful.
439          * @exception   E_INVALID_OPERATION             The current state of the instance prohibits the execution of the specified operation. @n
440          *                                                                              The current mode of %SearchBar prohibits the execution of the method.
441          * @exception   E_SYSTEM                                A system error has occurred.
442          * @remarks             The method performs Invalidate() on the content area.
443          */
444         result UpdateContentArea(bool invalidate = true);
445
446         /**
447          * Sets the visibility state of the content area.
448          *
449          * @since               2.0
450          *
451          * @return              An error code
452          * @param[in]   visible                         Set to @c true to make the content area visible, @n
453          *                                                                      else @c false
454          * @exception   E_SUCCESS                       The method is successful.
455          * @exception   E_SYSTEM                        A system error has occurred.
456          * @see                 IsContentAreaVisible()
457          */
458         result SetContentAreaVisible(bool visible);
459
460         /**
461          * Checks whether the content area is visible.
462          *
463          * @since               2.0
464          *
465          * @return              @c true if the content area is visible, @n
466          *                              else @c false
467          * @exception   E_SUCCESS                       The method is successful.
468          * @see                 SetContentAreaVisible()
469          */
470         bool IsContentAreaVisible(void) const;
471
472         /**
473          * Sets the size of the content area of the %SearchBar control.
474          *
475          * @since               2.0
476          *
477          * @return              An error code
478          * @param[in]   size                            The size of the content area
479          * @exception   E_SUCCESS                       The method is successful.
480          * @exception   E_INVALID_ARG           The specified input parameter is invalid. @n
481          *                                  The width and height of @c size must be greater than or equal to @c 0.
482          * @remarks             The content area must be resized when the orientation of the form is changed once the size of the content area is changed.
483          * @see         GetContentAreaSize()
484          */
485         result SetContentAreaSize(const Tizen::Graphics::Dimension& size);
486
487         /**
488          * Gets the size of the content area of the %SearchBar control.
489          *
490          * @since               2.0
491          *
492          * @return              The size of the content area
493          * @remarks             The content area is the area where the 'content' of the %SearchBar control is displayed. The size of the content areas can
494          *              be changed at runtime.
495          * @see         AddSearchBarEventListener()
496          * @see         ISearchBarEventListener
497          */
498         Tizen::Graphics::Dimension GetContentAreaSize(void) const;
499
500 // Modes
501         /**
502          * Gets the search bar mode.
503          *
504          * @since               2.0
505          *
506          * @return      The search bar mode
507          * @exception   E_SUCCESS                       The method is successful.
508          * @exception   E_SYSTEM                        A system error has occurred.
509          * @remarks     The specific error code can be accessed using the GetLastResult() method.
510          * @see         SetMode()
511          */
512         SearchBarMode GetMode(void) const;
513
514         /**
515          * Checks whether the search bar mode is locked.
516          *
517          * @since               2.0
518          *
519          * @return              @c true if the mode is locked, @n
520          *                              else @c false
521          * @exception   E_SUCCESS                       The method is successful.
522          * @exception   E_SYSTEM                        A system error has occurred.
523          * @remarks             The specific error code can be accessed using the GetLastResult() method.
524          * @see                 SetModeLock()
525          */
526         bool IsModeLocked(void) const;
527
528         /**
529          * Sets the search bar mode.
530          *
531          * @since               2.0
532          *
533          * @return              An error code
534          * @param[in]   mode                The search bar mode
535          * @exception   E_SUCCESS                       The method is successful.
536          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation, or @n
537          *                                                                      the mode is locked.
538          * @exception   E_SYSTEM            A system error has occurred.
539          * @see                 GetMode()
540          * @see                 SetModeLock()
541          */
542         result SetMode(SearchBarMode mode);
543
544         /**
545          * Sets the lock status of the search bar mode.
546          *
547          * @since               2.0
548          *
549          * @return      An error code
550          * @param[in]   modeLocked          Set to @c true to lock the search bar mode, @n
551          *                                                                      else @c false
552          * @exception   E_SUCCESS           The method is successful.
553          * @exception   E_SYSTEM            A system error has occurred.
554          * @see         GetMode()
555          */
556         result SetModeLocked(bool modeLocked);
557
558         /**
559          * Gets the action ID of the search bar button.
560          *
561          * @since               2.0
562          *
563          * @return      The action ID, @n
564          *                              else @c -1 if an error occurs
565          * @exception   E_SUCCESS           The method is successful.
566          * @exception   E_SYSTEM            A system error has occurred.
567          * @remarks     The specific error code can be accessed using the GetLastResult() method. @n
568          *                              By default, the method returns @c -1 if no user defined search bar button is set.
569          */
570         int GetButtonActionId(void) const;
571
572         /**
573          * Gets the color of the search bar button for the specified state.
574          *
575          * @since               2.0
576          *
577          * @return              The color of the search bar button, @n
578          *                              else RGBA(0,0,0,0) if an error occurs
579          * @param[in]   status                          The status of the search bar button
580          * @exception   E_SUCCESS                       The method is successful.
581          * @exception   E_SYSTEM                        A system error has occurred.
582          * @remarks             The specific error code can be accessed using the GetLastResult() method.
583          * @see                 SetButtonColor()
584          */
585         Tizen::Graphics::Color GetButtonColor(SearchBarButtonStatus status) const;
586
587         /**
588          * Gets the text color of the search bar button for the specified state.
589          *
590          * @since               2.0
591          *
592          * @return              The text color of the search bar button, @n
593          *                              else RGBA(0,0,0,0) if an error occurs
594          * @param[in]   status              The status of the search bar button
595          * @exception   E_SUCCESS           The method is successful.
596          * @exception   E_SYSTEM            A system error has occurred.
597          * @remarks     The specific error code can be accessed using the GetLastResult() method.
598          */
599         Tizen::Graphics::Color GetButtonTextColor(SearchBarButtonStatus status) const;
600
601         /**
602          * Gets the state of the search bar button.
603          *
604          * @since               2.0
605          *
606          * @return              The state of the search bar button
607          * @exception   E_SUCCESS           The method is successful.
608          * @exception   E_SYSTEM            A system error has occurred.
609          * @remarks             The specific error code can be accessed using the GetLastResult() method.
610          */
611         SearchBarButtonStatus GetButtonStatus(void) const;
612
613         /**
614          * Sets the user defined search bar button.
615          *
616          * @since               2.0
617          *
618          * @return      An error code
619          * @param[in]   text                    The button text
620          * @param[in]   actionId                The button action ID
621          * @exception   E_SUCCESS               The method is successful.
622          * @exception   E_INVALID_ARG   A specified input parameter is invalid, or @n
623          *                                                              the specified @c actionId must be greater than or equal to @c 0.
624          * @exception   E_SYSTEM                A system error has occurred.
625          */
626         result SetButton(const Tizen::Base::String& text, int actionId);
627
628         /**
629          * Sets the enabled status of the search bar button.
630          *
631          * @since               2.0
632          *
633          * @return              An error code
634          * @param[in]   enabled                 Set to @c true to enable the search bar button, @n
635          *                                                              else @c false
636          * @exception   E_SUCCESS               The method is successful.
637          * @exception   E_SYSTEM                A system error has occurred.
638          */
639         result SetButtonEnabled(bool enabled);
640
641         /**
642          * Sets the color of the search bar button for the specified state.
643          *
644          * @since               2.0
645          *
646          * @return              An error code
647          * @param[in]   status          The button status
648          * @param[in]   color           The button color to be set
649          * @exception   E_SUCCESS               The method is successful.
650          * @exception   E_SYSTEM                A system error has occurred.
651          * @see                 GetButtonColor()
652          */
653         result SetButtonColor(SearchBarButtonStatus status, const Tizen::Graphics::Color& color);
654
655         /**
656          * Sets the text color of the button of the %SearchBar control for the specified state.
657          *
658          * @since               2.0
659          *
660          * @return              An error code
661          * @param[in]   status                  The button status
662          * @param[in]   color                   The button text color to set
663          * @exception   E_SUCCESS               The method is successful.
664          * @exception   E_SYSTEM                A system error has occurred.
665          */
666         result SetButtonTextColor(SearchBarButtonStatus status, const Tizen::Graphics::Color& color);
667
668         /**
669          * Appends the specified character at the end of the text.
670          *
671          * @since               2.0
672          *
673          * @return              An error code
674          * @param[in]   character               The character to be added
675          * @exception   E_SUCCESS               The method is successful.
676          * @exception   E_SYSTEM                A system error has occurred.
677          * @remarks             The method modifies the text buffer that is managed by the %SearchBar control. @n
678          *              To display the changes, the control must be drawn again.
679          */
680         result AppendCharacter(const Tizen::Base::Character& character);
681
682         /**
683          * Appends the specified text at the end of the existing text.
684          *
685          * @since               2.0
686          *
687          * @return              An error code
688          * @param[in]   text            The text to be appended
689          * @exception   E_SUCCESS       The method is successful.
690          * @exception   E_SYSTEM    A system error has occurred.
691          * @remarks             To denote the end of a line use '\\n'. @n
692          *              The method modifies the text buffer that is managed by the %SearchBar control. @n
693          *              To display the changes, the control must be drawn again.
694          */
695         result AppendText(const Tizen::Base::String& text);
696
697
698         /**
699          * Sets the text to be displayed.
700          *
701          * @since               2.0
702          *
703          * @return              An error code
704          * @param[in]   text                    The text to be displayed
705          * @exception   E_SUCCESS       The method is successful.
706          * @exception   E_SYSTEM        A system error has occurred.
707          * @remarks             To denote the end of a line use '\\n'. @n
708          *              The method modifies the text buffer that is managed by the %SearchBar control. @n
709          *              To display the changes, the control must be drawn again.
710          */
711         result SetText(const Tizen::Base::String& text);
712
713         /**
714          * Inserts the character at the specified index.
715          *
716          * @since               2.0
717          *
718          * @return              An error code
719          * @param[in]   index                   The position to insert the character
720          * @param[in]   character               The character to be inserted
721          * @exception   E_SUCCESS               The method is successful.
722          * @exception   E_OUT_OF_RANGE  The specified @c index is outside the bounds of the data structure. @n
723          *                              The specified @c index is greater than the number of elements or less than @c 0.
724          * @exception   E_MAX_EXCEEDED  The length of the specified @c text exceeds the system limitation.
725          * @exception   E_SYSTEM                A system error has occurred.
726          * @remarks             The method modifies the text buffer that is managed by the %SearchBar control. @n
727          *                              To display the changes, the control must be drawn again.
728          */
729         result InsertCharacterAt(int index, const Tizen::Base::Character& character);
730
731         /**
732          * Inserts the specified text at the specified index.
733          *
734          * @since               2.0
735          *
736          * @return              An error code
737          * @param[in]   index                   The position at which to insert
738          * @param[in]   text                    The text to be inserted
739          * @exception   E_SUCCESS               The method is successful.
740          * @exception   E_OUT_OF_RANGE  The specified @c index is outside the bounds of the data structure. @n
741          *                                                              The specified @c index is greater than the number of elements or less than @c 0.
742          * @exception   E_MAX_EXCEEDED  The length of the specified @c text exceeds the system limitation.
743          * @exception   E_SYSTEM            A system error has occurred.
744          * @remarks             The method modifies the text buffer that is managed by the %SearchBar control.
745          *                              To display the changes, the control must be drawn again.
746          */
747         result InsertTextAt(int index, const Tizen::Base::String& text);
748
749         /**
750          * Deletes the character at the specified position.
751          *
752          * @since               2.0
753          *
754          * @return              An error code
755          * @param[in]   index                   The index
756          * @exception   E_SUCCESS               The method is successful.
757          * @exception   E_INVALID_ARG   The specified @c index is negative.
758          * @exception   E_OUT_OF_RANGE  The specified @c index is outside the bounds of the data structure. @n
759          *                              The specified @c index is greater than the number of elements or less than @c 0.
760          * @exception   E_SYSTEM                A system error has occurred.
761          * @remarks     The method modifies the text buffer that is managed by the %SearchBar control. @n
762          *              To display the changes, the control must be drawn again.
763          */
764         result DeleteCharacterAt(int index);
765
766         /**
767          * Clears the text that is displayed by the %SearchBar control.
768          *
769          * @since               2.0
770          *
771          * @return              An error code
772          * @exception   E_SUCCESS               The method is successful.
773          * @exception   E_SYSTEM                A system error has occurred.
774          * @remarks             The method modifies the text buffer that is managed by the %SearchBar control. @n
775          *                              To display the changes, the control must be drawn again.
776          */
777         result Clear(void);
778
779         /**
780          * Gets the length of the text that is displayed by the %SearchBar control.
781          *
782          * @since               2.0
783          *
784          * @return              The length of the text, @n
785          *                              else @c -1 if an error occurs
786          * @exception   E_SUCCESS               The method is successful.
787          * @exception   E_SYSTEM                A system error has occurred.
788          * @remarks             The specific error code can be accessed using the GetLastResult() method.
789          */
790         int GetTextLength(void) const;
791
792         /**
793          * Gets the text that is displayed by the %SearchBar control.
794          *
795          * @since               2.0
796          *
797          * @return              The text displayed by the %SearchBar control, @n
798          *                              else an empty string if an error occurs
799          * @exception   E_SUCCESS                       The method is successful.
800          * @exception   E_SYSTEM                        A system error has occurred.
801          * @remarks             The specific error code can be accessed using the GetLastResult() method.
802          * @see                 SetText()
803          */
804         Tizen::Base::String GetText(void) const;
805
806         /**
807          * Gets a portion of text that is displayed by the %SearchBar control.
808          *
809          * @since               2.0
810          *
811          * @return              The specified portion of the text, @n
812          *                              else an empty string if an error occurs
813          * @param[in]   start           The starting index of range
814          * @param[in]   end                 The last index of range
815          * @exception   E_SUCCESS       The method is successful.
816          * @exception   E_OUT_OF_RANGE  The specified index is outside the bounds of the data structure, or @n
817          *                                                              either the @c start or @c end parameter is greater than the number of elements or less than @c 0.
818          * @exception   E_SYSTEM                A system error has occurred.
819          * @remarks             The specific error code can be accessed using the GetLastResult() method.
820          * @see                 SetText()
821          */
822         Tizen::Base::String GetText(int start, int end) const;
823
824         /**
825          * Gets the limit of the length of the text.
826          *
827          * @since               2.0
828          *
829          * @return              The limit of the text length, @n
830          *                              else @c -1 if an error occurs
831          * @exception   E_SUCCESS               The method is successful.
832          * @exception   E_SYSTEM                A system error has occurred.
833          * @remarks     The specific error code can be accessed using the GetLastResult() method. @n
834          *                              The default limit length is @c 500.
835          * @see         SetLimitLength()
836          */
837         int GetLimitLength(void) const;
838
839         /**
840          * Sets the limit of the length of the text.
841          *
842          * @since               2.0
843          *
844          * @return              An error code
845          * @param[in]   limitLength             The limit text length to be set
846          * @exception   E_SUCCESS               The method is successful.
847          * @exception   E_INVALID_ARG   The specified input parameter is invalid, or @n
848          *                                                              the specified limit length cannot be @c 0 or negative.
849          * @exception   E_SYSTEM                A system error has occurred.
850          * @see                 GetLimitLength()
851          */
852         result SetLimitLength(int limitLength);
853
854         /**
855          * Shows the keypad associated with the %SearchBar control.
856          *
857          * @since               2.0
858          *
859          * @return              An error code
860          * @exception   E_SUCCESS               The method is successful.
861          * @exception   E_INVALID_STATE This instance is in an invalid state.
862          * @exception   E_SYSTEM                A system error has occurred.
863          * @see                 HideKeypad()
864          */
865         result ShowKeypad(void) const;
866
867         /**
868          * Hides the keypad associated with the %SearchBar control.
869          *
870          * @since               2.0
871          *
872          * @return              An error code
873          * @exception   E_SUCCESS               The method is successful.
874          * @exception   E_SYSTEM                A system error has occurred.
875          * @see                 ShowKeypad()
876          */
877         result HideKeypad(void) const;
878
879         /**
880          * Gets the text size of the search field.
881          *
882          * @since               2.0
883          *
884          * @return      The size of the text, @n
885          *              else @c -1 if an error occurs
886          * @exception   E_SUCCESS               The method is successful.
887          * @exception   E_SYSTEM                A system error has occurred.
888          * @remarks     The specific error code can be accessed using the GetLastResult() method.
889          * @see         SetSearchFieldTextSize()
890          */
891         int GetSearchFieldTextSize(void) const;
892
893         /**
894          * Sets the text size of the text field of the %SearchBar control.
895          *
896          * @since               2.0
897          *
898          * @return              An error code
899          * @param[in]   size                    The text size
900          * @exception   E_SUCCESS               The method is successful.
901          * @exception   E_INVALID_ARG   The specified input parameter is invalid, or @n
902          *                                                              the specified @c size cannot be a negative value.
903          * @exception   E_SYSTEM                A system error has occurred.
904          * @see                 GetSearchFieldTextSize()
905          */
906         result SetSearchFieldTextSize(int size);
907
908         /**
909          * Gets the start and the end index of the currently selected text block.
910          *
911          * @since               2.0
912          *
913          * @return              An error code
914          * @param[out]  start                   The start index of the text block
915          * @param[out]  end                             The end index of the text block
916          * @exception   E_SUCCESS               The method is successful.
917          * @exception   E_SYSTEM                A system error has occurred.
918          * @remarks             The method returns @c start = 0 and @c end = 0 if no text block is selected.
919          * @see                 ReleaseBlock()
920          * @see                 SetBlockRange()
921          */
922         result GetBlockRange(int& start, int& end) const;
923
924         /**
925          * Releases the selection of the current text block.
926          *
927          * @since               2.0
928          *
929          * @return              An error code
930          * @exception   E_SUCCESS                       The method is successful.
931          * @exception   E_SYSTEM                        A system error has occurred.
932          * @see                 GetBlockRange()
933          * @see                 SetBlockRange()
934          */
935         result ReleaseBlock(void);
936
937         /**
938          * Sets the block range for the text.
939          *
940          * @since               2.0
941          *
942          * @return              An error code
943          * @param[in]   start           The start index of the text block
944          * @param[in]   end             The end index of the text block
945          * @exception   E_SUCCESS       The method is successful.
946          * @exception   E_OUT_OF_RANGE  The specified index is outside the bounds of the data structure, or @n
947          *                                                              either the @c start or @c end parameter is greater than the number of elements or less than @c 0.
948          * @exception   E_SYSTEM                A system error has occurred.
949          * @see                 ReleaseBlock()
950          * @see                 GetBlockRange()
951          */
952         result SetBlockRange(int start, int end);
953
954         /**
955          * Removes the text of the selected text block.
956          *
957          * @since               2.0
958          *
959          * @return              An error code
960          * @exception   E_SUCCESS                       The method is successful.
961          * @exception   E_SYSTEM                        A system error has occurred.
962          */
963         result RemoveTextBlock(void);
964
965         /**
966          * Gets the color of the %SearchBar control for the specified status.
967          *
968          * @since               2.0
969          *
970          * @return              The color of the %SearchBar control, @n
971          *                              else RGBA(0,0,0,0) if an error occurs
972          * @exception   E_SUCCESS               The method is successful.
973          * @exception   E_SYSTEM                A system error has occurred.
974          * @remarks             The specific error code can be accessed using the GetLastResult() method.
975          * @see                 SetColor()
976          */
977         Tizen::Graphics::Color GetColor(void) const;
978
979         /**
980          * Gets the color of the search field for the specified status.
981          *
982          * @since               2.0
983          *
984          * @return              The color, @n
985          *                              else RGBA(0,0,0,0) if an error occurs
986          * @param[in]   status                  The search field status
987          * @exception   E_SUCCESS               The method is successful.
988          * @exception   E_SYSTEM                A system error has occurred.
989          * @remarks             The specific error code can be accessed using the GetLastResult() method.
990          * @see                 SetSearchFieldColor()
991          */
992         Tizen::Graphics::Color GetSearchFieldColor(SearchFieldStatus status) const;
993
994         /**
995          * Gets the text color of the search field for the specified status.
996          *
997          * @since               2.0
998          *
999          * @return              The text color, @n
1000          *                              else RGBA(0,0,0,0) if an error occurs
1001          * @param[in]   status                  The search field status
1002          * @exception   E_SUCCESS               The method is successful.
1003          * @exception   E_SYSTEM                A system error has occurred.
1004          * @remarks             The specific error code can be accessed using the GetLastResult() method.
1005          * @see                 SetSearchFieldTextColor()
1006          */
1007         Tizen::Graphics::Color GetSearchFieldTextColor(SearchFieldStatus status) const;
1008
1009         /**
1010          * Sets the background bitmap of the %SearchBar control.
1011          *
1012          * @since               2.0
1013          *
1014          * @return              An error code
1015          * @param[in]   bitmap                  The background bitmap
1016          * @exception   E_SUCCESS               The method is successful.
1017          * @exception   E_SYSTEM                A system error has occurred.
1018          */
1019         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
1020
1021         /**
1022          * Sets the color of the search bar.
1023          *
1024          * @since               2.0
1025          *
1026          * @return              An error code
1027          * @param[in]   color                   The color
1028          * @exception   E_SUCCESS               The method is successful.
1029          * @exception   E_SYSTEM                A system error has occurred.
1030          * @see                 GetColor()
1031          */
1032         result SetColor(const Tizen::Graphics::Color& color);
1033
1034         /**
1035          * Sets the color of the search field for the specified status.
1036          *
1037          * @since               2.0
1038          *
1039          * @return              An error code
1040          * @param[in]   status                          The state of the search field
1041          * @param[in]   color                           The text color
1042          * @exception   E_SUCCESS                       The method is successful.
1043          * @exception   E_SYSTEM                        A system error has occurred.
1044          * @see                 GetSearchFieldColor()
1045          */
1046         result SetSearchFieldColor(SearchFieldStatus status, const Tizen::Graphics::Color& color);
1047
1048         /**
1049          * Sets the text color of the search field for the specified status.
1050          *
1051          * @since               2.0
1052          *
1053          * @return              An error code
1054          * @param[in]   status                  The state of the search field
1055          * @param[in]   color                   The text color
1056          * @exception   E_SUCCESS               The method is successful.
1057          * @exception   E_SYSTEM                A system error has occurred.
1058          * @see                 GetSearchFieldTextColor()
1059          */
1060         result SetSearchFieldTextColor(SearchFieldStatus status, const Tizen::Graphics::Color& color);
1061
1062         /**
1063          * Gets the guide text.
1064          *
1065          * @since               2.0
1066          *
1067          * @return              The guide text, @n
1068          *                              else an empty string if an error occurs
1069          * @exception   E_SUCCESS        The method is successful.
1070          * @exception   E_SYSTEM         A system error has occurred.
1071          * @remarks             The specific error code can be accessed using the GetLastResult() method.
1072          * @see                 GetGuideText()
1073          */
1074         Tizen::Base::String GetGuideText(void) const;
1075
1076         /**
1077          * Sets the guide text. @n
1078          * This text is displayed when there is no text in the %SearchBar control.
1079          *
1080          * @since               2.0
1081          *
1082          * @return              An error code
1083          * @param[in]   guideText                       The guide text
1084          * @exception   E_SUCCESS                       The method is successful.
1085          * @exception   E_SYSTEM                        A system error has occurred.
1086          * @see                 GetGuideText()
1087          */
1088         result SetGuideText(const Tizen::Base::String& guideText);
1089
1090         /**
1091          * Gets the text color of the guide text.
1092          *
1093          * @since               2.0
1094          *
1095          * @return              The text color of the guide text, @n
1096          *                              else RGBA(0,0,0,0) if an error occurs
1097          * @exception   E_SUCCESS                       The method is successful.
1098          * @exception   E_SYSTEM                        A system error has occurred.
1099          * @remarks             The specific error code can be accessed using the GetLastResult() method.
1100          * @see                 SetGuideTextColor()
1101          */
1102         Tizen::Graphics::Color GetGuideTextColor(void) const;
1103
1104         /**
1105          * Sets the text color of the guide text.
1106          *
1107          * @since               2.0
1108          *
1109          * @return              An error code
1110          * @param[in]   color                           The guide text color
1111          * @exception   E_SUCCESS                       The method is successful.
1112          * @exception   E_SYSTEM                        A system error has occurred.
1113          * @see                 GetGuideTextColor()
1114          */
1115         result SetGuideTextColor(const Tizen::Graphics::Color& color);
1116
1117 // Cursor
1118         /**
1119          * Gets the current cursor position index.
1120          *
1121          * @since               2.0
1122          *
1123          * @return              The cursor position, @n
1124          *                              else @c -1 if an error occurs
1125          * @exception   E_SUCCESS                       The method is successful.
1126          * @exception   E_SYSTEM                        A system error has occurred.
1127          * @remarks             The specific error code can be accessed using the GetLastResult() method.
1128          * @see                 SetCursorPosition()
1129          */
1130         int GetCursorPosition(void) const;
1131
1132         /**
1133          * Sets the cursor at the specified index.
1134          *
1135          * @since               2.0
1136          *
1137          * @return              An error code
1138          * @param[in]   index                   The cursor index
1139          * @exception   E_SUCCESS               The method is successful.
1140          * @exception   E_OUT_OF_RANGE  The specified @c index is outside the bounds of the data structure. @n
1141          *                                                              The specified @c index is greater than the number of elements or less than @c 0.
1142          * @exception   E_SYSTEM            A system error has occurred.
1143          * @see                 GetCursorPosition()
1144          */
1145         result SetCursorPosition(int index);
1146
1147         /**
1148          * Checks whether the lowercase mode is enabled.
1149          *
1150          * @since               2.0
1151          *
1152          * @return              @c true if the lowercase mode is enabled, @n
1153          *                              else @c false
1154          * @exception   E_SUCCESS               The method is successful.
1155          * @exception   E_SYSTEM                A system error has occurred.
1156          * @remarks             The specific error code can be accessed using the GetLastResult() method.
1157          * @see                 SetLowerCaseModeEnabled()
1158          */
1159         bool IsLowerCaseModeEnabled(void) const;
1160
1161         /**
1162          * Enables or disables the lowercase mode.
1163          *
1164          * @since               2.0
1165          *
1166          * @param[in]   enable                  Set to @c true to enable the lowercase mode, @n
1167          *                                                              else @c false
1168          * @exception   E_SUCCESS               The method is successful.
1169          * @exception   E_SYSTEM                A system error has occurred.
1170          * @see                 IsLowerCaseModeEnabled()
1171          */
1172         void SetLowerCaseModeEnabled(bool enable);
1173
1174 // Ellipsis
1175         /**
1176          * Gets the ellipsis position.
1177          *
1178          * @since               2.0
1179          *
1180          * @return              The ellipsis position
1181          * @exception   E_SUCCESS                       The method is successful.
1182          * @exception   E_SYSTEM                        A system error has occurred.
1183          * @remarks             The specific error code can be accessed using the GetLastResult() method.
1184          * @see                 SetEllipsisPosition()
1185          */
1186         EllipsisPosition GetEllipsisPosition(void) const;
1187
1188         /**
1189          * Sets the ellipsis position.
1190          *
1191          * @since               2.0
1192          *
1193          * @return              An error code
1194          * @param[in]   position                        The ellipsis position
1195          * @exception   E_SUCCESS                       The method is successful.
1196          * @exception   E_SYSTEM                        A system error has occurred.
1197          * @see                 GetEllipsisPosition()
1198          */
1199         result SetEllipsisPosition(EllipsisPosition position);
1200
1201         /**
1202          * Sets the input language.
1203          *
1204          * @since 2.0
1205          *
1206          * @return     An error code
1207          * @param[in]  languageCode               The language to set
1208          * @exception  E_SUCCESS              The method is successful.
1209          * @exception  E_OUT_OF_MEMORY                   The memory is insufficient.
1210          * @remarks    The application can set the language of the current keypad that is associated with the current %SearchBar. @n
1211          *             This method only works if the language to set is supported by the current preloaded keypad.
1212          */
1213
1214         result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
1215
1216         /**
1217          * Gets the current input language.
1218          *
1219          * @since 2.0
1220          *
1221          * @return     An error code
1222          * @param[out] language               The current input language
1223          * @exception     E_SUCCESS                             The method is successful.
1224          * @remarks   The application can get the current language of the keypad that is associated with the current %SearchBar.
1225          */
1226
1227         result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
1228
1229         /**
1230          * Gets the keypad action type.
1231          *
1232          * @since               2.0
1233          *
1234          * @return              The keypad action
1235          * @exception   E_SUCCESS                       The method is successful.
1236          * @exception   E_SYSTEM                        A system error has occurred.
1237          * @remarks             The specific error code can be accessed using the GetLastResult() method.
1238          */
1239         KeypadAction GetKeypadAction(void) const;
1240
1241         /**
1242          * Checks whether the text prediction is enabled.
1243          *
1244          * @since 2.0
1245          * @return                @c true if the text prediction is enabled, @n
1246          *                                 else @c false
1247          * @exception          E_SUCCESS                The method is successful.
1248          * @see                      SetTextPredictionEnabled()
1249          */
1250         bool IsTextPredictionEnabled(void) const;
1251
1252         /**
1253          * Enables or disables the text prediction.
1254          *
1255          * @since 2.0
1256          * @param[in]           enable                       Set to @c true to enable the text prediction, @n
1257          *                                                                    else @c false
1258          * @return                An error code
1259          * @exception           E_SUCCESS                The method is successful.
1260          * @exception           E_UNSUPPORTED_OPERATION     This operation is not supported.
1261          * @see                      IsTextPredictionEnabled()
1262          */
1263         result SetTextPredictionEnabled(bool enable);
1264
1265         /**
1266          * Adds the specified action event listener. @n
1267          * The added listener is notified when the user clicks the search bar button.
1268          *
1269          * @since               2.0
1270          *
1271          * @param[in]   listener        The event listener to be added
1272          * @see                 RemoveActionEventListener()
1273          */
1274         void AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
1275
1276         /**
1277          * Removes the specified action event listener. @n
1278          * The removed listener cannot listen to events when they are fired.
1279          *
1280          * @since               2.0
1281          *
1282          * @param[in]   listener        The event listener to be removed
1283          * @see                 AddActionEventListener()
1284          */
1285         void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
1286
1287         /**
1288          * Adds the specified text event listener. @n
1289          * The added listener can listen to events on the context of the specified event dispatcher when they are fired.
1290          *
1291          * @since               2.0
1292          *
1293          * @param[in]   listener                The event listener to be added
1294          * @remarks             The added listener is notified when: @n
1295          *              @li The user presses a key on the software keypad.
1296          *              @li The user selects a word in the candidate list.
1297          *              @li The user pastes a text.
1298          * @see                 RemoveTextEventListener()
1299          */
1300         void AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
1301
1302         /**
1303          * Removes the specified text event listener. @n
1304          * The removed listener cannot listen to events when they are fired.
1305          *
1306          * @since               2.0
1307          *
1308          * @param[in]   listener        The event listener to be removed
1309          * @see                 AddTextEventListener()
1310          */
1311         void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
1312
1313         /**
1314          * Adds the specified search bar event listener. @n
1315          * The added listener can listen to events on the context of the specified event dispatcher when they are fired.
1316          *
1317          * @since               2.0
1318          *
1319          * @param[in]   listener        The event listener to be added
1320          * @remarks             The added listener is notified when: @n
1321          *              @li The user presses a key on the software keypad.
1322          *              @li The user selects a word in the candidate list.
1323          *              @li The user pastes a text.
1324          * @see                 AddSearchBarEventListener()
1325          */
1326         void AddSearchBarEventListener(ISearchBarEventListener& listener);
1327
1328         /**
1329          * Removes the specified search bar event listener. @n
1330          * The removed listener cannot listen to events when they are fired.
1331          *
1332          * @since               2.0
1333          *
1334          * @param[in]   listener        The event listener to be removed
1335          * @see         RemoveTextEventListener()
1336          */
1337         void RemoveSearchBarEventListener(ISearchBarEventListener& listener);
1338
1339         /**
1340          * Adds the specified text block event listener.
1341          *
1342          * @since               2.0
1343          *
1344          * @param[in]   listener        The event listener to be added
1345          * @remarks             Programmatically, modification of the text selection does not cause the text block selection event to fire.
1346          * @see                 RemoveTextBlockEventListener()
1347          */
1348         void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
1349
1350         /**
1351          * Removes the specified text block event listener. @n
1352          * The removed listener cannot listen to events when they are fired.
1353          *
1354          * @since               2.0
1355          *
1356          * @param[in]   listener        The event listener to be removed
1357          * @see                 AddTextBlockEventListener()
1358          */
1359         void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
1360
1361         /**
1362          * Adds the specified keypad event listener. @n
1363          * The added listener is notified when the keypad associated with this text editor is opened or closed.
1364          *
1365          * @since               2.0
1366          *
1367          * @param[in]   listener        The event listener to be added
1368          * @see         RemoveKeypadEventListener()
1369          */
1370         void AddKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
1371
1372         /**
1373          * Removes the specified keypad event listener. @n
1374          * The removed listener cannot listen to events when they are fired.
1375          *
1376          * @since               2.0
1377          *
1378          * @param[in]   listener        The event listener to be removed
1379          * @see                 AddKeypadEventListener()
1380          */
1381         void RemoveKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
1382
1383         /**
1384          * Adds a listener instance for language events. @n
1385          * The added listener is notified when the input language is changed.
1386          *
1387          * @since 2.0
1388          *
1389          * @param[in]  listener               The listener to add
1390          * @remarks    The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener.
1391          * @see            RemoveLanguageEventListener()
1392          */
1393
1394         void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
1395
1396         /**
1397          * Removes the specified listener instance. @n
1398          * The removed listener cannot listen to events when they are fired.
1399          *
1400          * @since 2.0
1401          *
1402          * @param[in]  listener               The listener to remove
1403          * @see             AddLanguageEventListener()
1404          */
1405
1406         void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
1407
1408
1409 protected:
1410         friend class _SearchBarImpl;
1411
1412 private:
1413         //
1414         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1415         //
1416         SearchBar(const SearchBar& rhs);
1417
1418         //
1419         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1420         //
1421         SearchBar& operator =(const SearchBar& rhs);
1422
1423 }; // SearchBar
1424
1425 }}} // Tizen::Ui::Controls
1426
1427 #endif // _FUI_CTRL_SEARCH_BAR_H_