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 FUiCtrlEditArea.h
20 * @brief This is the header file for the %EditArea class.
22 * This header file contains the declarations of the %EditArea class and its helper classes.
25 #ifndef _FUI_CTRL_EDIT_AREA_H_
26 #define _FUI_CTRL_EDIT_AREA_H_
28 #include <FBaseString.h>
29 #include <FBaseCharacter.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpColor.h>
32 #include <FGrpPoint.h>
33 #include <FGrpRectangle.h>
34 #include <FUiContainer.h>
35 #include <FUiControl.h>
36 #include <FUiCtrlControlsTypes.h>
37 #include <FUiCtrlEditTypes.h>
38 #include <FUiCtrlInputTypes.h>
39 #include <FUiIActionEventListener.h>
40 #include <FUiIKeypadEventListener.h>
41 #include <FUiILanguageEventListener.h>
42 #include <FUiIScrollPanelEventListener.h>
43 #include <FUiITextBlockEventListener.h>
44 #include <FUiITextEventListener.h>
45 #include <FUiIUiLinkEventListener.h>
47 namespace Tizen { namespace Locales
52 namespace Tizen { namespace Ui { namespace Controls
57 * @brief This class defines the common behavior for the %EditArea control.
61 * The %EditArea class displays a multi-line text editor.
63 * 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>.
65 * The following example demonstrates how to use the %EditArea class.
68 // Sample code for EditAreaSample.h
72 : public Tizen::Ui::Controls::Form
73 , public Tizen::Ui::ITextEventListener
79 bool Initialize(void);
80 virtual result OnInitializing(void);
83 virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
84 virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source);
87 Tizen::Ui::Controls::EditArea* __pEditArea;
92 // Sample code for EditAreaSample.cpp
93 #include <FGraphics.h>
95 #include "EditAreaSample.h"
97 using namespace Tizen::Graphics;
98 using namespace Tizen::Ui::Controls;
101 EditAreaSample::Initialize(void)
103 Construct(FORM_STYLE_NORMAL);
108 EditAreaSample::OnInitializing(void)
110 result r = E_SUCCESS;
112 // Creates an instance of EditArea
113 __pEditArea = new EditArea();
114 __pEditArea->Construct(Rectangle(50, 100, 400, 150));
115 __pEditArea->AddTextEventListener(*this);
117 // Adds the edit area to the form
118 AddControl(*__pEditArea);
123 // ITextEventListener implementation
125 EditAreaSample::OnTextValueChanged(const Tizen::Ui::Control& source)
131 EditAreaSample::OnTextValueChangeCanceled(const Tizen::Ui::Control& source)
138 class _OSP_EXPORT_ EditArea
139 : public Tizen::Ui::Control
144 * 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.
151 * 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.
155 virtual ~EditArea(void);
158 * Initializes this instance of the %EditArea control with the specified parameters.
162 * @return An error code
163 * @param[in] rect An instance of the Graphics::Rectangle class @n
164 * This instance represents the x and y coordinates of the top-left corner of the created window along with
165 * the width and height of the control.
166 * @param[in] inputStyle Determines whether the fullscreen keypad or overlay keypad is displayed
167 * @param[in] limitLength The maximum limit of the length of the text that can be displayed by %EditArea
168 * @exception E_SUCCESS The method is successful.
169 * @exception E_INVALID_ARG A specified input parameter is invalid.@n
170 * The specified @c limitLength is less than or equal to @c 0. @n
171 * The @c rect.width or the @c rect.height is less than 0.
172 * @exception E_SYSTEM A system error has occurred.
173 * @remarks Some methods of the control will only work as expected when it becomes 'displayable'.
174 * For more information, see Control::IsDisplayable() @n
175 * The orientation of the full-screen style keypad is determined by the current device orientation.
177 result Construct(const Tizen::Graphics::Rectangle& rect, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, int limitLength = 1000);
181 * Gets the horizontal text alignment.
185 * @return The horizontal text alignment
186 * @exception E_SUCCESS The method is successful.
187 * @exception E_SYSTEM A system error has occurred.
188 * @remarks The specific error code can be accessed using the GetLastResult() method.
189 * @see SetTextAlignment()
191 HorizontalAlignment GetTextAlignment(void) const;
194 * Sets the horizontal text alignment.
198 * @return An error code
199 * @param[in] alignment The horizontal text alignment
200 * @exception E_SUCCESS The method is successful.
201 * @exception E_SYSTEM A system error has occurred.
202 * @see GetTextAlignment()
204 result SetTextAlignment(HorizontalAlignment alignment);
207 * Checks whether the view mode is enabled.
211 * @return @c true if the view mode is enabled, @n
213 * @exception E_SUCCESS The method is successful.
214 * @exception E_SYSTEM A system error has occurred.
215 * @remarks The specific error code can be accessed using the GetLastResult() method.
216 * @see SetViewModeEnabled()
218 bool IsViewModeEnabled(void) const;
221 * Enables or disables the view mode.
225 * @return An error code
226 * @param[in] enable Set to @c true to enable the view mode, @n
228 * @exception E_SUCCESS The method is successful.
229 * @exception E_SYSTEM A system error has occurred.
230 * @remarks When the view mode is enabled, the auto-detected links will be displayed as linked text.
231 * @see IsViewModeEnabled()
233 result SetViewModeEnabled(bool enable);
236 * Sets the auto-link mask.
240 * @return An error code
241 * @param[in] autoLinks The auto-link mask @n
242 * Multiple link types can be combined using bitwise OR (see Tizen::Base::Utility::LinkType). @n
243 * For more information, see <a href="../org.tizen.native.appprogramming/html/guide/ui/auto_link_detection.htm">AutoLink Detection</a>.
244 * @exception E_SUCCESS The method is successful.
245 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
246 * The operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
247 * @exception E_SYSTEM A system error has occurred.
248 * @remarks When @c autoLinks is set to zero, the auto-link detection is disabled.
249 * @see Tizen::Base::Utility::LinkType
250 * @see GetAutoLinkMask()
251 * @see IsViewModeEnabled()
252 * @see SetViewModeEnabled()
254 result SetAutoLinkMask(unsigned long autoLinks);
257 * Gets the auto-link mask.
261 * @return The auto-link mask
262 * @exception E_SUCCESS The method is successful.
263 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
264 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
265 * @exception E_SYSTEM A system error has occurred.
266 * @remarks The specific error code can be accessed using the GetLastResult()() method.
267 * @see SetAutoLinkMask()
269 unsigned long GetAutoLinkMask(void) const;
272 * Adds the specified link event listener.
276 * @param[in] listener The event listener to be added
277 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.@n
278 * The added listener will be notified when the links are selected by the user.
279 * @see RemoveUiLinkEventListener()
281 void AddUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
284 * Removes the specified link event listener. @n
285 * The removed listener cannot listen to the events when they are fired.
289 * @param[in] listener The event listener to be removed
290 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
291 * @see AddUiLinkEventListener()
293 void RemoveUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
296 * Gets the line spacing.
300 * @return The line spacing, @n
301 * else @c -1 if an error occurs
302 * @exception E_SUCCESS The method is successful.
303 * @remarks The specific error code can be accessed using the GetLastResult()() method.
304 * @see SetLineSpacing()
306 int GetLineSpacing(void) const;
309 * Sets the line spacing. @n
310 * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra.
313 * The line spacing = (default line spacing) * multiplier + extra
317 * @return An error code
318 * @param[in] multiplier The line spacing multiplier
319 * @param[in] extra The extra line spacing
320 * @exception E_SUCCESS The method is successful.
321 * @exception E_INVALID_ARG A specified input parameter is invalid, or @n
322 * the specified line spacing value cannot be supported.
323 * @exception E_SYSTEM A system error has occurred.
324 * @see GetLineSpacing()
326 result SetLineSpacing(int multiplier, int extra);
329 * Gets the margin value of the specified margin type.
333 * @return The margin value, @n
334 * else @c -1 if an error occurs
335 * @param[in] marginType The margin type
336 * @exception E_SUCCESS The method is successful.
337 * @exception E_SYSTEM A system error has occurred.
338 * @remarks The specific error code can be accessed using the GetLastResult()() method.
341 int GetMargin(EditMarginType marginType) const;
344 * Sets the margin value for the specified margin type.
348 * @return An error code
349 * @param[in] marginType The margin type
350 * @param[in] margin The margin value to set
351 * @exception E_SUCCESS The method is successful.
352 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
353 * The specified @c margin cannot be a negative integer.
354 * @exception E_SYSTEM A system error has occurred.
357 result SetMargin(EditMarginType marginType, int margin);
360 * Enables or disables the keypad action.
363 * @return An error code
364 * @param[in] enable Set to @c true to enable the keypad action, @n
366 * @exception E_SUCCESS The method is successful.
367 * @exception E_UNSUPPORTED_OPERATION The underlying input method does not support this operation.
368 * @remarks Depending on the value of input param, the enter key have a enable or disable look accordingly.
370 result SetKeypadActionEnabled(bool enable);
373 * Checks whether the keypad action is enabled.
376 * @return @c true if the keypad action is enabled, @n
379 bool IsKeypadActionEnabled(void) const;
382 * Gets the keypad action type.
386 * @return The keypad action
387 * @exception E_SUCCESS The method is successful.
388 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
389 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
390 * @exception E_SYSTEM A system error has occurred.
391 * @remarks The specific error code can be accessed using the GetLastResult()() method.
393 Tizen::Ui::KeypadAction GetKeypadAction(void) const;
396 * Sets the keypad action type.
400 * @return An error code
401 * @param[in] keypadAction The keypad action
402 * @exception E_SUCCESS The method is successful.
403 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
404 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
405 * @exception E_SYSTEM A system error has occurred.
406 * @remarks Depending on the value of @c keypadAction specified, the enter key label of the keypad will change accordingly.
408 result SetKeypadAction(Tizen::Ui::KeypadAction keypadAction);
411 * Gets the keypad style.
415 * @return The keypad style
416 * @exception E_SUCCESS The method is successful.
417 * @exception E_SYSTEM A system error has occurred.
418 * @remarks The specific error code can be accessed using the GetLastResult() method.
419 * @see SetKeypadStyle()
421 KeypadStyle GetKeypadStyle(void) const;
424 * Sets the keypad style.
428 * @return An error code
429 * @param[in] keypadStyle The keypad style
430 * @exception E_SUCCESS The method is successful.
431 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
432 * The specified @c keypadStyle cannot be @c KEYPAD_STYLE_PASSWORD.
433 * @exception E_SYSTEM A system error has occurred.
434 * @remarks Depending on the value of the specified @c keypadStyle, the keypad's layout will change accordingly.
435 * @see GetKeypadStyle()
437 result SetKeypadStyle(KeypadStyle keypadStyle);
440 * Checks whether the text prediction is enabled.
443 * @return @c true if the text prediction is enabled, @n
445 * @exception E_SUCCESS The method is successful.
446 * @see SetTextPredictionEnabled()
448 bool IsTextPredictionEnabled(void) const;
451 * Enables or disables the text prediction.
454 * @param[in] enable Set to @c true to enable the text prediction, @n
456 * @return An error code
457 * @exception E_SUCCESS The method is successful.
458 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
459 * @see IsTextPredictionEnabled()
461 result SetTextPredictionEnabled(bool enable);
464 * Sets the visibility of the command buttons of the overlay style keypad.
468 * @return An error code
469 * @param[in] visible Set to @c true to make the overlay keypad command buttons visible, @n
471 * @exception E_SUCCESS The method is successful.
472 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
473 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
474 * @exception E_SYSTEM A system error has occurred.
476 result SetOverlayKeypadCommandButtonVisible(bool visible);
479 * Checks whether the command buttons of the overlay style keypad are visible.
483 * @return @c true if the overlay command buttons are set to be visible, @n
485 * @exception E_SUCCESS The method is successful.
486 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
487 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
488 * @exception E_SYSTEM A system error has occurred.
489 * @remarks The specific error code can be accessed using the GetLastResult()() method.
491 bool IsOverlayCommandButtonVisible(void) const;
498 * @return An error code
499 * @exception E_SUCCESS The method is successful.
500 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
501 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
502 * @exception E_SYSTEM A system error has occurred.
505 result HideKeypad(void);
508 * Gets the text size.
512 * @return The size of the text, @n
513 * else @c -1 if an error occurs
514 * @exception E_SUCCESS The method is successful.
515 * @exception E_SYSTEM A system error has occurred.
516 * @remarks The specific error code can be accessed using the GetLastResult() method.
519 int GetTextSize(void) const;
522 * Sets the text size.
526 * @return An error code
527 * @param[in] size The text size
528 * @exception E_SUCCESS The method is successful.
529 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
530 * The specified @c size cannot be a negative integer.
531 * @exception E_SYSTEM A system error has occurred.
534 result SetTextSize(int size);
537 * Gets the color of %EditArea for the specified status.
541 * @return The color, @n
542 * else RGBA (0,0,0,0) if an error occurs
543 * @param[in] status The status
544 * @exception E_SUCCESS The method is successful.
545 * @exception E_SYSTEM A system error has occurred.
546 * @remarks The specific error code can be accessed using the GetLastResult() method.
548 Tizen::Graphics::Color GetColor(EditStatus status) const;
551 * Gets the text color of the specified text color type.
555 * @return The color, @n
556 * else RGBA (0,0,0,0) if an error occurs
557 * @param[in] type The text color type
558 * @exception E_SUCCESS The method is successful.
559 * @exception E_SYSTEM A system error has occurred.
560 * @remarks The specific error code can be accessed using the GetLastResult() method.
561 * @see SetTextColor()
563 Tizen::Graphics::Color GetTextColor(EditTextColor type) const;
566 * Sets the background bitmap of the %EditArea control for the specified status.
570 * @return An error code
571 * @param[in] status The status
572 * @param[in] bitmap The background bitmap
573 * @exception E_SUCCESS The method is successful.
574 * @exception E_SYSTEM A system error has occurred.
576 result SetBackgroundBitmap(EditStatus status, const Tizen::Graphics::Bitmap& bitmap);
579 * Sets the color of the %EditArea control for the specified status.
583 * @return An error code
584 * @param[in] status The status
585 * @param[in] color The color
586 * @exception E_SUCCESS The method is successful.
587 * @exception E_SYSTEM A system error has occurred.
590 result SetColor(EditStatus status, const Tizen::Graphics::Color& color);
593 * Sets the text color of the %EditArea control for the specified text color type.
597 * @return An error code
598 * @param[in] type The text color type
599 * @param[in] color The text color
600 * @exception E_SUCCESS The method is successful.
601 * @exception E_SYSTEM A system error has occurred.
602 * @see GetTextColor()
604 result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color);
607 * Gets a portion of text that is displayed by the %EditArea control.
611 * @return The specified portion of the text, @n
612 * else an empty string if an error occurs
613 * @param[in] start The starting index of the range
614 * @param[in] end The last index of the range
615 * @exception E_SUCCESS The method is successful.
616 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
617 * The index is greater than the number of elements or less than @c 0.
618 * @exception E_SYSTEM A system error has occurred.
619 * @remarks The specific error code can be accessed using the GetLastResult()() method.
622 Tizen::Base::String GetText(int start, int end) const;
625 * Adds the specified keypad event listener. @n
626 * The added listener is notified when the keypad associated with the %EditArea control is opened or closed.
630 * @param[in] listener The event listener to be added
631 * @see RemoveKeypadEventListener()
633 void AddKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
636 * Removes the specified keypad event listener. @n
637 * The removed listener cannot listen to events when they are fired.
641 * @param[in] listener The event listener to be removed
642 * @see AddKeypadEventListener()
644 void RemoveKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
647 * Adds a text block event listener.
648 * The added listener is notified when the text block is selected.
652 * @param[in] listener The event listener to be added
653 * @remarks Programmatically modifying the text block does not cause the text block selection event to fire.
654 * @see RemoveTextBlockEventListener()
656 void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
659 * Removes the specified text block event listener. @n
660 * The removed listener cannot listen to events when they are fired.
664 * @param[in] listener The event listener to be removed
665 * @see AddTextBlockEventListener()
667 void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
670 * Adds a listener instance. @n
671 * The added listener can listen to the text related events.
675 * @param[in] listener The listener to be added
676 * @see RemoveTextEventListener()
678 void AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
681 * Removes a listener instance. @n
682 * The removed listener cannot listen to events when they are fired.
686 * @param[in] listener The listener to be removed
687 * @see AddTextEventListener()
689 void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
692 * Adds a listener instance to listen to the scroll panel events.
696 * @param[in] listener The listener to be added
697 * @remarks To listen to scroll panel events, the parent of the %EditArea control must be an instance of ScrollPanel. @n
698 * When OnOverlayControlCreated() or OnOvelayControlClosed() is called, the application resets the bounds of the controls placed
699 * within the %ScrollPanel. %ScrollPanel is automatically redrawn after this method is called.
700 * @see RemoveScrollPanelEventListener()
702 void AddScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
705 * Removes the scroll panel event listener. @n
706 * The removed listener cannot listen to events when they are fired.
710 * @param[in] listener The listener to be removed
711 * @see AddScrollPanelEventListener()
713 void RemoveScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
716 * Adds a listener instance. @n
717 * The added listener is notified when the action event is fire by the command buttons of the keypad.
721 * @param[in] listener The event listener to be added
722 * @see RemoveActionEventListener()
724 void AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
728 * Removes a listener instance. @n
729 * The removed listener cannot listen to events when they are fired.
733 * @param[in] listener The event listener to be removed
734 * @see AddActionEventListener()
736 void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
739 * Adds a listener instance for language events. @n
740 * The added listener is notified when the input language is changed.
744 * @param[in] listener The listener to be added
745 * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener.
746 * @see RemoveLanguageEventListener()
748 void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
751 * Removes the specified listener instance. @n
752 * The removed listener cannot listen to events when they are fired.
756 * @param[in] listener The listener to be removed
757 * @see AddLanguageEventListener()
759 void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
762 * Gets the remaining length of the %EditArea control.
766 * @return The remaining length of the %EditArea control, @n
767 * else @c -1 if an error occurs.
769 int GetRemainingLength(void) const;
772 * Enables or disables the lowercase mode.
776 * @param[in] enable Set to @c true to enable the lowercase mode, @n
779 void SetLowerCaseModeEnabled(bool enable);
782 * Checks whether the lowercase mode is enabled.
786 * @return @c true if the lowercase mode is enabled, @n
789 bool IsLowerCaseModeEnabled(void) const;
793 * Sets the input mode category.
795 * @brief <i> [Deprecated] </i>
796 * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
797 * or the current mode to initially set the keypad to, from this list. It is recommended to use SetKeypadStyle() method instead.
800 * @return An error code
801 * @param[in] categories The categories to be set @n
802 * Multiple input categories can be combined using bitwise OR (see Tizen::Ui::Controls::EditInputModeCategory).
803 * @param[in] enable The category value to be set
804 * @exception E_SUCCESS The method is successful.
805 * @exception E_INVALID_ARG A specified input mode category is invalid.
806 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n
807 * The specified @c categories cannot be supported with the current keypad style.
808 * @exception E_SYSTEM A system error has occurred.
811 result SetInputModeCategory(unsigned long categories, bool enable);
815 * Sets the current input mode category.
817 * @brief <i> [Deprecated] </i>
818 * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
819 * or the current mode to initially set the keypad to, from this list. It is recommended to use SetKeypadStyle() method instead.
822 * @return An error code
823 * @param[in] inputModeCategory An item of input category
824 * @exception E_SUCCESS The method is successful.
825 * @exception E_SYSTEM A system error has occurred.
828 result SetCurrentInputModeCategory(EditInputModeCategory inputModeCategory);
832 * Gets the input mode category.
834 * @brief <i> [Deprecated] </i>
835 * @deprecated This method is deprecated because we no longer provide a method to specify the list of styles @n
836 * which the user can set the keypad to. It is recommended to use GetKeypadStyle() method instead.
839 * @return A bitwise combination of Tizen::Ui::Controls::EditInputModeCategory, @n
840 * else @c EDIT_INPUTMODE_ALPHA if an error occurs
843 unsigned long GetInputModeCategory(void) const;
847 * Gets the current input mode category.
849 * @brief <i> [Deprecated] </i>
850 * @deprecated This method is deprecated because we no longer provide a method to specify the list of styles @n
851 * which the user can set the keypad to. It is recommended to use GetKeypadStyle() method instead.
854 * @return The current input mode category
857 EditInputModeCategory GetCurrentInputModeCategory(void) const;
860 * Sets the cursor at the specified position.
864 * @return An error code
865 * @param[in] position The cursor position that is to be set
866 * @exception E_SUCCESS The method is successful.
867 * @exception E_OUT_OF_RANGE The specified @c position is less than @c 0 or greater than the maximum length.
868 * @exception E_SYSTEM A system error has occurred.
870 result SetCursorPosition(int position);
873 * Gets the cursor position.
877 * @return The current cursor position, @n
878 * else @c -1 if an error occurs
880 int GetCursorPosition(void) const;
883 * Gets the text that is displayed by the %EditArea control.
887 * @return The text of the %EditArea control, @n
888 * else an empty string if an error occurs
890 Tizen::Base::String GetText(void) const;
893 * Gets the length of the text that is displayed by the %EditArea control.
897 * @return The length of the text, @n
898 * else @c -1 if an error occurs
900 int GetTextLength(void) const;
903 * Sets the text of the %EditArea control.
907 * @param[in] text The text that needs to be displayed by the %EditArea control.
908 * @exception E_SUCCESS The method is successful.
909 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
910 * The length of the specified @c text exceeds the system limitation or the limit length.
911 * @exception E_SYSTEM A system error has occurred.
912 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
914 result SetText(const Tizen::Base::String& text);
917 * Inserts the specified text at the current cursor position.
921 * @return An error code
922 * @param[in] text The text to be inserted
923 * @exception E_SUCCESS The method is successful.
924 * @exception E_SYSTEM A system error has occurred.
925 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.@n
927 result InsertTextAtCursorPosition(const Tizen::Base::String& text);
930 * Appends the specified text at the end of the existing text.
934 * @return An error code
935 * @param[in] text The text to be appended
936 * @exception E_SUCCESS The method is successful.
937 * @exception E_SYSTEM A system error has occurred.
938 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.@n
940 result AppendText(const Tizen::Base::String& text);
943 * Appends the specified character at the end of the existing text.
947 * @return An error code
948 * @param[in] character The character to be appended
949 * @exception E_SUCCESS The method is successful.
950 * @exception E_SYSTEM A system error has occurred.
951 * @remarks The method modifies the text buffer that is managed by the %EditArea control. To display the
952 * changes, the control must be drawn again.
954 result AppendCharacter(const Tizen::Base::Character& character);
957 * Inserts the text that will be displayed by bitmap at the specified text position.
961 * @return An error code
962 * @param[in] position The position to insert the text
963 * @param[in] text The text to be inserted
964 * @param[in] textImage The alternate bitmap to be drawn
965 * @exception E_SUCCESS The method is successful.
966 * @exception E_OUT_OF_RANGE The specified @c position is outside the valid range. @n
967 * Either the specified @c position is greater than the number of existing text in the %EditArea or less than @c 0.
968 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by %EditArea.
969 * @remarks The method modifies the text buffer that is managed by the %EditArea control. @n
970 * To display the changes, the control must be drawn again. The text to be inserted will be displayed by @c textImage.
972 result InsertTextAt(int position, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& textImage);
975 * Appends the text that will be displayed by bitmap at the end of the existing text.
979 * @return An error code
980 * @param[in] text The text to be appended
981 * @param[in] textImage The alternate bitmap to be drawn
982 * @exception E_SUCCESS The method is successful.
983 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by %EditArea.
984 * @remarks The method modifies the text buffer that is managed by the %EditArea control. @n
985 * To display the changes, the control must be drawn again. The text to be appended will be displayed by @c textImage.
987 result AppendText(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& textImage);
990 * Clears the text that is displayed by the %EditArea control.
994 * @return An error code
995 * @exception E_SUCCESS The method is successful.
996 * @exception E_SYSTEM A system error has occurred.
997 * @remarks The method modifies the text buffer that is managed by the %EditArea control. To display the
998 * changes, the control must be drawn again.
1003 * Deletes a character at the current cursor position.
1007 * @return An error code
1008 * @exception E_SUCCESS The method is successful.
1009 * @exception E_SYSTEM A system error has occurred.
1010 * @remarks The method modifies the text buffer that is managed by the %EditArea control. To display the
1011 * changes, the control must be drawn again.
1013 result DeleteCharacterAtCursorPosition(void);
1016 * Gets the range of the current text block.
1020 * @param[out] start The first index of the current text block
1021 * @param[out] end The last index of the current text block
1023 void GetCurrentTextRange(int& start, int& end) const;
1026 * Displays the guide text when there is no text in the %EditArea control.
1030 * @param[in] guideText The guide text
1031 * @remarks This is the default text that is displayed in the %EditArea control when the focus is given to it.
1033 void SetGuideText(const Tizen::Base::String& guideText);
1036 * Gets the guide text.
1040 * @return The guide text, @n
1041 * else an empty string if an error occurs
1042 * @exception E_SUCCESS The method is successful.
1043 * @exception E_SYSTEM A system error has occurred.
1044 * @remarks The specific error code can be accessed using the GetLastResult() method.
1045 * @see SetGuideText()
1047 Tizen::Base::String GetGuideText(void) const;
1050 * Gets the text color of the guide text.
1054 * @return The guide text color
1055 * @exception E_SUCCESS The method is successful.
1056 * @exception E_SYSTEM A system error has occurred.
1057 * @remarks The specific error code can be accessed using the GetLastResult() method.
1058 * @see SetGuideTextColor()
1060 Tizen::Graphics::Color GetGuideTextColor(void) const;
1063 * Sets the text color of the guide text.
1067 * @return An error code
1068 * @param[in] color The guide text color
1069 * @exception E_SUCCESS The method is successful.
1070 * @exception E_SYSTEM A system error has occurred.
1071 * @see GetGuideTextColor()
1073 result SetGuideTextColor(const Tizen::Graphics::Color& color);
1076 * Enables or disables the keypad.
1080 * @param[in] enable Set to @c true to enable the keypad, @n
1083 void SetKeypadEnabled(bool enable);
1086 * Checks whether the keypad is enabled.
1090 * @return @c true if the keypad is enabled, @n
1093 bool IsKeypadEnabled(void) const;
1100 * @return An error code
1101 * @exception E_SUCCESS The method is successful.
1102 * @exception E_INVALID_STATE This instance is in an invalid state.
1103 * @exception E_SYSTEM A system error has occurred.
1104 * @remarks This method is supported only when the input style is INPUT_STYLE_OVERLAY.
1106 result ShowKeypad(void);
1109 * Gets the line count.
1113 * @return The line count
1115 int GetTextLineCount(void) const;
1118 * Gets the range of the current text block.
1122 * @param[out] start The starting index of the current text block
1123 * @param[out] end The end index of the current text block
1125 void GetBlockRange(int& start, int& end) const;
1128 * Begins the text block from the current cursor position.
1132 * @return An error code
1133 * @exception E_SUCCESS The method is successful.
1134 * @exception E_SYSTEM A system error has occurred.
1135 * @remarks Move the cursor position to the end of the text block.
1136 * @see SetCursorPosition()
1137 * @see ReleaseBlock()
1140 result BeginBlock(void);
1143 * Releases the text block.
1147 * @return An error code
1148 * @exception E_SUCCESS The method is successful.
1149 * @exception E_SYSTEM A system error has occurred.
1153 result ReleaseBlock(void);
1156 * Checks whether a portion of the text is blocked.
1160 * @return @c true if the text is blocked, @n
1163 * @see ReleaseBlock()
1165 bool IsBlocked(void) const;
1168 * Copies the text block to the clipboard.
1172 * @return An error code
1173 * @exception E_SUCCESS The method is successful.
1174 * @exception E_SYSTEM A system error has occurred.
1175 * @see Cut(), Paste(), Remove()
1180 * Cuts the text block and copies it to the clipboard.
1184 * @return An error code
1185 * @exception E_SUCCESS The method is successful.
1186 * @exception E_SYSTEM A system error has occurred.
1187 * @see Copy(), Remove(), Paste()
1192 * Pastes the copied text at the cursor position.
1196 * @return An error code
1197 * @exception E_SUCCESS The method is successful.
1198 * @exception E_SYSTEM A system error has occurred.
1199 * @see Copy(), Cut(), Remove()
1204 * Removes the text that is marked by the text block.
1208 * @return An error code
1209 * @exception E_SUCCESS The method is successful.
1210 * @exception E_SYSTEM A system error has occurred.
1211 * @see Copy(), Cut(), Paste()
1213 result Remove(void);
1216 * Checks whether the text in the %EditArea control has been clipped.
1220 * @return @c true if the text has been clipped, @n
1222 * @remarks 'Clipped' means that the text has been copied to the clipboard.
1223 * @see Copy(), Cut(), Paste(), Remove()
1225 bool IsClipped(void) const;
1228 * Sets the command button properties of the keypad.
1232 * @return An error code
1233 * @param[in] position The position of the command button
1234 * @param[in] text The label of the command button
1235 * @param[in] actionId The action ID
1236 * @exception E_SUCCESS The method is successful.
1237 * @exception E_SYSTEM A system error has occurred.
1238 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
1240 result SetOverlayKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId);
1243 * Gets the text of the specified command button.
1247 * @return The text of the specified command button
1248 * @param[in] position The position of the command button
1249 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
1251 Tizen::Base::String GetOverlayKeypadCommandButtonText(CommandButtonPosition position) const;
1254 * Gets the action ID of the specified command button.
1258 * @return The action ID of the specified command button
1259 * @param[in] position The position of the command button
1260 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
1262 int GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const;
1265 * Sets the input language.
1269 * @return An error code
1270 * @param[in] languageCode The language to be set
1271 * @exception E_SUCCESS The method is successful.
1272 * @exception E_OUT_OF_MEMORY The memory is insufficient.
1273 * @remarks The application can set the language of the current keypad that is associated with the current %EditArea. @n
1274 * This method only works if the language to set is supported by the current preloaded keypad.
1276 result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
1279 * Gets the current input language.
1283 * @return An error code
1284 * @param[out] language The current input language
1285 * @exception E_SUCCESS The method is successful.
1286 * @remarks The application can get the current language of the keypad that is associated with the current %EditArea.
1288 result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
1291 friend class _EditAreaImpl;
1294 EditArea(const EditArea&);
1295 EditArea& operator =(const EditArea&);
1298 }}} // Tizen::Ui::Controls
1300 #endif // _FUI_CTRL_EDIT_AREA_H_