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 FUiCtrlExpandableEditArea.h
20 * @brief This is the header file for the %ExpandableEditArea class.
22 * This header file contains the declarations of the %ExpandableEditArea class.
25 #ifndef _FUI_CTRL_EXPANDABLE_EDIT_AREA_H_
26 #define _FUI_CTRL_EXPANDABLE_EDIT_AREA_H_
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FBaseTypes.h>
31 #include <FUiControl.h>
32 #include <FUiCtrlEditTypes.h>
33 #include <FUiCtrlITokenFilter.h>
34 #include <FUiIKeypadEventListener.h>
35 #include <FUiILanguageEventListener.h>
36 #include <FUiITextBlockEventListener.h>
37 #include <FUiITextEventListener.h>
39 // Forward declaration
40 namespace Tizen { namespace Graphics
45 namespace Tizen { namespace Ui { namespace Controls
48 class IExpandableEditAreaEventListener;
51 * @enum ExpandableEditAreaStyle
53 * Defines the possible styles of the expandable edit area.
57 enum ExpandableEditAreaStyle
59 EXPANDABLE_EDIT_AREA_STYLE_NORMAL, /**< The normal expandable edit area */
60 EXPANDABLE_EDIT_AREA_STYLE_TOKEN /**< The token expandable edit area */
65 * @enum ExpandableEditAreaTitleStyle
67 * Defines the possible styles of the expandable edit area title.
71 enum ExpandableEditAreaTitleStyle
73 EXPANDABLE_EDIT_AREA_TITLE_STYLE_NONE = 0, /**< The style with no title */
74 EXPANDABLE_EDIT_AREA_TITLE_STYLE_INNER, /**< The title appears as a right aligned text inside the edit text field */
75 EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP /**< The title appears at the top of the edit text field */
80 * @enum ExpandableEditAreaTokenStatus
82 * Defines the possible status of the expandable edit area tokens.
86 enum ExpandableEditAreaTokenStatus
88 EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL = 0, /**< The normal status */
89 EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED /**< The selected status */
94 * @class ExpandableEditArea
95 * @brief This class is an implementation of %ExpandableEditArea.
99 * The %ExpandableEditArea class displays a multi-line text editor the height of that is automatically adjusted according to the number of lines currently visible in the text box.
101 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_exp_editarea.htm">ExpandableEditArea</a>.
103 * The following sample code demonstrates how to use the %ExpandableEditArea class.
106 // Sample code for ExpandableEditAreaSample.h
109 class ExpandableEditAreaSample
110 : public Tizen::Ui::Controls::Form
111 , public Tizen::Ui::IKeypadEventListener
112 , public Tizen::Ui::Controls::IExpandableEditAreaEventListener
115 ExpandableEditAreaSample(void)
116 : __pExpandableEdit(null){}
118 bool Initialize(void);
119 virtual result OnInitializing(void);
121 //IKeypadEventListener
122 virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
123 virtual void OnKeypadClosed(Tizen::Ui::Control& source);
124 virtual void OnKeypadOpened(Tizen::Ui::Control& source);
125 virtual void OnKeypadWillOpen(Tizen::Ui::Control& source);
127 //IExpandableEditAreaEventListener
128 virtual void OnExpandableEditAreaLineAdded(Tizen::Ui::Controls::ExpandableEditArea& source, int newLineCount);
129 virtual void OnExpandableEditAreaLineRemoved(Tizen::Ui::Controls::ExpandableEditArea& source, int newLineCount);
132 Tizen::Ui::Controls::ExpandableEditArea* __pExpandableEdit;
135 // Sample code for ExpandableEditAreaSample.cpp
136 #include <FGraphics.h>
138 #include "ExpandableEditAreaSample.h"
140 using namespace Tizen::Graphics;;
141 using namespace Tizen::Ui;
142 using namespace Tizen::Ui::Controls;
145 ExpandableEditAreaSample::Initialize(void)
147 Construct(FORM_STYLE_NORMAL);
152 ExpandableEditAreaSample::OnInitializing(void)
154 result r = E_SUCCESS;
156 __pExpandableEdit = new ExpandableEditArea();
157 __pExpandableEdit->Construct(Rectangle(25, 100, GetClientAreaBounds().width - 50, 150),
158 EXPANDABLE_EDIT_AREA_STYLE_NORMAL, EXPANDABLE_EDIT_AREA_TITLE_STYLE_NONE, 5);
160 // Adds an instace of IKeypadEventListenerevent and an instance of IExpandableEditAreaEventListener
161 __pExpandableEdit->AddKeypadEventListener(*this);
162 __pExpandableEdit->AddExpandableEditAreaEventListener(*this);
164 AddControl(*__pExpandableEdit);
166 // Sets a focus to the expandable edit area
167 __pExpandableEdit->SetFocus();
172 // IKeypadEventListener implementation
174 ExpandableEditAreaSample::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction)
180 ExpandableEditAreaSample::OnKeypadClosed(Tizen::Ui::Control& source)
186 ExpandableEditAreaSample::OnKeypadOpened(Tizen::Ui::Control& source)
192 ExpandableEditAreaSample::OnKeypadWillOpen(Tizen::Ui::Control& source)
197 // IExpandableEditAreaEventListener implementation
199 ExpandableEditAreaSample::OnExpandableEditAreaLineAdded(Tizen::Ui::Controls::ExpandableEditArea& source, int newLineCount)
205 ExpandableEditAreaSample::OnExpandableEditAreaLineRemoved(Tizen::Ui::Controls::ExpandableEditArea& source, int newLineCount)
211 class _OSP_EXPORT_ ExpandableEditArea
212 : public Tizen::Ui::Control
216 * 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.
220 ExpandableEditArea(void);
223 * 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.
227 virtual ~ExpandableEditArea(void);
230 * Initializes this instance of %ExpandableEditArea with the specified parameters.
234 * @return An error code
235 * @param[in] rect An instance of the Graphics::Rectangle class @n
236 * This instance represents the x and y coordinates of the top-left corner of the expandable edit area along with
237 * the width and height.
238 * @param[in] style The style of the expandable edit area
239 * @param[in] titleStyle The title style
240 * @param[in] maxExpandableLines The maximum number of lines to which the control can be expanded.
241 * @exception E_SUCCESS The method is successful.
242 * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n
243 * The token style %ExpandabledEditArea does not support EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP.
244 * @exception E_MAX_EXCEEDED The number of lines has exceeded the maximum limit.
245 * @exception E_INVALID_ARG A specified input parameter is invalid, or @n
246 * the specified @c maxLines is either negative or @c 0.
247 * @exception E_SYSTEM A system error has occurred.
248 * @remarks By default, the line count is @c 1.
250 result Construct(const Tizen::Graphics::Rectangle& rect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle, int maxExpandableLines = 10);
254 * Appends the specified character at the end of the existing text.
258 * @return An error code
259 * @param[in] character The character to be appended
260 * @exception E_SUCCESS The method is successful.
261 * @exception E_MAX_EXCEEDED The number of items has exceeded the maximum limit. @n
262 * The number of characters has exceeded the maximum limit.
263 * @exception E_SYSTEM A system error has occurred.
264 * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n
265 * To display the changes, the control must be drawn again.
267 result AppendCharacter(const Tizen::Base::Character& character);
270 * Appends the specified text at the end of the existing text.
274 * @return An error code
275 * @param[in] text The text to be appended
276 * @exception E_SUCCESS The method is successful.
277 * @exception E_MAX_EXCEEDED The number of items has exceeded the maximum limit @n
278 * The number of characters has exceeded the maximum limit.
279 * @exception E_SYSTEM A system error has occurred.
280 * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n
281 * To display the changes, the control must be drawn again.
283 result AppendText(const Tizen::Base::String& text);
286 * Appends the text that will be displayed by bitmap at the end of the existing text.
290 * @return An error code
291 * @param[in] text The text to be appended @n
292 * It will be displayed by the @c textImage
293 * @param[in] textImage The alternate bitmap to be displayed
294 * @exception E_SUCCESS The method is successful.
295 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by % ExpanableEditArea.
296 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
297 * The operation is not supported if the style is EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
298 * @remarks The method modifies the text buffer that is managed by the %ExpanableEditArea control. @n
299 * To display the changes, the control must be drawn again. The text to be appended will be displayed by the @c textImage.
301 result AppendText(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& textImage);
304 * Deletes the character present at the current cursor position.
308 * @return An error code
309 * @param[in] index The index
310 * @exception E_SUCCESS The method is successful.
311 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
312 * The specified @c index is negative.
313 * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n
314 * Either the specified @c index is greater than the number of elements or less than @c 0.
315 * @exception E_SYSTEM A system error has occurred.
316 * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n
317 * To display the changes, the control must be drawn again.
319 result DeleteCharacterAt(int index);
322 * Inserts a character at the specified index.
326 * @return An error code
327 * @param[in] index The position to insert the character
328 * @param[in] character The character to be inserted
329 * @exception E_SUCCESS The method is successful.
330 * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n
331 * Either the specified @c index is greater than the number of elements or less than @c 0.
332 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds system limitations.
333 * @exception E_SYSTEM A system error has occurred.
334 * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n
335 * To display the changes, the control must be drawn again.
337 result InsertCharacterAt(int index, const Tizen::Base::Character& character);
340 * Inserts the text at the specified index.
344 * @return An error code
345 * @param[in] index The position to insert the text
346 * @param[in] text The text to be inserted
347 * @exception E_SUCCESS The method is successful.
348 * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n
349 * Either the specified @c index is greater than the number of elements or less than @c 0.
350 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds system limitations.
351 * @exception E_SYSTEM A system error has occurred.
353 result InsertTextAt(int index, const Tizen::Base::String& text);
356 * Inserts the text that will be displayed by bitmap at the specified text position.
360 * @return An error code
361 * @param[in] position The position to insert the text
362 * @param[in] text The text to be inserted @n
363 * It will be displayed by the @c textImage
364 * @param[in] textImage The alternate bitmap to be displayed
365 * @exception E_SUCCESS The method is successful.
366 * @exception E_OUT_OF_RANGE The specified @c position is outside the valid range. @n
367 * Either the specified @c position is greater than the number of existing text in the % ExpanableEditArea or less than @c 0.
368 * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by % ExpanableEditArea.
369 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
370 * The operation is not supported if the style is EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
371 * @remarks The method modifies the text buffer that is managed by the %ExpanableEditArea control. @n
372 * To display the changes, the control must be drawn again. The text to be inserted will be displayed by the @c textImage.
374 result InsertTextAt(int position, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& textImage);
377 * Gets the portion of the text that is displayed by the %ExpandableEditArea control.
381 * @return The specified portion of the text, @n
382 * else an empty string if an error occurs
383 * @param[in] start The starting index of the range
384 * @param[in] end The last index of the range
385 * @exception E_SUCCESS The method is successful.
386 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
387 * The specified @c start or @c end is greater than the number of elements or less than @c 0.
388 * @exception E_SYSTEM A system error has occurred.
389 * @remarks The specific error code can be accessed using the GetLastResult() method.
393 Tizen::Base::String GetText(int start, int end) const;
396 * Gets the text of the %ExpandableEditArea control.
400 * @return The text of the %ExpandableEditArea control, @n
401 * else an empty string if an error occurs
402 * @exception E_SUCCESS The method is successful.
403 * @exception E_SYSTEM A system error has occurred.
404 * @remarks The specific error code can be accessed using the GetLastResult() method.
406 Tizen::Base::String GetText(void) const;
409 * Gets the text length.
413 * @return The length of the text, @n
414 * else @c -1 if an error occurs
415 * @exception E_SUCCESS The method is successful.
416 * @exception E_SYSTEM A system error has occurred.
417 * @remarks The specific error code can be accessed using the GetLastResult() method.
419 int GetTextLength(void) const;
422 * Sets the text to be displayed by the %ExpandableEditArea control.
426 * @param[in] text The text to be set
427 * @exception E_SUCCESS The method is successful.
428 * @exception E_INVALID_ARG The specified input parameter is invalid, @n
429 * or the length of the specified @c text exceeds system limitations.
430 * @exception E_SYSTEM A system error has occurred.
431 * @remarks To denote the end of a line use '\\n'.
432 * The method modifies the text buffer that is managed by the %ExpandableEditArea control.
433 * To display the changes, the control must be drawn again.
435 result SetText(const Tizen::Base::String& text);
438 * Clears the text that is displayed by the %ExpandableEditArea control.
442 * @return An error code
443 * @exception E_SUCCESS The method is successful.
444 * @exception E_SYSTEM A system error has occurred.
445 * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control.
446 * To display the changes, the control must be drawn again.
451 * Sets the title of the %ExpandableEditArea control.
455 * @return An error code
456 * @param[in] title The title to be set
457 * @exception E_SUCCESS The method is successful.
458 * @exception E_SYSTEM A system error has occurred.
460 result SetTitleText(const Tizen::Base::String& title);
463 * Gets the title of the %ExpandableEditArea control.
467 * @return The title text of the entered string, @n
468 * else empty string if an error occurs
469 * @exception E_SUCCESS The method is successful.
470 * @exception E_SYSTEM A system error has occurred.
471 * @remarks The specific error code can be accessed using the GetLastResult() method.
473 Tizen::Base::String GetTitleText(void) const;
477 * Gets the guide text.
481 * @return The guide text, @n
482 * else an empty string if an error occurs
483 * @exception E_SUCCESS The method is successful.
484 * @exception E_SYSTEM A system error has occurred.
485 * @remarks The specific error code can be accessed using the GetLastResult() method.
486 * @see SetGuideText()
488 Tizen::Base::String GetGuideText(void) const;
491 * Sets the guide text to be displayed, when there is no data in the search field.
495 * @return An error code
496 * @param[in] guideText The guide text
497 * @exception E_SUCCESS The method is successful.
498 * @exception E_SYSTEM A system error has occurred.
499 * @see GetGuideText()
501 result SetGuideText(const Tizen::Base::String& guideText);
505 * Gets the maximum line count supported by the flexible text edit.
509 * @return The maximum line count, @n
510 * else @c -1 if an error occurs
511 * @exception E_SUCCESS The method is successful.
512 * @exception E_SYSTEM A system error has occurred.
513 * @remarks The specific error code can be accessed using the GetLastResult() method.
515 int GetMaxLineCount(void) const;
518 * Gets the line spacing.
521 * @return The line spacing, @n
522 * else @c -1 if an error occurs
523 * @see SetLineSpacing ()
525 int GetLineSpacing (void) const;
528 * Sets the line spacing. @n
529 * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra.
532 * The line spacing = (default line spacing) * multiplier + extra
536 * @return An error code
537 * @param[in] multiplier The line spacing multiplier
538 * @param[in] extra The extra line spacing
539 * @exception E_SUCCESS The method is successful.
540 * @exception E_INVALID_ARG This exception is returned when @c multiplier or @c extra is less than 0.
541 * @see GetLineSpacing ()
543 result SetLineSpacing (int multiplier, int extra);
546 * Gets the current line count.
550 * @return The line count of the text
551 * @exception E_SUCCESS The method is successful.
552 * @exception E_SYSTEM A system error has occurred.
553 * @remarks The specific error code can be accessed using the GetLastResult() method.
555 int GetTextLineCount(void) const;
559 * Gets the text size.
563 * @return The size of the text, @n
564 * else @c -1 if an error occurs
565 * @exception E_SUCCESS The method is successful.
566 * @exception E_SYSTEM A system error has occurred.
567 * @remarks The specific error code can be accessed using the GetLastResult() method.
570 int GetTextSize(void) const;
573 * Sets the text size.
577 * @return An error code
578 * @param[in] size The text size
579 * @exception E_SUCCESS The method is successful.
580 * @exception E_INVALID_ARG The specified @c size is invalid, @n
581 * or the specified @c size is a negative integer.
582 * @exception E_SYSTEM A system error has occurred.
585 result SetTextSize(int size);
589 * Gets the margin of the specified margin type.
593 * @return The margin value of the specified margin type, @n
594 * else @c -1 if an error occurs
595 * @param[in] marginType The margin type
596 * @exception E_SUCCESS The method is successful.
597 * @exception E_SYSTEM A system error has occurred.
598 * @remarks The specific error code can be accessed using the GetLastResult() method.
601 int GetMargin(EditMarginType marginType) const;
604 * Sets the margin for the specified margin type.
607 * @brief <i> [Compatibility] </i>
611 * @compatibility This method has compatibility issues with OSP compatible applications. @n
612 * For more information, see @ref CompSetMarginPage "here".
614 * @return An error code
615 * @param[in] marginType The margin type
616 * @param[in] margin The margin to be set
617 * @exception E_SUCCESS The method is successful.
618 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
619 * The specified @c margin cannot be negative integer.
620 * @exception E_SYSTEM A system error has occurred.
623 result SetMargin(EditMarginType marginType, int margin);
626 * @page CompSetMarginPage Compatibility for SetMargin()
627 * @section CompSetMarginPageIssueSection Issues
628 * Implementing this method in OSP compatible applications has the following issues: @n
629 * -# The SetMargin() method sets the margin value for ExpandableEditArea with only EXPANDABLE_EDIT_AREA_STYLE_NORMAL in API version 2.0. @n
631 * @section CompSetMarginPageSolutionSection Resolutions
632 * This issue has been resolved in Tizen. @n
638 * Enables or disables the lowercase mode.
642 * @return An error code
643 * @param[in] enable Set to @c true to enable the lowercase mode, @n
645 * @exception E_SUCCESS The method is successful.
646 * @exception E_SYSTEM A system error has occurred.
647 * @remarks When the lowercase mode is enabled, the text input starts with a lowercase character.
648 * @see IsLowerCaseModeEnabled()
650 result SetLowerCaseModeEnabled(bool enable);
653 * Checks whether the lowercase mode is enabled.
657 * @return @c true if the lowercase mode is enabled, @n
659 * @exception E_SUCCESS The method is successful.
660 * @exception E_SYSTEM A system error has occurred.
661 * @remarks The specific error code can be accessed using the GetLastResult() method.
662 * @see SetLowerCaseModeEnabled()
664 bool IsLowerCaseModeEnabled(void) const;
668 * Gets the cursor position.
672 * @return The current cursor position, @n
673 * else @c -1 if an error occurs
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.
678 int GetCursorPosition(void) const;
681 * Sets the cursor at the specified position.
685 * @return An error code
686 * @param[in] position The cursor position to be set
687 * @exception E_SUCCESS The method is successful.
688 * @exception E_OUT_OF_RANGE The specified @c position is less than @c 0 or greater than the maximum length.
689 * @exception E_SYSTEM A system error has occurred.
691 result SetCursorPosition(int position);
695 * Gets the start and end indexes of the currently selected text block.
699 * @return An error code
700 * @param[out] start The start index of the text block
701 * @param[out] end The end index of the text block
702 * @exception E_SUCCESS The method is successful.
703 * @exception E_SYSTEM A system error has occurred.
704 * @remarks The method returns the start and end indexes as @c 0 if no text block is selected.
705 * @see ReleaseBlock()
706 * @see SetBlockRange()
708 result GetBlockRange(int& start, int& end) const;
711 * Releases the selection of the current text block.
715 * @return An error code
716 * @exception E_SUCCESS The method is successful.
717 * @exception E_SYSTEM A system error has occurred.
718 * @see GetBlockRange()
719 * @see SetBlockRange()
721 result ReleaseBlock(void);
724 * Removes the text content of the current text block.
728 * @return An error code
729 * @exception E_SUCCESS The method is successful.
730 * @exception E_OBJ_NOT_FOUND The specified instance is not found, @n
731 * or the text block is not selected.
732 * @exception E_SYSTEM A system error has occurred.
734 result RemoveTextBlock(void);
737 * Sets the block range for the text.
741 * @return An error code
742 * @param[in] start The start index of the text block
743 * @param[in] end The end index of the text block
744 * @exception E_SUCCESS The method is successful.
745 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
746 * Either the index is greater than the number of elements or less than @c 0.
747 * @exception E_SYSTEM A system error has occurred.
748 * @see ReleaseBlock()
749 * @see GetBlockRange()
751 result SetBlockRange(int start, int end);
755 * Gets the keypad action type.
759 * @return The keypad action
760 * @exception E_SUCCESS The method is successful.
761 * @exception E_SYSTEM A system error has occurred.
762 * @remarks The specific error code can be accessed using the GetLastResult() method.
763 * @see SetKeypadAction()
765 Tizen::Ui::KeypadAction GetKeypadAction(void) const;
768 * Gets the keypad style.
772 * @return The keypad style
773 * @exception E_SUCCESS The method is successful.
774 * @exception E_SYSTEM A system error has occurred.
775 * @remarks The specific error code can be accessed using the GetLastResult() method.
776 * @see SetKeypadStyle()
778 KeypadStyle GetKeypadStyle(void) const;
781 * Hides the keypad associated with the %ExpandableEditArea control.
785 * @return An error code
786 * @exception E_SUCCESS The method is successful.
787 * @exception E_SYSTEM A system error has occurred.
790 result HideKeypad(void);
793 * Checks whether the keypad is enabled.
797 * @return @c true if the keypad is enabled, @n
799 * @exception E_SUCCESS The method is successful.
800 * @exception E_SYSTEM A system error has occurred.
801 * @remarks The specific error code can be accessed using the GetLastResult() method.
802 * @see SetKeypadEnabled()
804 bool IsKeypadEnabled(void) const;
807 * Sets the keypad action type.
811 * @return An error code
812 * @param[in] keypadAction The keypad action
813 * @exception E_SUCCESS The method is successful.
814 * @exception E_SYSTEM A system error has occurred.
815 * @remarks Depending on the value of @c keypadAction, the enter key label of the keypad will change accordingly.
816 * @see GetKeypadAction()
818 result SetKeypadAction(Tizen::Ui::KeypadAction keypadAction);
821 * Sets the keypad style.
825 * @return An error code
826 * @param[in] keypadStyle The keypad style
827 * @exception E_SUCCESS The method is successful.
828 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
829 * The specified @c keypadStyle is KEYPAD_STYLE_PASSWORD.
830 * @exception E_SYSTEM A system error has occurred.
831 * @remarks Depending on the value of the keypad style, the layout of the keypad will change accordingly.
832 * @see GetKeypadStyle()
834 result SetKeypadStyle(KeypadStyle keypadStyle);
837 * Checks whether the text prediction is enabled.
840 * @return @c true if the text prediction is enabled, @n
842 * @see SetTextPredictionEnabled()
844 bool IsTextPredictionEnabled(void) const;
847 * Enables or disables the text prediction.
850 * @param[in] enable Set to @c true to enable the text prediction, @n
852 * @return An error code
853 * @exception E_SUCCESS The method is successful.
854 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
855 * @see IsTextPredictionEnabled()
857 result SetTextPredictionEnabled(bool enable);
860 * Enables or disables the keypad.
864 * @return An error code
865 * @param[in] enable Set to @c true to enable the virtual keypad, @n
867 * @exception E_SUCCESS The method is successful.
868 * @exception E_SYSTEM A system error has occurred.
869 * @see IsKeypadEnabled()
871 result SetKeypadEnabled(bool enable);
878 * @return An error code
879 * @exception E_SUCCESS The method is successful.
880 * @exception E_SYSTEM A system error has occurred.
883 result ShowKeypad(void);
887 * Sets the text token filter.
891 * @return An error code
892 * @param[in] pFilter The filter
893 * @exception E_SUCCESS The method is successful.
894 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
895 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
896 * @exception E_SYSTEM A system error has occurred.
897 * @remarks The %ExpandableEditArea control checks with the registered filter to decide whether the user-entered text should be replaced.
899 result SetTokenFilter(const ITokenFilter* pFilter);
902 * Gets the text token filter.
906 * @return The filter, @n
907 * else @c null if an error occurs
908 * @exception E_SUCCESS The method is successful.
909 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
910 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
911 * @exception E_SYSTEM A system error has occurred.
912 * @remarks The specific error code can be accessed using the GetLastResult() method.
914 ITokenFilter* GetTokenFilter(void) const;
917 * Appends the specified token.
921 * @return An error code
922 * @param[in] token The token to be appended
923 * @exception E_SUCCESS The method is successful.
924 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
925 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
926 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
927 * The length of the specified @c token is @c 0.
928 * @exception E_SYSTEM A system error has occurred.
930 result AppendToken(const Tizen::Base::String& token);
933 * Inserts the token at the specified index.
937 * @return An error code
938 * @param[in] index The position to insert the token
939 * @param[in] token The token to be added
940 * @exception E_SUCCESS The method is successful.
941 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
942 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
943 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
944 * The length of the specified @c token is @c 0.
945 * @exception E_SYSTEM A system error has occurred.
947 result InsertTokenAt(int index, const Tizen::Base::String& token);
950 * Gets the token text at the specified index.
954 * @return The token text at the specified index, @n
955 * else an empty string if an error occurs
956 * @param[in] index The position to get the token
957 * @exception E_SUCCESS The method is successful.
958 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
959 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
960 * @exception E_OUT_OF_RANGE The specified index parameter is outside the bounds of the data structure. @n
961 * Either the index is greater than the number of elements or less than @c 0.
962 * @exception E_SYSTEM A system error has occurred.
963 * @remarks The specific error code can be accessed using the GetLastResult() method.
965 Tizen::Base::String GetTokenAt(int index) const;
968 * Gets the total token count.
972 * @return The total token count, @n
973 * else @c -1 if an error occurs
974 * @exception E_SUCCESS The method is successful.
975 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
976 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
977 * @exception E_SYSTEM A system error has occurred.
978 * @remarks The specific error code can be accessed using the GetLastResult() method.
980 int GetTokenCount(void) const;
983 * Gets the index of the token that is selected.
987 * @return The index of the selected token, @n
988 * else @c -1 if no token is selected or if an error occurs
989 * @exception E_SUCCESS The method is successful.
990 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
991 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
992 * @exception E_SYSTEM A system error has occurred.
993 * @remarks The specific error code can be accessed using the GetLastResult() method.
995 int GetSelectedTokenIndex(void) const;
998 * Checks whether the token editing mode is enabled.
1002 * @return @c true if the editing mode is enabled, @n
1004 * @exception E_SUCCESS The method is successful.
1005 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1006 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1007 * @exception E_SYSTEM A system error has occurred.
1008 * @remarks The specific error code can be accessed using the GetLastResult() method.
1010 bool IsTokenEditModeEnabled(void) const;
1013 * Removes the token at the specified index.
1017 * @return An error code
1018 * @param[in] index The index of the token to be removed
1019 * @exception E_SUCCESS The method is successful.
1020 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1021 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1022 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
1023 * Either the index is greater than the number of elements or less than @c 0.
1024 * @exception E_SYSTEM A system error has occurred.
1026 result RemoveTokenAt(int index);
1029 * Sets the selected state of the specified token.
1033 * @return An error code
1034 * @param[in] index The index of the token to select
1035 * @param[in] selected Set to @c true to select the specified token, @n
1036 * else @c false to unselect
1037 * @exception E_SUCCESS The method is successful.
1038 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1039 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1040 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
1041 * Either the index is greater than the number of elements or less than @c 0.
1042 * @exception E_SYSTEM A system error has occurred.
1043 * @remarks The currently selected token gets unselected automatically.
1045 result SetTokenSelected(int index, bool selected);
1048 * Enables or disables the token edit mode.
1052 * @return An error code
1053 * @param[in] enable Set to @c true to enable the token editing mode, @n
1055 * @exception E_SUCCESS The method is successful.
1056 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1057 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1058 * @exception E_SYSTEM A system error has occurred.
1060 result SetTokenEditModeEnabled(bool enable);
1064 * Gets the limit length.
1068 * @return The limit length, @n
1069 * else @c -1 if an error occurs
1070 * @exception E_SUCCESS The method is successful.
1071 * @exception E_SYSTEM A system error has occurred.
1072 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
1073 * The default limit length is @c 2048.
1074 * @see SetLimitLength()
1076 int GetLimitLength(void) const;
1079 * Sets the limit length.
1083 * @return An error code
1084 * @param[in] limitLength The limit text length to be set
1085 * @exception E_SUCCESS The method is successful.
1086 * @exception E_INVALID_ARG The specified input parameter is invalid, @n
1087 * or the specified limit length is @c 0 or negative.
1088 * @exception E_SYSTEM A system error has occurred.
1089 * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n
1090 * To display the changes, the control must be drawn again.
1091 * @see GetLimitLength()
1093 result SetLimitLength(int limitLength);
1097 * Gets the color of the %ExpandableEditArea control for the specified status.
1101 * @return The color, @n
1102 * else RGBA (0,0,0,0) if an error occurs
1103 * @param[in] status The status
1104 * @exception E_SUCCESS The method is successful.
1105 * @exception E_SYSTEM A system error has occurred.
1106 * @remarks The specific error code can be accessed using the GetLastResult() method.
1108 Tizen::Graphics::Color GetColor(EditStatus status) const;
1111 * Gets the text color of the specified text type.
1115 * @return The text color, @n
1116 * else RGBA (0,0,0,0) if an error occurs
1117 * @param[in] type The text type
1118 * @exception E_SUCCESS The method is successful.
1119 * @exception E_INVALID_ARG The specified type is not supported, or @n
1120 * the specified @c type is EDIT_TEXT_COLOR_LINK.
1121 * @exception E_SYSTEM A system error has occurred.
1122 * @remarks The specific error code can be accessed using the GetLastResult() method.
1123 * @see SetTextColor()
1125 Tizen::Graphics::Color GetTextColor(EditTextColor type) const;
1128 * Gets the text color of the guide text.
1132 * @return The guide text color, @n
1133 * else RGBA (0,0,0,0) if an error occurs
1134 * @exception E_SUCCESS The method is successful.
1135 * @exception E_SYSTEM A system error has occurred.
1136 * @remarks The specific error code can be accessed using the GetLastResult() method.
1137 * @see SetGuideTextColor()
1139 Tizen::Graphics::Color GetGuideTextColor(void) const;
1142 * Gets the text color of the title for the specified status.
1146 * @return The title text color, @n
1147 * else RGBA (0,0,0,0) if an error occurs
1148 * @param[in] status The state of the %ExpandableEditArea control
1149 * @exception E_SUCCESS The method is successful.
1150 * @exception E_SYSTEM A system error has occurred.
1151 * @remarks The specific error code can be accessed using the GetLastResult() method.
1152 * @see SetTitleTextColor()
1154 Tizen::Graphics::Color GetTitleTextColor(EditStatus status) const;
1157 * Gets the color of the tokens for the specified status.
1161 * @return The token color, @n
1162 * else RGBA (0,0,0,0) if an error occurs
1163 * @param[in] status The status
1164 * @exception E_SUCCESS The method is successful.
1165 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1166 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1167 * @exception E_SYSTEM A system error has occurred.
1168 * @remarks The specific error code can be accessed using the GetLastResult() method.
1169 * @see SetTokenColor
1171 Tizen::Graphics::Color GetTokenColor(ExpandableEditAreaTokenStatus status) const;
1174 * Gets the text color of tokens.
1178 * @return The text color, @n
1179 * else RGBA (0,0,0,0) if an error occurs
1180 * @exception E_SUCCESS The method is successful.
1181 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1182 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1183 * @exception E_SYSTEM A system error has occurred.
1184 * @remarks The specific error code can be accessed using the GetLastResult() method.
1185 * @see SetTokenTextColor()
1187 Tizen::Graphics::Color GetTokenTextColor(void) const;
1190 * Gets the text color of tokens at the specified index.
1194 * @return The text color, @n
1195 * else RGBA (0,0,0,0) if an error occurs
1196 * @exception E_SUCCESS The method is successful.
1197 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1198 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1199 * @exception E_SYSTEM A system error has occurred.
1200 * @remarks The specific error code can be accessed using the GetLastResult() method.
1201 * @see SetSelectedTokenTextColor()
1203 Tizen::Graphics::Color GetSelectedTokenTextColor(void) const;
1206 * Sets the background bitmap of the %ExpandableEditArea control.
1210 * @return An error code
1211 * @param[in] status The status
1212 * @param[in] bitmap The background bitmap
1213 * @exception E_SUCCESS The method is successful.
1214 * @exception E_SYSTEM A system error has occurred.
1216 result SetBackgroundBitmap(EditStatus status, const Tizen::Graphics::Bitmap& bitmap);
1219 * Sets the color of the %ExpandableEditArea control.
1223 * @return An error code
1224 * @param[in] status The status of the %ExpandableEditArea control
1225 * @param[in] color The color
1226 * @exception E_SUCCESS The method is successful.
1227 * @exception E_SYSTEM A system error has occurred.
1230 result SetColor(EditStatus status, const Tizen::Graphics::Color& color);
1233 * Sets the text color of the guide text.
1237 * @return An error code
1238 * @param[in] color The guide text color
1239 * @exception E_SUCCESS The method is successful.
1240 * @exception E_SYSTEM A system error has occurred.
1241 * @see GetGuideTextColor()
1243 result SetGuideTextColor(const Tizen::Graphics::Color& color);
1246 * Sets the text color of the title for the specified status.
1250 * @return An error code
1251 * @param[in] status The status of the %ExpandableEditArea control
1252 * @param[in] color The title text color
1253 * @exception E_SUCCESS The method is successful.
1254 * @exception E_SYSTEM A system error has occurred.
1255 * @see GetTitleTextColor()
1257 result SetTitleTextColor(EditStatus status, const Tizen::Graphics::Color& color);
1260 * Sets the text color of the %ExpandableEditArea control.
1264 * @return An error code
1265 * @param[in] type The text type
1266 * @param[in] color The text color
1267 * @exception E_SUCCESS The method is successful.
1268 * @exception E_SYSTEM A system error has occurred.
1269 * @see GetTextColor()
1271 result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color);
1274 * Sets the text color of the tokens at the specified index.
1278 * @return An error code
1279 * @param[in] color The token text color
1280 * @exception E_SUCCESS The method is successful.
1281 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1282 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1283 * @exception E_SYSTEM A system error has occurred.
1284 * @see GetSelectedTokenTextColor()
1286 result SetSelectedTokenTextColor(const Tizen::Graphics::Color& color);
1289 * Sets the color of the tokens for the specified status.
1293 * @return An error code
1294 * @param[in] status The status
1295 * @param[in] color The token color
1296 * @exception E_SUCCESS The method is successful.
1297 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1298 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1299 * @exception E_SYSTEM A system error has occurred.
1300 * @see GetTokenColor()
1302 result SetTokenColor(ExpandableEditAreaTokenStatus status, const Tizen::Graphics::Color& color);
1305 * Sets the text color of the tokens.
1309 * @return An error code
1310 * @param[in] color The token text color
1311 * @exception E_SUCCESS The method is successful.
1312 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1313 * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN.
1314 * @exception E_SYSTEM A system error has occurred.
1315 * @see GetTokenTextColor()
1317 result SetTokenTextColor(const Tizen::Graphics::Color& color);
1321 * Enables or disables the auto resizing if the candidate word list appears.
1323 * @brief <i> [Deprecated] </i>
1324 * @deprecated This API is deprecated because it is no longer necessary to handle the resizing of expandable edit area.
1327 * @return An error code
1328 * @param[in] enable Set to @c true to enable the auto resizing, @n
1330 * @exception E_SUCCESS The method is successful.
1331 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1332 * The current style of the %ExpandableEditArea does not support the operation.
1333 * @remarks Note that when this option is enabled, the normal style %ExpandableEditArea is auto resized and the line added and removed events are
1334 * generated if the candidate word list pop-up appears during the predictive texting. @n
1335 * The operation is not supported by the token style %ExpandableEditArea.
1336 * @see IsAutoResizingEnabled()
1337 * @see Tizen::Ui::Controls::IExpandableEditAreaEventListener
1340 result SetAutoResizingEnabled(bool enable);
1344 * Checks whether the auto-resizing is enabled.
1346 * @brief <i> [Deprecated] </i>
1347 * @deprecated This API is deprecated because it is no longer necessary to handle the resizing of expandable edit area.
1350 * @return @c true if the auto-resizing is enabled, @n
1352 * @exception E_SUCCESS The method is successful.
1353 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1354 * The current style of the %ExpandableEditArea control does not support the operation.
1355 * @remarks The specific error code can be accessed using the GetLastResult() method.
1356 * @see SetAutoResizingEnabled()
1359 bool IsAutoResizingEnabled(void) const;
1362 * Sets the input language.
1366 * @return An error code
1367 * @param[in] languageCode The language to set
1368 * @exception E_SUCCESS The method is successful.
1369 * @exception E_OUT_OF_MEMORY The memory is insufficient.
1370 * @remarks The application can set the language of the current keypad that is associated with the current %ExpandableEditArea. @n
1371 * This method only works if the language to set is supported by the current preloaded keypad.
1373 result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
1376 * Gets the current input language.
1380 * @return An error code
1381 * @param[out] language The current input language
1382 * @exception E_SUCCESS The method is successful.
1383 * @remarks The application can get the current language of the keypad that is associated with the current %ExpandableEditArea.
1385 result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
1387 // EVENT LISTENER MANAGEMENT
1389 * Adds the specified IExpandableEditAreaEventListener instance. @n
1390 * The added listener can listen to events when a line is added or removed or when a button is pressed.
1394 * @param[in] listener The event listener to be added
1395 * @see RemoveExpandableEditAreaEventListener()
1397 void AddExpandableEditAreaEventListener(IExpandableEditAreaEventListener& listener);
1400 * Adds the specified IKeypadEventListener instance. @n
1401 * The added listener is notified if the keypad associated with the edit area is opened or closed.
1405 * @param[in] listener The event listener to be added
1406 * @see RemoveKeypadEventListener()
1408 void AddKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
1411 * Adds the specified ITextBlockEventListener instance.
1415 * @param[in] listener The event listener to be added
1416 * @remarks Programmatically modifying the text block does not cause the text block selection event to fire.
1417 * @see RemoveTextBlockEventListener()
1419 void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
1422 * Adds the specified ITextEventListener instance. @n
1423 * The added listener can listen to the text-changed event.
1427 * @param[in] listener The listener to be added
1428 * @see RemoveTextEventListener()
1430 void AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
1433 * Removes the specified IExpandableEditAreaEventListener instance. @n
1434 * The removed listener cannot listen to events when they are fired.
1438 * @param[in] listener The event listener to be removed
1439 * @see AddActionEventListener()
1441 void RemoveExpandableEditAreaEventListener(IExpandableEditAreaEventListener& listener);
1444 * Removes the specified IKeypadEventListener listener. @n
1445 * The removed listener cannot listen to events when they are fired.
1449 * @param[in] listener The event listener to be removed
1450 * @see AddKeypadEventListener()
1452 void RemoveKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener);
1455 * Removes the specified ITextBlockEventListener listener. @n
1456 * The removed listener cannot listen to events when they are fired.
1460 * @param[in] listener The event listener to be removed
1461 * @see AddTextBlockEventListener()
1463 void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
1466 * Removes the specified ITextEventListener instance. @n
1467 * The removed listener cannot listen to events when they are fired.
1471 * @param[in] listener The listener to be removed
1472 * @see AddTextEventListener()
1474 void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
1477 * Adds a listener instance for language events. @n
1478 * The added listener is notified when the input language is changed.
1482 * @param[in] listener The listener to add
1483 * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener.
1484 * @see RemoveLanguageEventListener()
1487 void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
1490 * Removes the specified listener instance. @n
1491 * The removed listener cannot listen to events when they are fired.
1495 * @param[in] listener The listener to remove
1496 * @see AddLanguageEventListener()
1499 void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
1502 * Enables or disables the auto shrinking if the focus is lost.
1506 * @param[in] enable Set to @c true to enable the auto shrinking, @n
1508 * @remarks Note that when this option is enabled, the %ExpandableEditArea is auto shrinked
1509 * if the %ExpandableEditArea lost its focus. @n
1510 * @see IsAutoShrinkModeEnabled()
1512 void SetAutoShrinkModeEnabled(bool enable);
1515 * Checks whether the auto-shrinking is enabled.
1519 * @return @c true if the auto-shrinking is enabled, @n
1521 * @see SetAutoShrinkModeEnabled()
1523 bool IsAutoShrinkModeEnabled(void) const;
1527 friend class _ExpandableEditAreaImpl;
1531 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1533 ExpandableEditArea(const ExpandableEditArea& rhs);
1536 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1538 ExpandableEditArea& operator =(const ExpandableEditArea& rhs);
1539 }; // ExpandableEditArea
1541 }}} // Tizen::Ui::Controls
1543 #endif // _FUI_CTRL_EXPANDABLE_EDIT_AREA_H_