2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FUiCtrl_EditModel.h
19 * @brief This is the header file for the _EditModel class.
21 * This header file contains the declarations of the %_EditModel class.
24 #ifndef _FUI_CTRL_INTERNAL_EDIT_MODEL_H_
25 #define _FUI_CTRL_INTERNAL_EDIT_MODEL_H_
27 #include <FBaseObject.h>
28 #include <FLclLocale.h>
29 #include <FUiCtrlEditTypes.h>
30 #include "FUiCtrl_FooterImpl.h"
31 #include "FUiCtrl_IKeypadEventListener.h"
34 namespace Tizen { namespace Ui { namespace Controls
46 : public Tizen::Base::Object
51 virtual ~_EditModel(void);
56 * Sets the auto-link mask.
59 * @return An error code
60 * @param[in] autoLinks The auto-link mask.@n
61 * Multiple link types can be combined using bitwise OR (see Tizen::Base::Utility::LinkType).
62 * For more information, refer to @ref linkAutoLinkDetection "here".
63 * @exception E_SUCCESS The method was successful.
64 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
65 * -- The operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
66 * @exception E_SYSTEM A system error occurred.
67 * @remarks When @c autoLinks is set to zero, the auto-link detection is disabled.
68 * @see Tizen::Base::Utility::LinkType
69 * @see GetAutoLinkMask()
70 * @see IsViewModeEnabled()
71 * @see SetViewModeEnabled()
73 result SetAutoLinkMask(unsigned long autoLinks);
76 * Gets the auto-link mask.
79 * @return The auto-link mask
80 * @exception E_SUCCESS The method was successful.
81 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
82 * -- The operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
83 * @exception E_SYSTEM A system error occurred.
84 * @remarks The specific error code can be accessed using the GetLastResult()() method.
85 * @see SetAutoLinkMask()
87 unsigned long GetAutoLinkMask(void) const;
90 * Determines whether the view mode is enabled.
93 * @return A Boolean value indicating whether the view mode is enabled.
94 * @exception E_SUCCESS The method was successful.
95 * @exception E_SYSTEM A system error occurred.
96 * @remarks The specific error code can be accessed using the GetLastResult() method.
97 * @see SetViewModeEnabled()
99 bool IsViewModeEnabled(void) const;
102 * Enables or disables the view mode.
105 * @return An error code.
106 * @param[in] enable The view mode enabled flag
107 * @exception E_SUCCESS The method was successful.
108 * @exception E_SYSTEM A system error occurred.
109 * @remarks When the view mode is enabled, the auto-detected links will be displayed as linked text.
110 * @see IsViewModeEnabled()
112 result SetViewModeEnabled(bool enable);
115 * Enables or disables the keypad action.
118 * @return An error code.
119 * @param[in] enable A Boolean value indicating whether the keypad action is enabled.
120 * @exception E_SUCCESS The method was successful.
122 result SetKeypadActionEnabled(bool enable);
125 * Checks whether the keypad action is enabled.
128 * @return @c true if the keypad action is enabled @n
129 * @c false, otherwise
131 bool IsKeypadActionEnabled(void) const;
135 * Gets the keypad action type.
138 * @return The keypad action
139 * @exception E_SUCCESS The method was successful.
140 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
141 * -- The operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
142 * @exception E_SYSTEM A system error occurred.
143 * @remarks The specific error code can be accessed using the GetLastResult()() method.
145 Tizen::Ui::Controls::CoreKeypadAction GetKeypadAction(void) const;
148 * Sets the keypad action type.
151 * @return An error code
152 * @param[in] keypadAction The keypad action
153 * @exception E_SUCCESS The method was successful.
154 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation.@n
155 * -- The operation is not supported if the input style is not INPUT_STYLE_OVERLAY.
156 * @exception E_SYSTEM A system error occurred.
157 * @remarks Depending on the value of @c keypadAction specified, the keypad's enter key label will change accordingly.
159 result SetKeypadAction(Tizen::Ui::Controls::CoreKeypadAction keypadAction);
162 * Sets the input language.
165 * @return An error code
166 * @param[in] language The language to set
167 * @exception E_SUCCESS The method was successful.
168 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
169 * -- The specified language is not supported or unavailable.
170 * @exception E_SYSTEM A system error occurred.
172 result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode);
175 * Gets the current input language.
178 * @return An error code
179 * @param[out] language The current input language
180 * @exception E_SUCCESS The method was successful.
181 * @exception E_SYSTEM A system error occurred.
183 result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const;
186 * Sets the input language.
189 * @return An error code
190 * @param[in] language The inital keypad language to set
191 * @exception E_SUCCESS The method was successful.
192 * @exception E_SYSTEM A system error occurred.
194 result SetInitialKeypadLanguage(Tizen::Locales::LanguageCode languageCode);
197 * Gets the current input language.
200 * @return An error code
201 * @param[out] language The current inital keypad language
202 * @exception E_SUCCESS The method was successful.
203 * @exception E_SYSTEM A system error occurred.
205 result GetInitialKeypadLanguage(Tizen::Locales::LanguageCode& language) const;
208 * Enables or disables the keypad.
211 * @param[in] enable A Boolean value indicating whether the keypad is enabled.
213 void SetKeypadEnabled(bool enable);
216 * Checks whether the keypad is enabled.
219 * @return @c true if the keypad is enabled @n
220 * @c false, otherwise
222 bool IsKeypadEnabled(void) const;
225 * Enables or disables the lowercase mode.
228 * @param[in] enable Set to @c true to enable lowercase mode @n
229 * @c false, otherwise
231 void SetLowerCaseModeEnabled(bool enable);
234 * Checks whether the lowercase mode is enabled.
237 * @return @c true if the lowercase mode is set @n
238 * @c false, otherwise
240 bool IsLowerCaseModeEnabled(void) const;
243 * Gets the keypad style.
246 * @return The keypad style
247 * @exception E_SUCCESS The method was successful.
248 * @exception E_SYSTEM A system error occurred.
249 * @remarks The specific error code can be accessed using the GetLastResult()() method.
250 * @see SetKeypadStyle()
252 KeypadStyle GetKeypadStyle(void) const;
255 * Sets the keypad style.
258 * @return An error code
259 * @param[in] keypadStyle The keypad style
260 * @exception E_SUCCESS The method was successful.
261 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
262 * -- @c keypadStyle cannot be @c KEYPAD_STYLE_PASSWORD.
263 * @exception E_SYSTEM A system error occurred.
264 * @remarks Depending on the value of the specified @c keypadStyle, the keypad's layout will change accordingly.
265 * @see GetKeypadStyle()
267 result SetKeypadStyle(KeypadStyle keypadStyle);
269 result SetTextPredictionEnabled(bool enable);
271 bool IsTextPredictionEnabled(void) const;
274 * Enables or disables the auto resizing if the candidate word list appears.
277 * @return An error code
278 * @param[in] enable Set to @c true to enable the auto resizing, @n
280 * @exception E_SUCCESS The method is successful.
281 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
282 * The current style of the %ExpandableEditArea does not support the operation.
283 * @remarks Note that when this option is enabled, the normal style %ExpandableEditArea is auto resized and the line added and removed events are
284 * generated if the candidate word list pop-up appears during the predictive texting. @n
285 * The operation is not supported by the token style %ExpandableEditArea.
286 * @see IsAutoResizingEnabled()
287 * @see Tizen::Ui::Controls::IExpandableEditAreaEventListener
289 result SetAutoResizingEnabled(bool enable);
292 * Checks whether the auto-resizing is enabled.
295 * @return @c true if the auto-resizing is enabled, @n
297 * @exception E_SUCCESS The method is successful.
298 * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
299 * The current style of the %ExpandableEditArea control does not support the operation.
300 * @remarks The specific error code can be accessed using the GetLastResult() method.
301 * @see SetAutoResizingEnabled()
303 bool IsAutoResizingEnabled(void) const;
305 void SetMaxLineCount(int maxLineCount);
308 * Gets the maximum line count supported by the flexible text edit.
311 * @return The maximum line count, @n
312 * else @c -1 if an error occurs
313 * @exception E_SUCCESS The method is successful.
314 * @exception E_SYSTEM A system error has occurred.
315 * @remarks The specific error code can be accessed using the GetLastResult() method.
317 int GetMaxLineCount(void) const;
320 result SetCommandButtonItem(CommandButtonPosition buttonPosition, int actionId, const Tizen::Base::String& text);
321 Tizen::Base::String GetKeypadCommandButtonText(CommandButtonPosition position) const;
322 int GetKeypadCommandButtonActionId(CommandButtonPosition position) const;
325 _EditModel(const _EditModel& value);
326 _EditModel& operator =(const _EditModel& value);
330 unsigned long __autoLinkMask;
332 bool __keypadActionEnabled;
334 bool __viewModeEnabled;
336 KeypadStyle __keypadStyle;
338 bool __keypadEnabled;
342 bool __isTextPredictionEnabled;
344 CoreKeypadAction __keypadAction;
346 bool __enablePredictiveAutoResizing;
350 Tizen::Locales::LanguageCode __languageCode;
351 Tizen::Locales::LanguageCode __initialKeypadLanguageCode;
353 int __leftCommandButtonActionId;
354 int __rightCommandButtonActionId;
355 Tizen::Base::String __leftCommandButtonText;
356 Tizen::Base::String __rightCommandButtonText;
359 }}} // Tizen::Ui::Controls
361 #endif // _FUI_CTRL_INTERNAL_EDIT_MODEL_H_