Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiCtrlTextBox.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17 /**
18  * @file        FUiCtrlTextBox.h
19  * @brief       This is the header file for the %TextBox class.
20  *
21  * This header file contains the declarations of the %TextBox class and its helper classes.
22  */
23
24 #ifndef _FUI_CTRL_TEXT_BOX_H_
25 #define _FUI_CTRL_TEXT_BOX_H_
26
27 #include <FGrpRectangle.h>
28 #include <FUiCtrlControlsTypes.h>
29 #include <FUiControl.h>
30 #include <FUiITextBlockEventListener.h>
31 #include <FUiIUiLinkEventListener.h>
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35 class _TextBoxImpl;
36 };
37 };
38 };
39
40 namespace Tizen { namespace Ui { namespace Controls
41 {
42 /**
43  * @enum        TextBoxBorder
44  *
45  * Defines the possible types of text box borders.
46  *
47  * @since       2.0
48  */
49 enum TextBoxBorder
50 {
51         TEXT_BOX_BORDER_NONE,       /**< No border */
52         TEXT_BOX_BORDER_ROUNDED     /**< The rounded border */
53 };
54
55
56 /**
57  * @enum    TextBoxStatus
58  *
59  * Defines the possible states of the text box.
60  *
61  * @since       2.0
62  */
63 enum TextBoxStatus
64 {
65         TEXT_BOX_STATUS_NORMAL,         /**< The normal state */
66         TEXT_BOX_STATUS_HIGHLIGHTED,    /**< The focus-highlighted state */
67         TEXT_BOX_STATUS_DISABLED        /**< The disabled state */
68 };
69
70
71 /**
72  * @enum    TextBoxTextColor
73  *
74  * Defines the possible text colors.
75  *
76  * @since       2.0
77  */
78 enum TextBoxTextColor
79 {
80         TEXT_BOX_TEXT_COLOR_NORMAL,         /**< The default text color */
81         TEXT_BOX_TEXT_COLOR_HIGHLIGHTED,    /**< The highlighted text color */
82         TEXT_BOX_TEXT_COLOR_DISABLED,       /**< The disabled text color */
83         TEXT_BOX_TEXT_COLOR_BLOCKED,        /**< The text block color */
84         TEXT_BOX_TEXT_COLOR_LINK            /**< The link text color */
85 };
86
87
88 /**
89  * @enum    TextBoxTextStyle
90  *
91  * Defines the possible text styles.
92  *
93  * @since       2.0
94  */
95 enum TextBoxTextStyle
96 {
97         TEXT_BOX_TEXT_STYLE_NORMAL = 0x0000,                /**< The normal text style */
98         TEXT_BOX_TEXT_STYLE_BOLD = 0x0001,                  /**< The bold text style */
99         TEXT_BOX_TEXT_STYLE_ITALIC = 0x0002,                /**< The italic text style */
100         TEXT_BOX_TEXT_STYLE_UNDERLINE = 0x0004,             /**< The underline text style */
101         TEXT_BOX_TEXT_STYLE_STRIKEOUT = 0x0008,             /**< The strikeout text style */
102         TEXT_BOX_TEXT_STYLE_MAX = 0x7FFF                    /**< The placeholder */
103 };
104
105 /**
106  * @class       TextBox
107  * @brief       This class is an implementation of a %TextBox control.
108  *
109  * @since       2.0
110  *
111  * The %TextBox class displays a non-editable text field.
112  *
113  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_textbox.htm">TextBox</a>.
114  *
115  * @code
116 // Sample code for TextBoxSample.h
117 #include <FUi.h>
118
119 class TextBoxSample
120         : public Tizen::Ui::Controls::Form
121 {
122 public:
123         TextBoxSample(void)
124         : __pTextBox(null){}
125
126         bool Initialize(void);
127         virtual result OnInitializing(void);
128
129 private:
130         Tizen::Ui::Controls::TextBox* __pTextBox;
131 };
132  * @endcode
133  *
134  * @code
135 // Sample code for TextBoxSample.cpp
136 #include <FGraphics.h>
137
138 #include "TextBoxSample.h"
139
140 using namespace Tizen::Graphics;
141 using namespace Tizen::Ui::Controls;
142
143 bool
144 TextBoxSample::Initialize(void)
145 {
146         Construct(FORM_STYLE_NORMAL);
147         return true;
148 }
149
150 result
151 TextBoxSample::OnInitializing(void)
152 {
153         result r = E_SUCCESS;
154
155         // Creates an instance of TextBox
156         __pTextBox = new TextBox();
157         __pTextBox->Construct(Rectangle(50, 50, GetClientAreaBounds().width-80, 300), TEXT_BOX_BORDER_ROUNDED);
158
159         // Sets properties on the text box
160         __pTextBox->SetTextSize(50);
161         __pTextBox->SetText(L"Tizen Developer");
162         __pTextBox->SetTextColor(TEXT_BOX_TEXT_COLOR_HIGHLIGHTED, Color::GetColor(COLOR_ID_RED));
163         __pTextBox->AppendText(L"\nTizen SDK");
164
165         // Adds the text box to the form
166         AddControl(*__pTextBox);
167
168         return r;
169 }
170 * @endcode
171 */
172 class _OSP_EXPORT_ TextBox
173         : public Tizen::Ui::Control
174 {
175 // Lifecycle
176 public:
177         /**
178          * 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.
179          *
180          * @since       2.0
181          *
182          */
183         TextBox(void);
184
185         /**
186          * 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.
187          *
188          * @since       2.0
189          */
190         virtual ~TextBox(void);
191
192         /**
193          * Initializes this instance of %TextBox with the specified parameters.
194          *
195          * @since               2.0
196          *
197          * @return              An error code
198          * @param[in]   rect                An instance of the Graphics::Rectangle class @n
199          *                                                                      This instance represents the x and y coordinates of the top-left corner of the created window along with
200          *                                                                      the width and height of the control.
201          * @param[in]   border              The border style
202          * @exception   E_SUCCESS           The method is successful.
203          * @exception   E_SYSTEM            A system error has occurred.
204          */
205         result Construct(const Tizen::Graphics::Rectangle& rect, TextBoxBorder border = TEXT_BOX_BORDER_ROUNDED);
206
207         /**
208          * Initializes this instance of %TextBox with the specified parameters.
209          *
210          * @since               2.1
211          *
212          * @return              An error code
213          * @param[in]   rect                            An instance of the Graphics::FloatRectangle class @n
214          *                                                                      This instance represents the x and y coordinates of the top-left corner of the created window along with
215          *                                                                      the width and height of the control.
216          * @param[in]   border                          The border style
217          * @exception   E_SUCCESS                       The method is successful.
218          * @exception   E_SYSTEM                        A system error has occurred.
219          */
220         result Construct(const Tizen::Graphics::FloatRectangle& rect, TextBoxBorder border = TEXT_BOX_BORDER_ROUNDED);
221
222 // Operation
223 public:
224         /**
225          * Sets the auto-link mask.
226          *
227          * @since               2.0
228          *
229          * @return              An error code
230          * @param[in]   autoLinks               The auto-link mask @n
231          *                                                              Multiple link types can be combined using the bitwise OR operator (see Tizen::Base::Utility::LinkType). @n
232          *                                                              For more information, see <a href="../org.tizen.native.appprogramming/html/guide/ui/auto_link_detection.htm">AutoLink Detection</a>.
233          * @exception   E_SUCCESS               The method is successful.
234          * @exception   E_SYSTEM                A system error has occurred.
235          * @remarks             When @c autoLinks is set to @c 0, the auto-link detection is disabled.
236          * @see                 Tizen::Base::Utility::LinkType
237          * @see                 GetAutoLinkMask()
238          */
239         result SetAutoLinkMask(unsigned long autoLinks);
240
241         /**
242          * Gets the auto-link mask.
243          *
244          * @since               2.0
245          *
246          * @return              The auto-link mask
247          * @exception   E_SUCCESS                               The method is successful.
248          * @exception   E_SYSTEM                                A system error has occurred.
249          * @remarks             The specific error code can be accessed using the GetLastResult() method.
250          * @see                 SetAutoLinkMask()
251          */
252         unsigned long GetAutoLinkMask(void) const;
253
254         /**
255          * Adds a link event listener.
256          *
257          * @since               2.0
258          *
259          * @param[in]   listener    The event listener to add
260          * @see                 RemoveUiLinkEventListener()
261          */
262         void AddUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
263
264         /**
265          * Removes the specified link event listener. @n
266          * The removed listener cannot listen to events when they are fired.
267          *
268          * @since               2.0
269          *
270          * @param[in]   listener    The event listener to remove
271          * @see                 AddUiLinkEventListener()
272          */
273         void RemoveUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
274
275 // Text
276         /**
277          * Appends the specified character at the end of the text.
278          *
279          * @since               2.0
280          *
281          * @return              An error code
282          * @param[in]   character               The character to add
283          * @exception   E_SUCCESS               The method is successful.
284          * @exception   E_SYSTEM                A system error has occurred.
285          * @remarks             The method modifies the text buffer that is managed by the %TextBox control. @n
286          *              To display the changes, the control must be drawn again.
287          */
288         result AppendCharacter(const Tizen::Base::Character& character);
289
290         /**
291          * Appends the specified text at the end of the text.
292          *
293          * @since               2.0
294          *
295          * @return              An error code
296          * @param[in]   text                    The text to append
297          * @exception   E_SUCCESS               The method is successful.
298          * @exception   E_SYSTEM        A system error has occurred.
299          * @remarks             To denote the end of a line use '\\n'. @n
300          *              The method modifies the text buffer that is managed by the %TextBox control. @n
301          *              To display the changes, the control must be drawn again.
302          */
303         result AppendText(const Tizen::Base::String& text);
304
305         /**
306          * Clears the text that is displayed by the %TextBox control.
307          *
308          * @since               2.0
309          *
310          * @return              An error code
311          * @exception   E_SUCCESS           The method is successful.
312          * @exception   E_SYSTEM                        A system error has occurred.
313          * @remarks             The method modifies the text buffer that is managed by the %TextBox control. @n
314          *              To display the changes, the control must be drawn again.
315          */
316         result Clear(void);
317
318         /**
319          * Gets the number of the lines contained in the %TextBox control.
320          *
321          * @since               2.0
322          *
323          * @return              The line count of the text, @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          */
328         int GetLineCount(void) const;
329
330         /**
331          * Gets the text that is displayed by the %TextBox control.
332          *
333          * @since               2.0
334          *
335          * @return              The text of the %TextBox control, @n
336          *                          else an empty string if an error occurs
337          * @exception   E_SUCCESS                       The method is successful.
338          * @exception   E_SYSTEM            A system error has occurred.
339          * @remarks             The specific error code can be accessed using the GetLastResult() method.
340          * @see                 SetText()
341          */
342         Tizen::Base::String GetText(void) const;
343
344         /**
345          * Gets a portion of the text that is displayed by the %TextBox control.
346          *
347          * @since               2.0
348          *
349          * @return              The specified portion of the text, @n
350          *              else an empty string if an error occurs
351          * @param[in]   start           The starting index of the range
352          * @param[in]   end                 The last index of the range
353          * @exception   E_SUCCESS       The method is successful.
354          * @exception   E_OUT_OF_RANGE  The specified index is outside the bounds of the data structure. @n
355          *                                                              The index is greater than the number of elements or less than @c 0.
356          * @exception   E_SYSTEM            A system error has occurred.
357          * @remarks             The specific error code can be accessed using the GetLastResult() method.
358          * @see                 SetText()
359          */
360         Tizen::Base::String GetText(int start, int end) const;
361
362         /**
363          * Gets the length of the text that is displayed by the %TextBox control.
364          *
365          * @since               2.0
366          *
367          * @return              The length of the text, @n
368          *              else @c -1 if an error occurs
369          * @exception   E_SUCCESS                       The method is successful.
370          * @exception   E_SYSTEM                        A system error has occurred.
371          * @remarks             The specific error code can be accessed using the GetLastResult() method.
372          */
373         int GetTextLength(void) const;
374
375         /**
376          * Inserts the character at the specified index.
377          *
378          * @since               2.0
379          *
380          * @return              An error code
381          * @param[in]   index               The position at which to insert the character
382          * @param[in]   character           The character to insert
383          * @exception   E_SUCCESS       The method is successful.
384          * @exception   E_OUT_OF_RANGE  The specified @c index is outside the bounds of the data structure. @n
385          *                                                              The specified @c index is greater than the number of elements or less than @c 0.
386          * @exception   E_SYSTEM        A system error has occurred.
387          */
388         result InsertCharacterAt(int index, const Tizen::Base::Character& character);
389
390         /**
391          * Inserts the text at the specified index.
392          *
393          * @since               2.0
394          *
395          * @return              An error code
396          * @param[in]   index               The position at which to insert the text
397          * @param[in]   text                The text to insert
398          * @exception   E_SUCCESS       The method is successful.
399          * @exception   E_OUT_OF_RANGE  The specified @c index is outside the bounds of the data structure. @n
400          *                                                              The specified @c index is greater than the number of elements or less than @c 0.
401          * @exception   E_SYSTEM        A system error has occurred.
402          */
403         result InsertTextAt(int index, const Tizen::Base::String& text);
404
405         /**
406          * Sets the text to be displayed.
407          *
408          * @since               2.0
409          *
410          * @return              An error code
411          * @param[in]   text            The text to display
412          * @exception   E_SUCCESS       The method is successful.
413          * @exception   E_SYSTEM        A system error has occurred.
414          * @remarks     To denote the end of a line use '\\n'. @n
415          *              The method modifies the text buffer that is managed by the %TextBox control. @n
416          *              To display the changes, the control must be drawn again.
417          */
418         result SetText(const Tizen::Base::String& text);
419
420 // Line Spacing
421         /**
422          * Gets the line spacing.
423          *
424          * @since               2.0
425          *
426          * @return      The line spacing,  @n
427          *              else @c -1 if an error occurs
428          * @exception   E_SUCCESS                       The method is successful.
429          * @remarks             The specific error code can be accessed using the GetLastResult() method.
430          * @see                 SetLineSpacing()
431          */
432         int GetLineSpacing(void) const;
433
434         /**
435          * Gets the line spacing.
436          *
437          * @since               2.1
438          *
439          * @return      The line spacing,  @n
440          *              else @c -1 if an error occurs
441          * @exception   E_SUCCESS                       The method is successful.
442          * @remarks             The specific error code can be accessed using the GetLastResult() method.
443          * @see                 SetLineSpacing()
444          */
445         float GetLineSpacingF(void) const;
446
447         /**
448          * Sets the line spacing. @n
449          * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. @n
450          *
451          * @code
452          * The line spacing = (default line spacing) * multiplier + extra
453          * @endcode
454          *
455          * @since          2.0
456          *
457          * @return         An error code
458          * @param[in]      multiplier                   The line spacing multiplier
459          * @param[in]      extra                                The extra line spacing
460          * @exception      E_SUCCESS                    The method is successful.
461          * @exception      E_INVALID_ARG                A specified input parameter is invalid. @n
462          *                                                                              The specified line spacing value cannot be supported.
463          * @exception      E_SYSTEM                             A system error has occurred.
464          * @see            GetLineSpacing()
465          */
466         result SetLineSpacing(int multiplier, int extra);
467
468         /**
469          * Sets the line spacing. @n
470          * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. @n
471          *
472          * @code
473          * The line spacing = (default line spacing) * multiplier + extra
474          * @endcode
475          *
476          * @since          2.1
477          *
478          * @return         An error code
479          * @param[in]      multiplier                   The line spacing multiplier
480          * @param[in]      extra                                The extra line spacing
481          * @exception      E_SUCCESS                    The method is successful.
482          * @exception      E_INVALID_ARG                A specified input parameter is invalid. @n
483          *                                                                              The specified line spacing value cannot be supported.
484          * @exception      E_SYSTEM                             A system error has occurred.
485          * @see            GetLineSpacingF()
486          */
487         result SetLineSpacing(int multiplier, float extra);
488
489         // Text Alignment
490         /**
491          * Gets the horizontal text alignment.
492          *
493          * @since               2.0
494          *
495          * @return              The horizontal text alignment
496          * @exception   E_SUCCESS                       The method is successful.
497          * @exception   E_SYSTEM                        A system error has occurred.
498          * @remarks             The specific error code can be accessed using the GetLastResult() method.
499          * @see                 SetTextAlignment()
500          */
501         HorizontalAlignment GetTextAlignment(void) const;
502
503         /**
504          * Sets the horizontal text alignment.
505          *
506          * @since               2.0
507          *
508          * @return              An error code
509          * @param[in]   alignment               The horizontal text alignment
510          * @exception   E_SUCCESS               The method is successful.
511          * @exception   E_SYSTEM                A system error has occurred.
512          * @see                 GetTextAlignment()
513          */
514         result SetTextAlignment(HorizontalAlignment alignment);
515
516         // Text Size
517         /**
518          * Gets the text size of the %TextBox control.
519          *
520          * @since               2.0
521          *
522          * @return      The size of the text, @n
523          *              else @c -1 if an error occurs
524          * @exception   E_SUCCESS          The method is successful.
525          * @exception   E_SYSTEM           A system error has occurred.
526          * @remarks             The specific error code can be accessed using the GetLastResult() method.
527          * @see                 SetTextSize()
528          */
529         int GetTextSize(void) const;
530
531         /**
532          * Gets the text size of the %TextBox control.
533          *
534          * @since               2.1
535          *
536          * @return      The size of the text, @n
537          *              else @c -1 if an error occurs
538          * @exception   E_SUCCESS          The method is successful.
539          * @exception   E_SYSTEM           A system error has occurred.
540          * @remarks             The specific error code can be accessed using the GetLastResult() method.
541          * @see                 SetTextSize()
542          */
543         float GetTextSizeF(void) const;
544
545         /**
546          * Sets the text size.
547          *
548          * @since               2.0
549          *
550          * @return              An error code
551          * @param[in]   size                The text size
552          * @exception   E_SUCCESS           The method is successful.
553          * @exception   E_INVALID_ARG       The specified input parameter is invalid. @n
554          *                                                                      The specified @c size cannot be a negative integer.
555          * @exception   E_SYSTEM            A system error has occurred.
556          * @see                 GetTextSize()
557          */
558         result SetTextSize(int size);
559
560         /**
561          * Sets the text size.
562          *
563          * @since               2.1
564          *
565          * @return              An error code
566          * @param[in]   size                The text size
567          * @exception   E_SUCCESS           The method is successful.
568          * @exception   E_INVALID_ARG       The specified input parameter is invalid. @n
569          *                                                                      The specified @c size cannot be a negative integer.
570          * @exception   E_SYSTEM            A system error has occurred.
571          * @see                 GetTextSizeF()
572          */
573         result SetTextSize(float size);
574
575         // Text Font
576         /**
577          * @if OSPDEPREC
578          * Gets the font typeface name and the style mask of the %TextBox control.
579          *
580          * @brief <i> [Deprecated] </i>
581          * @deprecated   This method is deprecated. Instead of using this method, use the GetTextStyle() method.
582          * @since               2.0
583          *
584          * @return              An error code
585          * @param[out]  typefaceName        The name of the font typeface
586          * @param[out]  style               The text style (see TextBoxTextStyle)
587          * @exception   E_SUCCESS           The method is successful.
588          * @exception   E_SYSTEM            A system error has occurred.
589          * @remarks     Multiple styles can be combined using the bitwise OR operator.
590          * @see                 SetFontType()
591          * @see                 Tizen::Graphics::Font::GetSystemFontListN()
592          * @see                 TextBoxTextStyle
593          * @endif
594          */
595         result GetFontType(Tizen::Base::String& typefaceName, unsigned long& style) const;
596
597         /**
598         * Gets the text style mask of the %TextBox control.
599         *
600         * @since 2.0
601         *
602         * @return                  A bitwise combination of Tizen::Ui::Controls::TextBoxTextStyle
603         * @see                      SetTextStyle()
604         * @see                      TextBoxTextStyle
605         */
606         unsigned long GetTextStyle(void) const;
607
608         /**
609          * @if OSPDEPREC
610          * Sets the font and the style mask of the %TextBox control.
611          *
612          * @brief <i> [Deprecated] </i>
613          * @deprecated   This method is deprecated. Instead of using this method, use the SetTextStyle() method.
614          * @since               2.0
615          *
616          * @return              An error code
617          * @param[in]   typefaceName        The name of the font typeface
618          * @param[in]   style               The text style @n
619          *                                                                  Multiple styles can be combined using the bitwise OR operator(see TextBoxTextStyle).
620          * @exception   E_SUCCESS           The method is successful.
621          * @exception   E_INVALID_ARG       A specified input parameter is invalid, or the specified font typeface is not supported.
622          * @exception   E_SYSTEM            A system error has occurred.
623          * @remarks         The specified font typeface must be one of the system fonts. @n
624          *              @c italic and @c bold cannot be applied at the same time. If the specified style mask contains both @c italic and @c bold, @c italic will
625          *                              be applied.
626          * @see                 GetFontType()
627          * @see                 Tizen::Graphics::Font::GetSystemFontListN()
628          * @see                 TextBoxTextStyle
629          * @endif
630          */
631         result SetFontType(const Tizen::Base::String& typefaceName, unsigned long style);
632
633         /**
634         * Sets the text style mask of the %TextBox control.
635         *
636         * @since 2.0
637         *
638         * @return                  An error code
639         * @param[in]    style               The text style @n
640         *                      Multiple styles can be combined using the bitwise OR operator (see Tizen::Ui::Controls::TextBoxTextStyle).
641         * @exception    E_SUCCESS           The method is successful.
642         * @exception    E_OUT_OF_MEMORY  The memory is insufficient.
643         * @see                      GetTextStyle()
644         * @see                      TextBoxTextStyle
645         */
646         result SetTextStyle(unsigned long style);
647
648         using Control::SetFont;
649         /**
650          * @if OSPDEPREC
651          * Sets the font to render the text.
652          *
653          * @brief <i> [Deprecated] </i>
654          * @deprecated   This method is deprecated. Instead of using this method, use the SetFont(const String& fontName) method of superclass.
655          * @since               2.0
656          *
657          * @return              An error code
658          * @param[in]   font             The text font
659          * @exception   E_SUCCESS        The method is successful.
660          * @exception   E_SYSTEM         A system error has occurred.
661          * @remarks             All previously set text attributes (style, weight, decoration, and size) will be discarded.
662          * @endif
663          */
664         result SetFont(const Tizen::Graphics::Font& font);
665
666 // Text Block
667         /**
668          * Releases the selection of the current text block.
669          *
670          * @since               2.0
671          *
672          * @return              An error code
673          * @exception   E_SUCCESS          The method is successful.
674          * @exception   E_SYSTEM           A system error has occurred.
675          * @see                 GetBlockRange()
676          * @see                 SetBlockRange()
677          */
678         result ReleaseBlock(void);
679
680         /**
681          * Gets the start and the end index of the currently selected text block.
682          *
683          * @since               2.0
684          *
685          * @return              An error code
686          * @param[out]  start              The start index of the text block
687          * @param[out]  end                The end index of the text block
688          * @exception   E_SUCCESS          The method is successful.
689          * @exception   E_SYSTEM           A system error has occurred.
690          * @remarks             The method returns @c start = 0 and @c end = 0 if there is no selected text block.
691          * @see                 ReleaseBlock()
692          * @see                 SetBlockRange()
693          */
694         result GetBlockRange(int& start, int& end) const;
695
696         /**
697          * Sets the specified block of the text.
698          *
699          * @since               2.0
700          *
701          * @return              An error code
702          * @param[in]   start           The start index of the text block
703          * @param[in]   end             The end index of the text block
704          * @exception   E_SUCCESS       The method is successful.
705          * @exception   E_OUT_OF_RANGE  The specified index is outside the bounds of the data structure. @n
706          *                                                              Either the @c start or @c end parameters are greater than the number of elements or less than @c 0.
707          * @exception   E_SYSTEM        A system error has occurred.
708          * @see                 ReleaseBlock()
709          * @see                 GetBlockRange()
710          */
711         result SetBlockRange(int start, int end);
712
713 // Appearances
714         /**
715          * Gets the color of the %TextBox control for the specified status.
716          *
717          * @since               2.0
718          *
719          * @return              The color of the %TextBox control, @n
720          *                              else RGBA (0,0,0,0) if an error occurs
721          * @param[in]   status                  The state of the %TextBox control
722          * @exception   E_SUCCESS           The method is successful.
723          * @remarks             The specific error code can be accessed using the GetLastResult() method.
724          * @see                 SetColor()
725          */
726         Tizen::Graphics::Color GetColor(TextBoxStatus status) const;
727
728         /**
729          * Gets the text color of the specified text color type.
730          *
731          * @since               2.0
732          *
733          * @return              The color, @n
734          *                              else RGBA (0,0,0,0) if an error occurs
735          * @param[in]   type                            The text color type
736          * @exception   E_SUCCESS                       The method is successful.
737          * @exception   E_SYSTEM                        A system error has occurred.
738          * @remarks             The specific error code can be accessed using the GetLastResult() method.
739          * @see                 SetTextColor()
740          */
741         Tizen::Graphics::Color GetTextColor(TextBoxTextColor type) const;
742
743         /**
744          * Sets the background bitmap of the %TextBox control.
745          *
746          * @since               2.0
747          *
748          * @return              An error code
749          * @param[in]   status                  The state of the %TextBox control
750          * @param[in]   bitmap                  The background bitmap
751          * @exception   E_SUCCESS       The method is successful.
752          * @exception   E_SYSTEM        A system error has occurred.
753          * @see                 SetBackgroundColor()
754          */
755         result SetBackgroundBitmap(TextBoxStatus status, const Tizen::Graphics::Bitmap& bitmap);
756
757         /**
758          * Sets the color of the %TextBox control for the specified status.
759          *
760          * @since               2.0
761          *
762          * @return              An error code
763          * @param[in]   status          The state of the %TextBox control
764          * @param[in]   color           The color to set
765          * @exception   E_SUCCESS       The method is successful.
766          * @exception   E_SYSTEM        A system error has occurred.
767          * @see                 GetColor()
768          */
769         result SetColor(TextBoxStatus status, const Tizen::Graphics::Color& color);
770
771         /**
772          * Sets the text color of the %TextBox control for the specified text type.
773          *
774          * @since               2.0
775          *
776          * @return              An error code
777          * @param[in]   type             The text color type
778          * @param[in]   color            The text color to set
779          * @exception   E_SUCCESS        The method is successful.
780          * @exception   E_SYSTEM         A system error has occurred.
781          * @see                 GetTextColor()
782          */
783         result SetTextColor(TextBoxTextColor type, const Tizen::Graphics::Color& color);
784
785         /**
786          * Adds a text block event listener.
787          *
788          * @since               2.0
789          *
790          * @param[in]   listener        The event listener to add
791          * @remarks             Programmatically modifying the text selection does not cause the text block selection event to fire.
792          * @see                 RemoveTextBlockEventListener()
793          */
794         void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
795
796         /**
797          * Removes the specified text block event listener. @n
798          * The removed listener cannot listen to events when they are fired.
799          *
800          * @since               2.0
801          *
802          * @param[in]   listener        The event listener to remove
803          * @see                 AddTextBlockEventListener()
804          */
805         void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
806
807 protected:
808         friend class _TextBoxImpl;
809
810 private:
811         TextBox(const TextBox& value);
812         TextBox& operator =(const TextBox& value);
813 };  //TextBox
814 }}} //Tizen::Ui::Controls
815
816 #endif  // _FUI_CTRL_TEXT_BOX_H_