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 FUiCtrlEditField.h
20 * @brief This is the header file for the %EditField class.
22 * This header file contains the declarations of the %EditField class and its helper classes.
25 #ifndef _FUI_CTRL_EDIT_FIELD_H_
26 #define _FUI_CTRL_EDIT_FIELD_H_
28 #include <FBaseCharacter.h>
29 #include <FBaseString.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpPoint.h>
32 #include <FGrpRectangle.h>
33 #include <FLclLocale.h>
34 #include <FUiControl.h>
35 #include <FUiContainer.h>
36 #include <FUiCtrlControlsTypes.h>
37 #include <FUiCtrlEditTypes.h>
38 #include <FUiCtrlGroupTypes.h>
39 #include <FUiCtrlInputTypes.h>
40 #include <FUiIActionEventListener.h>
41 #include <FUiIKeypadEventListener.h>
42 #include <FUiILanguageEventListener.h>
43 #include <FUiIScrollPanelEventListener.h>
44 #include <FUiITextBlockEventListener.h>
45 #include <FUiITextEventListener.h>
46 #include <FUiIUiLinkEventListener.h>
48 namespace Tizen { namespace Locales
53 namespace Tizen { namespace Ui { namespace Controls
58 * @brief This class defines a common behavior for an %EditField control.
62 * The %EditField class displays a single-line text editor.
64 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_editfield_editarea.htm">EditArea and EditField</a>.
66 * The following example demonstrates how to use the %EditField class.
69 // Sample code for EditFieldSample.h
73 : public Tizen::Ui::Controls::Form
74 , public Tizen::Ui::ITextEventListener
78 : __pEditField(null){}
80 bool Initialize(void);
81 virtual result OnInitializing(void);
84 virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
85 virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source);
88 Tizen::Ui::Controls::EditField* __pEditField;
93 // Sample code for EditFieldSample.cpp
94 #include <FGraphics.h>
96 #include "EditFieldSample.h"
98 using namespace Tizen::Graphics;
99 using namespace Tizen::Ui::Controls;
102 EditFieldSample::Initialize(void)
104 Construct(FORM_STYLE_NORMAL);
109 EditFieldSample::OnInitializing(void)
111 result r = E_SUCCESS;
113 // Creates an instance of EditField
114 __pEditField = new EditField();
115 __pEditField->Construct(Rectangle(50, 100, 400, 150));
116 __pEditField->AddTextEventListener(*this);
118 //Adds the edit field to the Form
119 AddControl(*__pEditField);
124 // ITextEventListener implementation
126 EditFieldSample::OnTextValueChanged(const Tizen::Ui::Control& source)
132 EditFieldSample::OnTextValueChangeCanceled(const Tizen::Ui::Control& source)
140 class _OSP_EXPORT_ EditField
141 : public Tizen::Ui::Control
145 * 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.
152 * 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.
156 virtual ~EditField(void);
159 * Initializes this instance of the %EditField control with the specified parameters.
163 * @return An error code
164 * @param[in] rect An instance of the Graphics::Rectangle class @n
165 * This instance represents the x and y coordinates of the top-left corner of the created window along with
166 * the width and height of the control.
167 * @param[in] style The style of the %EditField control
168 * @param[in] inputStyle The input style of the %EditField control
169 * @param[in] showTitle Set to @c true to display the title, @n
171 * @param[in] limitLength The limit for the length of the text in the %EditField control
172 * @param[in] groupStyle The table view style of the %EditField control
173 * @exception E_SUCCESS The method is successful.
174 * @exception E_INVALID_ARG The specified @c limitLength is less than or equal to @c 0, or @n
175 * either the @c rect.width or the @c rect.height is less than @c 0.
176 * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n
177 * The title is not supported by small style %EditField.
178 * @exception E_SYSTEM A system error has occurred.
179 * @remarks A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control has been used
180 * earlier. The %EditField style of SMALL property cannot be used together with group styles. @n
181 * If the specified size is less than the minimum size, %EditField is constructed with the minimum size.
182 * @remarks Following are the input styles used for creating the different orientations of a keypad: @n
183 * - INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value. @n
184 * - INPUT_STYLE_OVERLAY: The orientation is the same as that of a parent form.
186 result Construct(const Tizen::Graphics::Rectangle& rect, EditFieldStyle style = EDIT_FIELD_STYLE_NORMAL, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, bool showTitle = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
189 * Initializes this instance of the %EditField control.
193 * @return An error code
194 * @param[in] rect The bounds of %EditField
195 * @param[in] style The style of the %EditField control
196 * @param[in] inputStyle The input style of the %EditField control
197 * @param[in] titleStyle The title style
198 * @param[in] enableClear Set to @c true to enable the clear button, @n
200 * @param[in] limitLength The limit of the length of text in the %EditField control
201 * @param[in] groupStyle The table view style of the %EditField control
202 * @exception E_SUCCESS The method is successful.
203 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
204 * The specified @c limitLength is less than or equal to @c 0. @n
205 * The specified @c rect.width or the @c rect.height is less than @c 0.
206 * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n
207 * Title is not supported in small style %EditField.
208 * @exception E_SYSTEM A system error has occurred.
209 * @remarks A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control is used earlier.
210 * The %EditField style of SMALL property cannot be used together with group styles. @n
211 * If the specified size is less than the minimum size, EditFied() is constructed with the minimum size.
212 * @remarks Following are the input styles used for creating different orientations of a keypad: @n
213 * - INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.@n
214 * - INPUT_STYLE_OVERLAY: The orientation is similar to the parent Form.
216 result Construct(const Tizen::Graphics::Rectangle& rect, EditFieldStyle style, InputStyle inputStyle, EditFieldTitleStyle titleStyle, bool enableClear = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
220 * Gets the horizontal text alignment of the %EditField control.
224 * @return The horizontal text alignment
225 * @exception E_SUCCESS The method is successful.
226 * @exception E_SYSTEM A system error has occurred.
227 * @remarks The specific error code can be accessed using the GetLastResult() method.
228 * @see SetTextAlignment()
230 HorizontalAlignment GetTextAlignment(void) const;
233 * Sets the horizontal text alignment of the %EditField control.
237 * @return An error code
238 * @exception E_SUCCESS The method is successful.
239 * @exception E_SYSTEM A system error has occurred.
240 * @see GetTextAlignment()
242 result SetTextAlignment(HorizontalAlignment alignment);
245 * Checks whether the view mode is enabled.
249 * @return @c true if the view mode is enabled, @n
251 * @exception E_SUCCESS The method is successful.
252 * @exception E_SYSTEM A system error has occurred.
253 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
254 * In the view mode, the auto-detected links are displayed as linked text.
255 * @see SetViewModeEnabled()
257 bool IsViewModeEnabled(void) const;
260 * Enables or disables the view mode.
264 * @return An error code
265 * @param[in] enable Set to @c true to enable the view mode, @n
267 * @exception E_SUCCESS The method is successful.
268 * @exception E_SYSTEM A system error has occurred.
269 * @remarks In the view mode, the auto-detected links are displayed as linked text.
270 * @see IsViewModeEnabled()
272 result SetViewModeEnabled(bool enable);
275 * Sets the auto-link mask.
279 * @return An error code
280 * @param[in] autoLinks The auto-link mask @n
281 * Multiple link types can be combined using bitwise OR operator (see Tizen::Base::Utility::LinkType). @n
282 * For more information, see <a href="../org.tizen.native.appprogramming/html/guide/ui/auto_link_detection.htm">AutoLink Detection</a>.
283 * @exception E_SUCCESS The method is successful.
284 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation @n
285 * The input style is not @c INPUT_STYLE_OVERLAY.
286 * @exception E_SYSTEM A system error has occurred.
287 * @remarks When @c autoLinks is set to @c 0, the auto-link detection is disabled.
288 * @see Tizen::Base::Utility::LinkType
289 * @see GetAutoLinkMask()
290 * @see IsViewModeEnabled()
291 * @see SetViewModeEnabled()
293 result SetAutoLinkMask(unsigned long autoLinks);
296 * Gets the auto-link mask.
300 * @return The auto-link mask
301 * @exception E_SUCCESS The method is successful.
302 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation @n
303 * The input style is not @c INPUT_STYLE_OVERLAY.
304 * @exception E_SYSTEM A system error has occurred.
305 * @remarks The specific error code can be accessed using the GetLastResult() method.
306 * @see SetAutoLinkMask()
308 unsigned long GetAutoLinkMask(void) const;
311 * Adds a link event listener.
315 * @param[in] listener The event listener to be added
316 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY. @n
317 * The added listener is notified when the links are selected by the user.
318 * @see RemoveUiLinkEventListener()
320 void AddUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
323 * Removes the specified link event listener. @n
324 * The removed listener cannot listen to events when they are fired.
328 * @param[in] listener The event listener to be removed
329 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
330 * @see AddUiLinkEventListener()
332 void RemoveUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
335 * Gets the margin value of the specified margin type.
339 * @return The margin value of the specified margin type, @n
340 * else @c -1 if an error occurs
341 * @param[in] marginType The margin type
342 * @exception E_SUCCESS The method is successful.
343 * @exception E_SYSTEM A system error has occurred.
344 * @remarks The specific error code can be accessed using the GetLastResult() method.
347 int GetMargin(EditMarginType marginType) const;
350 * Sets the margin for the specified margin type.
354 * @return An error code
355 * @param[in] marginType The margin type
356 * @param[in] margin The margin to set
357 * @exception E_SUCCESS The method is successful.
358 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
359 * The specified @c margin cannot be a negative integer.
360 * @exception E_SYSTEM A system error has occurred.
363 result SetMargin(EditMarginType marginType, int margin);
366 * Enables or disables the keypad action.
369 * @return An error code
370 * @param[in] enable Set to @c true to enable the keypad action, @n
372 * @exception E_SUCCESS The method is successful.
373 * @exception E_UNSUPPORTED_OPERATION The underlying input method does not support this operation.
374 * @remarks Depending on the value of input param, the enter key have a enable or disable look accordingly.
376 result SetKeypadActionEnabled(bool enable);
379 * Checks whether the keypad action is enabled.
382 * @return @c true if the keypad action is enabled, @n
385 bool IsKeypadActionEnabled(void) const;
388 * Gets the keypad action type.
392 * @return The keypad action
393 * @exception E_SUCCESS The method is successful.
394 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
395 * The input style is not @c INPUT_STYLE_OVERLAY.
396 * @exception E_SYSTEM A system error has occurred.
397 * @remarks The specific error code can be accessed using the GetLastResult() method.
398 * @see SetKeypadAction()
400 Tizen::Ui::KeypadAction GetKeypadAction(void) const;
403 * Sets the keypad action type.
407 * @return An error code
408 * @param[in] keypadAction The keypad action
409 * @exception E_SUCCESS The method is successful.
410 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
411 * The input style is not @c INPUT_STYLE_OVERLAY.
412 * @exception E_SYSTEM A system error has occurred.
413 * @remarks Based on the specified value of @c keypadAction, the enter key label of the keypad changes accordingly.
414 * @see GetKeypadAction()
416 result SetKeypadAction(Tizen::Ui::KeypadAction keypadAction);
419 * Sets the visibility of the command buttons of the overlay style keypad.
423 * @return An error code
424 * @param[in] visible Set to @c true to set the visibility of the overlay keypad command buttons, @n
426 * @exception E_SUCCESS The method is successful.
427 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
428 * The input style is not @c INPUT_STYLE_OVERLAY.
429 * @exception E_SYSTEM A system error has occurred.
431 result SetOverlayKeypadCommandButtonVisible(bool visible);
434 * Checks whether the command buttons of the overlay style keypad are visible.
438 * @return @c true if the overlay command buttons are visible, @n
440 * @exception E_SUCCESS The method is successful.
441 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
442 * The input style is not @c INPUT_STYLE_OVERLAY.
443 * @exception E_SYSTEM A system error has occurred.
444 * @remarks The specific error code can be accessed using the GetLastResult() method.
446 bool IsOverlayCommandButtonVisible(void) const;
453 * @return An error code
454 * @exception E_SUCCESS The method is successful.
455 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
456 * The input style is not @c INPUT_STYLE_OVERLAY.
457 * @exception E_SYSTEM A system error has occurred.
460 result HideKeypad(void);
463 * Gets the position of the ellipsis.
467 * @return The ellipsis position
468 * @exception E_SUCCESS The method is successful.
469 * @exception E_SYSTEM A system error has occurred.
470 * @remarks The specific error code can be accessed using the GetLastResult() method.
471 * @see SetEllipsisPosition()
473 EllipsisPosition GetEllipsisPosition(void) const;
476 * Sets the position of the ellipsis.
480 * @return An error code
481 * @param[in] position The ellipsis position
482 * @exception E_SUCCESS The method is successful.
483 * @exception E_SYSTEM A system error has occurred.
484 * @see GetEllipsisPosition()
486 result SetEllipsisPosition(EllipsisPosition position);
489 * Gets the text size.
493 * @return The size of the text, @n
494 * else @c -1 if an error occurs
495 * @exception E_SUCCESS The method is successful.
496 * @exception E_SYSTEM A system error has occurred.
497 * @remarks The specific error code can be accessed using the GetLastResult() method.
500 int GetTextSize(void) const;
503 * Sets the text size.
507 * @return An error code
508 * @param[in] size The text size
509 * @exception E_SUCCESS The method is successful.
510 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
511 * The @c size cannot be a negative integer.
512 * @exception E_SYSTEM A system error has occurred.
515 result SetTextSize(int size);
518 * Gets the color of the %EditField control for the specified status.
522 * @return The color, @n
523 * else RGBA(0,0,0,0) if an error occurs
524 * @param[in] status The status
525 * @exception E_SUCCESS The method is successful.
526 * @exception E_SYSTEM A system error has occurred.
527 * @remarks The specific error code can be accessed using the GetLastResult() method.
529 Tizen::Graphics::Color GetColor(EditStatus status) const;
532 * Gets the text color of the specified text color type.
536 * @return The color, @n
537 * else RGBA(0,0,0,0) if an error occurs
538 * @param[in] type The text color type
539 * @exception E_SUCCESS The method is successful.
540 * @exception E_SYSTEM A system error has occurred.
541 * @remarks The specific error code can be accessed using the GetLastResult() method.
542 * @see SetTextColor()
544 Tizen::Graphics::Color GetTextColor(EditTextColor type) const;
547 * Sets the background bitmap of the %EditField control for the specified status.
551 * @return An error code
552 * @param[in] status The status
553 * @param[in] bitmap The background bitmap
554 * @exception E_SUCCESS The method is successful.
555 * @exception E_SYSTEM A system error has occurred.
557 result SetBackgroundBitmap(EditStatus status, const Tizen::Graphics::Bitmap& bitmap);
560 * Sets the color of the %EditField control for the specified status.
564 * @return An error code
565 * @param[in] status The status
566 * @param[in] color The color
567 * @exception E_SUCCESS The method is successful.
568 * @exception E_SYSTEM A system error has occurred.
571 result SetColor(EditStatus status, const Tizen::Graphics::Color& color);
574 * Sets the text color of the %EditField control for the specified text color type.
578 * @return An error code
579 * @param[in] type The text color type
580 * @param[in] color The text color
581 * @exception E_SUCCESS The method is successful.
582 * @exception E_SYSTEM A system error has occurred.
583 * @see GetTextColor()
585 result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color);
588 * Gets a portion of text that is displayed by the %EditField control.
592 * @return The specified portion of the text, @n
593 * else an empty string if an error occurs
594 * @param[in] start The starting index of the range
595 * @param[in] end The last index of the range
596 * @exception E_SUCCESS The method is successful.
597 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or @n
598 * the index is greater than the number of elements or less than @c 0.
599 * @exception E_SYSTEM A system error has occurred.
600 * @remarks The specific error code can be accessed using the GetLastResult() method.
603 Tizen::Base::String GetText(int start, int end) const;
606 * Adds a keypad event listener. @n
607 * The added listener is notified when the keypad associated with the %EditField control is opened or closed.
611 * @param[in] listener The event listener to be added
612 * @see RemoveKeypadEventListener()
614 void AddKeypadEventListener(IKeypadEventListener& listener);
617 * Removes the specified keypad event listener. @n
618 * The removed listener cannot listen to events when they are fired.
622 * @param[in] listener The event listener to be removed
623 * @see AddKeypadEventListener()
625 void RemoveKeypadEventListener(IKeypadEventListener& listener);
628 * Adds a text block event listener. @n
629 * The added listener is notified when the text block is selected.
633 * @param[in] listener The event listener to be added
634 * @remarks Programmatically modifying the text block does not cause the text block selection event to fire.
635 * @see RemoveTextBlockEventListener()
637 void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
640 * Removes the specified text block event listener. @n
641 * The removed listener cannot listen to events when they are fired.
645 * @param[in] listener The event listener to be removed
646 * @see AddTextBlockEventListener()
648 void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
651 * Adds the ITextEventListener instance. @n
652 * The added listener listens to events on the context of the specified event dispatcher when they are fired.
656 * @param[in] listener The listener to be added
658 void AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
661 * Removes the ITextEventListener instance. @n
662 * The removed listener cannot listen to events when they are fired.
666 * @param[in] listener The listener to be removed
668 void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
671 * Adds the specified listener instance to listen to the scroll panel events.
675 * @param[in] listener The listener to be added
676 * @remarks To listen to the scroll panel events, the parent of EditArea must be an instance of ScrollPanel. @n
677 * When OnOverlayControlCreated() or OnOvelayControlClosed() is called, the application resets the bounds of the controls placed
678 * within the ScrollPanel control. ScrollPanel is automatically drawn again after this method is called.
679 * @see RemoveScrollPanelEventListener()
681 void AddScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
684 * Removes the specified scroll panel event listener instance. @n
685 * The removed listener cannot listen to events when they are fired.
689 * @param[in] listener The listener to be removed
691 void RemoveScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
694 * Adds the specified listener instance. @n
695 * The added listener can listen to events on the context of the given event dispatcher when they are fired.
699 * @param[in] listener The event listener to be added
701 void AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
704 * Removes a listener instance. @n
705 * The removed listener cannot listen to events when they are fired.
709 * @param[in] listener The event listener to remove
711 void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
714 * Adds the specified listener instance for language events. @n
715 * The added listener is notified when the input language is changed.
719 * @param[in] listener The listener to be added
720 * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener.
721 * @see RemoveLanguageEventListener()
723 void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
726 * Removes the specified listener instance. @n
727 * The removed listener cannot listen to events when they are fired.
731 * @param[in] listener The listener to be removed
732 * @see AddLanguageEventListener()
734 void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
737 * Gets the remaining length of the %EditField control.
741 * @return The remaining length of the %EditField control, @n
742 * else @c -1 if an error occurs
744 int GetRemainingLength(void) const;
747 * Enables or disables the lowercase mode.
751 * @param[in] enable Set to @c true to enable the lowercase mode, @n
754 void SetLowerCaseModeEnabled(bool enable);
757 * Checks whether the lowercase mode is enabled.
761 * @return @c true if the lowercase mode is enabled, @n
764 bool IsLowerCaseModeEnabled(void) const;
768 * Sets the input mode category.
770 * @brief <i> [Deprecated] </i>
771 * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
772 * or the current mode to initially set the keypad to, from this list. It is recommended to use EditFieldStyle in the Construct() method instead.
775 * @return An error code
776 * @param[in] categories The categories to be set @n
777 * Multiple input categories can be combined using bitwise OR operator (see Tizen::Ui::Controls::EditInputModeCategory).
778 * @param[in] enable The category value to set
779 * @exception E_SUCCESS The method is successful.
780 * @exception E_INVALID_ARG A specified input mode category is invalid.
781 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n
782 * The specified @c categories cannot be supported with the current keypad style.
783 * @exception E_SYSTEM A system error has occurred.
786 result SetInputModeCategory(unsigned long categories, bool enable);
790 * Sets the current input mode category.
792 * @brief <i> [Deprecated] </i>
793 * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
794 * or the current mode to initially set the keypad to, from this list. It is recommended to use EditFieldStyle in the Construct() method instead.
797 * @return An error code
798 * @param[in] inputModeCategory An item of input category
799 * @exception E_SUCCESS The method is successful.
800 * @exception E_SYSTEM A system error has occurred.
803 result SetCurrentInputModeCategory(EditInputModeCategory inputModeCategory);
807 * Gets the input mode category.
809 * @brief <i> [Deprecated] </i>
810 * @deprecated This method is deprecated because we no longer provide a method to specify the list of styles which the user can set the keypad to.
813 * @return A bitwise combination of Tizen::Ui::Controls::EditInputModeCategory, @n
814 * else EDIT_INPUTMODE_ALPHA if an error occurs
817 unsigned long GetInputModeCategory(void) const;
821 * Gets the current input mode category.
823 * @brief <i> [Deprecated] </i>
824 * @deprecated This method is deprecated because we no longer provide a method to specify the list of styles which the user can set the keypad to.
827 * @return The current input mode category
830 EditInputModeCategory GetCurrentInputModeCategory(void) const;
833 * Sets the cursor in the %EditField control at the specified position.
837 * @return An error code
838 * @param[in] position The cursor position that is to be set
839 * @exception E_SUCCESS The method is successful.
840 * @exception E_OUT_OF_RANGE The specified @c position is less than @c 0 or greater than the maximum length.
841 * @exception E_SYSTEM A system error has occurred.
843 result SetCursorPosition(int position);
846 * Gets the cursor position.
850 * @return The current cursor position, @n
851 * else @c -1 if an error occurs
853 int GetCursorPosition(void) const;
856 * Gets the text that is displayed by the %EditField control.
860 * @return The text of the %EditField control, @n
861 * else an empty string if an error occurs
863 Tizen::Base::String GetText(void) const;
866 * Gets the length of the text that is displayed by the %EditField control.
870 * @return The length of the text, @n
871 * else @c -1 if an error occurs
873 int GetTextLength(void) const;
876 * Sets the text of the %EditField control.
880 * @param[in] text The text to be displayed by the %EditField control
881 * @exception E_SUCCESS The method is successful.
882 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
883 * The length of the specified @c text exceeds the system limitation or the limit length.
884 * @exception E_SYSTEM A system error has occurred.
885 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
887 result SetText(const Tizen::Base::String& text);
890 * Inserts the specified text at the current cursor position.
894 * @return An error code
895 * @param[in] text The text to be inserted
896 * @exception E_SUCCESS The method is successful.
897 * @exception E_SYSTEM A system error has occurred.
898 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
900 result InsertTextAtCursorPosition(const Tizen::Base::String& text);
903 * Appends the specified text at the end of the existing text.
907 * @return An error code
908 * @param[in] text The text to be appended
909 * @exception E_SUCCESS The method is successful.
910 * @exception E_SYSTEM A system error has occurred.
911 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
913 result AppendText(const Tizen::Base::String& text);
916 * Appends the specified character at the end of the existing text.
920 * @return An error code
921 * @param[in] character The character to be appended
922 * @exception E_SUCCESS The method is successful.
923 * @exception E_SYSTEM A system error has occurred.
924 * @remarks The method modifies the text buffer that is managed by the %EditField control. To display the
925 * changes, the control must be drawn again.
927 result AppendCharacter(const Tizen::Base::Character& character);
930 * Clears the text that is displayed by the %EditField control.
934 * @return An error code
935 * @exception E_SUCCESS The method is successful.
936 * @exception E_SYSTEM A system error has occurred.
937 * @remarks The method modifies the text buffer that is managed by the %EditField control. To display the
938 * changes, the control must be drawn again.
943 * Deletes a character at the current cursor position.
947 * @return An error code
948 * @exception E_SUCCESS The method is successful.
949 * @exception E_SYSTEM A system error has occurred.
950 * @remarks The method modifies the text buffer that is managed by the %EditField control. To display the
951 * changes, the control must be drawn again.
953 result DeleteCharacterAtCursorPosition(void);
956 * Gets the range of the current text block.
960 * @param[out] start The first index of the current text block
961 * @param[out] end The last index of the current text block
963 void GetCurrentTextRange(int& start, int& end) const;
966 * Sets the guide text.
970 * @param[in] guideText The guide text
971 * @remarks This is the default text that is displayed in the %EditField
972 * control when the focus is given to it and no text is entered.
974 void SetGuideText(const Tizen::Base::String& guideText);
977 * Gets the guide text.
981 * @return The guide text, @n
982 * else an empty string if an error occurs
983 * @exception E_SUCCESS The method is successful.
984 * @exception E_SYSTEM A system error has occurred.
985 * @remarks The specific error code can be accessed using the GetLastResult() method.
986 * @see SetGuideText()
988 Tizen::Base::String GetGuideText(void) const;
991 * Gets the text color of the guide text.
995 * @return The guide text color
996 * @exception E_SUCCESS The method is successful.
997 * @exception E_SYSTEM A system error has occurred.
998 * @remarks The specific error code can be accessed using the GetLastResult() method.
999 * @see SetGuideTextColor()
1001 Tizen::Graphics::Color GetGuideTextColor(void) const;
1004 * Sets the text color of the guide text.
1008 * @return An error code
1009 * @param[in] color The guide text color
1010 * @exception E_SUCCESS The method is successful.
1011 * @exception E_SYSTEM A system error has occurred.
1012 * @see GetGuideTextColor()
1014 result SetGuideTextColor(const Tizen::Graphics::Color& color);
1017 * Gets the text color of the title for the specified status.
1021 * @return The title text color, @n
1022 * else RGBA(0,0,0,0) if an error occurs
1023 * @param[in] status The state of the %EditField control
1024 * @exception E_SUCCESS The method is successful.
1025 * @exception E_SYSTEM A system error has occurred.
1026 * @remarks The specific error code can be accessed using the GetLastResult() method.
1027 * @see SetTitleTextColor()
1029 Tizen::Graphics::Color GetTitleTextColor(EditStatus status) const;
1032 * Sets the text color of the title for the specified status.
1036 * @return An error code
1037 * @param[in] status The state of the %EditField control
1038 * @param[in] color The title text color
1039 * @exception E_SUCCESS The method is successful.
1040 * @exception E_SYSTEM A system error has occurred.
1041 * @see GetTitleTextColor()
1043 result SetTitleTextColor(EditStatus status, const Tizen::Graphics::Color& color);
1046 * Enables or disables the keypad.
1050 * @param[in] enable Set to @c true to enable the keypad,
1053 void SetKeypadEnabled(bool enable);
1056 * Checks whether the keypad is enabled.
1060 * @return @c true if the keypad is enabled, @n
1063 bool IsKeypadEnabled(void) const;
1066 * Checks whether the text prediction is enabled.
1069 * @return @c true if the text prediction is enabled, @n
1071 * @see SetTextPredictionEnabled()
1073 bool IsTextPredictionEnabled(void) const;
1076 * Enables or disables the text prediction.
1079 * @param[in] enable Set to @c true to enable the text prediction, @n
1081 * @return An error code
1082 * @exception E_SUCCESS The method is successful.
1083 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
1084 * @see IsTextPredictionEnabled()
1086 result SetTextPredictionEnabled(bool enable);
1089 * Displays the keypad.
1093 * @return An error code
1094 * @exception E_SUCCESS The method is successful.
1095 * @exception E_INVALID_STATE This instance is in an invalid state.
1096 * @exception E_SYSTEM A system error has occurred.
1097 * @remarks This method is supported only when the input style is INPUT_STYLE_OVERLAY.
1099 result ShowKeypad(void);
1102 * Gets the range of the current text block that is selected.
1106 * @param[out] start The starting index of the current block
1107 * @param[out] end The end index of the current block
1109 void GetBlockRange(int& start, int& end) const;
1112 * Begins the text block from the current cursor position.
1116 * @return An error code
1117 * @exception E_SUCCESS The method is successful.
1118 * @exception E_SYSTEM A system error has occurred.
1119 * @remarks Move the cursor position to the end of the text block.
1120 * @see SetCursorPosition()
1121 * @see ReleaseBlock()
1124 result BeginBlock(void);
1127 * Releases the selection of the current text block.
1131 * @return An error code
1132 * @exception E_SUCCESS The method is successful.
1133 * @exception E_SYSTEM A system error has occurred.
1137 result ReleaseBlock(void);
1140 * Checks whether a portion of the text is blocked.
1144 * @return @c true if the text is blocked, @n
1147 * @see ReleaseBlock()
1149 bool IsBlocked(void) const;
1152 * Copies the text block to the clipboard.
1156 * @return An error code
1157 * @exception E_SUCCESS The method is successful.
1158 * @exception E_SYSTEM A system error has occurred.
1159 * @see Cut(), Paste(), Remove()
1164 * Cuts the text block and copies it to the clipboard.
1168 * @return An error code
1169 * @exception E_SUCCESS The method is successful.
1170 * @exception E_SYSTEM A system error has occurred.
1171 * @see Copy(), Remove(), Paste()
1176 * Pastes the copied text at the cursor position.
1180 * @return An error code
1181 * @exception E_SUCCESS The method is successful.
1182 * @exception E_SYSTEM A system error has occurred.
1183 * @see Copy(), Cut(), Remove()
1188 * Removes the text that is marked by the text block.
1192 * @return An error code
1193 * @exception E_SUCCESS The method is successful.
1194 * @exception E_SYSTEM A system error has occurred.
1195 * @see Copy(), Cut(), Paste()
1197 result Remove(void);
1200 * Checks whether the text in the %EditField control is clipped.
1204 * @return @c true if the text is clipped, @n
1206 * @remarks 'clipped' means that the text is copied to the clipboard.
1207 * @see Copy(), Cut(), Paste(), Remove()
1209 bool IsClipped(void) const;
1212 * Sets the title of the %EditField control.
1216 * @return An error code
1217 * @param[in] title The title to be set
1218 * @exception E_SUCCESS The method is successful.
1219 * @exception E_SYSTEM A system error has occurred.
1221 result SetTitleText(const Tizen::Base::String& title);
1224 * Gets the title text of the %EditField control.
1228 * @return The title text, @n
1229 * else an empty string if an error occurs
1231 Tizen::Base::String GetTitleText(void) const;
1234 * Sets the command button properties of the keypad.
1238 * @return An error code
1239 * @param[in] position The position of the command button
1240 * @param[in] text The label of the command button
1241 * @param[in] actionId The action ID
1242 * @exception E_SUCCESS The method is successful.
1243 * @exception E_SYSTEM A system error has occurred.
1244 * @remarks This method is supported only when the input style is INPUT_STYLE_OVERLAY.
1246 result SetOverlayKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId);
1249 * Gets the text of the specified command button.
1253 * @return The text of the specified command button
1254 * @param[in] position The position of the command button
1255 * @remarks This method is supported only when the input style is INPUT_STYLE_OVERLAY.
1257 Tizen::Base::String GetOverlayKeypadCommandButtonText(CommandButtonPosition position) const;
1260 * Gets the action ID of the specified command button.
1264 * @return The action ID of the specified command button
1265 * @param[in] position The position of the command button
1266 * @remarks This method is supported only when the input style is INPUT_STYLE_OVERLAY.
1268 int GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const;
1271 * Sets the input language.
1275 * @return An error code
1276 * @param[in] languageCode The language to be set
1277 * @exception E_SUCCESS The method is successful.
1278 * @exception E_OUT_OF_MEMORY The memory is insufficient.
1279 * @remarks The application can set the language of the current keypad that is associated with the current %EditField. @n
1280 * This method only works if the language to set is supported by the current preloaded keypad.
1282 result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
1285 * Gets the current input language.
1289 * @return An error code
1290 * @param[out] language The current input language
1291 * @exception E_SUCCESS The method is successful.
1292 * @remarks The application can get the current language of the keypad that is associated with the current %EditField.
1294 result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
1297 friend class _EditFieldImpl;
1300 EditField(const EditField&);
1301 EditField& operator =(const EditField&);
1305 }}} // Tizen::Ui::Controls
1307 #endif // _FUI_CTRL_EDIT_FIELD_H_