Tizen 2.1 base
[framework/osp/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 // Operation
208 public:
209         /**
210          * Sets the auto-link mask.
211          *
212          * @since               2.0
213          *
214          * @return              An error code
215          * @param[in]   autoLinks               The auto-link mask @n
216          *                                                              Multiple link types can be combined using the bitwise OR operator (see Tizen::Base::Utility::LinkType). @n
217          *                                                              For more information, see <a href="../org.tizen.native.appprogramming/html/guide/ui/auto_link_detection.htm">AutoLink Detection</a>.
218          * @exception   E_SUCCESS               The method is successful.
219          * @exception   E_SYSTEM                A system error has occurred.
220          * @remarks             When @c autoLinks is set to @c 0, the auto-link detection is disabled.
221          * @see                 Tizen::Base::Utility::LinkType
222          * @see                 GetAutoLinkMask()
223          */
224         result SetAutoLinkMask(unsigned long autoLinks);
225
226         /**
227          * Gets the auto-link mask.
228          *
229          * @since               2.0
230          *
231          * @return              The auto-link mask
232          * @exception   E_SUCCESS                               The method is successful.
233          * @exception   E_SYSTEM                                A system error has occurred.
234          * @remarks             The specific error code can be accessed using the GetLastResult() method.
235          * @see                 SetAutoLinkMask()
236          */
237         unsigned long GetAutoLinkMask(void) const;
238
239         /**
240          * Adds a link event listener.
241          *
242          * @since               2.0
243          *
244          * @param[in]   listener    The event listener to be added
245          * @see                 RemoveUiLinkEventListener()
246          */
247         void AddUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
248
249         /**
250          * Removes the specified link event listener. @n
251          * The removed listener cannot listen to events when they are fired.
252          *
253          * @since               2.0
254          *
255          * @param[in]   listener    The event listener to be removed
256          * @see                 AddUiLinkEventListener()
257          */
258         void RemoveUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
259
260 // Text
261         /**
262          * Appends the specified character at the end of the text.
263          *
264          * @since               2.0
265          *
266          * @return              An error code
267          * @param[in]   character               The character to be added
268          * @exception   E_SUCCESS               The method is successful.
269          * @exception   E_SYSTEM                A system error has occurred.
270          * @remarks             The method modifies the text buffer that is managed by the %TextBox control. @n
271          *              To display the changes, the control must be drawn again.
272          */
273         result AppendCharacter(const Tizen::Base::Character& character);
274
275         /**
276          * Appends the specified text at the end of the text.
277          *
278          * @since               2.0
279          *
280          * @return              An error code
281          * @param[in]   text                    The text to be appended
282          * @exception   E_SUCCESS               The method is successful.
283          * @exception   E_SYSTEM        A system error has occurred.
284          * @remarks             To denote the end of a line use '\\n'. @n
285          *              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 AppendText(const Tizen::Base::String& text);
289
290         /**
291          * Clears the text that is displayed by the %TextBox control.
292          *
293          * @since               2.0
294          *
295          * @return              An error code
296          * @exception   E_SUCCESS           The method is successful.
297          * @exception   E_SYSTEM                        A system error has occurred.
298          * @remarks             The method modifies the text buffer that is managed by the %TextBox control. @n
299          *              To display the changes, the control must be drawn again.
300          */
301         result Clear(void);
302
303         /**
304          * Gets the number of the lines contained in the %TextBox control.
305          *
306          * @since               2.0
307          *
308          * @return              The line count of the text, @n
309          *                              else @c -1 if an error occurs
310          * @exception   E_SUCCESS                       The method is successful.
311          * @remarks             The specific error code can be accessed using the GetLastResult() method.
312          */
313         int GetLineCount(void) const;
314
315         /**
316          * Gets the text that is displayed by the %TextBox control.
317          *
318          * @since               2.0
319          *
320          * @return              The text of the %TextBox control, @n
321          *                          else an empty string if an error occurs
322          * @exception   E_SUCCESS                       The method is successful.
323          * @exception   E_SYSTEM            A system error has occurred.
324          * @remarks             The specific error code can be accessed using the GetLastResult() method.
325          * @see                 SetText()
326          */
327         Tizen::Base::String GetText(void) const;
328
329         /**
330          * Gets a portion of the text that is displayed by the %TextBox control.
331          *
332          * @since               2.0
333          *
334          * @return              The specified portion of the text, @n
335          *              else an empty string if an error occurs
336          * @param[in]   start           The starting index of the range
337          * @param[in]   end                 The last index of the range
338          * @exception   E_SUCCESS       The method is successful.
339          * @exception   E_OUT_OF_RANGE  The specified index is outside the bounds of the data structure. @n
340          *                                                              The index is greater than the number of elements or less than @c 0.
341          * @exception   E_SYSTEM            A system error has occurred.
342          * @remarks             The specific error code can be accessed using the GetLastResult() method.
343          * @see                 SetText()
344          */
345         Tizen::Base::String GetText(int start, int end) const;
346
347         /**
348          * Gets the length of the text that is displayed by the %TextBox control.
349          *
350          * @since               2.0
351          *
352          * @return              The length of the text, @n
353          *              else @c -1 if an error occurs
354          * @exception   E_SUCCESS                       The method is successful.
355          * @exception   E_SYSTEM                        A system error has occurred.
356          * @remarks             The specific error code can be accessed using the GetLastResult() method.
357          */
358         int GetTextLength(void) const;
359
360         /**
361          * Inserts the character at the specified index.
362          *
363          * @since               2.0
364          *
365          * @return              An error code
366          * @param[in]   index               The position at which to insert the character
367          * @param[in]   character           The character to be inserted
368          * @exception   E_SUCCESS       The method is successful.
369          * @exception   E_OUT_OF_RANGE  The specified @c index is outside the bounds of the data structure. @n
370          *                                                              The specified @c index is greater than the number of elements or less than @c 0.
371          * @exception   E_SYSTEM        A system error has occurred.
372          */
373         result InsertCharacterAt(int index, const Tizen::Base::Character& character);
374
375         /**
376          * Inserts the text 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 text
382          * @param[in]   text                The text to be inserted
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 InsertTextAt(int index, const Tizen::Base::String& text);
389
390         /**
391          * Sets the text to be displayed.
392          *
393          * @since               2.0
394          *
395          * @return              An error code
396          * @param[in]   text            The text to be displayed
397          * @exception   E_SUCCESS       The method is successful.
398          * @exception   E_SYSTEM        A system error has occurred.
399          * @remarks     To denote the end of a line use '\\n'. @n
400          *              The method modifies the text buffer that is managed by the %TextBox control. @n
401          *              To display the changes, the control must be drawn again.
402          */
403         result SetText(const Tizen::Base::String& text);
404
405 // Line Spacing
406         /**
407          * Gets the line spacing.
408          *
409          * @since               2.0
410          *
411          * @return      The line spacing,  @n
412          *              else @c -1 if an error occurs
413          * @exception   E_SUCCESS                       The method is successful.
414          * @remarks             The specific error code can be accessed using the GetLastResult() method.
415          * @see                 SetLineSpacing()
416          */
417         int GetLineSpacing(void) const;
418
419         /**
420          * Sets the line spacing. @n
421          * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. @n
422          *
423          * @code
424          * The line spacing = (default line spacing) * multiplier + extra
425          * @endcode
426          *
427          * @since          2.0
428          *
429          * @return         An error code
430          * @param[in]      multiplier                   The line spacing multiplier
431          * @param[in]      extra                                The extra line spacing
432          * @exception      E_SUCCESS                    The method is successful.
433          * @exception      E_INVALID_ARG                A specified input parameter is invalid. @n
434          *                                                                              The specified line spacing value cannot be supported.
435          * @exception      E_SYSTEM                             A system error has occurred.
436          * @see            GetLineSpacing()
437          */
438         result SetLineSpacing(int multiplier, int extra);
439
440         // Text Alignment
441         /**
442          * Gets the horizontal text alignment.
443          *
444          * @since               2.0
445          *
446          * @return              The horizontal text alignment
447          * @exception   E_SUCCESS                       The method is successful.
448          * @exception   E_SYSTEM                        A system error has occurred.
449          * @remarks             The specific error code can be accessed using the GetLastResult() method.
450          * @see                 SetTextAlignment()
451          */
452         HorizontalAlignment GetTextAlignment(void) const;
453
454         /**
455          * Sets the horizontal text alignment.
456          *
457          * @since               2.0
458          *
459          * @return              An error code
460          * @param[in]   alignment               The horizontal text alignment
461          * @exception   E_SUCCESS               The method is successful.
462          * @exception   E_SYSTEM                A system error has occurred.
463          * @see                 GetTextAlignment()
464          */
465         result SetTextAlignment(HorizontalAlignment alignment);
466
467         // Text Size
468         /**
469          * Gets the text size of the %TextBox control.
470          *
471          * @since               2.0
472          *
473          * @return      The size of the text, @n
474          *              else @c -1 if an error occurs
475          * @exception   E_SUCCESS          The method is successful.
476          * @exception   E_SYSTEM           A system error has occurred.
477          * @remarks             The specific error code can be accessed using the GetLastResult() method.
478          * @see                 SetTextSize()
479          */
480         int GetTextSize(void) const;
481
482         /**
483          * Sets the text size.
484          *
485          * @since               2.0
486          *
487          * @return              An error code
488          * @param[in]   size                The text size
489          * @exception   E_SUCCESS           The method is successful.
490          * @exception   E_INVALID_ARG       The specified input parameter is invalid. @n
491          *                                                                      The specified @c size cannot be a negative integer.
492          * @exception   E_SYSTEM            A system error has occurred.
493          * @see                 GetTextSize()
494          */
495         result SetTextSize(int size);
496
497         // Text Font
498         /**
499          * @if OSPDEPREC
500          * Gets the font typeface name and the style mask of the %TextBox control.
501          *
502          * @brief <i> [Deprecated] </i>
503          * @deprecated   This method is deprecated. Instead of using this method, use the GetTextStyle() method.
504          * @since               2.0
505          *
506          * @return              An error code
507          * @param[out]  typefaceName        The name of the font typeface
508          * @param[out]  style               The text style (see TextBoxTextStyle)
509          * @exception   E_SUCCESS           The method is successful.
510          * @exception   E_SYSTEM            A system error has occurred.
511          * @remarks     Multiple styles can be combined using the bitwise OR operator.
512          * @see                 SetFontType()
513          * @see                 Tizen::Graphics::Font::GetSystemFontListN()
514          * @see                 TextBoxTextStyle
515          * @endif
516          */
517         result GetFontType(Tizen::Base::String& typefaceName, unsigned long& style) const;
518
519         /**
520          * Gets the text style mask of the %TextBox control.
521          *
522          * @since 2.0
523          *
524          * @return                  A bitwise combination of Tizen::Ui::Controls::TextBoxTextStyle
525          * @see                      SetTextStyle()
526          * @see                      TextBoxTextStyle
527          */
528         unsigned long GetTextStyle(void) const;
529
530         /**
531          * @if OSPDEPREC
532          * Sets the font and the style mask of the %TextBox control.
533          *
534          * @brief <i> [Deprecated] </i>
535          * @deprecated   This method is deprecated. Instead of using this method, use the SetTextStyle() method.
536          * @since               2.0
537          *
538          * @return              An error code
539          * @param[in]   typefaceName        The name of the font typeface
540          * @param[in]   style               The text style @n
541          *                                                                  Multiple styles can be combined using the bitwise OR operator(see TextBoxTextStyle).
542          * @exception   E_SUCCESS           The method is successful.
543          * @exception   E_INVALID_ARG       A specified input parameter is invalid, or the specified font typeface is not supported.
544          * @exception   E_SYSTEM            A system error has occurred.
545          * @remarks         The specified font typeface must be one of the system fonts. @n
546          *              @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
547          *                              be applied.
548          * @see                 GetFontType()
549          * @see                 Tizen::Graphics::Font::GetSystemFontListN()
550          * @see                 TextBoxTextStyle
551          * @endif
552          */
553         result SetFontType(const Tizen::Base::String& typefaceName, unsigned long style);
554
555         /**
556          * Sets the text style mask of the %TextBox control.
557          *
558          * @since 2.0
559          *
560          * @return                  An error code
561          * @param[in]    style               The text style @n
562          *                      Multiple styles can be combined using the bitwise OR operator (see Tizen::Ui::Controls::TextBoxTextStyle).
563          * @exception    E_SUCCESS           The method is successful.
564          * @exception    E_OUT_OF_MEMORY  The memory is insufficient.
565          * @see                      GetTextStyle()
566          * @see                      TextBoxTextStyle
567          */
568         result SetTextStyle(unsigned long style);
569
570         using Control::SetFont;
571         /**
572          * @if OSPDEPREC
573          * Sets the font to render the text.
574          *
575          * @brief <i> [Deprecated] </i>
576          * @deprecated   This method is deprecated. Instead of using this method, use the SetFont(const String& fontName) method of superclass.
577          * @since               2.0
578          *
579          * @return              An error code
580          * @param[in]   font             The text font
581          * @exception   E_SUCCESS        The method is successful.
582          * @exception   E_SYSTEM         A system error has occurred.
583          * @remarks             All previously set text attributes (style, weight, decoration, and size) will be discarded.
584          * @endif
585          */
586         result SetFont(const Tizen::Graphics::Font& font);
587
588 // Text Block
589         /**
590          * Releases the selection of the current text block.
591          *
592          * @since               2.0
593          *
594          * @return              An error code
595          * @exception   E_SUCCESS          The method is successful.
596          * @exception   E_SYSTEM           A system error has occurred.
597          * @see                 GetBlockRange()
598          * @see                 SetBlockRange()
599          */
600         result ReleaseBlock(void);
601
602         /**
603          * Gets the start and the end index of the currently selected text block.
604          *
605          * @since               2.0
606          *
607          * @return              An error code
608          * @param[out]  start              The start index of the text block
609          * @param[out]  end                The end index of the text block
610          * @exception   E_SUCCESS          The method is successful.
611          * @exception   E_SYSTEM           A system error has occurred.
612          * @remarks             The method returns @c start = 0 and @c end = 0 if there is no selected text block.
613          * @see                 ReleaseBlock()
614          * @see                 SetBlockRange()
615          */
616         result GetBlockRange(int& start, int& end) const;
617
618         /**
619          * Sets the specified block of the text.
620          *
621          * @since               2.0
622          *
623          * @return              An error code
624          * @param[in]   start           The start index of the text block
625          * @param[in]   end             The end index of the text block
626          * @exception   E_SUCCESS       The method is successful.
627          * @exception   E_OUT_OF_RANGE  The specified index is outside the bounds of the data structure. @n
628          *                                                              Either the @c start or @c end parameters are greater than the number of elements or less than @c 0.
629          * @exception   E_SYSTEM        A system error has occurred.
630          * @see                 ReleaseBlock()
631          * @see                 GetBlockRange()
632          */
633         result SetBlockRange(int start, int end);
634
635 // Appearances
636         /**
637          * Gets the color of the %TextBox control for the specified status.
638          *
639          * @since               2.0
640          *
641          * @return              The color of the %TextBox control, @n
642          *                              else RGBA (0,0,0,0) if an error occurs
643          * @param[in]   status                  The state of the %TextBox control
644          * @exception   E_SUCCESS           The method is successful.
645          * @remarks             The specific error code can be accessed using the GetLastResult() method.
646          * @see                 SetColor()
647          */
648         Tizen::Graphics::Color GetColor(TextBoxStatus status) const;
649
650         /**
651          * Gets the text color of the specified text color type.
652          *
653          * @since               2.0
654          *
655          * @return              The color, @n
656          *                              else RGBA (0,0,0,0) if an error occurs
657          * @param[in]   type                            The text color type
658          * @exception   E_SUCCESS                       The method is successful.
659          * @exception   E_SYSTEM                        A system error has occurred.
660          * @remarks             The specific error code can be accessed using the GetLastResult() method.
661          * @see                 SetTextColor()
662          */
663         Tizen::Graphics::Color GetTextColor(TextBoxTextColor type) const;
664
665         /**
666          * Sets the background bitmap of the %TextBox control.
667          *
668          * @since               2.0
669          *
670          * @return              An error code
671          * @param[in]   status                  The state of the %TextBox control
672          * @param[in]   bitmap                  The background bitmap
673          * @exception   E_SUCCESS       The method is successful.
674          * @exception   E_SYSTEM        A system error has occurred.
675          * @see                 SetBackgroundColor()
676          */
677         result SetBackgroundBitmap(TextBoxStatus status, const Tizen::Graphics::Bitmap& bitmap);
678
679         /**
680          * Sets the color of the %TextBox control for the specified status.
681          *
682          * @since               2.0
683          *
684          * @return              An error code
685          * @param[in]   status          The state of the %TextBox control
686          * @param[in]   color           The color to be set
687          * @exception   E_SUCCESS       The method is successful.
688          * @exception   E_SYSTEM        A system error has occurred.
689          * @see                 GetColor()
690          */
691         result SetColor(TextBoxStatus status, const Tizen::Graphics::Color& color);
692
693         /**
694          * Sets the text color of the %TextBox control for the specified text type.
695          *
696          * @since               2.0
697          *
698          * @return              An error code
699          * @param[in]   type             The text color type
700          * @param[in]   color            The text color to be set
701          * @exception   E_SUCCESS        The method is successful.
702          * @exception   E_SYSTEM         A system error has occurred.
703          * @see                 GetTextColor()
704          */
705         result SetTextColor(TextBoxTextColor type, const Tizen::Graphics::Color& color);
706
707         /**
708          * Adds a text block event listener.
709          *
710          * @since               2.0
711          *
712          * @param[in]   listener        The event listener to be added
713          * @remarks             Programmatically modifying the text selection does not cause the text block selection event to fire.
714          * @see                 RemoveTextBlockEventListener()
715          */
716         void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
717
718         /**
719          * Removes the specified text block event listener. @n
720          * The removed listener cannot listen to events when they are fired.
721          *
722          * @since               2.0
723          *
724          * @param[in]   listener        The event listener to be removed
725          * @see                 AddTextBlockEventListener()
726          */
727         void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
728
729 protected:
730         friend class _TextBoxImpl;
731
732 private:
733         TextBox(const TextBox& value);
734         TextBox& operator =(const TextBox& value);
735 };  //TextBox
736 }}} //Tizen::Ui::Controls
737
738 #endif  // _FUI_CTRL_TEXT_BOX_H_