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 <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 the common behavior for the %EditArea control.
62 * The %EditArea class displays a multi-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 %EditArea class.
69 // Sample code for EditAreaSample.h
73 : public Tizen::Ui::Controls::Form
74 , public Tizen::Ui::ITextEventListener
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::EditArea* __pEditArea;
93 // Sample code for EditAreaSample.cpp
94 #include <FGraphics.h>
96 #include "EditAreaSample.h"
98 using namespace Tizen::Graphics;
99 using namespace Tizen::Ui::Controls;
102 EditAreaSample::Initialize(void)
104 Construct(FORM_STYLE_NORMAL);
109 EditAreaSample::OnInitializing(void)
111 result r = E_SUCCESS;
113 // Creates an instance of EditArea
114 __pEditArea = new EditArea();
115 __pEditArea->Construct(Rectangle(50, 100, 400, 150));
116 __pEditArea->AddTextEventListener(*this);
118 // Adds the edit area to the form
119 AddControl(*__pEditArea);
124 // ITextEventListener implementation
126 EditAreaSample::OnTextValueChanged(const Tizen::Ui::Control& source)
132 EditAreaSample::OnTextValueChangeCanceled(const Tizen::Ui::Control& source)
139 class _OSP_EXPORT_ EditArea
140 : 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 ~EditArea(void);
159 * Initializes this instance of the %EditArea 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] inputStyle Determines whether the fullscreen keypad or overlay keypad is displayed
168 * @param[in] limitLength The maximum limit of the length of the text that can be displayed by %EditArea
169 * @exception E_SUCCESS The method is successful.
170 * @exception E_INVALID_ARG A specified input parameter is invalid.@n
171 * The specified @c limitLength is less than or equal to @c 0. @n
172 * The @c rect.width or the @c rect.height is less than 0.
173 * @exception E_SYSTEM A system error has occurred.
174 * @remarks Some methods of the control will only work as expected when it becomes 'displayable'.
175 * For more information, see Control::IsDisplayable() @n
176 * The orientation of the full-screen style keypad is determined by the current device orientation.
178 result Construct(const Tizen::Graphics::Rectangle& rect, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, int limitLength = 1000);
181 * Initializes this instance of the %EditArea control with the specified parameters.
185 * @return An error code
186 * @param[in] rect An instance of the Graphics::FloatRectangle class @n
187 * This instance represents the x and y coordinates of the top-left corner of the created window along with
188 * the width and height of the control.
189 * @param[in] inputStyle Determines whether the fullscreen keypad or overlay keypad is displayed
190 * @param[in] limitLength The maximum limit of the length of the text that can be displayed by %EditArea
191 * @exception E_SUCCESS The method is successful.
192 * @exception E_INVALID_ARG A specified input parameter is invalid.@n
193 * The specified @c limitLength is less than or equal to @c 0. @n
194 * The @c rect.width or the @c rect.height is less than 0.
195 * @exception E_SYSTEM A system error has occurred.
196 * @remarks Some methods of the control will only work as expected when it becomes 'displayable'.
197 * For more information, see Control::IsDisplayable() @n
198 * The orientation of the full-screen style keypad is determined by the current device orientation.
200 result Construct(const Tizen::Graphics::FloatRectangle& rect, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, int limitLength = 1000);
204 * Gets the horizontal text alignment.
208 * @return The horizontal text alignment
209 * @exception E_SUCCESS The method is successful.
210 * @exception E_SYSTEM A system error has occurred.
211 * @remarks The specific error code can be accessed using the GetLastResult() method.
212 * @see SetTextAlignment()
214 HorizontalAlignment GetTextAlignment(void) const;
217 * Sets the horizontal text alignment.
221 * @return An error code
222 * @param[in] alignment The horizontal text alignment
223 * @exception E_SUCCESS The method is successful.
224 * @exception E_SYSTEM A system error has occurred.
225 * @see GetTextAlignment()
227 result SetTextAlignment(HorizontalAlignment alignment);
230 * Checks whether the view mode is enabled.
234 * @return @c true if the view mode is enabled, @n
236 * @exception E_SUCCESS The method is successful.
237 * @exception E_SYSTEM A system error has occurred.
238 * @remarks The specific error code can be accessed using the GetLastResult() method.
239 * @see SetViewModeEnabled()
241 bool IsViewModeEnabled(void) const;
244 * Enables or disables the view mode.
248 * @return An error code
249 * @param[in] enable Set to @c true to enable the view mode, @n
251 * @exception E_SUCCESS The method is successful.
252 * @exception E_SYSTEM A system error has occurred.
253 * @remarks When the view mode is enabled, the auto-detected links will be displayed as linked text.
254 * @see IsViewModeEnabled()
256 result SetViewModeEnabled(bool enable);
259 * Sets the auto-link mask.
263 * @return An error code
264 * @param[in] autoLinks The auto-link mask @n
265 * Multiple link types can be combined using bitwise OR (see Tizen::Base::Utility::LinkType). @n
266 * For more information, see <a href="../org.tizen.native.appprogramming/html/guide/ui/auto_link_detection.htm">AutoLink Detection</a>.
267 * @exception E_SUCCESS The method is successful.
268 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
269 * The operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
270 * @exception E_SYSTEM A system error has occurred.
271 * @remarks When @c autoLinks is set to zero, the auto-link detection is disabled.
272 * @see Tizen::Base::Utility::LinkType
273 * @see GetAutoLinkMask()
274 * @see IsViewModeEnabled()
275 * @see SetViewModeEnabled()
277 result SetAutoLinkMask(unsigned long autoLinks);
280 * Gets the auto-link mask.
284 * @return The auto-link mask
285 * @exception E_SUCCESS The method is successful.
286 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
287 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
288 * @exception E_SYSTEM A system error has occurred.
289 * @remarks The specific error code can be accessed using the GetLastResult()() method.
290 * @see SetAutoLinkMask()
292 unsigned long GetAutoLinkMask(void) const;
295 * Adds the specified link event listener.
299 * @param[in] listener The event listener to add
300 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.@n
301 * The added listener will be notified when the links are selected by the user.
302 * @see RemoveUiLinkEventListener()
304 void AddUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
307 * Removes the specified link event listener. @n
308 * The removed listener cannot listen to the events when they are fired.
312 * @param[in] listener The event listener to remove
313 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
314 * @see AddUiLinkEventListener()
316 void RemoveUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
319 * Gets the line spacing.
323 * @return The line spacing, @n
324 * else @c -1 if an error occurs
325 * @exception E_SUCCESS The method is successful.
326 * @remarks The specific error code can be accessed using the GetLastResult()() method.
327 * @see SetLineSpacing()
329 int GetLineSpacing(void) const;
332 * Gets the line spacing.
336 * @return The line spacing, @n
337 * else @c -1 if an error occurs
338 * @exception E_SUCCESS The method is successful.
339 * @remarks The specific error code can be accessed using the GetLastResult()() method.
340 * @see SetLineSpacing()
342 float GetLineSpacingF(void) const;
345 * Sets the line spacing. @n
346 * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra.
349 * The line spacing = (default line spacing) * multiplier + extra
353 * @return An error code
354 * @param[in] multiplier The line spacing multiplier
355 * @param[in] extra The extra line spacing
356 * @exception E_SUCCESS The method is successful.
357 * @exception E_INVALID_ARG A specified input parameter is invalid, or @n
358 * the specified line spacing value cannot be supported.
359 * @exception E_SYSTEM A system error has occurred.
360 * @see GetLineSpacing()
362 result SetLineSpacing(int multiplier, int extra);
365 * Sets the line spacing. @n
366 * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra.
369 * The line spacing = (default line spacing) * multiplier + extra
373 * @return An error code
374 * @param[in] multiplier The line spacing multiplier
375 * @param[in] extra The extra line spacing
376 * @exception E_SUCCESS The method is successful.
377 * @exception E_INVALID_ARG A specified input parameter is invalid, or @n
378 * the specified line spacing value cannot be supported.
379 * @exception E_SYSTEM A system error has occurred.
380 * @see GetLineSpacingF()
382 result SetLineSpacing(int multiplier, float extra);
385 * Gets the margin value of the specified margin type.
389 * @return The margin value, @n
390 * else @c -1 if an error occurs
391 * @param[in] marginType The margin type
392 * @exception E_SUCCESS The method is successful.
393 * @exception E_SYSTEM A system error has occurred.
394 * @remarks The specific error code can be accessed using the GetLastResult()() method.
397 int GetMargin(EditMarginType marginType) const;
400 * Gets the margin value of the specified margin type.
404 * @return The margin value, @n
405 * else @c -1 if an error occurs
406 * @param[in] marginType The margin type
407 * @exception E_SUCCESS The method is successful.
408 * @exception E_SYSTEM A system error has occurred.
409 * @remarks The specific error code can be accessed using the GetLastResult()() method.
412 float GetMarginF(EditMarginType marginType) const;
415 * Sets the margin value for the specified margin type.
419 * @return An error code
420 * @param[in] marginType The margin type
421 * @param[in] margin The margin value to set
422 * @exception E_SUCCESS The method is successful.
423 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
424 * The specified @c margin cannot be a negative integer.
425 * @exception E_SYSTEM A system error has occurred.
428 result SetMargin(EditMarginType marginType, int margin);
431 * Sets the margin value for the specified margin type.
435 * @return An error code
436 * @param[in] marginType The margin type
437 * @param[in] margin The margin value to set
438 * @exception E_SUCCESS The method is successful.
439 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
440 * The specified @c margin cannot be a negative integer.
441 * @exception E_SYSTEM A system error has occurred.
444 result SetMargin(EditMarginType marginType, float margin);
447 * Enables or disables the keypad action.
450 * @return An error code
451 * @param[in] enable Set to @c true to enable the keypad action, @n
453 * @exception E_SUCCESS The method is successful.
454 * @exception E_UNSUPPORTED_OPERATION The underlying input method does not support this operation.
455 * @remarks Depending on the value of input param, the enter key have a enable or disable look accordingly.
457 result SetKeypadActionEnabled(bool enable);
460 * Checks whether the keypad action is enabled.
463 * @return @c true if the keypad action is enabled, @n
466 bool IsKeypadActionEnabled(void) const;
469 * Gets the keypad action type.
473 * @return The keypad action
474 * @exception E_SUCCESS The method is successful.
475 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
476 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
477 * @exception E_SYSTEM A system error has occurred.
478 * @remarks The specific error code can be accessed using the GetLastResult()() method.
480 Tizen::Ui::KeypadAction GetKeypadAction(void) const;
483 * Sets the keypad action type.
487 * @return An error code
488 * @param[in] keypadAction The keypad action
489 * @exception E_SUCCESS The method is successful.
490 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
491 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
492 * @exception E_SYSTEM A system error has occurred.
493 * @remarks Depending on the value of @c keypadAction specified, the enter key label of the keypad will change accordingly.
495 result SetKeypadAction(Tizen::Ui::KeypadAction keypadAction);
498 * Gets the keypad style.
502 * @return The keypad style
503 * @exception E_SUCCESS The method is successful.
504 * @exception E_SYSTEM A system error has occurred.
505 * @remarks The specific error code can be accessed using the GetLastResult() method.
506 * @see SetKeypadStyle()
508 KeypadStyle GetKeypadStyle(void) const;
511 * Sets the keypad style.
515 * @return An error code
516 * @param[in] keypadStyle The keypad style
517 * @exception E_SUCCESS The method is successful.
518 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
519 * The specified @c keypadStyle cannot be @c KEYPAD_STYLE_PASSWORD.
520 * @exception E_SYSTEM A system error has occurred.
521 * @remarks Depending on the value of the specified @c keypadStyle, the keypad's layout will change accordingly.
522 * @see GetKeypadStyle()
524 result SetKeypadStyle(KeypadStyle keypadStyle);
527 * Checks whether the text prediction is enabled.
530 * @return @c true if the text prediction is enabled, @n
532 * @exception E_SUCCESS The method is successful.
533 * @see SetTextPredictionEnabled()
535 bool IsTextPredictionEnabled(void) const;
538 * Enables or disables the text prediction.
541 * @param[in] enable Set to @c true to enable the text prediction, @n
543 * @return An error code
544 * @exception E_SUCCESS The method is successful.
545 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
546 * @see IsTextPredictionEnabled()
548 result SetTextPredictionEnabled(bool enable);
551 * Sets the visibility of the command buttons of the overlay style keypad.
555 * @return An error code
556 * @param[in] visible Set to @c true to make the overlay keypad command buttons visible, @n
558 * @exception E_SUCCESS The method is successful.
559 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
560 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
561 * @exception E_SYSTEM A system error has occurred.
563 result SetOverlayKeypadCommandButtonVisible(bool visible);
566 * Checks whether the command buttons of the overlay style keypad are visible.
570 * @return @c true if the overlay command buttons are set to be visible, @n
572 * @exception E_SUCCESS The method is successful.
573 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
574 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
575 * @exception E_SYSTEM A system error has occurred.
576 * @remarks The specific error code can be accessed using the GetLastResult()() method.
578 bool IsOverlayCommandButtonVisible(void) const;
585 * @return An error code
586 * @exception E_SUCCESS The method is successful.
587 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
588 * This operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
589 * @exception E_SYSTEM A system error has occurred.
592 result HideKeypad(void);
595 * Gets the text size.
599 * @return The size of the text, @n
600 * else @c -1 if an error occurs
601 * @exception E_SUCCESS The method is successful.
602 * @exception E_SYSTEM A system error has occurred.
603 * @remarks The specific error code can be accessed using the GetLastResult() method.
606 int GetTextSize(void) const;
609 * Gets the text size.
613 * @return The size of the text, @n
614 * else @c -1 if an error occurs
615 * @exception E_SUCCESS The method is successful.
616 * @exception E_SYSTEM A system error has occurred.
617 * @remarks The specific error code can be accessed using the GetLastResult() method.
620 float GetTextSizeF(void) const;
623 * Sets the text size.
627 * @return An error code
628 * @param[in] size The text size
629 * @exception E_SUCCESS The method is successful.
630 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
631 * The specified @c size cannot be a negative integer.
632 * @exception E_SYSTEM A system error has occurred.
635 result SetTextSize(int size);
638 * Sets the text size.
642 * @return An error code
643 * @param[in] size The text size
644 * @exception E_SUCCESS The method is successful.
645 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
646 * The specified @c size cannot be a negative integer.
647 * @exception E_SYSTEM A system error has occurred.
648 * @see GetTextSizeF()
650 result SetTextSize(float size);
653 * Gets the color of %EditArea for the specified status.
657 * @return The color, @n
658 * else RGBA (0,0,0,0) if an error occurs
659 * @param[in] status The status
660 * @exception E_SUCCESS The method is successful.
661 * @exception E_SYSTEM A system error has occurred.
662 * @remarks The specific error code can be accessed using the GetLastResult() method.
664 Tizen::Graphics::Color GetColor(EditStatus status) const;
667 * Gets the text color of the specified text color type.
671 * @return The color, @n
672 * else RGBA (0,0,0,0) if an error occurs
673 * @param[in] type The text color type
674 * @exception E_SUCCESS The method is successful.
675 * @exception E_SYSTEM A system error has occurred.
676 * @remarks The specific error code can be accessed using the GetLastResult() method.
677 * @see SetTextColor()
679 Tizen::Graphics::Color GetTextColor(EditTextColor type) const;
682 * Sets the background bitmap of the %EditArea control for the specified status.
686 * @return An error code
687 * @param[in] status The status
688 * @param[in] bitmap The background bitmap
689 * @exception E_SUCCESS The method is successful.
690 * @exception E_SYSTEM A system error has occurred.
692 result SetBackgroundBitmap(EditStatus status, const Tizen::Graphics::Bitmap& bitmap);
695 * Sets the color of the %EditArea control for the specified status.
699 * @return An error code
700 * @param[in] status The status
701 * @param[in] color The color
702 * @exception E_SUCCESS The method is successful.
703 * @exception E_SYSTEM A system error has occurred.
706 result SetColor(EditStatus status, const Tizen::Graphics::Color& color);
709 * Sets the text color of the %EditArea control for the specified text color type.
713 * @return An error code
714 * @param[in] type The text color type
715 * @param[in] color The text color
716 * @exception E_SUCCESS The method is successful.
717 * @exception E_SYSTEM A system error has occurred.
718 * @see GetTextColor()
720 result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color);
723 * Gets a portion of text that is displayed by the %EditArea control.
727 * @return The specified portion of the text, @n
728 * else an empty string if an error occurs
729 * @param[in] start The starting index of the range
730 * @param[in] end The last index of the range
731 * @exception E_SUCCESS The method is successful.
732 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
733 * The index is greater than the number of elements or less than @c 0.
734 * @exception E_SYSTEM A system error has occurred.
735 * @remarks The specific error code can be accessed using the GetLastResult()() method.
738 Tizen::Base::String GetText(int start, int end) const;
741 * Adds the specified keypad event listener. @n
742 * The added listener is notified when the keypad associated with the %EditArea control is opened or closed.
746 * @param[in] listener The event listener to add
747 * @see RemoveKeypadEventListener()
749 void AddKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
752 * Removes the specified keypad event listener. @n
753 * The removed listener cannot listen to events when they are fired.
757 * @param[in] listener The event listener to remove
758 * @see AddKeypadEventListener()
760 void RemoveKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
763 * Adds a text block event listener.
764 * The added listener is notified when the text block is selected.
768 * @param[in] listener The event listener to add
769 * @remarks Programmatically modifying the text block does not cause the text block selection event to fire.
770 * @see RemoveTextBlockEventListener()
772 void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
775 * Removes the specified text block event listener. @n
776 * The removed listener cannot listen to events when they are fired.
780 * @param[in] listener The event listener to remove
781 * @see AddTextBlockEventListener()
783 void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
786 * Adds a listener instance. @n
787 * The added listener can listen to the text related events.
791 * @param[in] listener The listener to add
792 * @see RemoveTextEventListener()
794 void AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
797 * Removes a listener instance. @n
798 * The removed listener cannot listen to events when they are fired.
802 * @param[in] listener The listener to remove
803 * @see AddTextEventListener()
805 void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
808 * Adds a listener instance to listen to the scroll panel events.
812 * @param[in] listener The listener to add
813 * @remarks To listen to scroll panel events, the parent of the %EditArea control must be an instance of ScrollPanel. @n
814 * When OnOverlayControlCreated() or OnOvelayControlClosed() is called, the application resets the bounds of the controls placed
815 * within the %ScrollPanel. %ScrollPanel is automatically redrawn after this method is called.
816 * @see RemoveScrollPanelEventListener()
818 void AddScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
821 * Removes the scroll panel event listener. @n
822 * The removed listener cannot listen to events when they are fired.
826 * @param[in] listener The listener to remove
827 * @see AddScrollPanelEventListener()
829 void RemoveScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
832 * Adds a listener instance. @n
833 * The added listener is notified when the action event is fire by the command buttons of the keypad.
837 * @param[in] listener The event listener to add
838 * @see RemoveActionEventListener()
840 void AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
844 * Removes a listener instance. @n
845 * The removed listener cannot listen to events when they are fired.
849 * @param[in] listener The event listener to remove
850 * @see AddActionEventListener()
852 void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
855 * Adds a listener instance for language events. @n
856 * The added listener is notified when the input language is changed.
860 * @param[in] listener The listener to add
861 * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener.
862 * @see RemoveLanguageEventListener()
864 void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
867 * Removes the specified listener instance. @n
868 * The removed listener cannot listen to events when they are fired.
872 * @param[in] listener The listener to remove
873 * @see AddLanguageEventListener()
875 void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
878 * Gets the remaining length of the %EditArea control.
882 * @return The remaining length of the %EditArea control, @n
883 * else @c -1 if an error occurs.
885 int GetRemainingLength(void) const;
888 * Enables or disables the lowercase mode.
892 * @param[in] enable Set to @c true to enable the lowercase mode, @n
895 void SetLowerCaseModeEnabled(bool enable);
898 * Checks whether the lowercase mode is enabled.
902 * @return @c true if the lowercase mode is enabled, @n
905 bool IsLowerCaseModeEnabled(void) const;
909 * Sets the input mode category.
911 * @brief <i> [Deprecated] </i>
912 * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
913 * or the current mode to initially set the keypad to, from this list. It is recommended to use SetKeypadStyle() method instead.
916 * @return An error code
917 * @param[in] categories The categories to set @n
918 * Multiple input categories can be combined using bitwise OR (see Tizen::Ui::Controls::EditInputModeCategory).
919 * @param[in] enable The category value to set
920 * @exception E_SUCCESS The method is successful.
921 * @exception E_INVALID_ARG A specified input mode category is invalid.
922 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n
923 * The specified @c categories cannot be supported with the current keypad style.
924 * @exception E_SYSTEM A system error has occurred.
927 result SetInputModeCategory(unsigned long categories, bool enable);
931 * Sets the current input mode category.
933 * @brief <i> [Deprecated] </i>
934 * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
935 * or the current mode to initially set the keypad to, from this list. It is recommended to use SetKeypadStyle() method instead.
938 * @return An error code
939 * @param[in] inputModeCategory An item of input category
940 * @exception E_SUCCESS The method is successful.
941 * @exception E_SYSTEM A system error has occurred.
944 result SetCurrentInputModeCategory(EditInputModeCategory inputModeCategory);
948 * Gets the input mode category.
950 * @brief <i> [Deprecated] </i>
951 * @deprecated This method is deprecated because we no longer provide a method to specify the list of styles @n
952 * which the user can set the keypad to. It is recommended to use GetKeypadStyle() method instead.
955 * @return A bitwise combination of Tizen::Ui::Controls::EditInputModeCategory, @n
956 * else @c 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 @n
967 * which the user can set the keypad to. It is recommended to use GetKeypadStyle() method instead.
970 * @return The current input mode category
973 EditInputModeCategory GetCurrentInputModeCategory(void) const;
976 * Sets the cursor at the specified position.
980 * @return An error code
981 * @param[in] position The cursor position to set
982 * @exception E_SUCCESS The method is successful.
983 * @exception E_OUT_OF_RANGE The specified @c position is less than @c 0 or greater than the maximum length.
984 * @exception E_SYSTEM A system error has occurred.
986 result SetCursorPosition(int position);
989 * Gets the cursor position.
993 * @return The current cursor position, @n
994 * else @c -1 if an error occurs
996 int GetCursorPosition(void) const;
999 * Gets the text that is displayed by the %EditArea control.
1003 * @return The text of the %EditArea control, @n
1004 * else an empty string if an error occurs
1006 Tizen::Base::String GetText(void) const;
1009 * Gets the length of the text that is displayed by the %EditArea control.
1013 * @return The length of the text, @n
1014 * else @c -1 if an error occurs
1016 int GetTextLength(void) const;
1019 * Sets the text of the %EditArea control.
1023 * @param[in] text The text to display by the %EditArea control
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.
1028 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
1030 result SetText(const Tizen::Base::String& text);
1033 * Inserts the specified text at the current cursor position.
1037 * @return An error code
1038 * @param[in] text The text to insert
1039 * @exception E_SUCCESS The method is successful.
1040 * @exception E_SYSTEM A system error has occurred.
1041 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.@n
1043 result InsertTextAtCursorPosition(const Tizen::Base::String& text);
1046 * Appends the specified text at the end of the existing text.
1050 * @return An error code
1051 * @param[in] text The text to append
1052 * @exception E_SUCCESS The method is successful.
1053 * @exception E_SYSTEM A system error has occurred.
1054 * @remarks Use @htmlonly '\n' @endhtmlonly to denote the end of the line.@n
1056 result AppendText(const Tizen::Base::String& text);
1059 * Appends the specified character at the end of the existing text.
1063 * @return An error code
1064 * @param[in] character The character to append
1065 * @exception E_SUCCESS The method is successful.
1066 * @exception E_SYSTEM A system error has occurred.
1067 * @remarks The method modifies the text buffer that is managed by the %EditArea control. To display the
1068 * changes, the control must be drawn again.
1070 result AppendCharacter(const Tizen::Base::Character& character);
1073 * Inserts the text that will be displayed by bitmap at the specified text position.
1077 * @return An error code
1078 * @param[in] position The position to insert the text
1079 * @param[in] text The text to insert
1080 * @param[in] textImage The alternate bitmap to draw
1081 * @exception E_SUCCESS The method is successful.
1082 * @exception E_OUT_OF_RANGE The specified @c position is outside the valid range. @n
1083 * Either the specified @c position is greater than the number of existing text in the %EditArea or less than @c 0.
1084 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by %EditArea.
1085 * @remarks The method modifies the text buffer that is managed by the %EditArea control. @n
1086 * To display the changes, the control must be drawn again. The text to be inserted will be displayed by @c textImage.
1088 result InsertTextAt(int position, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& textImage);
1091 * Appends the text that will be displayed by bitmap at the end of the existing text.
1095 * @return An error code
1096 * @param[in] text The text to append
1097 * @param[in] textImage The alternate bitmap to draw
1098 * @exception E_SUCCESS The method is successful.
1099 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by %EditArea.
1100 * @remarks The method modifies the text buffer that is managed by the %EditArea control. @n
1101 * To display the changes, the control must be drawn again. The text to be appended will be displayed by @c textImage.
1103 result AppendText(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& textImage);
1106 * Clears the text that is displayed by the %EditArea control.
1110 * @return An error code
1111 * @exception E_SUCCESS The method is successful.
1112 * @exception E_SYSTEM A system error has occurred.
1113 * @remarks The method modifies the text buffer that is managed by the %EditArea control. To display the
1114 * changes, the control must be drawn again.
1119 * Deletes a character at the current cursor position.
1123 * @return An error code
1124 * @exception E_SUCCESS The method is successful.
1125 * @exception E_SYSTEM A system error has occurred.
1126 * @remarks The method modifies the text buffer that is managed by the %EditArea control. To display the
1127 * changes, the control must be drawn again.
1129 result DeleteCharacterAtCursorPosition(void);
1132 * Gets the range of the current text block.
1136 * @param[out] start The first index of the current text block
1137 * @param[out] end The last index of the current text block
1139 void GetCurrentTextRange(int& start, int& end) const;
1142 * Displays the guide text when there is no text in the %EditArea control.
1146 * @param[in] guideText The guide text
1147 * @remarks This is the default text that is displayed in the %EditArea control when the focus is given to it.
1149 void SetGuideText(const Tizen::Base::String& guideText);
1152 * Gets the guide text.
1156 * @return The guide text, @n
1157 * else an empty string if an error occurs
1158 * @exception E_SUCCESS The method is successful.
1159 * @exception E_SYSTEM A system error has occurred.
1160 * @remarks The specific error code can be accessed using the GetLastResult() method.
1161 * @see SetGuideText()
1163 Tizen::Base::String GetGuideText(void) const;
1166 * Gets the text color of the guide text.
1170 * @return The guide text color
1171 * @exception E_SUCCESS The method is successful.
1172 * @exception E_SYSTEM A system error has occurred.
1173 * @remarks The specific error code can be accessed using the GetLastResult() method.
1174 * @see SetGuideTextColor()
1176 Tizen::Graphics::Color GetGuideTextColor(void) const;
1179 * Sets the text color of the guide text.
1183 * @return An error code
1184 * @param[in] color The guide text color
1185 * @exception E_SUCCESS The method is successful.
1186 * @exception E_SYSTEM A system error has occurred.
1187 * @see GetGuideTextColor()
1189 result SetGuideTextColor(const Tizen::Graphics::Color& color);
1192 * Enables or disables the keypad.
1196 * @param[in] enable Set to @c true to enable the keypad, @n
1199 void SetKeypadEnabled(bool enable);
1202 * Checks whether the keypad is enabled.
1206 * @return @c true if the keypad is enabled, @n
1209 bool IsKeypadEnabled(void) const;
1216 * @return An error code
1217 * @exception E_SUCCESS The method is successful.
1218 * @exception E_INVALID_STATE This instance is in an invalid state.
1219 * @exception E_SYSTEM A system error has occurred.
1220 * @remarks This method is supported only when the input style is INPUT_STYLE_OVERLAY.
1222 result ShowKeypad(void);
1225 * Gets the line count.
1229 * @return The line count
1231 int GetTextLineCount(void) const;
1234 * Gets the range of the current text block.
1238 * @param[out] start The starting index of the current text block
1239 * @param[out] end The end index of the current text block
1241 void GetBlockRange(int& start, int& end) const;
1244 * Begins the text block from the current cursor position.
1248 * @return An error code
1249 * @exception E_SUCCESS The method is successful.
1250 * @exception E_SYSTEM A system error has occurred.
1251 * @remarks Move the cursor position to the end of the text block.
1252 * @see SetCursorPosition()
1253 * @see ReleaseBlock()
1256 result BeginBlock(void);
1259 * Releases the text block.
1263 * @return An error code
1264 * @exception E_SUCCESS The method is successful.
1265 * @exception E_SYSTEM A system error has occurred.
1269 result ReleaseBlock(void);
1272 * Checks whether a portion of the text is blocked.
1276 * @return @c true if the text is blocked, @n
1279 * @see ReleaseBlock()
1281 bool IsBlocked(void) const;
1284 * Copies the text block to the clipboard.
1288 * @return An error code
1289 * @exception E_SUCCESS The method is successful.
1290 * @exception E_SYSTEM A system error has occurred.
1291 * @see Cut(), Paste(), Remove()
1296 * Cuts the text block and copies it to the clipboard.
1300 * @return An error code
1301 * @exception E_SUCCESS The method is successful.
1302 * @exception E_SYSTEM A system error has occurred.
1303 * @see Copy(), Remove(), Paste()
1308 * Pastes the copied text at the cursor position.
1312 * @return An error code
1313 * @exception E_SUCCESS The method is successful.
1314 * @exception E_SYSTEM A system error has occurred.
1315 * @see Copy(), Cut(), Remove()
1320 * Removes the text that is marked by the text block.
1324 * @return An error code
1325 * @exception E_SUCCESS The method is successful.
1326 * @exception E_SYSTEM A system error has occurred.
1327 * @see Copy(), Cut(), Paste()
1329 result Remove(void);
1332 * Checks whether the text in the %EditArea control has been clipped.
1336 * @return @c true if the text has been clipped, @n
1338 * @remarks 'Clipped' means that the text has been copied to the clipboard.
1339 * @see Copy(), Cut(), Paste(), Remove()
1341 bool IsClipped(void) const;
1344 * Sets the command button properties of the keypad.
1348 * @return An error code
1349 * @param[in] position The position of the command button
1350 * @param[in] text The label of the command button
1351 * @param[in] actionId The action ID
1352 * @exception E_SUCCESS The method is successful.
1353 * @exception E_SYSTEM A system error has occurred.
1354 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
1356 result SetOverlayKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId);
1359 * Gets the text of the specified command button.
1363 * @return The text of the specified command button
1364 * @param[in] position The position of the command button
1365 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
1367 Tizen::Base::String GetOverlayKeypadCommandButtonText(CommandButtonPosition position) const;
1370 * Gets the action ID of the specified command button.
1374 * @return The action ID of the specified command button
1375 * @param[in] position The position of the command button
1376 * @remarks This method is supported when the input style is @c INPUT_STYLE_OVERLAY.
1378 int GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const;
1381 * Sets the input language.
1385 * @return An error code
1386 * @param[in] languageCode The language to set
1387 * @exception E_SUCCESS The method is successful.
1388 * @exception E_OUT_OF_MEMORY The memory is insufficient.
1389 * @remarks The application can set the language of the current keypad that is associated with the current %EditArea. @n
1390 * This method only works if the language to set is supported by the current preloaded keypad.
1392 result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
1395 * Gets the current input language.
1399 * @return An error code
1400 * @param[out] language The current input language
1401 * @exception E_SUCCESS The method is successful.
1402 * @remarks The application can get the current language of the keypad that is associated with the current %EditArea.
1404 result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
1407 * Sets the text filter.
1411 * @param[in] pFilter The filter
1412 * @remarks The %EditArea control checks with the registered filter to decide whether the user-entered text should be replaced.
1414 void SetEditTextFilter(IEditTextFilter* pFilter);
1417 * Sends opaque command to the input method.
1421 * @param[in] command The opaque command
1422 * @remarks This method can be used to provide domain-specific features that are only known between certain input methods and their clients.
1423 * This method may not work, depending on the active Input Method.
1425 void SendOpaqueCommand (const Tizen::Base::String& command);
1428 friend class _EditAreaImpl;
1431 EditArea(const EditArea&);
1432 EditArea& operator =(const EditArea&);
1435 }}} // Tizen::Ui::Controls
1437 #endif // _FUI_CTRL_EDIT_AREA_H_