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