2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
19 * @file FUiCtrl_SearchBarImpl.h
20 * @brief This is the header file for the _SearchBarImpl class.
22 * This header file contains the declarations of the %_SearchBarImpl class.
25 #ifndef _FUI_CTRL_INTERNAL_SEARCH_BAR_IMPL_H_
26 #define _FUI_CTRL_INTERNAL_SEARCH_BAR_IMPL_H_
28 #include <FUiCtrlSearchBar.h>
29 #include "FUi_ControlImpl.h"
30 #include "FUiCtrl_IActionEventListener.h"
31 #include "FUiCtrl_IKeypadEventListener.h"
32 #include "FUiCtrl_ILanguageEventListener.h"
33 #include "FUiCtrl_ITextBlockEventListener.h"
34 #include "FUiCtrl_ITextEventListener.h"
35 #include "FUiCtrl_ISearchBarEventListener.h"
36 #include "FUiCtrl_PublicKeypadEvent.h"
37 #include "FUiCtrl_PublicLanguageEvent.h"
38 #include "FUiCtrl_PublicSearchBarEvent.h"
39 #include "FUiCtrl_SearchBar.h"
42 namespace Tizen { namespace Ui { namespace Controls
44 class _PublicActionEvent;
45 class _PublicTextEvent;
46 class _PublicTextBlockEvent;
50 , public _IActionEventListener
51 , public _IKeypadEventListener
52 , public _ILanguageEventListener
53 , public _ITextBlockEventListener
54 , public _ITextEventListener
55 , public _ISearchBarEventListener
56 , virtual public Tizen::Base::Runtime::IEventListener
59 static _SearchBarImpl* CreateSearchBarImplN(SearchBar* pCore, const Tizen::Graphics::Rectangle& bounds, bool enableSearchBarButton = true, KeypadAction keypadAction = KEYPAD_ACTION_SEARCH);
62 * This is default constructor for this class.
66 _SearchBarImpl(SearchBar* pPublic, _SearchBar* pCore);
69 * This is the destructor for this class.
73 virtual ~_SearchBarImpl(void);
75 virtual const char* GetPublicClassName(void) const;
76 virtual const SearchBar& GetPublic(void) const;
77 virtual SearchBar& GetPublic(void);
78 virtual const _SearchBar& GetCore(void) const;
79 virtual _SearchBar& GetCore(void);
82 * Gets the content of %Control.
85 * @return The control that is displayed in the SearchBar's content area in SEARCH_BAR_MODE_INPUT mode, @n
86 * else @c null if an error occurs
87 * @exception E_SUCCESS The method was successful.
88 * @remarks The specific error code can be accessed using the GetLastResult() method.
90 Tizen::Ui::Control* GetContent(void) const;
93 * Sets the content control.
96 * @return An error code
97 * @param[in] pContent The control that is to be displayed in the
98 * SearchBar's content area.
99 * @exception E_SUCCESS The method was successful.
100 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
101 * The following controls cannot be set as the
103 * @li All classes derived from Window class
104 * @li All picker classes (ex: DateTimePicker)
108 * @exception E_SYSTEM A system error occurred.
109 * @remarks The specified content control is displayed when the SearchBar controls mode is changed to SEARCH_BAR_MODE_INPUT.
110 * @see GetContentAreaSize()
111 * @see AddSearchBarEventListener()
112 * @see ISearchBarEventListener
114 result SetContent(const Tizen::Ui::Control* pContent);
117 * Updates the content area of the SearchBar control.
120 * @return An error code
121 * @param[in] show A Boolean flag indicating whether to perform show on the content area.
122 * @exception E_SUCCESS The method was successful.
123 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n
124 * -- the current mode of SearchBar prohibits the execution of the method. @n
125 * @exception E_SYSTEM A system error occurred.
126 * @remarks The method performs Invalidate() on the content area.
128 result UpdateContentArea(bool invalidate = true);
131 * Sets the visibility state of the content area.
134 * @return An error code
135 * @param[in] visible The visibility state of the content area.
136 * @exception E_SUCCESS The method was successful.
137 * @exception E_SYSTEM A system error occurred.
138 * @see IsContentAreaVisible()
140 result SetContentAreaVisible(bool visible);
143 * Checks whether the content area is visible.
146 * @return The visibility state of the content area.
147 * @exception E_SUCCESS The method was successful.
148 * @see SetContentAreaVisible()
150 bool IsContentAreaVisible(void) const;
153 * Sets the size of the content area of the SearchBar control.
156 * @return An error code
157 * @param[in] size The content area size.
158 * @exception E_SUCCESS The method was successful.
159 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
160 * -- width and height of @c size must be greater than or equal to @c 0.
161 * @remarks You must resize the content area when the Form's orientation is changed once you change the
163 * the size of the content area.
165 * @see GetContentAreaSize()
167 result SetContentAreaSize(const Tizen::Graphics::Dimension& size);
170 * Gets the size of the content area of the SearchBar control.
173 * @return The size of the content area
174 * @remarks The content area is the area where the 'content' of the SearchBar control is displayed. The size of the content areas can
175 * be changed at runtime.
176 * @see AddSearchBarEventListener()
177 * @see ISearchBarEventListener
179 Tizen::Graphics::Dimension GetContentAreaSize(void) const;
182 * Gets the search bar mode.
185 * @return The search bar mode
186 * @exception E_SUCCESS The method was successful.
187 * @exception E_SYSTEM A system error occurred.
188 * @remarks The specific error code can be accessed using the GetLastResult() method.
191 SearchBarMode GetMode(void) const;
194 * Determines whether the search bar mode is locked.
197 * @return @c true if the mode is locked, @n
199 * @exception E_SUCCESS The method was successful.
200 * @exception E_SYSTEM A system error occurred.
201 * @remarks The specific error code can be accessed using the GetLastResult() method.
204 bool IsModeLocked(void) const;
207 * Sets the search bar mode.
210 * @return An error code
211 * @exception E_SUCCESS The method was successful.
212 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or the mode is locked.
213 * @exception E_SYSTEM A system error occurred.
217 result SetMode(SearchBarMode mode);
220 * Locks or unlocks the search bar mode.
223 * @return An error code
224 * @param[in] modeLocked The mode lock
225 * @exception E_SUCCESS The method was successful.
226 * @exception E_SYSTEM A system error occurred.
229 result SetModeLocked(bool modeLocked);
232 * Gets the search bar button's action Id
235 * @return The action ID, @n
236 * else @c -1 if an error occurs
237 * @exception E_SUCCESS The method was successful.
238 * @exception E_SYSTEM A system error occurred.
239 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
240 * By default, the method returns @c -1 if no user defined search bar button is set.
242 int GetButtonActionId(void) const;
245 * Gets the color of the search bar button for the specified state.
248 * @return The color of the search bar button, @n
249 * else RGBA(0,0,0,0) if an error occurs
250 * @param[in] status The search bar button's status
251 * @exception E_SUCCESS The method was successful.
252 * @exception E_SYSTEM A system error occurred.
253 * @remarks The specific error code can be accessed using the GetLastResult() method.
254 * @see SetButtonColor()
256 Tizen::Graphics::Color GetButtonColor(SearchBarButtonStatus status) const;
259 * Gets the text color of the search bar button for the specified state.
262 * @return The text color of the search bar button, @n
263 * else RGBA(0,0,0,0) if an error occurs
264 * @param[in] status The search bar button's status
265 * @exception E_SUCCESS The method was successful.
266 * @exception E_SYSTEM A system error occurred.
267 * @remarks The specific error code can be accessed using the GetLastResult() method.
269 Tizen::Graphics::Color GetButtonTextColor(SearchBarButtonStatus status) const;
272 * Gets the state of the search bar button.
275 * @return The state of the search bar button
276 * @exception E_SUCCESS The method was successful.
277 * @exception E_SYSTEM A system error occurred.
278 * @remarks The specific error code can be accessed using the GetLastResult() method.
280 SearchBarButtonStatus GetButtonStatus(void) const;
283 * Sets the user defined search bar button.
286 * @return An error code
287 * @param[in] text The button text
288 * @param[in] actionId The button action ID
289 * @exception E_SUCCESS The method was successful.
290 * @exception E_INVALID_ARG A specified input parameter is invalid, or the action ID of the specified item must greater than or equal to zero.
291 * @exception E_SYSTEM A system error occurred.
293 result SetButton(const Tizen::Base::String& text, int actionId);
296 * Enables or disables the search bar button.
299 * @return An error code
300 * @param[in] enabled Set to @c true to enable the search bar button, @n
302 * @exception E_SUCCESS The method was successful.
303 * @exception E_SYSTEM A system error occurred.
305 result SetButtonEnabled(bool enabled);
308 * Sets the search bar button's color for the specified state.
311 * @return An error code
312 * @param[in] status The button status
313 * @param[in] color The button color to set
314 * @exception E_SUCCESS The method was successful.
315 * @exception E_SYSTEM A system error occurred.
316 * @see GetButtonColor()
318 result SetButtonColor(SearchBarButtonStatus status, const Tizen::Graphics::Color& color);
321 * Sets the text color of the SearchBar control's button for the specified state.
324 * @return An error code
325 * @param[in] status The button status
326 * @param[in] color The button text color to set
327 * @exception E_SUCCESS The method was successful.
328 * @exception E_SYSTEM A system error occurred.
330 result SetButtonTextColor(SearchBarButtonStatus status, const Tizen::Graphics::Color& color);
333 * Appends the specified character at the end of the text.
336 * @return An error code
337 * @param[in] character The character to add
338 * @exception E_SUCCESS The method was successful.
339 * @exception E_SYSTEM A system error occurred.
340 * @remarks The method modifies the text buffer that is managed by the SearchBar control. @n
341 * To display the changes, the control must be drawn again.
343 result AppendCharacter(const Tizen::Base::Character& character);
346 * Appends the specified text at the end of the existing text.
349 * @return An error code
350 * @param[in] text The text to append
351 * @exception E_SUCCESS The method was successful.
352 * @exception E_SYSTEM A system error occurred.
353 * @remarks To denote the end of a line use '\\n'. @n
354 * The method modifies the text buffer that is managed by the SearchBar control. @n
355 * To display the changes, the control must be drawn again.
357 result AppendText(const Tizen::Base::String& text);
360 * Sets the text to display.
363 * @return An error code
364 * @param[in] text The text to display
365 * @exception E_SUCCESS The method was successful.
366 * @exception E_SYSTEM A system error occurred.
367 * @remarks To denote the end of a line use '\\n'. @n
368 * The method modifies the text buffer that is managed by the SearchBar control. @n
369 * To display the changes, the control must be drawn again.
371 result SetText(const Tizen::Base::String& text);
374 * Inserts the character at the specified index.
377 * @return An error code
378 * @param[in] index The position to insert the character
379 * @param[in] character The character to insert
380 * @exception E_SUCCESS The method was successful.
381 * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n
382 * -- @c index is greater than the number of elements or less than zero.
383 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the system limitation.
384 * @exception E_SYSTEM A system error occurred.
385 * @remarks The method modifies the text buffer that is managed by the SearchBar control.
386 * To display the changes, the control must be drawn again.
388 result InsertCharacterAt(int index, const Tizen::Base::Character& character);
391 * Inserts the specified text at the specified index.
394 * @return An error code
395 * @param[in] index The position at which to insert.
396 * @param[in] text The text to be inserted
397 * @exception E_SUCCESS The method was successful.
398 * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds
399 * of the data structure. @n
400 * -- @c index is greater than the number of elements or less than zero.
401 * @exception E_MAX_EXCEEDED The length of the specified @c text
402 * exceeds the system limitation.
403 * @exception E_SYSTEM A system error occurred.
404 * @remarks The method modifies the text buffer that is managed by the SearchBar control.
405 * To display the changes, the control must be drawn again.
407 result InsertTextAt(int index, const Tizen::Base::String& text);
410 * Deletes the character at the specified position.
413 * @return An error code
414 * @param[in] index The index
415 * @exception E_SUCCESS The method was successful.
416 * @exception E_INVALID_ARG The specified @c index is negative.
417 * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds
418 * of the data structure. @n
419 * -- @c index is greater than the number of elements or less than zero.
420 * @exception E_SYSTEM A system error occurred.
421 * @remarks The method modifies the text buffer that is managed by the SearchBar control.
422 * To display the changes, the control must be drawn again.
424 result DeleteCharacterAt(int index);
427 * Clears text that is displayed by the SearchBar control.
430 * @return An error code
431 * @exception E_SUCCESS The method was successful.
432 * @exception E_SYSTEM A system error occurred.
433 * @remarks The method modifies the text buffer that is managed by the SearchBar control.
434 * To display the changes, the control must be drawn again.
439 * Gets the length of the text that is displayed by the SearchBar control.
442 * @return The length of the text, @n
443 * else @c -1 if an error occurs
444 * @exception E_SUCCESS The method was successful.
445 * @exception E_SYSTEM A system error occurred.
446 * @remarks The specific error code can be accessed using the GetLastResult() method.
448 int GetTextLength(void) const;
451 * Gets the text that is displayed by the SearchBar control.
454 * @return The text of the SearchBar control, @n
455 * else an empty string if an error occurs
456 * @exception E_SUCCESS The method was successful.
457 * @exception E_SYSTEM A system error occurred.
458 * @remarks The specific error code can be accessed using the GetLastResult() method.
461 Tizen::Base::String GetText(void) const;
464 * Gets a portion of text that is displayed by the SearchBar control.
467 * @return The specified portion of the text, @n
468 * else an empty string if an error occurs
469 * @param[in] start The starting index of range
470 * @param[in] end The last index of range
471 * @exception E_SUCCESS The method was successful.
472 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or either the @c start or @c end parameter is greater than the number of elements or less than zero.
473 * @exception E_SYSTEM A system error occurred.
474 * @remarks The specific error code can be accessed using the GetLastResult() method.
477 Tizen::Base::String GetText(int start, int end) const;
480 * Gets the limit of the length of the text.
483 * @return The limit length, @n
484 * else @c -1 if an error occurs
485 * @exception E_SUCCESS The method was successful.
486 * @exception E_SYSTEM A system error occurred.
487 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
488 * The default limit length is @c 500.
489 * @see SetLimitLength()
491 int GetLimitLength(void) const;
494 * Sets the limit of the length of the text.
497 * @return An error code
498 * @param[in] limitLength The limit text length to set
499 * @exception E_SUCCESS The method was successful.
500 * @exception E_INVALID_ARG A specified input parameter is invalid, or the specified limit length cannot be negative value or zero.
501 * @exception E_SYSTEM A system error occurred.
502 * @see GetLimitLength()
504 result SetLimitLength(int limitLength);
507 * Opens the keypad associated with the SearchBar control.
510 * @return An error code
511 * @exception E_SUCCESS The method was successful.
512 * @exception E_SYSTEM A system error occurred.
515 result ShowKeypad(void) const;
518 * Closes the keypad associated with the SearchBar control.
521 * @return An error code
522 * @exception E_SUCCESS The method was successful.
523 * @exception E_SYSTEM A system error occurred.
526 result HideKeypad(void) const;
529 * Gets the text size of the search field.
532 * @return The size of the text, @n
533 * else @c -1 if an error occurs
534 * @exception E_SUCCESS The method was successful.
535 * @exception E_SYSTEM A system error occurred.
536 * @remarks The specific error code can be accessed using the GetLastResult() method.
537 * @see SetSearchFieldTextSize()
539 int GetSearchFieldTextSize(void) const;
542 * Sets the text size of the SearchBar control's text field.
545 * @return An error code
546 * @param[in] size The text size
547 * @exception E_SUCCESS The method was successful.
548 * @exception E_INVALID_ARG A specified input parameter is invalid, or the specified @c size cannot be negative value.
549 * @exception E_SYSTEM A system error occurred.
550 * @see GetSearchFieldTextSize()
552 result SetSearchFieldTextSize(int size);
555 * Gets the start and the end index of the currently selected text block.
558 * @return An error code
559 * @param[out] start The start index of the text block
560 * @param[out] end The end index of the text block
561 * @exception E_SUCCESS The method was successful.
562 * @exception E_SYSTEM A system error occurred.
563 * @remarks The method returns @c start = 0 and @c end = 0 if no text block is selected.
564 * @see ReleaseBlock()
565 * @see SetBlockRange()
567 result GetBlockRange(int& start, int& end) const;
570 * Releases the selection of the current text block.
573 * @return An error code
574 * @exception E_SUCCESS The method was successful.
575 * @exception E_SYSTEM A system error occurred.
576 * @see GetBlockRange()
577 * @see SetBlockRange()
579 result ReleaseBlock(void);
582 * Selects the specified block of the text.
585 * @return An error code
586 * @param[in] start The start index of the text block
587 * @param[in] end The end index of the text block
588 * @exception E_SUCCESS The method was successful.
589 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or either the @c start or @c end parameter is greater than the number of elements or less than zero.
590 * @exception E_SYSTEM A system error occurred.
591 * @see ReleaseBlock()
592 * @see GetBlockRange()
594 result SetBlockRange(int start, int end);
597 * Removes the text of the selected text block.
600 * @return An error code
601 * @exception E_SUCCESS The method was successful.
602 * @exception E_SYSTEM A system error occurred.
604 result RemoveTextBlock(void);
607 * Gets the color of the SearchBar control for the specified status.
610 * @return The color of the SearchBar control, @n
611 * else RGBA(0,0,0,0) if an error occurs
612 * @exception E_SUCCESS The method was successful.
613 * @exception E_SYSTEM A system error occurred.
614 * @remarks The specific error code can be accessed using the GetLastResult() method.
617 Tizen::Graphics::Color GetColor(void) const;
620 * Gets the color of the search field for the specified status.
623 * @return The color, @n
624 * else RGBA(0,0,0,0) if an error occurs
625 * @param[in] status The search field status
626 * @exception E_SUCCESS The method was successful.
627 * @exception E_SYSTEM A system error occurred.
628 * @remarks The specific error code can be accessed using the GetLastResult() method.
629 * @see SetSearchFieldColor()
631 Tizen::Graphics::Color GetSearchFieldColor(SearchFieldStatus status) const;
634 * Gets the text color of the search field for the specified status.
637 * @return The text color, @n
638 * else RGBA(0,0,0,0) if an error occurs
639 * @param[in] status The search field status
640 * @exception E_SUCCESS The method was successful.
641 * @exception E_SYSTEM A system error occurred.
642 * @remarks The specific error code can be accessed using the GetLastResult() method.
643 * @see SetSearchFieldTextColor()
645 Tizen::Graphics::Color GetSearchFieldTextColor(SearchFieldStatus status) const;
648 * Sets the background bitmap of the SearchBar control.
651 * @return An error code
652 * @param[in] bitmap The background bitmap
653 * @exception E_SUCCESS The method was successful.
654 * @exception E_SYSTEM A system error occurred.
656 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
659 * Sets the color of the search bar.
662 * @return An error code
663 * @param[in] status The state of SearchBar
664 * @param[in] color The color
665 * @exception E_SUCCESS The method was successful.
666 * @exception E_SYSTEM A system error occurred.
669 result SetColor(const Tizen::Graphics::Color& color);
672 * Sets the color of the search field for the specified status.
675 * @return An error code
676 * @param[in] status The state of search field
677 * @param[in] color The text color
678 * @exception E_SUCCESS The method was successful.
679 * @exception E_SYSTEM A system error occurred.
680 * @see GetSearchFieldColor()
682 result SetSearchFieldColor(SearchFieldStatus status, const Tizen::Graphics::Color& color);
685 * Sets the text color of the search field for the specified status.
688 * @return An error code
689 * @param[in] status The state of search field
690 * @param[in] color The text color
691 * @exception E_SUCCESS The method was successful.
692 * @exception E_SYSTEM A system error occurred.
693 * @see GetSearchFieldTextColor()
695 result SetSearchFieldTextColor(SearchFieldStatus status, const Tizen::Graphics::Color& color);
698 * Gets the guide text.
701 * @return The guide text, @n
702 * else an empty string if an error occurs
703 * @param[in] guideText
704 * @exception E_SUCCESS The method was successful.
705 * @exception E_SYSTEM A system error occurred.
706 * @remarks The specific error code can be accessed using the GetLastResult() method.
707 * @see GetGuideText()
709 Tizen::Base::String GetGuideText(void) const;
712 * Displays the specified text when there is no text in the SearchBar control.
715 * @return An error code
716 * @param[in] guideText The guide text
717 * @exception E_SUCCESS The method was successful.
718 * @exception E_SYSTEM A system error occurred.
719 * @see GetGuideText()
721 result SetGuideText(const Tizen::Base::String& guideText);
724 * Gets the text color of the guide text.
727 * @return The text color of the guide text, @n
728 * else RGBA(0,0,0,0) if an error occurs
729 * @exception E_SUCCESS The method was successful.
730 * @exception E_SYSTEM A system error occurred.
731 * @remarks The specific error code can be accessed using the GetLastResult() method.
732 * @see SetGuideTextColor()
734 Tizen::Graphics::Color GetGuideTextColor(void) const;
737 * Sets the text color of the guide text.
740 * @return An error code
741 * @param[in] color The guide text color
742 * @exception E_SUCCESS The method was successful.
743 * @exception E_SYSTEM A system error occurred.
744 * @see GetGuideTextColor()
746 result SetGuideTextColor(const Tizen::Graphics::Color& color);
749 * Gets the current cursor position index.
752 * @return The cursor position, @n
753 * else @c -1 if an error occurs
754 * @exception E_SUCCESS The method was successful.
755 * @exception E_SYSTEM A system error occurred.
756 * @remarks The specific error code can be accessed using the GetLastResult() method.
757 * @see SetCursorPosition()
759 int GetCursorPosition(void) const;
762 * Sets the cursor at the specified index.
765 * @return An error code
766 * @param[in] index The cursor index
767 * @exception E_SUCCESS The method was successful.
768 * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure, or @c index is greater than the number of elements or less than zero.
769 * @exception E_SYSTEM A system error occurred.
770 * @see GetCursorPosition()
772 result SetCursorPosition(int index);
775 * Checks whether the lowercase mode is enabled.
778 * @return @c true if the lowercase mode is enabled, @n
780 * @exception E_SUCCESS The method was successful.
781 * @exception E_SYSTEM A system error occurred.
782 * @remarks The specific error code can be accessed using the GetLastResult() method.
783 * @see SetLowerCaseModeEnabled()
785 bool IsLowerCaseModeEnabled(void) const;
788 * Enables or disables the lowercase mode.
791 * @param[in] enable Set to @c true to enable lowercase mode, @n
793 * @exception E_SUCCESS The method was successful.
794 * @exception E_SYSTEM A system error occurred.
795 * @see IsLowerCaseModeEnabled()
797 void SetLowerCaseModeEnabled(bool enable);
800 * Gets the ellipsis position.
803 * @return The ellipsis position
804 * @exception E_SUCCESS The method was successful.
805 * @exception E_SYSTEM A system error occurred.
806 * @remarks The specific error code can be accessed using the GetLastResult() method.
807 * @see SetEllipsisPosition()
809 EllipsisPosition GetEllipsisPosition(void) const;
812 * Sets the ellipsis position.
815 * @return An error code
816 * @param[in] position The ellipsis position
817 * @exception E_SUCCESS The method was successful.
818 * @exception E_SYSTEM A system error occurred.
819 * @see GetEllipsisPosition()
821 result SetEllipsisPosition(EllipsisPosition position);
824 * Gets the keypad action type.
827 * @return The keypad action
828 * @exception E_SUCCESS The method was successful.
829 * @exception E_SYSTEM A system error occurred.
830 * @remarks The specific error code can be accessed using the GetLastResult() method.
832 KeypadAction GetKeypadAction(void) const;
835 * Checks whether the text prediction is enabled.
838 * @return @c true if the text prediction is enabled, @n
840 * @exception E_SUCCESS The method is successful.
841 * @exception E_SYSTEM A system error has occurred.
842 * @remarks The specific error code can be accessed using the GetLastResult() method.
843 * @see SetTextPredictionEnabled()
845 bool IsTextPredictionEnabled(void) const;
848 * Enables or disables the text prediction.
851 * @param[in] enable Set to @c true to enable the text prediction, @n
853 * @return An error code
854 * @exception E_SUCCESS The method is successful.
855 * @exception E_SYSTEM A system error has occurred.
856 * @see IsTextPredictionEnabled()
858 result SetTextPredictionEnabled(bool enable);
860 result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
861 result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
864 * Adds an action event listener. @n
865 * The added listener is notified when the user clicks the search bar button.
868 * @param[in] listener The event listener to add
869 * @see RemoveActionEventListener()
871 result AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
874 * Removes the specified action event listener. @n
875 * The removed listener cannot listen to events when they are fired.
878 * @param[in] listener The event listener to remove
879 * @see AddActionEventListener()
881 result RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
884 * Adds a text event listener. @n
885 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
888 * @param[in] listener The event listener to add
889 * @remarks The added listener is notified when: @n
890 * @li the user presses a key on the software keypad.
891 * @li the user selects a word in the candidate list.
892 * @li the user pastes a text.
893 * @see RemoveTextEventListener()
895 result AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
898 * Removes the specified text event listener. @n
899 * The removed listener cannot listen to events when they are fired.
902 * @param[in] listener The event listener to remove
903 * @see AddTextEventListener()
905 result RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
908 * Adds a search bar event listener. @n
909 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
912 * @param[in] listener The event listener to add
913 * @remarks The added listener is notified when: @n
914 * @li the user presses a key on the software keypad.
915 * @li the user selects a word in the candidate list.
916 * @li the user pastes a text.
917 * @see AddSearchBarEventListener()
919 result AddSearchBarEventListener(const ISearchBarEventListener& listener);
922 * Removes the specified search bar event listener. @n
923 * The removed listener cannot listen to events when they are fired.
926 * @param[in] listener The event listener to remove
927 * @see RemoveTextEventListener()
929 result RemoveSearchBarEventListener(const ISearchBarEventListener& listener);
932 * Adds a text block event listener.
935 * @param[in] listener The event listener to add
936 * @remarks Programmatically, modification of the text selection does not cause
937 * the text block selection event to fire.
938 * @see RemoveTextBlockEventListener()
940 result AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
943 * Removes the specified text block event listener. @n
944 * The removed listener cannot listen to events when they are fired.
947 * @param[in] listener The event listener to remove
948 * @see AddTextBlockEventListener()
950 result RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
953 * Adds a keypad event listener. @n
954 * The added listener is notified when the keypad associated with this text
955 * editor is opened or closed.
958 * @param[in] listener The event listener to add
959 * @see RemoveKeypadEventListener()
961 result AddKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
964 * Removes the specified keypad event listener. @n
965 * The removed listener cannot listen to events when they are fired.
968 * @param[in] listener The event listener to remove
969 * @see AddKeypadEventListener()
971 result RemoveKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
973 result AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
974 result RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
976 virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
978 virtual void OnKeypadWillOpen(void);
979 virtual void OnKeypadOpened(void);
980 virtual void OnKeypadClosed(void);
981 virtual void OnKeypadBoundsChanged(void);
982 virtual void OnKeypadActionPerformed(CoreKeypadAction keypadAction);
984 virtual void OnTextBlockSelected(Tizen::Ui::_Control& source, int start, int end);
986 virtual void OnTextValueChanged(const Tizen::Ui::_Control& source);
987 virtual void OnTextValueChangeCanceled(const Tizen::Ui::_Control& source);
989 virtual void OnSearchBarModeChanged(_SearchBar& source, SearchBarMode mode);
991 virtual void OnLanguageChanged(Tizen::Locales::LanguageCode oldLanguage, Tizen::Locales::LanguageCode newLanguage);
993 static _SearchBarImpl* GetInstance(SearchBar& searchBar);
994 static const _SearchBarImpl* GetInstance(const SearchBar& searchBar);
997 _SearchBarImpl(const _SearchBarImpl&);
998 _SearchBarImpl& operator =(const _SearchBarImpl&);
1000 result Initialize(bool enableSearchBarButton, KeypadAction keypadAction);
1001 KeypadAction ConvertKeypadAction(CoreKeypadAction keypadAction) const;
1002 CoreKeypadAction ConvertKeypadAction(KeypadAction keypadAction) const;
1004 _SearchBar* __pSearchBar;
1006 Control* __pContentControl;
1008 _PublicActionEvent* __pPublicActionEvent;
1009 _PublicKeypadEvent* __pPublicKeypadEvent;
1010 _PublicTextBlockEvent* __pPublicTextBlockEvent;
1011 _PublicTextEvent* __pPublicTextEvent;
1012 _PublicSearchBarEvent* __pPublicSearchBarEvent;
1013 _PublicLanguageEvent* __pPublicLanguageEvent;
1015 }; // _SearchBarImpl
1017 }}} // Tizen::Ui::Controls
1019 #endif // _FUI_CTRL_INTERNAL_SEARCH_BAR_IMPL_H_