Fix for klockwork minor issues.
[platform/framework/native/uifw.git] / inc / FUiCtrlEditField.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 /**
19  * @file        FUiCtrlEditField.h
20  * @brief       This is the header file for the %EditField class.
21  *
22  * This header file contains the declarations of the %EditField class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_EDIT_FIELD_H_
26 #define _FUI_CTRL_EDIT_FIELD_H_
27
28 #include <FBaseCharacter.h>
29 #include <FBaseString.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpPoint.h>
32 #include <FGrpRectangle.h>
33 #include <FLclLocale.h>
34 #include <FUiControl.h>
35 #include <FUiContainer.h>
36 #include <FUiCtrlControlsTypes.h>
37 #include <FUiCtrlEditTypes.h>
38 #include <FUiCtrlIEditTextFilter.h>
39 #include <FUiCtrlInputTypes.h>
40 #include <FUiIActionEventListener.h>
41 #include <FUiIKeypadEventListener.h>
42 #include <FUiILanguageEventListener.h>
43 #include <FUiIScrollPanelEventListener.h>
44 #include <FUiITextBlockEventListener.h>
45 #include <FUiITextEventListener.h>
46 #include <FUiIUiLinkEventListener.h>
47
48 namespace Tizen { namespace Locales
49 {
50 class Locale;
51 }}
52
53 namespace Tizen { namespace Ui { namespace Controls
54 {
55
56 /**
57  * @class       EditField
58  * @brief   This class defines a common behavior for an %EditField control.
59  *
60  * @since               2.0
61  *
62  * The %EditField class displays a single-line text editor.
63  *
64  * For more information on the class features,
65  * see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_editfield_editarea.htm">EditArea and EditField</a>.
66  *
67  * The following example demonstrates how to use the %EditField class.
68  *
69  * @code
70 // Sample code for EditFieldSample.h
71 #include <FUi.h>
72
73 class EditFieldSample
74         : public Tizen::Ui::Controls::Form
75         , public Tizen::Ui::ITextEventListener
76 {
77 public:
78         EditFieldSample(void)
79         : __pEditField(null){}
80
81         bool Initialize(void);
82         virtual result OnInitializing(void);
83
84         // ITextEventListener
85         virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
86         virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source);
87
88 private:
89         Tizen::Ui::Controls::EditField* __pEditField;
90 };
91  * @endcode
92  *
93  * @code
94 // Sample code for EditFieldSample.cpp
95 #include <FGraphics.h>
96
97 #include "EditFieldSample.h"
98
99 using namespace Tizen::Graphics;
100 using namespace Tizen::Ui::Controls;
101
102 bool
103 EditFieldSample::Initialize(void)
104 {
105         Construct(FORM_STYLE_NORMAL);
106         return true;
107 }
108
109 result
110 EditFieldSample::OnInitializing(void)
111 {
112         result r = E_SUCCESS;
113
114         // Creates an instance of EditField
115         __pEditField = new EditField();
116         __pEditField->Construct(Rectangle(50, 100, 400, 150));
117         __pEditField->AddTextEventListener(*this);
118
119         //Adds the edit field to the Form
120         AddControl(__pEditField);
121
122         return r;
123 }
124
125 // ITextEventListener implementation
126 void
127 EditFieldSample::OnTextValueChanged(const Tizen::Ui::Control& source)
128 {
129     // ....
130 }
131
132 void
133 EditFieldSample::OnTextValueChangeCanceled(const Tizen::Ui::Control& source)
134 {
135     // ....
136 }
137  * @endcode
138  *
139  */
140
141 class _OSP_EXPORT_ EditField
142         : public Tizen::Ui::Control
143 {
144 public:
145         /**
146          * The object is not fully constructed after this constructor is called. @n
147          * For full construction, the %Construct() method must be called right after calling this constructor.
148          *
149          * @since               2.0
150          */
151         EditField(void);
152
153         /**
154         * This polymorphic destructor should be overridden if required.@n
155          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
156         *
157         * @since                2.0
158         */
159         virtual ~EditField(void);
160
161         /**
162          * Initializes this instance of the %EditField control with the specified parameters.
163          *
164          * @since                       2.0
165          *
166          * @return                      An error code
167          * @param[in]           rect            An instance of the Graphics::Rectangle class @n
168          *                                              This instance represents the x and y coordinates of the top-left corner of the created window along with
169          *                                              the width and height of the control. @n
170          *                                              If the size is less than the minimum size, %EditField is constructed with the minimum size. @n
171          *                                              The optimal size of the control is defined in
172          *                                              <a href="../org.tizen.native.appprogramming/html/guide/ui/control_optimalsize.htm">Optimal Size of UI Controls</a>.
173          * @param[in]   style                   The style of the %EditField control
174          * @param[in]   inputStyle              The input style of the %EditField control
175          * @param[in]   showTitle                               Set to @c true to display the title, @n
176          *                                                              else @c false
177          * @param[in]   limitLength             The limit for the length of the text in the %EditField control
178          * @param[in]   groupStyle              The table view style of the %EditField control
179          * @exception   E_SUCCESS                               The method is successful.
180          * @exception   E_INVALID_ARG                   The specified @c limitLength is less than or equal to @c 0, or @n
181          *                                                                              either the @c rect.width or the @c rect.height is less than @c 0.
182          * @exception   E_UNSUPPORTED_OPTION    The specified option is not supported. @n
183          *                                                                              The title is not supported by small style %EditField.
184          * @exception   E_SYSTEM                                A system error has occurred.
185          * @remarks
186          *                      - A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control has been used
187          *                      earlier. The %EditField style of SMALL property cannot be used together with group styles.
188          *                      - Following are the input styles used for creating the different orientations of a keypad:
189          *                              - @c INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.
190          *                              - @c INPUT_STYLE_OVERLAY: The orientation is the same as that of a parent form.
191          */
192         result Construct(const Tizen::Graphics::Rectangle& rect, EditFieldStyle style = EDIT_FIELD_STYLE_NORMAL, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, bool showTitle = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
193
194         /**
195          * Initializes this instance of the %EditField control with the specified parameters.
196          *
197          * @since                       2.1
198          *
199          * @return                      An error code
200          * @param[in]           rect            An instance of the Tizen::Graphics::FloatRectangle class @n
201          *                                              This instance represents the x and y coordinates of the top-left corner of the created window along with
202          *                                              the width and height of the control. @n
203          *                                              If the size is less than the minimum size, %EditField is constructed with the minimum size. @n
204          *                                              The optimal size of the control is defined in
205          *                                              <a href="../org.tizen.native.appprogramming/html/guide/ui/control_optimalsize.htm">Optimal Size of UI Controls</a>.
206          * @param[in]   style                   The style of the %EditField control
207          * @param[in]   inputStyle              The input style of the %EditField control
208          * @param[in]   showTitle                               Set to @c true to display the title, @n
209          *                                                              else @c false
210          * @param[in]   limitLength     The limit for the length of the text in the %EditField control
211          * @param[in]   groupStyle              The table view style of the %EditField control
212          * @exception   E_SUCCESS                               The method is successful.
213          * @exception   E_INVALID_ARG                   The specified @c limitLength is less than or equal to @c 0, or @n
214          *                                                                              either the @c rect.width or the @c rect.height is less than @c 0.
215          * @exception   E_UNSUPPORTED_OPTION    The specified option is not supported. @n
216          *                                                                              The title is not supported by small style %EditField.
217          * @exception   E_SYSTEM                                A system error has occurred.
218          * @remarks
219          *                      - A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control has been used
220          *                      earlier. The %EditField style of SMALL property cannot be used together with group styles.
221          *                      - Following are the input styles used for creating the different orientations of a keypad:
222          *                              - @c INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.
223          *                              - @c INPUT_STYLE_OVERLAY: The orientation is the same as that of a parent form.
224          */
225         result Construct(const Tizen::Graphics::FloatRectangle& rect, EditFieldStyle style = EDIT_FIELD_STYLE_NORMAL, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, bool showTitle = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
226
227         /**
228          * Initializes this instance of the %EditField control.
229          *
230          * @since        2.0
231          *
232          * @return       An error code
233          * @param[in]   rect                    An instance of the Tizen::Graphics::FloatRectangle class @n
234          *                                              This instance represents the x and y coordinates of the top-left corner of the created window along with
235          *                                              the width and height of the control. @n
236          *                                              If the size is less than the minimum size, EditFied() is constructed with the minimum size. @n
237          *                                              The optimal size of the control is defined in
238          *                                              <a href="../org.tizen.native.appprogramming/html/guide/ui/control_optimalsize.htm">Optimal Size of UI Controls</a>.
239          * @param[in]    style           The style of the %EditField control
240          * @param[in]    inputStyle      The input style of the %EditField control
241          * @param[in]    titleStyle      The title style
242          * @param[in]   enableClear                 Set to @c true to enable the clear button, @n
243          *                                                                              else @c false
244          * @param[in]    limitLength     The limit of the length of text in the %EditField control
245          * @param[in]    groupStyle      The table view style of the %EditField control
246          * @exception   E_SUCCESS               The method is successful.
247          * @exception   E_INVALID_ARG           A specified input parameter is invalid. @n
248          *                                      The specified @c limitLength is less than or equal to @c 0. @n
249          *                                                                      The specified @c rect.width or the @c rect.height is less than @c 0.
250          * @exception   E_UNSUPPORTED_OPTION    The specified option is not supported. @n
251          *                                                                              Title is not supported in small style %EditField.
252          * @exception   E_SYSTEM                                A system error has occurred.
253          * @remarks
254          *                      - A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control is used earlier.
255          *                      The %EditField style of SMALL property cannot be used together with group styles.
256          *                      - Following are the input styles used for creating different orientations of a keypad:
257          *                              - @c INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.
258          *                              - @c INPUT_STYLE_OVERLAY: The orientation is similar to the parent form.
259          */
260         result Construct(const Tizen::Graphics::Rectangle& rect, EditFieldStyle style, InputStyle inputStyle, EditFieldTitleStyle titleStyle, bool enableClear = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
261
262         /**
263          * Initializes this instance of the %EditField control.
264          *
265          * @since                2.1
266          *
267          * @return               An error code
268          * @param[in]   rect                    An instance of the Tizen::Graphics::FloatRectangle class @n
269          *                                              This instance represents the x and y coordinates of the top-left corner of the created window along with
270          *                                              the width and height of the control. @n
271          *                                              If the size is less than the minimum size, EditFied() is constructed with the minimum size. @n
272          *                                              The optimal size of the control is defined in
273          *                                              <a href="../org.tizen.native.appprogramming/html/guide/ui/control_optimalsize.htm">Optimal Size of UI Controls</a>.
274          * @param[in]    style                   The style of the %EditField control
275          * @param[in]    inputStyle      The input style of the %EditField control
276          * @param[in]    titleStyle      The title style
277          * @param[in]   enableClear                     Set to @c true to enable the clear button, @n
278          *                                                                              else @c false
279          * @param[in]    limitLength     The limit of the length of text in the %EditField control
280          * @param[in]    groupStyle      The table view style of the %EditField control
281          * @exception   E_SUCCESS                               The method is successful.
282          * @exception   E_INVALID_ARG                   A specified input parameter is invalid. @n
283          *                                                                              The specified @c limitLength is less than or equal to @c 0. @n
284          *                                                                              The specified @c rect.width or the @c rect.height is less than @c 0.
285          * @exception   E_UNSUPPORTED_OPTION    The specified option is not supported. @n
286          *                                                                              Title is not supported in small style %EditField.
287          * @exception   E_SYSTEM                                A system error has occurred.
288          * @remarks
289          *                      - A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control is used earlier.
290          *                      The %EditField style of SMALL property cannot be used together with group styles.
291          *                      - Following are the input styles used for creating different orientations of a keypad:
292          *                              - @c INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.
293          *                              - @c INPUT_STYLE_OVERLAY: The orientation is similar to the parent form.
294          */
295         result Construct(const Tizen::Graphics::FloatRectangle& rect, EditFieldStyle style, InputStyle inputStyle, EditFieldTitleStyle titleStyle, bool enableClear = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE);
296
297 public:
298         /**
299          * Gets the horizontal text alignment of the %EditField control.
300          *
301          * @since               2.0
302          *
303          * @return              The horizontal text alignment
304          * @exception   E_SUCCESS                       The method is successful.
305          * @exception   E_SYSTEM                        A system error has occurred.
306          * @remarks         The specific error code can be accessed using the GetLastResult() method.
307          * @see                 SetTextAlignment()
308          */
309         HorizontalAlignment GetTextAlignment(void) const;
310
311         /**
312          * Sets the horizontal text alignment of the %EditField control.
313          *
314          * @since       2.0
315          *
316          * @return              An error code
317          * @exception   E_SUCCESS                       The method is successful.
318          * @exception   E_SYSTEM                        A system error has occurred.
319          * @see                 GetTextAlignment()
320          */
321         result SetTextAlignment(HorizontalAlignment alignment);
322
323         /**
324          * Checks whether the view mode is enabled. @n
325          * In the view mode, the auto-detected links are displayed as linked text.
326          *
327          * @since       2.0
328          *
329          * @return              @c true if the view mode is enabled, @n
330          *              else @c false
331          * @exception   E_SUCCESS                       The method is successful.
332          * @exception   E_SYSTEM                        A system error has occurred.
333          * @remarks     The specific error code can be accessed using the GetLastResult() method.
334          * @see   SetViewModeEnabled()
335          */
336         bool IsViewModeEnabled(void) const;
337
338         /**
339          * Enables or disables the view mode. @n
340          * In the view mode, the auto-detected links are displayed as linked text.
341          *
342          * @since       2.0
343          *
344          * @return              An error code
345          * @param[in]   enable              Set to @c true to enable the view mode, @n
346          *                                                                      else @c false
347          * @exception   E_SUCCESS                       The method is successful.
348          * @exception   E_SYSTEM                        A system error has occurred.
349          * @see         IsViewModeEnabled()
350          */
351         result SetViewModeEnabled(bool enable);
352
353         /**
354          * Sets the auto-link mask.
355          *
356          * @since               2.0
357          *
358          * @return              An error code
359          * @param[in]   autoLinks                               The auto-link mask @n
360          *                                                              Multiple link types can be combined using bitwise OR operator (see Tizen::Base::Utility::LinkType). @n
361          *                                                              For more information, see <a href="../org.tizen.native.appprogramming/html/guide/ui/auto_link_detection.htm">AutoLink Detection</a>. @n
362          *                                                              When it is set to @c 0, the auto-link detection is disabled.
363          * @exception   E_SUCCESS                               The method is successful.
364          * @exception   E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation @n
365          *                                                                              The input style is not ::INPUT_STYLE_OVERLAY.
366          * @exception   E_SYSTEM                                A system error has occurred.
367          * @see                 Tizen::Base::Utility::LinkType
368          * @see                 GetAutoLinkMask()
369          * @see                 IsViewModeEnabled()
370          * @see                 SetViewModeEnabled()
371          */
372         result SetAutoLinkMask(unsigned long autoLinks);
373
374         /**
375          * Gets the auto-link mask.
376          *
377          * @since               2.0
378          *
379          * @return              The auto-link mask
380          * @exception   E_SUCCESS                               The method is successful.
381          * @exception   E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation @n
382          *                                                                              The input style is not ::INPUT_STYLE_OVERLAY.
383          * @exception   E_SYSTEM                                A system error has occurred.
384          * @remarks             The specific error code can be accessed using the GetLastResult() method.
385          * @see                 SetAutoLinkMask()
386          */
387         unsigned long GetAutoLinkMask(void) const;
388
389         /**
390          * Adds a link event listener. @n
391          * The added listener is notified when the links are selected by the user. @n
392          * The %AddUiLinkEventListener() method is supported when the input style is ::INPUT_STYLE_OVERLAY.
393          *
394          * @since               2.0
395          *
396          * @param[in]   listener        The event listener to add
397          * @see                 RemoveUiLinkEventListener()
398          */
399         void AddUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
400
401         /**
402          * Removes the specified link event listener. @n
403          * The removed listener cannot listen to events when they are fired. @n
404          * The %RemoveUiLinkEventListener() method is supported when the input style is ::INPUT_STYLE_OVERLAY.
405          *
406          * @since               2.0
407          *
408          * @param[in]   listener        The event listener to remove
409          * @see                 AddUiLinkEventListener()
410          */
411         void RemoveUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
412
413         /**
414          * Gets the margin value of the specified margin type.
415          *
416          * @since       2.0
417          *
418          * @return          The margin value of the specified margin type, @n
419          *                              else @c -1 if an error occurs
420          * @param[in]   marginType              The margin type
421          * @exception   E_SUCCESS               The method is successful.
422          * @exception   E_SYSTEM                A system error has occurred.
423          * @remarks     The specific error code can be accessed using the GetLastResult() method.
424          * @see         SetMargin()
425          */
426         int GetMargin(EditMarginType marginType) const;
427
428         /**
429          * Gets the margin value of the specified margin type.
430          *
431          * @since       2.1
432          *
433          * @return          The margin value of the specified margin type, @n
434          *                              else @c -1 if an error occurs
435          * @param[in]   marginType              The margin type
436          * @exception   E_SUCCESS               The method is successful.
437          * @exception   E_SYSTEM                A system error has occurred.
438          * @remarks     The specific error code can be accessed using the GetLastResult() method.
439          * @see         SetMargin()
440          */
441         float GetMarginF(EditMarginType marginType) const;
442
443         /**
444          * Sets the margin for the specified margin type.
445          *
446          * @since       2.0
447          *
448          * @return          An error code
449          * @param[in]   marginType              The margin type
450          * @param[in]   margin                  The margin to set
451          * @exception   E_SUCCESS               The method is successful.
452          * @exception   E_INVALID_ARG   A specified input parameter is invalid. @n
453          *                                                              The specified @c margin cannot be a negative integer.
454          * @exception   E_SYSTEM                A system error has occurred.
455          * @see         GetMargin()
456          */
457         result SetMargin(EditMarginType marginType, int margin);
458
459         /**
460          * Sets the margin for the specified margin type.
461          *
462          * @since       2.1
463          *
464          * @return          An error code
465          * @param[in]   marginType              The margin type
466          * @param[in]   margin                  The margin to set
467          * @exception   E_SUCCESS               The method is successful.
468          * @exception   E_INVALID_ARG   A specified input parameter is invalid. @n
469          *                                                              The specified @c margin cannot be a negative integer.
470          * @exception   E_SYSTEM                A system error has occurred.
471          * @see         GetMarginF()
472          */
473         result SetMargin(EditMarginType marginType, float margin);
474
475         /**
476          * Enables or disables the keypad action.
477          *
478          * @since 2.0
479          * @return      An error code
480          * @param[in]   enable  Set to @c true to enable the keypad action, @n
481          *                                              else @c false
482          * @exception   E_SUCCESS                               The method is successful.
483          * @exception   E_UNSUPPORTED_OPERATION  The underlying input method does not support this operation.
484          * @remarks     Depending on the value of input param, the enter key have a enable or disable look accordingly.
485          */
486         result SetKeypadActionEnabled(bool enable);
487
488         /**
489          * Checks whether the keypad action is enabled.
490          *
491          * @since 2.0
492          * @return              @c true if the keypad action is enabled, @n
493          *                              else @c false
494          */
495         bool IsKeypadActionEnabled(void) const;
496
497         /**
498          * Gets the keypad action type.
499          *
500          * @since               2.0
501          *
502          * @return      The keypad action
503          * @exception   E_SUCCESS                               The method is successful.
504          * @exception   E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
505          *                                                                              The input style is not ::INPUT_STYLE_OVERLAY.
506          * @exception   E_SYSTEM                A system error has occurred.
507          * @remarks     The specific error code can be accessed using the GetLastResult() method.
508          * @see         SetKeypadAction()
509          */
510         Tizen::Ui::KeypadAction GetKeypadAction(void) const;
511
512         /**
513          * Sets the keypad action type.
514          *
515          * @since               2.0
516          *
517          * @return      An error code
518          * @param[in]   keypadAction                    The keypad action
519          * @exception   E_SUCCESS                               The method is successful.
520          * @exception   E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
521          *                                                                              The input style is not ::INPUT_STYLE_OVERLAY.
522          * @exception   E_SYSTEM                                A system error has occurred.
523          * @remarks             Depending on the value of input param, the enter key label of the keypad changes accordingly.
524          * @see         GetKeypadAction()
525          */
526         result SetKeypadAction(Tizen::Ui::KeypadAction keypadAction);
527
528         /**
529          * Sets the visibility of the command buttons of the overlay style keypad.
530          *
531          * @since               2.0
532          *
533          * @return              An error code
534          * @param[in]   visible                                 Set to @c true to set the visibility of the overlay keypad command buttons, @n
535          *                                      else @c false
536          * @exception   E_SUCCESS                               The method is successful.
537          * @exception   E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
538          *                                                                              The input style is not ::INPUT_STYLE_OVERLAY.
539          * @exception   E_SYSTEM                                A system error has occurred.
540          */
541         result SetOverlayKeypadCommandButtonVisible(bool visible);
542
543         /**
544          * Checks whether the command buttons of the overlay style keypad are visible.
545          *
546          * @since       2.0
547          *
548          * @return      @c true if the overlay command buttons are visible, @n
549          *              else @c false
550          * @exception   E_SUCCESS                   The method is successful.
551          * @exception   E_UNSUPPORTED_OPERATION         The current state of the instance prohibits the execution of the specified operation. @n
552          *                                                                              The input style is not ::INPUT_STYLE_OVERLAY.
553          * @exception   E_SYSTEM                    A system error has occurred.
554          * @remarks     The specific error code can be accessed using the GetLastResult() method.
555          */
556         bool IsOverlayCommandButtonVisible(void) const;
557
558         /**
559          * Hides the keypad.
560          *
561          * @since       2.0
562          *
563          * @return      An error code
564          * @exception   E_SUCCESS                               The method is successful.
565          * @exception   E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
566          *                                                                      The input style is not ::INPUT_STYLE_OVERLAY.
567          * @exception   E_SYSTEM                                A system error has occurred.
568          * @see         ShowKeypad()
569          */
570         result HideKeypad(void);
571
572         /**
573          * Gets the position of the ellipsis.
574          *
575          * @since       2.0
576          *
577          * @return      The ellipsis position
578          * @exception   E_SUCCESS                       The method is successful.
579          * @exception   E_SYSTEM                        A system error has occurred.
580          * @remarks     The specific error code can be accessed using the GetLastResult() method.
581          * @see         SetEllipsisPosition()
582          */
583         EllipsisPosition GetEllipsisPosition(void) const;
584
585         /**
586          * Sets the position of the ellipsis.
587          *
588          * @since       2.0
589          *
590          * @return      An error code
591          * @param[in]   position        The ellipsis position
592          * @exception   E_SUCCESS                       The method is successful.
593          * @exception   E_SYSTEM                        A system error has occurred.
594          * @see         GetEllipsisPosition()
595          */
596         result SetEllipsisPosition(EllipsisPosition position);
597
598         /**
599          * Gets the text size.
600          *
601          * @since       2.0
602          *
603          * @return      The size of the text, @n
604          *              else @c -1 if an error occurs
605          * @exception   E_SUCCESS                       The method is successful.
606          * @exception   E_SYSTEM                        A system error has occurred.
607          * @remarks     The specific error code can be accessed using the GetLastResult() method.
608          * @see         SetTextSize()
609          */
610         int GetTextSize(void) const;
611
612         /**
613          * Gets the text size.
614          *
615          * @since       2.1
616          *
617          * @return      The size of the text, @n
618          *              else @c -1 if an error occurs
619          * @exception   E_SUCCESS                       The method is successful.
620          * @exception   E_SYSTEM                        A system error has occurred.
621          * @remarks     The specific error code can be accessed using the GetLastResult() method.
622          * @see         SetTextSize()
623          */
624         float GetTextSizeF(void) const;
625
626         /**
627          * Sets the text size.
628          *
629          * @since               2.0
630          *
631          * @return              An error code
632          * @param[in]   size                    The text size @n
633          *                                              The size should be greater than or equal to minimum font size which is 4.
634          * @exception   E_SUCCESS               The method is successful.
635          * @exception   E_INVALID_ARG   The specified input parameter is invalid. @n
636          *                                                              The @c size cannot be a negative integer.
637          * @exception   E_SYSTEM                A system error has occurred.
638          * @see                 GetTextSize()
639          */
640         result SetTextSize(int size);
641
642         /**
643          * Sets the text size.
644          *
645          * @since               2.1
646          *
647          * @return              An error code
648          * @param[in]   size                    The text size @n
649          *                                              The size should be greater than or equal to minimum font size which is 4.0f.
650          * @exception   E_SUCCESS               The method is successful.
651          * @exception   E_INVALID_ARG   The specified input parameter is invalid. @n
652          *                                                              The @c size cannot be a negative integer.
653          * @exception   E_SYSTEM                A system error has occurred.
654          * @see                 GetTextSizeF()
655          */
656         result SetTextSize(float size);
657
658         /**
659          * Gets the color of the %EditField control for the specified status.
660          *
661          * @since        2.0
662          *
663          * @return       The color, @n
664          *                               else RGBA(0,0,0,0) if an error occurs
665          * @param[in]    status                         The status
666          * @exception   E_SUCCESS                       The method is successful.
667          * @exception   E_SYSTEM                        A system error has occurred.
668          * @remarks      The specific error code can be accessed using the GetLastResult() method.
669          */
670         Tizen::Graphics::Color GetColor(EditStatus status) const;
671
672         /**
673          * Gets the text color of the specified text color type.
674          *
675          * @since               2.0
676          *
677          * @return              The color, @n
678          *                              else RGBA(0,0,0,0) if an error occurs
679          * @param[in]   type                    The text color type
680          * @exception   E_SUCCESS               The method is successful.
681          * @exception   E_SYSTEM                A system error has occurred.
682          * @remarks             The specific error code can be accessed using the GetLastResult() method.
683          * @see                 SetTextColor()
684          */
685         Tizen::Graphics::Color GetTextColor(EditTextColor type) const;
686
687         /**
688          * Sets the background bitmap of the %EditField control for the specified status.
689          *
690          * @since               2.0
691          *
692          * @return              An error code
693          * @param[in]   status                  The status
694          * @param[in]   bitmap                  The background bitmap
695          * @exception   E_SUCCESS               The method is successful.
696          * @exception   E_SYSTEM                A system error has occurred.
697          */
698         result SetBackgroundBitmap(EditStatus status, const Tizen::Graphics::Bitmap& bitmap);
699
700         /**
701          * Sets the color of the %EditField control for the specified status.
702          *
703          * @since               2.0
704          *
705          * @return              An error code
706          * @param[in]   status                  The status
707          * @param[in]   color                   The color
708          * @exception   E_SUCCESS               The method is successful.
709          * @exception   E_SYSTEM                A system error has occurred.
710          * @see                 GetColor()
711          */
712         result SetColor(EditStatus status, const Tizen::Graphics::Color& color);
713
714         /**
715          * Sets the text color of the %EditField control for the specified text color type.
716          *
717          * @since               2.0
718          *
719          * @return              An error code
720          * @param[in]   type                    The text color type
721          * @param[in]   color                   The text color
722          * @exception   E_SUCCESS               The method is successful.
723          * @exception   E_SYSTEM                A system error has occurred.
724          * @see                 GetTextColor()
725          */
726         result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color);
727
728         /**
729          * Gets a portion of text that is displayed by the %EditField control.
730          *
731          * @since               2.0
732          *
733          * @return      The specified portion of the text, @n
734          *                              else an empty string if an error occurs
735          * @param[in]   start                   The starting index of the range
736          * @param[in]   end                             The last index of the range
737          * @exception   E_SUCCESS               The method is successful.
738          * @exception   E_OUT_OF_RANGE  The specified index is outside the bounds of the data structure, or @n
739          *                                                              the index is greater than the number of elements or less than @c 0.
740          * @exception   E_SYSTEM                A system error has occurred.
741          * @remarks     The specific error code can be accessed using the GetLastResult() method.
742          * @see         SetText()
743          */
744         Tizen::Base::String GetText(int start, int end) const;
745
746         /**
747          * Adds a keypad event listener. @n
748          * The added listener is notified when the keypad associated with the %EditField control is opened or closed.
749          *
750          * @since       2.0
751          *
752          * @param[in]   listener        The event listener to add
753          * @see         RemoveKeypadEventListener()
754          */
755         void AddKeypadEventListener(IKeypadEventListener& listener);
756
757         /**
758          * Removes the specified keypad event listener. @n
759          * The removed listener cannot listen to events when they are fired.
760          *
761          * @since       2.0
762          *
763          * @param[in]   listener        The event listener to remove
764          * @see         AddKeypadEventListener()
765          */
766         void RemoveKeypadEventListener(IKeypadEventListener& listener);
767
768         /**
769          * Adds a text block event listener. @n
770          * The added listener is notified when the text block is selected.
771          *
772          * @since               2.0
773          *
774          * @param[in]   listener        The event listener to add
775          * @remarks             Programmatically modifying the text block does not cause the text block selection event to fire.
776          * @see                 RemoveTextBlockEventListener()
777          */
778         void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
779
780         /**
781          * Removes the specified text block event listener. @n
782          * The removed listener cannot listen to events when they are fired.
783          *
784          * @since       2.0
785          *
786          * @param[in]   listener        The event listener to remove
787          * @see                 AddTextBlockEventListener()
788          */
789         void RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener);
790
791         /**
792          * Adds the ITextEventListener instance. @n
793          * The added listener listens to events on the context of the specified event dispatcher when they are fired.
794          *
795          * @since               2.0
796          *
797          * @param[in]   listener    The listener to add
798          */
799         void AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
800
801         /**
802         * Removes the ITextEventListener instance. @n
803         * The removed listener cannot listen to events when they are fired.
804         *
805         * @since                2.0
806         *
807         * @param[in]    listener    The listener to remove
808         */
809         void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
810
811         /**
812          * Adds the specified listener instance to listen to the scroll panel events. @n
813          * To listen to the scroll panel events, the parent of EditArea must be an instance of ScrollPanel.
814          *
815          * @since               2.0
816          *
817          * @param[in]   listener        The listener to add
818          * @remarks     When IScrollPanelEventListener::OnOverlayControlCreated() or IScrollPanelEventListener::OnOvelayControlClosed() is called,
819          *                      the application resets the bounds of the controls placed within the ScrollPanel control. %ScrollPanel is automatically
820          *                      drawn again after this method is called.
821          * @see         RemoveScrollPanelEventListener()
822          */
823         void AddScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
824
825         /**
826         * Removes the specified scroll panel event listener instance. @n
827         * The removed listener cannot listen to events when they are fired.
828         *
829         * @since                2.0
830         *
831         * @param[in]    listener        The listener to remove
832         */
833         void RemoveScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener);
834
835         /**
836          * Adds the specified listener instance. @n
837          * The added listener can listen to events on the context of the given event dispatcher when they are fired.
838          *
839          * @since               2.0
840          *
841          * @param[in]   listener        The event listener to add
842          */
843         void AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
844
845         /**
846          * Removes a listener instance. @n
847          * The removed listener cannot listen to events when they are fired.
848          *
849          * @since                       2.0
850          *
851          * @param[in]   listener        The event listener to remove
852          */
853         void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
854
855         /**
856          * Adds the specified listener instance for language events. @n
857          * The added listener is notified when the input language is changed.
858          *
859          * @since      2.0
860          *
861          * @param[in]  listener                         The listener to add
862          * @remarks    The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener.
863          * @see            RemoveLanguageEventListener()
864          */
865         void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
866
867         /**
868          * Removes the specified listener instance. @n
869          * The removed listener cannot listen to events when they are fired.
870          *
871          * @since      2.0
872          *
873          * @param[in]  listener                         The listener to remove
874          * @see            AddLanguageEventListener()
875          */
876         void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener);
877
878         /**
879          * Gets the remaining length of the %EditField control.
880          *
881          * @since       2.0
882          *
883          * @return      The remaining length of the %EditField control, @n
884          *                      else @c -1 if an error occurs
885          */
886         int GetRemainingLength(void) const;
887
888         /**
889          * Enables or disables the lowercase mode.
890          *
891          * @since               2.0
892          *
893          * @param[in]   enable  Set to @c true to enable the lowercase mode, @n
894          *                      else @c false
895          */
896         void SetLowerCaseModeEnabled(bool enable);
897
898         /**
899          * Checks whether the lowercase mode is enabled.
900          *
901          * @since       2.0
902          *
903          * @return      @c true if the lowercase mode is enabled, @n
904          *                      else @c false
905          */
906         bool IsLowerCaseModeEnabled(void) const;
907
908         /**
909          * @if OSPDEPREC
910          * Sets the input mode category.
911          *
912          * @brief <i> [Deprecated]  </i>
913          * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
914          *                         or the current mode to initially set the keypad to, from this list. It is recommended to use EditFieldStyle in the Construct() method instead.
915          * @since        2.0
916          *
917          * @return       An error code
918          * @param[in]    categories             The categories to set @n
919          *                              Multiple input categories can be combined using bitwise OR operator (see Tizen::Ui::Controls::EditInputModeCategory).
920          * @param[in]    enable                 The category value to set
921          * @exception    E_SUCCESS                              The method is successful.
922          * @exception    E_INVALID_ARG                  A specified input mode category is invalid.
923          * @exception    E_INVALID_OPERATION    The current state of the instance prohibits the execution of the specified operation @n
924          *                                                                              The specified @c categories cannot be supported with the current keypad style.
925          * @exception    E_SYSTEM                               A system error has occurred.
926          * @endif
927          */
928         result SetInputModeCategory(unsigned long categories, bool enable);
929
930         /**
931          * @if OSPDEPREC
932          * Sets the current input mode category.
933          *
934          * @brief <i> [Deprecated]  </i>
935          * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n
936          *                         or the current mode to initially set the keypad to, from this list. It is recommended to use EditFieldStyle in the Construct() method instead.
937          * @since               2.0
938          *
939          * @return              An error code
940          * @param[in]   inputModeCategory   An item of input category
941          * @exception   E_SUCCESS                       The method is successful.
942          * @exception   E_SYSTEM                        A system error has occurred.
943          * @endif
944          */
945         result SetCurrentInputModeCategory(EditInputModeCategory inputModeCategory);
946
947         /**
948          * @if OSPDEPREC
949          * Gets the input mode category.
950          *
951          * @brief <i> [Deprecated]  </i>
952          * @deprecated This method is deprecated because we no longer provide a method to specify the list of styles which the user can set the keypad to.
953          * @since       2.0
954          *
955          * @return  A bitwise combination of Tizen::Ui::Controls::EditInputModeCategory, @n
956          *                      else EDIT_INPUTMODE_ALPHA if an error occurs
957          * @endif
958          */
959         unsigned long GetInputModeCategory(void) const;
960
961         /**
962          * @if OSPDEPREC
963          * Gets the current input mode category.
964          *
965          * @brief <i> [Deprecated]  </i>
966          * @deprecated This method is deprecated because we no longer provide a method to specify the list of styles which the user can set the keypad to.
967          * @since    2.0
968          *
969          * @return   The current input mode category
970          * @endif
971          */
972         EditInputModeCategory GetCurrentInputModeCategory(void) const;
973
974         /**
975          * Sets the cursor in the %EditField control at the specified position.
976          *
977          * @since               2.0
978          *
979          * @return              An error code
980          * @param[in]   position                The cursor position to set
981          * @exception   E_SUCCESS               The method is successful.
982          * @exception   E_OUT_OF_RANGE  The specified @c position is less than @c 0 or greater than the maximum length.
983          * @exception   E_SYSTEM                A system error has occurred.
984          */
985         result SetCursorPosition(int position);
986
987         /**
988          * Gets the cursor position.
989          *
990          * @since                       2.0
991          *
992          * @return                      The current cursor position, @n
993          *                  else @c -1 if an error occurs
994          */
995         int GetCursorPosition(void) const;
996
997         /**
998          * Gets the text that is displayed by the %EditField control.
999          *
1000          * @since       2.0
1001          *
1002          * @return      The text of the %EditField control, @n
1003          *          else an empty string if an error occurs
1004          */
1005         Tizen::Base::String GetText(void) const;
1006
1007         /**
1008          * Gets the length of the text that is displayed by the %EditField control.
1009          *
1010          * @since       2.0
1011          *
1012          * @return      The length of the text, @n
1013          *          else @c -1 if an error occurs
1014          */
1015         int GetTextLength(void) const;
1016
1017         /**
1018          * Sets the text of the %EditField control.
1019          *
1020          * @since               2.0
1021          *
1022          * @param[in]   text                    The text to display by the %EditField control @n
1023          *                                              Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
1024          * @exception   E_SUCCESS               The method is successful.
1025          * @exception   E_INVALID_ARG   The specified input parameter is invalid. @n
1026          *                                                              The length of the specified @c text exceeds the system limitation or the limit length.
1027          * @exception   E_SYSTEM                A system error has occurred.
1028          */
1029         result SetText(const Tizen::Base::String& text);
1030
1031         /**
1032          * Inserts the specified text at the current cursor position.
1033          *
1034          * @since               2.0
1035          *
1036          * @return              An error code
1037          * @param[in]   text        The text to insert @n
1038          *                                      Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
1039          * @exception   E_SUCCESS   The method is successful.
1040          * @exception   E_SYSTEM    A system error has occurred.
1041          */
1042         result InsertTextAtCursorPosition(const Tizen::Base::String& text);
1043
1044         /**
1045          * Appends the specified text at the end of the existing text.
1046          *
1047          * @since               2.0
1048          *
1049          * @return              An error code
1050          * @param[in]   text        The text to append @n
1051          *                                      Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
1052          * @exception   E_SUCCESS   The method is successful.
1053          * @exception   E_SYSTEM    A system error has occurred.
1054          */
1055         result AppendText(const Tizen::Base::String& text);
1056
1057         /**
1058          * Appends the specified character at the end of the existing text.
1059          *
1060          * @since               2.0
1061          *
1062          * @return      An error code
1063          * @param[in]   character               The character to append
1064          * @exception   E_SUCCESS               The method is successful.
1065          * @exception   E_SYSTEM                A system error has occurred.
1066          * @remarks             The method modifies the text buffer that is managed by the %EditField control. To display the
1067          *              changes, the control must be drawn again.
1068          */
1069         result AppendCharacter(const Tizen::Base::Character& character);
1070
1071         /**
1072          * Clears the text that is displayed by the %EditField control.
1073          *
1074          * @since               2.0
1075          *
1076          * @return              An error code
1077          * @exception   E_SUCCESS               The method is successful.
1078          * @exception   E_SYSTEM                A system error has occurred.
1079          * @remarks             The method modifies the text buffer that is managed by the %EditField control. To display the
1080          *              changes, the control must be drawn again.
1081          */
1082         result Clear(void);
1083
1084         /**
1085          * Deletes a character at the current cursor position.
1086          *
1087          * @since               2.0
1088          *
1089          * @return              An error code
1090          * @exception   E_SUCCESS               The method is successful.
1091          * @exception   E_SYSTEM                A system error has occurred.
1092          * @remarks             The method modifies the text buffer that is managed by the %EditField control. To display the
1093          *              changes, the control must be drawn again.
1094          */
1095         result DeleteCharacterAtCursorPosition(void);
1096
1097         /**
1098          * Gets the range of the current text block.
1099          *
1100          * @since        2.0
1101          *
1102          * @param[out]   start   The first index of the current text block
1103          * @param[out]   end     The last index of the current text block
1104          */
1105         void GetCurrentTextRange(int& start, int& end) const;
1106
1107         /**
1108          * Sets the guide text.
1109          *
1110          * @since               2.0
1111          *
1112          * @param[in]   guideText    The guide text that is displayed in the %EditField control when the focus is given to it and no text is entered.
1113          */
1114         void SetGuideText(const Tizen::Base::String& guideText);
1115
1116         /**
1117          * Gets the guide text.
1118          *
1119          * @since       2.0
1120          *
1121          * @return      The guide text, @n
1122          *              else an empty string if an error occurs
1123          * @exception   E_SUCCESS                       The method is successful.
1124          * @exception   E_SYSTEM                        A system error has occurred.
1125          * @remarks     The specific error code can be accessed using the GetLastResult() method.
1126          * @see         SetGuideText()
1127          */
1128         Tizen::Base::String GetGuideText(void) const;
1129
1130         /**
1131          * Gets the text color of the guide text.
1132          *
1133          * @since       2.0
1134          *
1135          * @return      The guide text color
1136          * @exception   E_SUCCESS                       The method is successful.
1137          * @exception   E_SYSTEM                        A system error has occurred.
1138          * @remarks     The specific error code can be accessed using the GetLastResult() method.
1139          * @see         SetGuideTextColor()
1140          */
1141         Tizen::Graphics::Color GetGuideTextColor(void) const;
1142
1143         /**
1144          * Sets the text color of the guide text.
1145          *
1146          * @since       2.0
1147          *
1148          * @return      An error code
1149          * @param[in]   color            The guide text color
1150          * @exception   E_SUCCESS                       The method is successful.
1151          * @exception   E_SYSTEM                        A system error has occurred.
1152          * @see         GetGuideTextColor()
1153          */
1154         result SetGuideTextColor(const Tizen::Graphics::Color& color);
1155
1156         /**
1157          * Gets the text color of the title for the specified status.
1158          *
1159          * @since               2.0
1160          *
1161          * @return              The title text color, @n
1162          *                              else RGBA(0,0,0,0) if an error occurs
1163          * @param[in]   status                  The state of the %EditField control
1164          * @exception   E_SUCCESS               The method is successful.
1165          * @exception   E_SYSTEM                A system error has occurred.
1166          * @remarks             The specific error code can be accessed using the GetLastResult() method.
1167          * @see                 SetTitleTextColor()
1168          */
1169         Tizen::Graphics::Color GetTitleTextColor(EditStatus status) const;
1170
1171         /**
1172          * Sets the text color of the title for the specified status.
1173          *
1174          * @since       2.0
1175          *
1176          * @return          An error code
1177          * @param[in]   status                  The state of the %EditField control
1178          * @param[in]   color                   The title text color
1179          * @exception   E_SUCCESS               The method is successful.
1180          * @exception   E_SYSTEM                A system error has occurred.
1181          * @see         GetTitleTextColor()
1182          */
1183         result SetTitleTextColor(EditStatus status, const Tizen::Graphics::Color& color);
1184
1185         /**
1186          * Enables or disables the keypad.
1187          *
1188          * @since               2.0
1189          *
1190          * @param[in]   enable  Set to @c true to enable the keypad,
1191          *                      else @c false
1192          */
1193         void SetKeypadEnabled(bool enable);
1194
1195         /**
1196          * Checks whether the keypad is enabled.
1197          *
1198          * @since        2.0
1199          *
1200          * @return       @c true if the keypad is enabled, @n
1201          *               else @c false
1202          */
1203         bool IsKeypadEnabled(void) const;
1204
1205         /**
1206         * Checks whether the text prediction is enabled.
1207         *
1208         * @since 2.0
1209         * @return                @c true if the text prediction is enabled, @n
1210         *                                 else @c false
1211         * @see                      SetTextPredictionEnabled()
1212         */
1213         bool IsTextPredictionEnabled(void) const;
1214
1215         /**
1216         * Enables or disables the text prediction.
1217         *
1218         * @since 2.0
1219         * @param[in]           enable                       Set to @c true to enable the text prediction, @n
1220         *                                                                    else @c false
1221         * @return                An error code
1222         * @exception           E_SUCCESS                The method is successful.
1223         * @exception            E_UNSUPPORTED_OPERATION     This operation is not supported.
1224         * @see                      IsTextPredictionEnabled()
1225         */
1226         result SetTextPredictionEnabled(bool enable);
1227
1228         /**
1229          * Displays the keypad. @n
1230          * The %ShowKeypad() method is supported only when the input style is ::INPUT_STYLE_OVERLAY.
1231          *
1232          * @since               2.0
1233          *
1234          * @return              An error code
1235          * @exception   E_SUCCESS       The method is successful.
1236          * @exception   E_INVALID_STATE This instance is in an invalid state.
1237          * @exception   E_SYSTEM                A system error has occurred.
1238          */
1239         result ShowKeypad(void);
1240
1241         /**
1242          * Gets the range of the current text block that is selected.
1243          *
1244          * @since               2.0
1245          *
1246          * @param[out]  start   The starting index of the current block
1247          * @param[out]  end     The end index of the current block
1248          */
1249         void GetBlockRange(int& start, int& end) const;
1250
1251         /**
1252          * Begins the text block from the current cursor position.
1253          *
1254          * @since               2.0
1255          *
1256          * @return              An error code
1257          * @exception   E_SUCCESS               The method is successful.
1258          * @exception   E_SYSTEM                A system error has occurred.
1259          * @remarks             Move the cursor position to the end of the text block.
1260          * @see         SetCursorPosition()
1261          * @see         ReleaseBlock()
1262          * @see                 IsBlocked()
1263          */
1264         result BeginBlock(void);
1265
1266         /**
1267          * Releases the selection of the current text block.
1268          *
1269          * @since               2.0
1270          *
1271          * @return              An error code
1272          * @exception   E_SUCCESS               The method is successful.
1273          * @exception   E_SYSTEM                A system error has occurred.
1274          * @see         BeginBlock()
1275          * @see                 IsBlocked()
1276          */
1277         result ReleaseBlock(void);
1278
1279         /**
1280          * Checks whether a portion of the text is blocked.
1281          *
1282          * @since       2.0
1283          *
1284          * @return      @c true if the text is blocked, @n
1285          *                      else @c false
1286          * @see     BeginBlock()
1287          * @see         ReleaseBlock()
1288          */
1289         bool IsBlocked(void) const;
1290
1291         /**
1292          * Copies the text block to the clipboard.
1293          *
1294          * @since               2.0
1295          *
1296          * @return              An error code
1297          * @exception   E_SUCCESS       The method is successful.
1298          * @exception   E_SYSTEM        A system error has occurred.
1299          * @see         Cut()
1300          * @see         Paste()
1301          * @see         Remove()
1302          */
1303         result Copy(void);
1304
1305         /**
1306          * Cuts the text block and copies it to the clipboard.
1307          *
1308          * @since               2.0
1309          *
1310          * @return              An error code
1311          * @exception   E_SUCCESS               The method is successful.
1312          * @exception   E_SYSTEM                A system error has occurred.
1313          * @see                 Copy()
1314          * @see                 Remove()
1315          * @see                 Paste()
1316          */
1317         result Cut(void);
1318
1319         /**
1320          * Pastes the copied text at the cursor position.
1321          *
1322          * @since               2.0
1323          *
1324          * @return              An error code
1325          * @exception   E_SUCCESS       The method is successful.
1326          * @exception   E_SYSTEM        A system error has occurred.
1327          * @see                 Copy()
1328          * @see                 Cut()
1329          * @see                 Remove()
1330          */
1331         result Paste(void);
1332
1333         /**
1334          * Removes the text that is marked by the text block.
1335          *
1336          * @since               2.0
1337          *
1338          * @return              An error code
1339          * @exception   E_SUCCESS               The method is successful.
1340          * @exception   E_SYSTEM                A system error has occurred.
1341          * @see                 Copy()
1342          * @see                 Cut()
1343          * @see                 Paste()
1344          */
1345         result Remove(void);
1346
1347         /**
1348          * Checks whether the text in the %EditField control is clipped.
1349          *
1350          * @since       2.0
1351          *
1352          * @return      @c true if the text is clipped, @n
1353          *                      else @c false
1354          * @remarks     'clipped' means that the text is copied to the clipboard.
1355          * @see         Copy()
1356          * @see         Cut()
1357          * @see         Paste()
1358          * @see         Remove()
1359          */
1360         bool IsClipped(void) const;
1361
1362         /**
1363          * Sets the title of the %EditField control.
1364          *
1365          * @since               2.0
1366          *
1367          * @return              An error code
1368          * @param[in]   title                   The title to set
1369          * @exception   E_SUCCESS               The method is successful.
1370          * @exception   E_SYSTEM                A system error has occurred.
1371          */
1372         result SetTitleText(const Tizen::Base::String& title);
1373
1374         /**
1375          * Gets the title text of the %EditField control.
1376          *
1377          * @since               2.0
1378          *
1379          * @return              The title text, @n
1380          *                              else an empty string if an error occurs
1381          */
1382         Tizen::Base::String GetTitleText(void) const;
1383
1384         /**
1385          * Sets the command button properties of the keypad. @n
1386          * The %SetOverlayKeypadCommandButton() method is supported only when the input style is ::INPUT_STYLE_OVERLAY.
1387          *
1388          * @since       2.0
1389          *
1390          * @return              An error code
1391          * @param[in]   position                        The position of the command button
1392          * @param[in]   text                            The label of the command button
1393          * @param[in]   actionId                        The action ID
1394          * @exception   E_SUCCESS           The method is successful.
1395          * @exception   E_SYSTEM            A system error has occurred.
1396          */
1397         result SetOverlayKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId);
1398
1399         /**
1400          * Gets the text of the specified command button. @n
1401          * The %GetOverlayKeypadCommandButtonText() method is supported only when the input style is ::INPUT_STYLE_OVERLAY.
1402          *
1403          * @since               2.0
1404          *
1405          * @return              The text of the specified command button
1406          * @param[in]   position    The position of the command button
1407          */
1408         Tizen::Base::String GetOverlayKeypadCommandButtonText(CommandButtonPosition position) const;
1409
1410         /**
1411          * Gets the action ID of the specified command button. @n
1412          * The %GetOverlayKeypadCommandButtonActionId() method is supported only when the input style is ::INPUT_STYLE_OVERLAY.
1413          *
1414          * @since               2.0
1415          *
1416          * @return              The action ID of the specified command button
1417          * @param[in]   position    The position of the command button
1418          */
1419         int GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const;
1420
1421         /**
1422           * Sets the input language.
1423           *
1424           * @since      2.0
1425           *
1426           * @brief <i> [Deprecated]  </i>
1427           * @deprecated We no longer provide a method to set the language of the current keypad. @n
1428           *                                This method is provided only for backward compatibility and will be deleted in the near future.
1429           * @return     An error code
1430           * @param[in]  languageCode                            The language to set
1431           * @exception  E_SUCCESS                               The method is successful.
1432           * @exception  E_OUT_OF_MEMORY                   The memory is insufficient.
1433           * @remarks
1434           *                     - The application can set the language of the current keypad that is associated with the current %EditField.
1435           *                     - This method only works if the language to set is supported by the current preloaded keypad.
1436           */
1437         result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
1438
1439         /**
1440           * Gets the current input language.
1441           *
1442           * @since      2.0
1443           *
1444           * @return     An error code
1445           * @param[out] language               The current input language of the keypad that is associated with the current %EditField
1446           * @exception  E_SUCCESS                               The method is successful.
1447           */
1448         result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
1449
1450         /**
1451          * Sets the text filter.
1452          *
1453          * @since               2.1
1454          *
1455          * @param[in]           pFilter The filter to set
1456          * @remarks             The %EditField control checks with the registered filter to decide whether the user-entered text should be replaced or not.
1457          */
1458         void  SetEditTextFilter(IEditTextFilter* pFilter);
1459
1460         /**
1461         * Sends opaque command to the input method.
1462         *
1463         * @since     2.1
1464         *
1465         * @param[in] command            The opaque command to send
1466         * @remarks
1467         *                       - This method can be used to provide domain-specific features that are only known between certain input methods and their clients.
1468         *                       - This method may not work, depending on the active Input Method.
1469         */
1470         void SendOpaqueCommand (const Tizen::Base::String& command);
1471
1472         /**
1473           * Sets the password text as visible when %EditField is in password-related styles.
1474           *
1475           * @since               2.2
1476           *
1477           * @return  An error code
1478           * @param[in] visible  Set to @c true to show password is visible as plain text, @n
1479           *                     else @c false
1480           * @exception E_SUCCESS        The method is successful.
1481           * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1482           *             This operation is supported when the EditFieldStyle is ::EDIT_FIELD_STYLE_PASSWORD, @n ::EDIT_FIELD_STYLE_PASSWORD_SMALL, ::EDIT_FIELD_STYLE_PASSWORD_NUMBER, or ::EDIT_FIELD_STYLE_PASSWORD_NUMBER_SMALL.
1483         */
1484         result SetPasswordVisible(bool visible);
1485
1486         /**
1487         * Checks whether the password text is visible when %EditField is in password-related styles
1488         *
1489         * @since 2.2
1490         *
1491         * @return  @c true if the password is visible as plain text, @n
1492         *        else @c false
1493         * @exception E_SUCCESS    The method is successful.
1494         * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1495           *             This operation is supported when the EditFieldStyle is ::EDIT_FIELD_STYLE_PASSWORD, @n ::EDIT_FIELD_STYLE_PASSWORD_SMALL, ::EDIT_FIELD_STYLE_PASSWORD_NUMBER, or ::EDIT_FIELD_STYLE_PASSWORD_NUMBER_SMALL.
1496         * @remarks The specific error code can be accessed using the GetLastResult() method.
1497         * @see   SetPasswordVisible()
1498         */
1499         bool IsPasswordVisible(void) const;
1500
1501 protected:
1502         friend class _EditFieldImpl;
1503
1504 private:
1505         EditField(const EditField&);
1506         EditField& operator =(const EditField&);
1507
1508 }; // EditField
1509
1510 }}} // Tizen::Ui::Controls
1511
1512 #endif // _FUI_CTRL_EDIT_FIELD_H_