2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0/
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 <FUiCtrlIEditTextFilter.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,
65 * see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_editfield_editarea.htm">EditArea and EditField</a>.
67 * The following example demonstrates how to use the %EditField class.
70 // Sample code for EditFieldSample.h
74 : public Tizen::Ui::Controls::Form
75 , public Tizen::Ui::ITextEventListener
79 : __pEditField(null){}
81 bool Initialize(void);
82 virtual result OnInitializing(void);
85 virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
86 virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source);
89 Tizen::Ui::Controls::EditField* __pEditField;
94 // Sample code for EditFieldSample.cpp
95 #include <FGraphics.h>
97 #include "EditFieldSample.h"
99 using namespace Tizen::Graphics;
100 using namespace Tizen::Ui::Controls;
103 EditFieldSample::Initialize(void)
105 Construct(FORM_STYLE_NORMAL);
110 EditFieldSample::OnInitializing(void)
112 result r = E_SUCCESS;
114 // Creates an instance of EditField
115 __pEditField = new EditField();
116 __pEditField->Construct(Rectangle(50, 100, 400, 150));
117 __pEditField->AddTextEventListener(*this);
119 //Adds the edit field to the Form
120 AddControl(__pEditField);
125 // ITextEventListener implementation
127 EditFieldSample::OnTextValueChanged(const Tizen::Ui::Control& source)
133 EditFieldSample::OnTextValueChangeCanceled(const Tizen::Ui::Control& source)
141 class _OSP_EXPORT_ EditField
142 : public Tizen::Ui::Control
146 * The object is not fully constructed after this constructor is called. @n
147 * For full construction, the %Construct() method must be called right after calling this constructor.
154 * This polymorphic destructor should be overridden if required.@n
155 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
159 virtual ~EditField(void);
162 * Initializes this instance of the %EditField control with the specified parameters.
166 * @return An error code
167 * @param[in] rect An instance of the Graphics::Rectangle class @n
168 * This instance represents the x and y coordinates of the top-left corner of the created window along with
169 * the width and height of the control. @n
170 * If the size is less than the minimum size, %EditField is constructed with the minimum size. @n
171 * The optimal size of the control is defined in
172 * <a href="../org.tizen.native.appprogramming/html/guide/ui/control_optimalsize.htm">Optimal Size of UI Controls</a>.
173 * @param[in] style The style of the %EditField control
174 * @param[in] inputStyle The input style of the %EditField control
175 * @param[in] showTitle Set to @c true to display the title, @n
177 * @param[in] limitLength The limit for the length of the text in the %EditField control
178 * @param[in] groupStyle The table view style of the %EditField control
179 * @exception E_SUCCESS The method is successful.
180 * @exception E_INVALID_ARG The specified @c limitLength is less than or equal to @c 0, or @n
181 * either the @c rect.width or the @c rect.height is less than @c 0.
182 * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n
183 * The title is not supported by small style %EditField.
184 * @exception E_SYSTEM A system error has occurred.
186 * - 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
187 * earlier. The %EditField style of SMALL property cannot be used together with group styles.
188 * - Following are the input styles used for creating the different orientations of a keypad:
189 * - @c INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.
190 * - @c INPUT_STYLE_OVERLAY: The orientation is the same as that of a parent form.
192 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);
195 * Initializes this instance of the %EditField control with the specified parameters.
199 * @return An error code
200 * @param[in] rect An instance of the Tizen::Graphics::FloatRectangle class @n
201 * This instance represents the x and y coordinates of the top-left corner of the created window along with
202 * the width and height of the control. @n
203 * If the size is less than the minimum size, %EditField is constructed with the minimum size. @n
204 * The optimal size of the control is defined in
205 * <a href="../org.tizen.native.appprogramming/html/guide/ui/control_optimalsize.htm">Optimal Size of UI Controls</a>.
206 * @param[in] style The style of the %EditField control
207 * @param[in] inputStyle The input style of the %EditField control
208 * @param[in] showTitle Set to @c true to display the title, @n
210 * @param[in] limitLength The limit for the length of the text in the %EditField control
211 * @param[in] groupStyle The table view style of the %EditField control
212 * @exception E_SUCCESS The method is successful.
213 * @exception E_INVALID_ARG The specified @c limitLength is less than or equal to @c 0, or @n
214 * either the @c rect.width or the @c rect.height is less than @c 0.
215 * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n
216 * The title is not supported by small style %EditField.
217 * @exception E_SYSTEM A system error has occurred.
219 * - 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
220 * earlier. The %EditField style of SMALL property cannot be used together with group styles.
221 * - Following are the input styles used for creating the different orientations of a keypad:
222 * - @c INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.
223 * - @c INPUT_STYLE_OVERLAY: The orientation is the same as that of a parent form.
225 result Construct(const Tizen::Graphics::FloatRectangle& rect, EditFieldStyle style = EDIT_FIELD_STYLE_NORMAL, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, bool showTitle = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
228 * Initializes this instance of the %EditField control.
232 * @return An error code
233 * @param[in] rect An instance of the Tizen::Graphics::FloatRectangle class @n
234 * This instance represents the x and y coordinates of the top-left corner of the created window along with
235 * the width and height of the control. @n
236 * If the size is less than the minimum size, EditFied() is constructed with the minimum size. @n
237 * The optimal size of the control is defined in
238 * <a href="../org.tizen.native.appprogramming/html/guide/ui/control_optimalsize.htm">Optimal Size of UI Controls</a>.
239 * @param[in] style The style of the %EditField control
240 * @param[in] inputStyle The input style of the %EditField control
241 * @param[in] titleStyle The title style
242 * @param[in] enableClear Set to @c true to enable the clear button, @n
244 * @param[in] limitLength The limit of the length of text in the %EditField control
245 * @param[in] groupStyle The table view style of the %EditField control
246 * @exception E_SUCCESS The method is successful.
247 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
248 * The specified @c limitLength is less than or equal to @c 0. @n
249 * The specified @c rect.width or the @c rect.height is less than @c 0.
250 * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n
251 * Title is not supported in small style %EditField.
252 * @exception E_SYSTEM A system error has occurred.
254 * - 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.
255 * The %EditField style of SMALL property cannot be used together with group styles.
256 * - Following are the input styles used for creating different orientations of a keypad:
257 * - @c INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.
258 * - @c INPUT_STYLE_OVERLAY: The orientation is similar to the parent form.
260 result Construct(const Tizen::Graphics::Rectangle& rect, EditFieldStyle style, InputStyle inputStyle, EditFieldTitleStyle titleStyle, bool enableClear = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
263 * Initializes this instance of the %EditField control.
267 * @return An error code
268 * @param[in] rect An instance of the Tizen::Graphics::FloatRectangle class @n
269 * This instance represents the x and y coordinates of the top-left corner of the created window along with
270 * the width and height of the control. @n
271 * If the size is less than the minimum size, EditFied() is constructed with the minimum size. @n
272 * The optimal size of the control is defined in
273 * <a href="../org.tizen.native.appprogramming/html/guide/ui/control_optimalsize.htm">Optimal Size of UI Controls</a>.
274 * @param[in] style The style of the %EditField control
275 * @param[in] inputStyle The input style of the %EditField control
276 * @param[in] titleStyle The title style
277 * @param[in] enableClear Set to @c true to enable the clear button, @n
279 * @param[in] limitLength The limit of the length of text in the %EditField control
280 * @param[in] groupStyle The table view style of the %EditField control
281 * @exception E_SUCCESS The method is successful.
282 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
283 * The specified @c limitLength is less than or equal to @c 0. @n
284 * The specified @c rect.width or the @c rect.height is less than @c 0.
285 * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n
286 * Title is not supported in small style %EditField.
287 * @exception E_SYSTEM A system error has occurred.
289 * - 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.
290 * The %EditField style of SMALL property cannot be used together with group styles.
291 * - Following are the input styles used for creating different orientations of a keypad:
292 * - @c INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.
293 * - @c INPUT_STYLE_OVERLAY: The orientation is similar to the parent form.
295 result Construct(const Tizen::Graphics::FloatRectangle& rect, EditFieldStyle style, InputStyle inputStyle, EditFieldTitleStyle titleStyle, bool enableClear = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
299 * Gets the horizontal text alignment of the %EditField control.
303 * @return The horizontal text alignment
304 * @exception E_SUCCESS The method is successful.
305 * @exception E_SYSTEM A system error has occurred.
306 * @remarks The specific error code can be accessed using the GetLastResult() method.
307 * @see SetTextAlignment()
309 HorizontalAlignment GetTextAlignment(void) const;
312 * Sets the horizontal text alignment of the %EditField control.
316 * @return An error code
317 * @exception E_SUCCESS The method is successful.
318 * @exception E_SYSTEM A system error has occurred.
319 * @see GetTextAlignment()
321 result SetTextAlignment(HorizontalAlignment alignment);
324 * Checks whether the view mode is enabled. @n
325 * In the view mode, the auto-detected links are displayed as linked text.
329 * @return @c true if the view mode is enabled, @n
331 * @exception E_SUCCESS The method is successful.
332 * @exception E_SYSTEM A system error has occurred.
333 * @remarks The specific error code can be accessed using the GetLastResult() method.
334 * @see SetViewModeEnabled()
336 bool IsViewModeEnabled(void) const;
339 * Enables or disables the view mode. @n
340 * In the view mode, the auto-detected links are displayed as linked text.
344 * @return An error code
345 * @param[in] enable Set to @c true to enable the view mode, @n
347 * @exception E_SUCCESS The method is successful.
348 * @exception E_SYSTEM A system error has occurred.
349 * @see IsViewModeEnabled()
351 result SetViewModeEnabled(bool enable);
354 * Sets the auto-link mask.
358 * @return An error code
359 * @param[in] autoLinks The auto-link mask @n
360 * Multiple link types can be combined using bitwise OR operator (see Tizen::Base::Utility::LinkType). @n
361 * For more information, see <a href="../org.tizen.native.appprogramming/html/guide/ui/auto_link_detection.htm">AutoLink Detection</a>. @n
362 * When it is set to @c 0, the auto-link detection is disabled.
363 * @exception E_SUCCESS The method is successful.
364 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation @n
365 * The input style is not ::INPUT_STYLE_OVERLAY.
366 * @exception E_SYSTEM A system error has occurred.
367 * @see Tizen::Base::Utility::LinkType
368 * @see GetAutoLinkMask()
369 * @see IsViewModeEnabled()
370 * @see SetViewModeEnabled()
372 result SetAutoLinkMask(unsigned long autoLinks);
375 * Gets the auto-link mask.
379 * @return The auto-link mask
380 * @exception E_SUCCESS The method is successful.
381 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation @n
382 * The input style is not ::INPUT_STYLE_OVERLAY.
383 * @exception E_SYSTEM A system error has occurred.
384 * @remarks The specific error code can be accessed using the GetLastResult() method.
385 * @see SetAutoLinkMask()
387 unsigned long GetAutoLinkMask(void) const;
390 * Adds a link event listener. @n
391 * The added listener is notified when the links are selected by the user. @n
392 * The %AddUiLinkEventListener() method is supported when the input style is ::INPUT_STYLE_OVERLAY.
396 * @param[in] listener The event listener to add
397 * @see RemoveUiLinkEventListener()
399 void AddUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
402 * Removes the specified link event listener. @n
403 * The removed listener cannot listen to events when they are fired. @n
404 * The %RemoveUiLinkEventListener() method is supported when the input style is ::INPUT_STYLE_OVERLAY.
408 * @param[in] listener The event listener to remove
409 * @see AddUiLinkEventListener()
411 void RemoveUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
414 * Gets the margin value of the specified margin type.
418 * @return The margin value of the specified margin type, @n
419 * else @c -1 if an error occurs
420 * @param[in] marginType The margin type
421 * @exception E_SUCCESS The method is successful.
422 * @exception E_SYSTEM A system error has occurred.
423 * @remarks The specific error code can be accessed using the GetLastResult() method.
426 int GetMargin(EditMarginType marginType) const;
429 * Gets the margin value of the specified margin type.
433 * @return The margin value of the specified margin type, @n
434 * else @c -1 if an error occurs
435 * @param[in] marginType The margin type
436 * @exception E_SUCCESS The method is successful.
437 * @exception E_SYSTEM A system error has occurred.
438 * @remarks The specific error code can be accessed using the GetLastResult() method.
441 float GetMarginF(EditMarginType marginType) const;
444 * Sets the margin for the specified margin type.
448 * @return An error code
449 * @param[in] marginType The margin type
450 * @param[in] margin The margin to set
451 * @exception E_SUCCESS The method is successful.
452 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
453 * The specified @c margin cannot be a negative integer.
454 * @exception E_SYSTEM A system error has occurred.
457 result SetMargin(EditMarginType marginType, int margin);
460 * Sets the margin for the specified margin type.
464 * @return An error code
465 * @param[in] marginType The margin type
466 * @param[in] margin The margin to set
467 * @exception E_SUCCESS The method is successful.
468 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
469 * The specified @c margin cannot be a negative integer.
470 * @exception E_SYSTEM A system error has occurred.
473 result SetMargin(EditMarginType marginType, float margin);
476 * Enables or disables the keypad action.
479 * @return An error code
480 * @param[in] enable Set to @c true to enable the keypad action, @n
482 * @exception E_SUCCESS The method is successful.
483 * @exception E_UNSUPPORTED_OPERATION The underlying input method does not support this operation.
484 * @remarks Depending on the value of input param, the enter key have a enable or disable look accordingly.
486 result SetKeypadActionEnabled(bool enable);
489 * Checks whether the keypad action is enabled.
492 * @return @c true if the keypad action is enabled, @n
495 bool IsKeypadActionEnabled(void) const;
498 * Gets the keypad action type.
502 * @return The keypad action
503 * @exception E_SUCCESS The method is successful.
504 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
505 * The input style is not ::INPUT_STYLE_OVERLAY.
506 * @exception E_SYSTEM A system error has occurred.
507 * @remarks The specific error code can be accessed using the GetLastResult() method.
508 * @see SetKeypadAction()
510 Tizen::Ui::KeypadAction GetKeypadAction(void) const;
513 * Sets the keypad action type.
517 * @return An error code
518 * @param[in] keypadAction The keypad action
519 * @exception E_SUCCESS The method is successful.
520 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
521 * The input style is not ::INPUT_STYLE_OVERLAY.
522 * @exception E_SYSTEM A system error has occurred.
523 * @remarks Depending on the value of input param, the enter key label of the keypad changes accordingly.
524 * @see GetKeypadAction()
526 result SetKeypadAction(Tizen::Ui::KeypadAction keypadAction);
529 * Sets the visibility of the command buttons of the overlay style keypad.
533 * @return An error code
534 * @param[in] visible Set to @c true to set the visibility of the overlay keypad command buttons, @n
536 * @exception E_SUCCESS The method is successful.
537 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
538 * The input style is not ::INPUT_STYLE_OVERLAY.
539 * @exception E_SYSTEM A system error has occurred.
541 result SetOverlayKeypadCommandButtonVisible(bool visible);
544 * Checks whether the command buttons of the overlay style keypad are visible.
548 * @return @c true if the overlay command buttons are visible, @n
550 * @exception E_SUCCESS The method is successful.
551 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
552 * The input style is not ::INPUT_STYLE_OVERLAY.
553 * @exception E_SYSTEM A system error has occurred.
554 * @remarks The specific error code can be accessed using the GetLastResult() method.
556 bool IsOverlayCommandButtonVisible(void) const;
563 * @return An error code
564 * @exception E_SUCCESS The method is successful.
565 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
566 * The input style is not ::INPUT_STYLE_OVERLAY.
567 * @exception E_SYSTEM A system error has occurred.
570 result HideKeypad(void);
573 * Gets the position of the ellipsis.
577 * @return The ellipsis position
578 * @exception E_SUCCESS The method is successful.
579 * @exception E_SYSTEM A system error has occurred.
580 * @remarks The specific error code can be accessed using the GetLastResult() method.
581 * @see SetEllipsisPosition()
583 EllipsisPosition GetEllipsisPosition(void) const;
586 * Sets the position of the ellipsis.
590 * @return An error code
591 * @param[in] position The ellipsis position
592 * @exception E_SUCCESS The method is successful.
593 * @exception E_SYSTEM A system error has occurred.
594 * @see GetEllipsisPosition()
596 result SetEllipsisPosition(EllipsisPosition position);
599 * Gets the text size.
603 * @return The size of the text, @n
604 * else @c -1 if an error occurs
605 * @exception E_SUCCESS The method is successful.
606 * @exception E_SYSTEM A system error has occurred.
607 * @remarks The specific error code can be accessed using the GetLastResult() method.
610 int GetTextSize(void) const;
613 * Gets the text size.
617 * @return The size of the text, @n
618 * else @c -1 if an error occurs
619 * @exception E_SUCCESS The method is successful.
620 * @exception E_SYSTEM A system error has occurred.
621 * @remarks The specific error code can be accessed using the GetLastResult() method.
624 float GetTextSizeF(void) const;
627 * Sets the text size.
631 * @return An error code
632 * @param[in] size The text size @n
633 * The size should be greater than or equal to minimum font size which is 4.
634 * @exception E_SUCCESS The method is successful.
635 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
636 * The @c size cannot be a negative integer.
637 * @exception E_SYSTEM A system error has occurred.
640 result SetTextSize(int size);
643 * Sets the text size.
647 * @return An error code
648 * @param[in] size The text size @n
649 * The size should be greater than or equal to minimum font size which is 4.0f.
650 * @exception E_SUCCESS The method is successful.
651 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
652 * The @c size cannot be a negative integer.
653 * @exception E_SYSTEM A system error has occurred.
654 * @see GetTextSizeF()
656 result SetTextSize(float size);
659 * Gets the color of the %EditField control for the specified status.
663 * @return The color, @n
664 * else RGBA(0,0,0,0) if an error occurs
665 * @param[in] status The status
666 * @exception E_SUCCESS The method is successful.
667 * @exception E_SYSTEM A system error has occurred.
668 * @remarks The specific error code can be accessed using the GetLastResult() method.
670 Tizen::Graphics::Color GetColor(EditStatus status) const;
673 * Gets the text color of the specified text color type.
677 * @return The color, @n
678 * else RGBA(0,0,0,0) if an error occurs
679 * @param[in] type The text color type
680 * @exception E_SUCCESS The method is successful.
681 * @exception E_SYSTEM A system error has occurred.
682 * @remarks The specific error code can be accessed using the GetLastResult() method.
683 * @see SetTextColor()
685 Tizen::Graphics::Color GetTextColor(EditTextColor type) const;
688 * Sets the background bitmap of the %EditField control for the specified status.
692 * @return An error code
693 * @param[in] status The status
694 * @param[in] bitmap The background bitmap
695 * @exception E_SUCCESS The method is successful.
696 * @exception E_SYSTEM A system error has occurred.
698 result SetBackgroundBitmap(EditStatus status, const Tizen::Graphics::Bitmap& bitmap);
701 * Sets the color of the %EditField control for the specified status.
705 * @return An error code
706 * @param[in] status The status
707 * @param[in] color The color
708 * @exception E_SUCCESS The method is successful.
709 * @exception E_SYSTEM A system error has occurred.
712 result SetColor(EditStatus status, const Tizen::Graphics::Color& color);
715 * Sets the text color of the %EditField control for the specified text color type.
719 * @return An error code
720 * @param[in] type The text color type
721 * @param[in] color The text color
722 * @exception E_SUCCESS The method is successful.
723 * @exception E_SYSTEM A system error has occurred.
724 * @see GetTextColor()
726 result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color);
729 * Gets a portion of text that is displayed by the %EditField control.
733 * @return The specified portion of the text, @n
734 * else an empty string if an error occurs
735 * @param[in] start The starting index of the range
736 * @param[in] end The last index of the range
737 * @exception E_SUCCESS The method is successful.
738 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or @n
739 * the index is greater than the number of elements or less than @c 0.
740 * @exception E_SYSTEM A system error has occurred.
741 * @remarks The specific error code can be accessed using the GetLastResult() method.
744 Tizen::Base::String GetText(int start, int end) const;
747 * Adds a keypad event listener. @n
748 * The added listener is notified when the keypad associated with the %EditField control is opened or closed.
752 * @param[in] listener The event listener to add
753 * @see RemoveKeypadEventListener()
755 void AddKeypadEventListener(IKeypadEventListener& listener);
758 * Removes the specified keypad event listener. @n
759 * The removed listener cannot listen to events when they are fired.
763 * @param[in] listener The event listener to remove
764 * @see AddKeypadEventListener()
766 void RemoveKeypadEventListener(IKeypadEventListener& listener);
769 * Adds a text block event listener. @n
770 * The added listener is notified when the text block is selected.
774 * @param[in] listener The event listener to add
775 * @remarks Programmatically modifying the text block does not cause the text block selection event to fire.
776 * @see RemoveTextBlockEventListener()
778 void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
781 * Removes the specified text block event listener. @n
782 * The removed listener cannot listen to events when they are fired.
786 * @param[in] listener The event listener to remove
787 * @see AddTextBlockEventListener()
789 void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
792 * Adds the ITextEventListener instance. @n
793 * The added listener listens to events on the context of the specified event dispatcher when they are fired.
797 * @param[in] listener The listener to add
799 void AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
802 * Removes the ITextEventListener instance. @n
803 * The removed listener cannot listen to events when they are fired.
807 * @param[in] listener The listener to remove
809 void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
812 * Adds the specified listener instance to listen to the scroll panel events. @n
813 * To listen to the scroll panel events, the parent of EditArea must be an instance of ScrollPanel.
817 * @param[in] listener The listener to add
818 * @remarks When IScrollPanelEventListener::OnOverlayControlCreated() or IScrollPanelEventListener::OnOvelayControlClosed() is called,
819 * the application resets the bounds of the controls placed within the ScrollPanel control. %ScrollPanel is automatically
820 * drawn again after this method is called.
821 * @see RemoveScrollPanelEventListener()
823 void AddScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
826 * Removes the specified scroll panel event listener instance. @n
827 * The removed listener cannot listen to events when they are fired.
831 * @param[in] listener The listener to remove
833 void RemoveScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
836 * Adds the specified listener instance. @n
837 * The added listener can listen to events on the context of the given event dispatcher when they are fired.
841 * @param[in] listener The event listener to add
843 void AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
846 * Removes a listener instance. @n
847 * The removed listener cannot listen to events when they are fired.
851 * @param[in] listener The event listener to remove
853 void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
856 * Adds the specified listener instance for language events. @n
857 * The added listener is notified when the input language is changed.
861 * @param[in] listener The listener to add
862 * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener.
863 * @see RemoveLanguageEventListener()
865 void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
868 * Removes the specified listener instance. @n
869 * The removed listener cannot listen to events when they are fired.
873 * @param[in] listener The listener to remove
874 * @see AddLanguageEventListener()
876 void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
879 * Gets the remaining length of the %EditField control.
883 * @return The remaining length of the %EditField control, @n
884 * else @c -1 if an error occurs
886 int GetRemainingLength(void) const;
889 * Enables or disables the lowercase mode.
893 * @param[in] enable Set to @c true to enable the lowercase mode, @n
896 void SetLowerCaseModeEnabled(bool enable);
899 * Checks whether the lowercase mode is enabled.
903 * @return @c true if the lowercase mode is enabled, @n
906 bool IsLowerCaseModeEnabled(void) const;
910 * Sets the input mode category.
912 * @brief <i> [Deprecated] </i>
913 * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
914 * or the current mode to initially set the keypad to, from this list. It is recommended to use EditFieldStyle in the Construct() method instead.
917 * @return An error code
918 * @param[in] categories The categories to set @n
919 * Multiple input categories can be combined using bitwise OR operator (see Tizen::Ui::Controls::EditInputModeCategory).
920 * @param[in] enable The category value to set
921 * @exception E_SUCCESS The method is successful.
922 * @exception E_INVALID_ARG A specified input mode category is invalid.
923 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n
924 * The specified @c categories cannot be supported with the current keypad style.
925 * @exception E_SYSTEM A system error has occurred.
928 result SetInputModeCategory(unsigned long categories, bool enable);
932 * Sets the current input mode category.
934 * @brief <i> [Deprecated] </i>
935 * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
936 * or the current mode to initially set the keypad to, from this list. It is recommended to use EditFieldStyle in the Construct() method instead.
939 * @return An error code
940 * @param[in] inputModeCategory An item of input category
941 * @exception E_SUCCESS The method is successful.
942 * @exception E_SYSTEM A system error has occurred.
945 result SetCurrentInputModeCategory(EditInputModeCategory inputModeCategory);
949 * Gets the input mode category.
951 * @brief <i> [Deprecated] </i>
952 * @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.
955 * @return A bitwise combination of Tizen::Ui::Controls::EditInputModeCategory, @n
956 * else EDIT_INPUTMODE_ALPHA if an error occurs
959 unsigned long GetInputModeCategory(void) const;
963 * Gets the current input mode category.
965 * @brief <i> [Deprecated] </i>
966 * @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.
969 * @return The current input mode category
972 EditInputModeCategory GetCurrentInputModeCategory(void) const;
975 * Sets the cursor in the %EditField control at the specified position.
979 * @return An error code
980 * @param[in] position The cursor position to set
981 * @exception E_SUCCESS The method is successful.
982 * @exception E_OUT_OF_RANGE The specified @c position is less than @c 0 or greater than the maximum length.
983 * @exception E_SYSTEM A system error has occurred.
985 result SetCursorPosition(int position);
988 * Gets the cursor position.
992 * @return The current cursor position, @n
993 * else @c -1 if an error occurs
995 int GetCursorPosition(void) const;
998 * Gets the text that is displayed by the %EditField control.
1002 * @return The text of the %EditField control, @n
1003 * else an empty string if an error occurs
1005 Tizen::Base::String GetText(void) const;
1008 * Gets the length of the text that is displayed by the %EditField control.
1012 * @return The length of the text, @n
1013 * else @c -1 if an error occurs
1015 int GetTextLength(void) const;
1018 * Sets the text of the %EditField control.
1022 * @param[in] text The text to display by the %EditField control @n
1023 * Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
1024 * @exception E_SUCCESS The method is successful.
1025 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
1026 * The length of the specified @c text exceeds the system limitation or the limit length.
1027 * @exception E_SYSTEM A system error has occurred.
1029 result SetText(const Tizen::Base::String& text);
1032 * Inserts the specified text at the current cursor position.
1036 * @return An error code
1037 * @param[in] text The text to insert @n
1038 * Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
1039 * @exception E_SUCCESS The method is successful.
1040 * @exception E_SYSTEM A system error has occurred.
1042 result InsertTextAtCursorPosition(const Tizen::Base::String& text);
1045 * Appends the specified text at the end of the existing text.
1049 * @return An error code
1050 * @param[in] text The text to append @n
1051 * Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
1052 * @exception E_SUCCESS The method is successful.
1053 * @exception E_SYSTEM A system error has occurred.
1055 result AppendText(const Tizen::Base::String& text);
1058 * Appends the specified character at the end of the existing text.
1062 * @return An error code
1063 * @param[in] character The character to append
1064 * @exception E_SUCCESS The method is successful.
1065 * @exception E_SYSTEM A system error has occurred.
1066 * @remarks The method modifies the text buffer that is managed by the %EditField control. To display the
1067 * changes, the control must be drawn again.
1069 result AppendCharacter(const Tizen::Base::Character& character);
1072 * Clears the text that is displayed by the %EditField control.
1076 * @return An error code
1077 * @exception E_SUCCESS The method is successful.
1078 * @exception E_SYSTEM A system error has occurred.
1079 * @remarks The method modifies the text buffer that is managed by the %EditField control. To display the
1080 * changes, the control must be drawn again.
1085 * Deletes a character at the current cursor position.
1089 * @return An error code
1090 * @exception E_SUCCESS The method is successful.
1091 * @exception E_SYSTEM A system error has occurred.
1092 * @remarks The method modifies the text buffer that is managed by the %EditField control. To display the
1093 * changes, the control must be drawn again.
1095 result DeleteCharacterAtCursorPosition(void);
1098 * Gets the range of the current text block.
1102 * @param[out] start The first index of the current text block
1103 * @param[out] end The last index of the current text block
1105 void GetCurrentTextRange(int& start, int& end) const;
1108 * Sets the guide text.
1112 * @param[in] guideText The guide text that is displayed in the %EditField control when the focus is given to it and no text is entered.
1114 void SetGuideText(const Tizen::Base::String& guideText);
1117 * Gets the guide text.
1121 * @return The guide text, @n
1122 * else an empty string if an error occurs
1123 * @exception E_SUCCESS The method is successful.
1124 * @exception E_SYSTEM A system error has occurred.
1125 * @remarks The specific error code can be accessed using the GetLastResult() method.
1126 * @see SetGuideText()
1128 Tizen::Base::String GetGuideText(void) const;
1131 * Gets the text color of the guide text.
1135 * @return The guide text color
1136 * @exception E_SUCCESS The method is successful.
1137 * @exception E_SYSTEM A system error has occurred.
1138 * @remarks The specific error code can be accessed using the GetLastResult() method.
1139 * @see SetGuideTextColor()
1141 Tizen::Graphics::Color GetGuideTextColor(void) const;
1144 * Sets the text color of the guide text.
1148 * @return An error code
1149 * @param[in] color The guide text color
1150 * @exception E_SUCCESS The method is successful.
1151 * @exception E_SYSTEM A system error has occurred.
1152 * @see GetGuideTextColor()
1154 result SetGuideTextColor(const Tizen::Graphics::Color& color);
1157 * Gets the text color of the title for the specified status.
1161 * @return The title text color, @n
1162 * else RGBA(0,0,0,0) if an error occurs
1163 * @param[in] status The state of the %EditField control
1164 * @exception E_SUCCESS The method is successful.
1165 * @exception E_SYSTEM A system error has occurred.
1166 * @remarks The specific error code can be accessed using the GetLastResult() method.
1167 * @see SetTitleTextColor()
1169 Tizen::Graphics::Color GetTitleTextColor(EditStatus status) const;
1172 * Sets the text color of the title for the specified status.
1176 * @return An error code
1177 * @param[in] status The state of the %EditField control
1178 * @param[in] color The title text color
1179 * @exception E_SUCCESS The method is successful.
1180 * @exception E_SYSTEM A system error has occurred.
1181 * @see GetTitleTextColor()
1183 result SetTitleTextColor(EditStatus status, const Tizen::Graphics::Color& color);
1186 * Enables or disables the keypad.
1190 * @param[in] enable Set to @c true to enable the keypad,
1193 void SetKeypadEnabled(bool enable);
1196 * Checks whether the keypad is enabled.
1200 * @return @c true if the keypad is enabled, @n
1203 bool IsKeypadEnabled(void) const;
1206 * Checks whether the text prediction is enabled.
1209 * @return @c true if the text prediction is enabled, @n
1211 * @see SetTextPredictionEnabled()
1213 bool IsTextPredictionEnabled(void) const;
1216 * Enables or disables the text prediction.
1219 * @param[in] enable Set to @c true to enable the text prediction, @n
1221 * @return An error code
1222 * @exception E_SUCCESS The method is successful.
1223 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
1224 * @see IsTextPredictionEnabled()
1226 result SetTextPredictionEnabled(bool enable);
1229 * Displays the keypad. @n
1230 * The %ShowKeypad() method is supported only when the input style is ::INPUT_STYLE_OVERLAY.
1234 * @return An error code
1235 * @exception E_SUCCESS The method is successful.
1236 * @exception E_INVALID_STATE This instance is in an invalid state.
1237 * @exception E_SYSTEM A system error has occurred.
1239 result ShowKeypad(void);
1242 * Gets the range of the current text block that is selected.
1246 * @param[out] start The starting index of the current block
1247 * @param[out] end The end index of the current block
1249 void GetBlockRange(int& start, int& end) const;
1252 * Begins the text block from the current cursor position.
1256 * @return An error code
1257 * @exception E_SUCCESS The method is successful.
1258 * @exception E_SYSTEM A system error has occurred.
1259 * @remarks Move the cursor position to the end of the text block.
1260 * @see SetCursorPosition()
1261 * @see ReleaseBlock()
1264 result BeginBlock(void);
1267 * Releases the selection of the current text block.
1271 * @return An error code
1272 * @exception E_SUCCESS The method is successful.
1273 * @exception E_SYSTEM A system error has occurred.
1277 result ReleaseBlock(void);
1280 * Checks whether a portion of the text is blocked.
1284 * @return @c true if the text is blocked, @n
1287 * @see ReleaseBlock()
1289 bool IsBlocked(void) const;
1292 * Copies the text block to the clipboard.
1296 * @return An error code
1297 * @exception E_SUCCESS The method is successful.
1298 * @exception E_SYSTEM A system error has occurred.
1306 * Cuts the text block and copies it to the clipboard.
1310 * @return An error code
1311 * @exception E_SUCCESS The method is successful.
1312 * @exception E_SYSTEM A system error has occurred.
1320 * Pastes the copied text at the cursor position.
1324 * @return An error code
1325 * @exception E_SUCCESS The method is successful.
1326 * @exception E_SYSTEM A system error has occurred.
1334 * Removes the text that is marked by the text block.
1338 * @return An error code
1339 * @exception E_SUCCESS The method is successful.
1340 * @exception E_SYSTEM A system error has occurred.
1345 result Remove(void);
1348 * Checks whether the text in the %EditField control is clipped.
1352 * @return @c true if the text is clipped, @n
1354 * @remarks 'clipped' means that the text is copied to the clipboard.
1360 bool IsClipped(void) const;
1363 * Sets the title of the %EditField control.
1367 * @return An error code
1368 * @param[in] title The title to set
1369 * @exception E_SUCCESS The method is successful.
1370 * @exception E_SYSTEM A system error has occurred.
1372 result SetTitleText(const Tizen::Base::String& title);
1375 * Gets the title text of the %EditField control.
1379 * @return The title text, @n
1380 * else an empty string if an error occurs
1382 Tizen::Base::String GetTitleText(void) const;
1385 * Sets the command button properties of the keypad. @n
1386 * The %SetOverlayKeypadCommandButton() method is supported only when the input style is ::INPUT_STYLE_OVERLAY.
1390 * @return An error code
1391 * @param[in] position The position of the command button
1392 * @param[in] text The label of the command button
1393 * @param[in] actionId The action ID
1394 * @exception E_SUCCESS The method is successful.
1395 * @exception E_SYSTEM A system error has occurred.
1397 result SetOverlayKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId);
1400 * Gets the text of the specified command button. @n
1401 * The %GetOverlayKeypadCommandButtonText() method is supported only when the input style is ::INPUT_STYLE_OVERLAY.
1405 * @return The text of the specified command button
1406 * @param[in] position The position of the command button
1408 Tizen::Base::String GetOverlayKeypadCommandButtonText(CommandButtonPosition position) const;
1411 * Gets the action ID of the specified command button. @n
1412 * The %GetOverlayKeypadCommandButtonActionId() method is supported only when the input style is ::INPUT_STYLE_OVERLAY.
1416 * @return The action ID of the specified command button
1417 * @param[in] position The position of the command button
1419 int GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const;
1422 * Sets the input language.
1426 * @brief <i> [Deprecated] </i>
1427 * @deprecated We no longer provide a method to set the language of the current keypad. @n
1428 * This method is provided only for backward compatibility and will be deleted in the near future.
1429 * @return An error code
1430 * @param[in] languageCode The language to set
1431 * @exception E_SUCCESS The method is successful.
1432 * @exception E_OUT_OF_MEMORY The memory is insufficient.
1434 * - The application can set the language of the current keypad that is associated with the current %EditField.
1435 * - This method only works if the language to set is supported by the current preloaded keypad.
1437 result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
1440 * Gets the current input language.
1444 * @return An error code
1445 * @param[out] language The current input language of the keypad that is associated with the current %EditField
1446 * @exception E_SUCCESS The method is successful.
1448 result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
1451 * Sets the text filter.
1455 * @param[in] pFilter The filter to set
1456 * @remarks The %EditField control checks with the registered filter to decide whether the user-entered text should be replaced or not.
1458 void SetEditTextFilter(IEditTextFilter* pFilter);
1461 * Sends opaque command to the input method.
1465 * @param[in] command The opaque command to send
1467 * - This method can be used to provide domain-specific features that are only known between certain input methods and their clients.
1468 * - This method may not work, depending on the active Input Method.
1470 void SendOpaqueCommand (const Tizen::Base::String& command);
1473 * Sets the password text as visible when %EditField is in password-related styles.
1477 * @return An error code
1478 * @param[in] visible Set to @c true to show password is visible as plain text, @n
1480 * @exception E_SUCCESS The method is successful.
1481 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1482 * This operation is supported when the EditFieldStyle is ::EDIT_FIELD_STYLE_PASSWORD, @n ::EDIT_FIELD_STYLE_PASSWORD_SMALL, ::EDIT_FIELD_STYLE_PASSWORD_NUMBER, or ::EDIT_FIELD_STYLE_PASSWORD_NUMBER_SMALL.
1484 result SetPasswordVisible(bool visible);
1487 * Checks whether the password text is visible when %EditField is in password-related styles
1491 * @return @c true if the password is visible as plain text, @n
1493 * @exception E_SUCCESS The method is successful.
1494 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1495 * This operation is supported when the EditFieldStyle is ::EDIT_FIELD_STYLE_PASSWORD, @n ::EDIT_FIELD_STYLE_PASSWORD_SMALL, ::EDIT_FIELD_STYLE_PASSWORD_NUMBER, or ::EDIT_FIELD_STYLE_PASSWORD_NUMBER_SMALL.
1496 * @remarks The specific error code can be accessed using the GetLastResult() method.
1497 * @see SetPasswordVisible()
1499 bool IsPasswordVisible(void) const;
1502 friend class _EditFieldImpl;
1505 EditField(const EditField&);
1506 EditField& operator =(const EditField&);
1510 }}} // Tizen::Ui::Controls
1512 #endif // _FUI_CTRL_EDIT_FIELD_H_