2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_Edit.cpp
20 * @brief This is the implementation file for the _Edit class.
23 #include <FBaseErrorDefine.h>
24 #include <FBaseSysLog.h>
26 #include <FGrp_BitmapImpl.h>
27 #include <FGrp_FontImpl.h>
28 #include "FUi_AccessibilityContainer.h"
29 #include "FUi_AccessibilityElement.h"
30 #include "FUi_IAccessibilityListener.h"
31 #include "FUi_UiEventManager.h"
32 #include "FUiAnim_VisualElement.h"
33 #include "FUiCtrl_Edit.h"
34 #include "FUiCtrl_EditPresenter.h"
35 #include "FUiCtrl_ScrollPanel.h"
37 using namespace Tizen::Base;
38 using namespace Tizen::Base::Runtime;
39 using namespace Tizen::Base::Utility;
40 using namespace Tizen::Graphics;
41 using namespace Tizen::Ui;
42 using namespace Tizen::Ui::Animations;
43 using namespace Tizen::Locales;
44 using namespace Tizen::Graphics::_Text;
45 using namespace Tizen::Base::Collection;
48 namespace Tizen { namespace Ui { namespace Controls
51 class _EditInternalTouchEventListener
52 : public _ITouchEventListener
53 , virtual public _IUiEventListener
54 , virtual public Tizen::Base::Runtime::IEventListener
58 _EditInternalTouchEventListener(const _Edit& edit);
60 * This is the destructor for this class.
62 virtual ~_EditInternalTouchEventListener(void) {}
65 * Notifies when an entity is touch pressed.
67 * @param[in] source The source of the event
68 * @param[in] currentPosition The current position
69 * @param[in] touchInfo The touch event information
71 virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
74 * Notifies when an entity is touch released.
76 * @param[in] source The source of the event
77 * @param[in] currentPosition The current position
78 * @param[in] touchInfo The touch event information
80 virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo){return false;};
83 * Notifies when an entity is touch moved.
85 * @param[in] source The source of the event
86 * @param[in] currentPosition The current position
87 * @param[in] touchInfo The touch event information
89 virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo){return false;};
92 * Notifies when an entity is touch cancelled.
94 * @param[in] source The source of the event
95 * @param[in] currentPosition The current position
96 * @param[in] touchInfo The touch event information
98 virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo){return false;};
102 }; // _ITouchEventListener
104 _EditInternalTouchEventListener::_EditInternalTouchEventListener(const _Edit& edit)
106 __pEdit = const_cast<_Edit*>(&edit);
110 _EditInternalTouchEventListener::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
112 _EditPresenter* pEditPresenter = __pEdit->GetPresenter();
113 _Toolbar* pCommandButton = pEditPresenter->GetKeypadCommandButton();
114 if (__pEdit == &source || pCommandButton == source.GetParent())
118 else //check the state of Text Prediction & CopyPaste Popup
120 if (pEditPresenter->IsCopyPastePopupVisible())
122 if (pEditPresenter->GetTextCompositionState())
124 pEditPresenter->FinishTextComposition();
127 if (pEditPresenter->IsCopyPastePopup(source))
129 return false; // CopyPastePopup is touched
133 pEditPresenter->InitializeCopyPasteManager();
141 IMPLEMENT_PROPERTY(_Edit);
144 : _pEditPresenter(null)
151 , __editStyle(EDIT_STYLE_NORMAL)
152 , __borderRoundStyle(false)
153 , __ellipsisPosition(ELLIPSIS_POSITION_END)
154 , __inputStyle(INPUT_STYLE_OVERLAY)
155 , __isConstructed(false)
156 , __guideTextColor(Color())
157 , __isSettingGuideTextColor(false)
158 , __pDefaultBackgroundEffectBitmap(null)
159 , __pGestureFlick(null)
160 , __pGestureLongPress(null)
161 , __pGestureTap(null)
162 , __pEditInternalTouchEventListener(null)
163 , __pExpandableEditAreaEvent(null)
164 , __pKeypadEvent(null)
165 , __pLanguageEvent(null)
167 , __pScrollPanelEvent(null)
168 , __pTextBlockEvent(null)
170 , __pTitleTextAccessibilityElement(null)
171 , __pTextAccessibilityElement(null)
172 , __pClearButtonTextAccessibilityElement(null)
173 , __pToolbarAccessibilityElement(null)
174 , __isAccessibilityCreated(false)
175 , __isFullScreenKeypadEdit(false)
177 for (int status = 0; status < EDIT_COLOR_MAX; status++)
179 __pBackgroundBitmap[status] = null;
182 for (int status = 0; status < EDIT_COLOR_MAX; status++)
184 __pDefaultBackgroundBitmap[status] = null;
187 __blockTextColor.used = false;
188 __blockTextColor.blockTextColor = Color();
193 delete _pEditPresenter;
194 _pEditPresenter = null;
196 for (int status = 0; status < EDIT_COLOR_MAX; status++)
198 if (__pBackgroundBitmap[status])
200 delete __pBackgroundBitmap[status];
201 __pBackgroundBitmap[status] = null;
204 if (__pDefaultBackgroundBitmap[status])
206 delete __pDefaultBackgroundBitmap[status];
207 __pDefaultBackgroundBitmap[status] = null;
211 if (__pDefaultBackgroundEffectBitmap)
213 delete __pDefaultBackgroundEffectBitmap;
214 __pDefaultBackgroundEffectBitmap = null;
217 if (__pTextBlockEvent)
219 delete __pTextBlockEvent;
220 __pTextBlockEvent = null;
231 delete __pKeypadEvent;
232 __pKeypadEvent = null;
235 if (__pScrollPanelEvent)
237 delete __pScrollPanelEvent;
238 __pScrollPanelEvent = null;
241 if (__pLanguageEvent)
243 delete __pLanguageEvent;
244 __pLanguageEvent = null;
249 _ITouchFlickGestureEventListener* pListener = dynamic_cast<_ITouchFlickGestureEventListener*>(this);
250 __pGestureFlick->RemoveGestureListener(*pListener);
251 RemoveGestureDetector(*__pGestureFlick);
252 delete __pGestureFlick;
253 __pGestureFlick = null;
256 if (__pGestureLongPress)
258 _ITouchLongPressGestureEventListener* pListener = dynamic_cast<_ITouchLongPressGestureEventListener*>(this);
259 __pGestureLongPress->RemoveGestureListener(*pListener);
260 RemoveGestureDetector(*__pGestureLongPress);
261 delete __pGestureLongPress;
262 __pGestureLongPress = null;
267 _ITouchTapGestureEventListener* pListener = dynamic_cast<_ITouchTapGestureEventListener*>(this);
268 __pGestureTap->RemoveGestureListener(*pListener);
269 RemoveGestureDetector(*__pGestureTap);
270 delete __pGestureTap;
271 __pGestureTap = null;
274 if (__pEditInternalTouchEventListener)
276 _UiEventManager::GetInstance()->RemoveTouchEventListener(*__pEditInternalTouchEventListener);
277 delete __pEditInternalTouchEventListener;
278 __pEditInternalTouchEventListener = null;
287 if (__pExpandableEditAreaEvent)
289 delete __pExpandableEditAreaEvent;
290 __pExpandableEditAreaEvent = null;
293 if (__pTitleTextAccessibilityElement)
295 __pTitleTextAccessibilityElement->Activate(false);
296 __pTitleTextAccessibilityElement = null;
298 if (__pTextAccessibilityElement)
300 __pTextAccessibilityElement->Activate(false);
301 __pTextAccessibilityElement = null;
303 if (__pClearButtonTextAccessibilityElement)
305 __pClearButtonTextAccessibilityElement->Activate(false);
306 __pClearButtonTextAccessibilityElement = null;
308 if (__pToolbarAccessibilityElement)
310 __pToolbarAccessibilityElement->Activate(false);
311 __pToolbarAccessibilityElement = null;
316 _Edit::CreateEditN(void)
318 _EditPresenter* pPresenter = _EditPresenter::CreateInstanceN();
319 if (pPresenter == null)
321 SetLastResult(E_OUT_OF_MEMORY);
326 result r = E_SUCCESS;
327 _VisualElement* pBaseVisualElement = null;
328 _Edit* pEdit = new (std::nothrow) _Edit;
329 SysTryCatch(NID_UI_CTRL, pEdit, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
331 pBaseVisualElement = pEdit->GetVisualElement();
332 if (pBaseVisualElement)
334 r = pBaseVisualElement->SetSurfaceOpaque(false);
335 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
338 pEdit->AcquireHandle();
340 r = pEdit->SetPresenter(*pPresenter);
341 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
353 _Edit::Initialize(int editStyle, InputStyle inputStyle, int limitLength, GroupStyle groupStyle)
355 result r = E_SUCCESS;
357 SetEditStyle(editStyle);
359 r = LoadDefaultBackgroundBitmap(groupStyle);
360 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to load Bitmaps", GetErrorMessage(r));
362 InitializeColorInformation();
364 r = _pEditPresenter->Initialize(*this);
365 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to construct", GetErrorMessage(r));
367 r = _pEditPresenter->SetTextLimitLength(limitLength);
368 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to set limit length", GetErrorMessage(r));
370 __inputStyle = inputStyle;
371 if (inputStyle == INPUT_STYLE_OVERLAY)
373 if (!(editStyle & EDIT_STYLE_FLEXIBLE))
375 _pEditPresenter->SetKeypadCommandButtonVisible(true);
379 _pEditPresenter->SetEditGroupStyle(groupStyle);
381 __textSize = _pEditPresenter->GetTextSize();
383 __pGestureFlick = new (std::nothrow) _TouchFlickGestureDetector;
384 SysTryReturn(NID_UI_CTRL, __pGestureFlick, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create touch flick gesture.");
385 r = AddGestureDetector(*__pGestureFlick);
386 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r));
387 r = __pGestureFlick->AddGestureListener(*this);
388 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r));
390 __pGestureLongPress = new (std::nothrow) _TouchLongPressGestureDetector;
391 SysTryReturn(NID_UI_CTRL, __pGestureLongPress, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create touch long press gesture.");
392 r = AddGestureDetector(*__pGestureLongPress);
393 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture detector", GetErrorMessage(r));
394 r = __pGestureLongPress->AddGestureListener(*this);
395 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r));
397 __pGestureTap = new (std::nothrow) _TouchTapGestureDetector;
398 SysTryReturn(NID_UI_CTRL, __pGestureTap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create touch tap gesture.");
399 r = AddGestureDetector(*__pGestureTap);
400 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture detector", GetErrorMessage(r));
401 r = __pGestureTap->AddGestureListener(*this);
402 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r));
404 __pEditInternalTouchEventListener = new (std::nothrow) _EditInternalTouchEventListener(*this);
405 SysTryReturn(NID_UI_CTRL, __pEditInternalTouchEventListener, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create internal touch listener.");
406 r = _UiEventManager::GetInstance()->AddTouchEventListener(*__pEditInternalTouchEventListener);
407 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Unable to add internal event listener", GetErrorMessage(r));
409 SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_INSENSITIVE);
410 __isConstructed = true;
416 _Edit::InitializeColorInformation(void)
418 GET_COLOR_CONFIG(EDIT::BG_NORMAL, __color[EDIT_STATUS_NORMAL].backgroundColor);
419 GET_COLOR_CONFIG(EDIT::BG_PRESSED, __color[EDIT_STATUS_PRESSED].backgroundColor);
420 GET_COLOR_CONFIG(EDIT::BG_HIGHLIGHTED, __color[EDIT_STATUS_HIGHLIGHTED].backgroundColor);
421 GET_COLOR_CONFIG(EDIT::BG_DISABLED, __color[EDIT_STATUS_DISABLED].backgroundColor);
423 GET_COLOR_CONFIG(EDIT::TITLE_TEXT_NORMAL, __color[EDIT_STATUS_NORMAL].titleTextColor);
424 GET_COLOR_CONFIG(EDIT::TITLE_TEXT_PRESSED, __color[EDIT_STATUS_PRESSED].titleTextColor);
425 GET_COLOR_CONFIG(EDIT::TITLE_TEXT_HIGHLIGHTED, __color[EDIT_STATUS_HIGHLIGHTED].titleTextColor);
426 GET_COLOR_CONFIG(EDIT::TITLE_TEXT_DISABLED, __color[EDIT_STATUS_DISABLED].titleTextColor);
428 GET_COLOR_CONFIG(EDIT::TEXT_NORMAL, __color[EDIT_STATUS_NORMAL].textColor);
429 GET_COLOR_CONFIG(EDIT::TEXT_PRESSED, __color[EDIT_STATUS_PRESSED].textColor);
430 GET_COLOR_CONFIG(EDIT::TEXT_HIGHLIGHTED, __color[EDIT_STATUS_HIGHLIGHTED].textColor);
431 GET_COLOR_CONFIG(EDIT::TEXT_DISABLED, __color[EDIT_STATUS_DISABLED].textColor);
433 GET_COLOR_CONFIG(EDIT::GUIDE_TEXT_NORMAL, __guideTextColor);
435 memset(__cutlinkColor, 0, sizeof(EditCutlinkColor) * EDIT_LINK_TYPE_MAX);
436 for (int i = 0; i < EDIT_LINK_TYPE_MAX; i++)
438 EditCutLinkType type = (EditCutLinkType) i;
439 //GET_COLOR_CONFIG(EDIT::CUT_LINK_TEXT_NORMAL, __cutlinkColor[type].cutlinkFgColor);
440 __cutlinkColor[type].cutlinkFgColor = Color::GetColor(COLOR_ID_BLUE);
441 GET_COLOR_CONFIG(EDIT::CUT_LINK_BG_NORMAL, __cutlinkColor[type].cutlinkBgColor);
446 _Edit::SetPresenter(const _EditPresenter& pPresenter)
448 result r = E_SUCCESS;
450 _pEditPresenter = const_cast<_EditPresenter*>(&pPresenter);
456 _Edit::GetPresenter(void) const
458 return _pEditPresenter;
462 _Edit::GetContentSizeInternal(void) const
464 Dimension dimension(0,0);
467 int textTopMargin = 0;
468 int textBottomMargin = 0;
470 _ControlOrientation orientation = GetOrientation();
471 GET_SHAPE_CONFIG(EDIT::AREA_LEFT_MARGIN, orientation, leftMargin);
472 GET_SHAPE_CONFIG(EDIT::AREA_RIGHT_MARGIN, orientation, rightMargin);
473 GET_SHAPE_CONFIG(EDIT::AREA_TEXT_TOP_MARGIN, orientation, textTopMargin);
474 GET_SHAPE_CONFIG(EDIT::AREA_TEXT_BOTTOM_MARGIN, orientation, textBottomMargin);
476 TextObject* pTextObject = _pEditPresenter->GetTextObject();
484 TextObjectActionType previousActionType = pTextObject->GetAction();
485 TextObjectWrapType previousWrapType = pTextObject->GetWrap();
486 Rectangle previousRect = pTextObject->GetBounds();
487 Rectangle newRect = previousRect;
489 if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
491 newRect.width = _ControlManager::GetInstance()->GetScreenSize().width;
495 newRect.width = _ControlManager::GetInstance()->GetScreenSize().height;
499 pTextObject->SetBounds(newRect);
500 pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE);
501 pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
502 pTextObject->Compose();
504 dimension = pTextObject->GetTextExtent(0, pTextObject->GetTextLength());
505 if (dimension.width > newRect.width)
507 dimension.width = newRect.width;
510 dimension.height = pTextObject->GetTotalHeight();
513 pTextObject->SetBounds(previousRect);
514 pTextObject->SetAction(previousActionType);
515 pTextObject->SetWrap(previousWrapType);
516 pTextObject->Compose();
518 dimension.width += leftMargin + rightMargin;
519 dimension.height += textTopMargin + textBottomMargin;
525 _Edit::GetTextAlignment(void) const
527 return _pEditPresenter->GetTextAlignment();
531 _Edit::SetTextAlignment(HorizontalAlignment alignment)
533 return _pEditPresenter->SetTextAlignment(alignment);
537 _Edit::IsViewModeEnabled(void) const
539 Variant var = GetProperty("viewModeEnabled");
545 _Edit::SetViewModeEnabled(bool enable)
549 return SetProperty("viewModeEnabled", var);
553 _Edit::SetAutoLinkMask(unsigned long autoLinks)
555 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
556 Variant var(autoLinks);
558 return SetProperty("autoLinkMask", var);
562 _Edit::GetAutoLinkMask(void) const
564 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), LINK_TYPE_NONE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
565 Variant var = GetProperty("autoLinkMask");
567 return var.ToULong();
571 _Edit::GetLineSpacing(void) const
573 return _pEditPresenter->GetLineSpacing();
577 _Edit::SetLineSpacing(int linePixelGap)
579 return _pEditPresenter->SetLineSpacing(linePixelGap);
583 _Edit::SetMaxLineCount(int maxLineCount)
585 _pEditPresenter->SetMaxLineCount(maxLineCount);
589 _Edit::GetMaxLineCount(void) const
591 return _pEditPresenter->GetMaxLineCount();
595 _Edit::GetHorizontalMargin(EditTextHorizontalMargin marginType) const
601 case EDIT_TEXT_LEFT_MARGIN:
602 var = GetProperty("leftMargin");
605 case EDIT_TEXT_RIGHT_MARGIN:
606 var = GetProperty("rightMargin");
609 case EDIT_TEXT_HORIZONTAL_MARGIN:
610 var = GetProperty("leftMargin");
621 _Edit::GetVerticalMargin(EditTextVerticalMargin marginType) const
627 case EDIT_TEXT_TOP_MARGIN:
628 var = GetProperty("topMargin");
631 case EDIT_TEXT_BOTTOM_MARGIN:
632 var = GetProperty("bottomMargin");
635 case EDIT_TEXT_VERTICAL_MARGIN:
636 var = GetProperty("topMargin");
647 _Edit::SetHorizontalMargin(int margin, EditTextHorizontalMargin marginType)
649 result r = E_SUCCESS;
652 SysTryReturn(NID_UI_CTRL, margin > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
656 case EDIT_TEXT_LEFT_MARGIN:
657 r = SetProperty("leftMargin", var);
660 case EDIT_TEXT_RIGHT_MARGIN:
661 r = SetProperty("rightMargin", var);
664 case EDIT_TEXT_HORIZONTAL_MARGIN:
665 r = SetProperty("leftMargin", var);
666 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
667 r = SetProperty("rightMargin", var);
673 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
675 _pEditPresenter->SetClientBounds();
676 r = _pEditPresenter->SetInitialBounds();
677 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
684 _Edit::SetVerticalMargin(int margin, EditTextVerticalMargin marginType)
686 result r = E_SUCCESS;
689 SysTryReturn(NID_UI_CTRL, margin > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
693 case EDIT_TEXT_TOP_MARGIN:
694 r = SetProperty("topMargin", var);
697 case EDIT_TEXT_BOTTOM_MARGIN:
698 r = SetProperty("bottomMargin", var);
701 case EDIT_TEXT_VERTICAL_MARGIN:
702 r = SetProperty("topMargin", var);
703 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
704 r = SetProperty("bottomMargin", var);
710 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
712 _pEditPresenter->SetClientBounds();
713 r = _pEditPresenter->SetInitialBounds();
714 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
721 _Edit::GetTextLimitLength(void) const
723 return _pEditPresenter->GetTextLimitLength();
727 _Edit::SetLimitLength(int limitLength)
729 return _pEditPresenter->SetTextLimitLength(limitLength);
733 _Edit::SetAutoResizingEnabled(bool enable)
737 return SetProperty("autoResizingEnabled", var);
741 _Edit::IsAutoResizingEnabled(void) const
743 Variant var = GetProperty("autoResizingEnabled");
749 _Edit::GetKeypadAction(void) const
751 Variant var = GetProperty("keypadAction");
753 return (CoreKeypadAction)var.ToInt();
757 _Edit::SetKeypadAction(CoreKeypadAction keypadAction)
759 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
760 Variant var((int)keypadAction);
762 return SetProperty("keypadAction", var);
766 _Edit::SetKeypadActionEnabled(bool enabled)
768 Variant var(enabled);
770 return SetProperty("keypadActionEnabled", var);
774 _Edit::GetKeypadActionEnabled(void) const
776 Variant var = GetProperty("keypadActionEnabled");
782 _Edit::GetKeypadStyle(void) const
784 Variant var = GetProperty("keypadStyle");
786 return (KeypadStyle)var.ToInt();
790 _Edit::SetKeypadStyle(KeypadStyle keypadStyle)
792 SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != keypadStyle), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
793 Variant var((int)keypadStyle);
795 return SetProperty("keypadStyle", var);
799 _Edit::SetKeypadNormalNumberStyle(bool enable)
801 return _pEditPresenter->SetKeypadNormalNumberStyle(enable);
805 _Edit::IsTextPredictionEnabled(void) const
807 return _pEditPresenter->IsTextPredictionEnabled();
811 _Edit::SetTextPredictionEnabled(bool enable)
813 return _pEditPresenter->SetTextPredictionEnabled(enable);
817 _Edit::UpdateAccessibilityElement(EditAccessibilityElementType type)
819 if (!__isAccessibilityCreated)
826 case EDIT_ACCESSIBILITY_ELEMENT_TYPE_TITLE_TEXT:
827 if (__pTitleTextAccessibilityElement)
829 __pTitleTextAccessibilityElement->SetBounds(_pEditPresenter->GetTitleBounds());
830 __pTitleTextAccessibilityElement->SetLabel(GetTitleText());
833 case EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT:
834 if (__pTextAccessibilityElement)
836 __pTextAccessibilityElement->SetBounds(_pEditPresenter->GetTextAreaBounds());
837 __pTextAccessibilityElement->SetLabel(GetText());
840 case EDIT_ACCESSIBILITY_ELEMENT_TYPE_CLEAR_ICON:
841 if (__pClearButtonTextAccessibilityElement)
843 __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBounds());
853 _Edit::SetFullScreenKeypadEdit(bool enabled)
855 __isFullScreenKeypadEdit = enabled;
859 _Edit::IsFullScreenKeypadEdit(void)
861 return __isFullScreenKeypadEdit;
865 _Edit::HideKeypad(void)
867 return _pEditPresenter->HideKeypad(true);
871 _Edit::GetTextSize(void) const
873 Variant size = GetProperty("textSize");
879 _Edit::SetTextSize(int size)
883 return SetProperty("textSize", Variant(size));
887 _Edit::GetColor(EditStatus status) const
892 case EDIT_STATUS_NORMAL:
893 color = GetProperty("normalColor");
896 case EDIT_STATUS_DISABLED:
897 color = GetProperty("disabledColor");
900 case EDIT_STATUS_HIGHLIGHTED:
901 color = GetProperty("highlightedColor");
904 case EDIT_STATUS_PRESSED:
905 color = GetProperty("pressedColor");
912 return color.ToColor();
916 _Edit::GetTextColor(EditTextColor type) const
918 Variant variantColor;
922 case EDIT_TEXT_COLOR_NORMAL:
923 variantColor = GetProperty("normalTextColor");
924 color = variantColor.ToColor();
927 case EDIT_TEXT_COLOR_DISABLED:
928 variantColor = GetProperty("disabledTextColor");
929 color = variantColor.ToColor();
932 case EDIT_TEXT_COLOR_HIGHLIGHTED:
933 variantColor = GetProperty("highlightedTextColor");
934 color = variantColor.ToColor();
937 case EDIT_TEXT_COLOR_LINK:
938 color = __cutlinkColor[EDIT_LINK_TYPE_URL].cutlinkFgColor;
949 _Edit::GetTextColor(EditStatus status) const
951 Variant variantColor;
956 case EDIT_STATUS_NORMAL:
957 variantColor = GetProperty("normalTextColor");
958 color = variantColor.ToColor();
961 case EDIT_STATUS_DISABLED:
962 variantColor = GetProperty("disabledTextColor");
963 color = variantColor.ToColor();
966 case EDIT_STATUS_HIGHLIGHTED:
967 variantColor = GetProperty("highlightedTextColor");
968 color = variantColor.ToColor();
971 case EDIT_STATUS_PRESSED:
972 variantColor = GetProperty("pressedTextColor");
973 color = variantColor.ToColor();
984 _Edit::SetBackgroundBitmap(EditStatus status, const Bitmap& bitmap)
986 result r = E_SUCCESS;
988 Bitmap* pNewBitmap = _BitmapImpl::CloneN(bitmap);
989 SysTryReturn(NID_UI_CTRL, pNewBitmap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
991 delete __pBackgroundBitmap[status];
992 __pBackgroundBitmap[status] = pNewBitmap;
998 _Edit::SetColor(EditStatus status, const Color& color)
1000 result r = E_SUCCESS;
1004 case EDIT_STATUS_NORMAL:
1005 r = SetProperty("normalColor", Variant(color));
1008 case EDIT_STATUS_DISABLED:
1009 r = SetProperty("disabledColor", Variant(color));
1012 case EDIT_STATUS_HIGHLIGHTED:
1013 r = SetProperty("highlightedColor", Variant(color));
1016 case EDIT_STATUS_PRESSED:
1017 r = SetProperty("pressedColor", Variant(color));
1024 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Unable to set color.", GetErrorMessage(r));
1030 _Edit::SetTextColor(EditTextColor type, const Color& color)
1032 result r = E_SUCCESS;
1033 EditCutlinkColor autoLinkColorInfo;
1037 case EDIT_TEXT_COLOR_NORMAL:
1038 r = SetProperty("normalTextColor", Variant(color));
1039 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
1042 case EDIT_TEXT_COLOR_DISABLED:
1043 r = SetProperty("disabledTextColor", Variant(color));
1044 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
1047 case EDIT_TEXT_COLOR_HIGHLIGHTED:
1048 r = SetProperty("highlightedTextColor", Variant(color));
1049 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
1051 r = SetProperty("pressedTextColor", Variant(color));
1052 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
1055 case EDIT_TEXT_COLOR_LINK:
1056 GetCutlinkColorInfo(EDIT_LINK_TYPE_URL, &autoLinkColorInfo);
1057 autoLinkColorInfo.cutlinkFgColor = color;
1058 SetCutlinkColorInfo(EDIT_LINK_TYPE_URL, autoLinkColorInfo);
1059 SetCutlinkColorInfo(EDIT_LINK_TYPE_EMAIL, autoLinkColorInfo);
1060 SetCutlinkColorInfo(EDIT_LINK_TYPE_PHONE_NUM, autoLinkColorInfo);
1072 _Edit::GetText(int start, int end) const
1074 SysTryReturn(NID_UI_CTRL, (start > -1 && end > -1 && end > start), String(), E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument(start = %d, end = %d) is given.");
1076 return _pEditPresenter->GetText(start, end);
1080 _Edit::AddExpandableEditAreaEventListener(const _IExpandableEditAreaEventListener& listener)
1082 if (__pExpandableEditAreaEvent == null)
1084 __pExpandableEditAreaEvent = _ExpandableEditAreaEvent::CreateInstanceN(*this);
1085 SysTryReturn(NID_UI_CTRL, __pExpandableEditAreaEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1088 return __pExpandableEditAreaEvent->AddListener(listener);
1092 _Edit::RemoveExpandableEditAreaEventListener(const _IExpandableEditAreaEventListener& listener)
1094 SysTryReturn(NID_UI_CTRL, __pExpandableEditAreaEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1096 return __pExpandableEditAreaEvent->RemoveListener(listener);
1100 _Edit::AddUiLinkEventListener(const _IUiLinkEventListener& listener)
1102 if (__pLinkEvent == null)
1104 __pLinkEvent = _LinkEvent::CreateInstanceN(*this);
1105 SysTryReturn(NID_UI_CTRL, __pLinkEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1108 return __pLinkEvent->AddListener(listener);
1112 _Edit::RemoveUiLinkEventListener(const _IUiLinkEventListener& listener)
1114 SysTryReturn(NID_UI_CTRL, __pLinkEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1116 return __pLinkEvent->RemoveListener(listener);
1120 _Edit::AddTextBlockEventListener(const _ITextBlockEventListener& listener)
1122 if (__pTextBlockEvent == null)
1124 __pTextBlockEvent = _TextBlockEvent::CreateInstanceN(*this);
1125 SysTryReturn(NID_UI_CTRL, __pTextBlockEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1128 return __pTextBlockEvent->AddListener(listener);
1132 _Edit::RemoveTextBlockEventListener(const _ITextBlockEventListener& listener)
1134 SysTryReturn(NID_UI_CTRL, __pTextBlockEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1136 __pTextBlockEvent->RemoveListener(listener);
1142 _Edit::AddKeypadEventListener(const _IKeypadEventListener& listener)
1144 if (__pKeypadEvent == null)
1146 __pKeypadEvent = _KeypadEvent::CreateInstanceN(*this);
1147 SysTryReturn(NID_UI_CTRL, __pKeypadEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1150 return __pKeypadEvent->AddListener(listener);
1154 _Edit::RemoveKeypadEventListener(const _IKeypadEventListener& listener)
1156 SysTryReturn(NID_UI_CTRL, __pKeypadEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1158 __pKeypadEvent->RemoveListener(listener);
1164 _Edit::AddTextEventListener(const _ITextEventListener& listener)
1166 if (__pTextEvent == null)
1168 __pTextEvent = _TextEvent::CreateInstanceN(*this);
1169 SysTryReturn(NID_UI_CTRL, __pTextEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1172 return __pTextEvent->AddListener(listener);
1176 _Edit::RemoveTextEventListener(const _ITextEventListener& listener)
1178 SysTryReturn(NID_UI_CTRL, __pTextEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1179 __pTextEvent->RemoveListener(listener);
1185 _Edit::AddScrollPanelEventListener(const _IScrollPanelEventListener& listener)
1187 if (__pScrollPanelEvent == null)
1189 if (__inputStyle != INPUT_STYLE_OVERLAY)
1191 SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1196 __pScrollPanelEvent = _ScrollPanelEvent::CreateScrollPanelEventN(*this);
1197 SysTryReturn(NID_UI_CTRL, __pScrollPanelEvent,
1198 E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1202 return __pScrollPanelEvent->AddListener(listener);
1206 _Edit::RemoveScrollPanelEventListener(const _IScrollPanelEventListener& listener)
1208 SysTryReturn(NID_UI_CTRL, __pScrollPanelEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1209 __pScrollPanelEvent->RemoveListener(listener);
1215 _Edit::AddActionEventListener(const _IActionEventListener& listener)
1217 _pEditPresenter->AddActionEventListener(listener);
1223 _Edit::RemoveActionEventListener(const _IActionEventListener& listener)
1225 _pEditPresenter->RemoveActionEventListener(listener);
1231 _Edit::AddLanguageEventListener(const _ILanguageEventListener& listener)
1233 if (__pLanguageEvent == null)
1235 __pLanguageEvent = _LanguageEvent::CreateInstanceN(*this);
1237 SysTryReturn(NID_UI_CTRL, __pLanguageEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.")
1239 __pLanguageEvent->AddListener(listener);
1246 _Edit::RemoveLanguageEventListener(const _ILanguageEventListener& listener)
1248 SysTryReturn(NID_UI_CTRL, __pLanguageEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1250 __pLanguageEvent->RemoveListener(listener);
1256 _Edit::GetRemainingLength(void) const
1258 return _pEditPresenter->GetRemainingLength();
1262 _Edit::SetLowerCaseModeEnabled(bool enable)
1264 Variant var(enable);
1266 SetProperty("lowerCaseModeEnabled", var);
1270 _Edit::IsLowerCaseModeEnabled(void) const
1272 Variant var = GetProperty("lowerCaseModeEnabled");
1274 return var.ToBool();
1278 _Edit::SetCursorPosition(int position)
1280 int textLength = GetTextLength();
1281 SysTryReturn(NID_UI_CTRL, (position >= 0 && position <= textLength), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] This position is out of range.");
1283 Variant var(position);
1285 return SetProperty("cursorPosition", var);
1289 _Edit::GetCursorPosition(void) const
1291 Variant var = GetProperty("cursorPosition");
1297 _Edit::GetText(void) const
1299 Variant var = GetProperty("text");
1301 return var.ToString();
1305 _Edit::GetTextLength(void) const
1307 return _pEditPresenter->GetTextLength();
1311 _Edit::SetText(const String& text)
1315 return SetProperty("text", var);
1319 _Edit::InsertTextAtCursorPosition(const String& text)
1321 return _pEditPresenter->InsertTextAtCursorPosition(text);
1325 _Edit::InsertCharacterAt(int index, const Character& character)
1327 return _pEditPresenter->InsertCharacterAt(index, character);
1331 _Edit::InsertTextAt(int index, const String& text)
1333 return _pEditPresenter->InsertTextAt(index, text);
1337 _Edit::AppendText(const String& text)
1339 return _pEditPresenter->AppendText(text);
1343 _Edit::AppendCharacter(const Character& character)
1345 return _pEditPresenter->AppendCharacter(character);
1349 _Edit::InsertTextAt(int position, const String& text, const Bitmap& textImage)
1351 return _pEditPresenter->InsertTextAt(position, text, textImage);
1355 _Edit::AppendText(const String& text, const Bitmap& textImage)
1357 return _pEditPresenter->InsertTextAt(_pEditPresenter->GetTextLength(), text, textImage);
1361 _Edit::ClearText(void)
1363 return _pEditPresenter->ClearText();
1367 _Edit::DeleteCharacterAt(int index)
1369 return _pEditPresenter->DeleteCharacterAt(index);
1373 _Edit::DeleteCharacterAtCursorPosition(void)
1375 return _pEditPresenter->DeleteCharacterAtCursorPosition();
1379 _Edit::GetCurrentTextRange(int& start, int& end) const
1381 return _pEditPresenter->GetCurrentTextRange(start, end);
1385 _Edit::SetGuideText(const String& guideText)
1387 Variant var(guideText);
1389 SetProperty("guideText", var);
1393 _Edit::GetGuideText(void) const
1395 Variant var = GetProperty("guideText");
1397 return var.ToString();
1401 _Edit::GetGuideTextColor(void) const
1403 Variant color = GetProperty("guideTextColor");
1405 return color.ToColor();
1409 _Edit::SetGuideTextColor(const Color& color)
1411 __isSettingGuideTextColor = true;
1413 return SetProperty("guideTextColor", Variant(color));
1417 _Edit::SetKeypadEnabled(bool enable)
1419 Variant var(enable);
1421 SetProperty("keypadEnabled", var);
1425 _Edit::IsKeypadEnabled(void) const
1427 Variant var = GetProperty("keypadEnabled");
1429 return var.ToBool();
1433 _Edit::ShowKeypad(void)
1435 SysTryReturn(NID_UI_CTRL, (HasParent() && GetParent()), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The keypad couldn't be shown.");
1436 SysTryReturn(NID_UI_CTRL, (IsKeypadEnabled() && (__inputStyle == INPUT_STYLE_OVERLAY)), E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] The keypad couldn't be shown.");
1438 return _pEditPresenter->ShowKeypad();
1442 _Edit::GetTextLineCount(void) const
1444 return _pEditPresenter->GetTextLineCount();
1448 _Edit::GetTextTotalHeight(void) const
1450 return _pEditPresenter->GetTextTotalHeight();
1454 _Edit::SetBlockTextColor(const Color& color)
1458 return SetProperty("blockedTextColor", var);
1462 _Edit::GetBlockTextColor(void) const
1466 if (__blockTextColor.used)
1468 var = GetProperty("blockedTextColor");
1472 var = GetProperty("highlightedColor");
1475 return var.ToColor();
1479 _Edit::GetBlockRange(int& start, int& end) const
1481 _pEditPresenter->GetBlockRange(start, end);
1485 _Edit::SetBlockRange(int start, int end)
1487 return _pEditPresenter->SetBlockRange(start, end);
1491 _Edit::GetWordPosition(int cursorPos, int& startPos, int& endPos) const
1493 _pEditPresenter->GetWordPosition(cursorPos, startPos, endPos);
1497 _Edit::GetTextImageRangeAt(int postion, int& startPosition, int& endPosition) const
1499 return _pEditPresenter->GetTextImageRangeAt(postion, startPosition, endPosition);
1503 _Edit::BeginTextBlock(void)
1505 return _pEditPresenter->BeginTextBlock();
1509 _Edit::ReleaseTextBlock(void)
1511 return _pEditPresenter->ReleaseTextBlock();
1515 _Edit::IsBlocked(void) const
1517 return _pEditPresenter->IsBlocked();
1521 _Edit::CopyText(void)
1523 return _pEditPresenter->CopyText();
1527 _Edit::CutText(void)
1529 return _pEditPresenter->CutText();
1533 _Edit::PasteText(void)
1535 return _pEditPresenter->PasteText();
1539 _Edit::RemoveTextBlock(void)
1541 return _pEditPresenter->RemoveTextBlock();
1545 _Edit::IsClipped(void) const
1547 return _pEditPresenter->IsClipped();
1551 _Edit::SetCurrentLanguage(LanguageCode languageCode)
1553 return _pEditPresenter->SetCurrentLanguage(languageCode);
1557 _Edit::GetCurrentLanguage(LanguageCode& language) const
1559 return _pEditPresenter->GetCurrentLanguage(language);
1563 _Edit::CalculateAbsoluteCursorBounds(int index, Rectangle& absCursorRect)
1565 return _pEditPresenter->CalculateAbsoluteCursorBounds(index, absCursorRect);
1571 Canvas* pCanvas = GetCanvasN();
1572 SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create instance.");
1574 _pEditPresenter->Draw(*pCanvas);
1580 _Edit::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
1582 return _pEditPresenter->OnTouchPressed(source, touchinfo);
1586 _Edit::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
1588 return _pEditPresenter->OnTouchCanceled(source, touchinfo);
1592 _Edit::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1594 return _pEditPresenter->OnTouchReleased(source, touchinfo);
1598 _Edit::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1600 return _pEditPresenter->OnTouchMoved(source, touchinfo);
1604 _Edit::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
1606 return _pEditPresenter->OnKeyPressed(source, keyInfo);
1610 _Edit::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
1612 return _pEditPresenter->OnKeyReleased(source, keyInfo);
1616 _Edit::OnNotifiedN(const _Control& source, IList* pArgs)
1618 return _pEditPresenter->OnNotifiedN(pArgs);
1623 _Edit::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture)
1627 gesture.GetDistance(xDistance, yDistance);
1628 Point flickPoint(xDistance, yDistance);
1630 _pEditPresenter->InitializeCopyPasteManager();
1632 _pEditPresenter->StartFlickAnimation(flickPoint, gesture.GetDuration());
1638 _Edit::OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture)
1644 _Edit::OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture)
1646 _pEditPresenter->OnLongPressGestureDetected();
1652 _Edit::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture)
1658 _Edit::OnTapGestureDetected(_TouchTapGestureDetector& gesture)
1660 _pEditPresenter->OnTapGestureDetected();
1666 _Edit::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
1672 _Edit::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem)
1674 _pEditPresenter->OnClipboardPopupClosed(pClipboardItem);
1678 _Edit::OnFocusGained(const _Control& source)
1680 return _pEditPresenter->OnFocusGained();
1684 _Edit::OnFocusLost(const _Control& source)
1686 _pEditPresenter->OnFocusLost();
1693 _Edit::OnAttachedToMainTree(void)
1695 if (__isAccessibilityCreated)
1700 _AccessibilityContainer* pEditAccessibilityContainer = GetAccessibilityContainer();
1701 if(pEditAccessibilityContainer)
1703 pEditAccessibilityContainer->Activate(true);
1705 if (pEditAccessibilityContainer)
1707 if ((__editStyle & EDIT_STYLE_TITLE_TOP) || (__editStyle & EDIT_STYLE_TITLE_LEFT))
1709 __pTitleTextAccessibilityElement = new _AccessibilityElement(true);
1710 __pTitleTextAccessibilityElement->SetBounds(_pEditPresenter->GetTitleBounds());
1711 __pTitleTextAccessibilityElement->SetLabel(GetTitleText());
1712 __pTitleTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD);
1713 __pTitleTextAccessibilityElement->SetName(L"EditTitleText");
1714 pEditAccessibilityContainer->AddElement(*__pTitleTextAccessibilityElement);
1717 __pTextAccessibilityElement = new _AccessibilityElement(true);
1718 __pTextAccessibilityElement->SetBounds(_pEditPresenter->GetTextAreaBounds());
1719 __pTextAccessibilityElement->SetLabel(GetText());
1720 __pTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD);
1721 __pTextAccessibilityElement->SetName(L"EditText");
1722 pEditAccessibilityContainer->AddElement(*__pTextAccessibilityElement);
1724 if (__editStyle & EDIT_STYLE_CLEAR)
1726 __pClearButtonTextAccessibilityElement = new _AccessibilityElement(true);
1727 __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBounds());
1728 __pClearButtonTextAccessibilityElement->SetLabel(L"all clear, button");
1729 __pClearButtonTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD);
1730 __pClearButtonTextAccessibilityElement->SetName(L"EditFieldClearButton");
1731 pEditAccessibilityContainer->AddElement(*__pClearButtonTextAccessibilityElement);
1735 __isAccessibilityCreated = true;
1741 _Edit::OnBoundsChanged(void)
1743 if (__isConstructed)
1745 SysAssertf(_pEditPresenter != null, "_pEditPresenter is null");
1747 _pEditPresenter->Resize();
1749 if(__isAccessibilityCreated)
1751 if (__pTitleTextAccessibilityElement)
1753 __pTitleTextAccessibilityElement->SetBounds(_pEditPresenter->GetTitleBounds());
1756 if (__pTextAccessibilityElement)
1758 __pTextAccessibilityElement->SetBounds(_pEditPresenter->GetTextAreaBounds());
1761 if (__pClearButtonTextAccessibilityElement)
1763 __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBounds());
1770 _Edit::OnChangeLayout(_ControlOrientation orientation)
1772 result r = _pEditPresenter->ChangeLayout(orientation);
1777 _Edit::OnScrollPanelBoundsChanged(void)
1779 _pEditPresenter->OnScrollPanelBoundsChanged();
1783 _Edit::OnFontChanged(Font* pFont)
1785 _pEditPresenter->OnFontChanged(pFont);
1789 _Edit::OnFontInfoRequested(unsigned long& style, int& size)
1791 _pEditPresenter->OnFontInfoRequested(style, size);
1795 _Edit::OnAncestorEnableStateChanged(const _Control& control)
1797 bool enableState = false;
1798 enableState = control.GetEnableState();
1802 if (_Edit::IsFocused())
1804 _pEditPresenter->HideKeypad(true);
1812 _Edit::GetEditStyle(void) const
1818 _Edit::SetEditStyle(unsigned long style)
1820 __editStyle = style;
1824 _Edit::SetBorderRoundStyleEnabled(bool enable)
1826 __borderRoundStyle = enable;
1830 _Edit::IsBorderRoundStyleEnabled(void) const
1832 return __borderRoundStyle;
1836 _Edit::IsUsbKeyboardConnected(void) const
1838 return _pEditPresenter->IsUsbKeyboardConnected();
1842 _Edit::IsKeypadExist(void) const
1844 return _pEditPresenter->IsKeypadExist();
1848 _Edit::SetAutoShrinkModeEnabled(bool enable)
1850 _pEditPresenter->SetAutoShrinkModeEnabled(enable);
1854 _Edit::IsAutoShrinkModeEnabled(void) const
1856 return _pEditPresenter->IsAutoShrinkModeEnabled();
1860 _Edit::GetEllipsisPosition(void) const
1862 return __ellipsisPosition;
1866 _Edit::SetEllipsisPosition(EllipsisPosition position)
1868 __ellipsisPosition = position;
1869 _pEditPresenter->SetEllipsisPosition(position);
1873 _Edit::GetCutlinkColorInfo(EditCutLinkType type, EditCutlinkColor* colorInfo) const
1875 *colorInfo = __cutlinkColor[type];
1879 _Edit::SetCutlinkColorInfo(EditCutLinkType type, EditCutlinkColor colorInfo)
1881 __cutlinkColor[type] = colorInfo;
1885 _Edit::GetBackgroundBitmap(EditStatus status) const
1887 return __pBackgroundBitmap[status];
1891 _Edit::LoadDefaultBackgroundBitmap(GroupStyle groupStyle)
1893 result r = E_SUCCESS;
1897 case GROUP_STYLE_NONE:
1898 r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
1899 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1900 r = GET_BITMAP_CONFIG_N(EDIT::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
1901 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1902 r = GET_BITMAP_CONFIG_N(EDIT::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
1903 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1904 r = GET_BITMAP_CONFIG_N(EDIT::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
1905 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1906 r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
1907 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1909 case GROUP_STYLE_SINGLE:
1910 r = GET_BITMAP_CONFIG_N(EDIT::BG_SINGLE_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
1911 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1912 r = GET_BITMAP_CONFIG_N(EDIT::BG_SINGLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
1913 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1915 case GROUP_STYLE_TOP:
1916 r = GET_BITMAP_CONFIG_N(EDIT::BG_TOP, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
1917 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1918 r = GET_BITMAP_CONFIG_N(EDIT::BG_TOP_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
1919 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1921 case GROUP_STYLE_MIDDLE:
1922 r = GET_BITMAP_CONFIG_N(EDIT::BG_CENTER, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
1923 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1924 r = GET_BITMAP_CONFIG_N(EDIT::BG_CENTER_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
1925 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1927 case GROUP_STYLE_BOTTOM:
1928 r = GET_BITMAP_CONFIG_N(EDIT::BG_BOTTOM, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
1929 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1930 r = GET_BITMAP_CONFIG_N(EDIT::BG_BOTTOM_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
1931 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1934 r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
1935 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1936 r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
1937 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1944 for (int status = 0; status < EDIT_COLOR_MAX; status++)
1946 if (__pDefaultBackgroundBitmap[status])
1948 delete __pDefaultBackgroundBitmap[status];
1949 __pDefaultBackgroundBitmap[status] = null;
1953 delete __pDefaultBackgroundEffectBitmap;
1954 __pDefaultBackgroundEffectBitmap = null;
1960 _Edit::ReplaceDefaultBackgroundBitmapForSearchBar(void)
1962 result r = E_SUCCESS;
1964 for (int status = 0; status < EDIT_COLOR_MAX; status++)
1966 if (__pDefaultBackgroundBitmap[status])
1968 delete __pDefaultBackgroundBitmap[status];
1969 __pDefaultBackgroundBitmap[status] = null;
1973 if (__pDefaultBackgroundEffectBitmap)
1975 delete __pDefaultBackgroundEffectBitmap;
1976 __pDefaultBackgroundEffectBitmap = null;
1979 r = GET_BITMAP_CONFIG_N(SEARCHBAR::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
1980 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1981 r = GET_BITMAP_CONFIG_N(SEARCHBAR::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
1982 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1983 r = GET_BITMAP_CONFIG_N(SEARCHBAR::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
1984 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1985 r = GET_BITMAP_CONFIG_N(SEARCHBAR::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
1986 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1987 r = GET_BITMAP_CONFIG_N(SEARCHBAR::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
1988 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
1990 _pEditPresenter->SetSearchBarFlag(true);
1995 for (int status = 0; status < EDIT_COLOR_MAX; status++)
1997 if (__pDefaultBackgroundBitmap[status])
1999 delete __pDefaultBackgroundBitmap[status];
2000 __pDefaultBackgroundBitmap[status] = null;
2004 delete __pDefaultBackgroundEffectBitmap;
2005 __pDefaultBackgroundEffectBitmap = null;
2011 _Edit::GetDefaultBackgroundBitmap(EditStatus status) const
2013 return __pDefaultBackgroundBitmap[status];
2017 _Edit::IsCustomDefaultBackgroundBitmap(EditStatus status) const
2019 bool isCustomBitmap = false;
2023 case EDIT_STATUS_NORMAL:
2024 isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_NORMAL)
2026 case EDIT_STATUS_DISABLED:
2027 isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_DISABLED)
2029 case EDIT_STATUS_HIGHLIGHTED:
2030 isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_HIGHLIGHTED)
2032 case EDIT_STATUS_PRESSED:
2033 isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_PRESSED)
2036 isCustomBitmap = false;
2040 return isCustomBitmap;
2044 _Edit::GetDefaultBackgroundEffectBitmap(void) const
2046 return __pDefaultBackgroundEffectBitmap;
2051 _Edit::IsSettingGuideTextColor(void) const
2053 return __isSettingGuideTextColor;
2057 _Edit::SetFont(const Font& font)
2059 return _pEditPresenter->SetFont(font);
2063 _Edit::GetFontType(String& typefaceName, unsigned long& styleMask) const
2065 _pEditPresenter->GetFontType(typefaceName, styleMask);
2069 _Edit::SetFontType(const String& typefaceName, unsigned long styleMask)
2071 return _pEditPresenter->SetFontType(typefaceName, styleMask);
2075 _Edit::GetTextStyle(void) const
2077 return _pEditPresenter->GetTextStyle();
2081 _Edit::SetTextStyle(unsigned long style)
2083 return _pEditPresenter->SetTextStyle(style);
2087 _Edit::GetTitleText(void) const
2089 SysTryReturn(NID_UI_CTRL, (GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT), String(), E_SYSTEM, "[E_SYSTEM] The EditField has no title style.\n");
2091 Variant var = GetProperty("titleText");
2093 return var.ToString();
2097 _Edit::SetTitleText(const String& title)
2099 SysTryReturn(NID_UI_CTRL, (GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The EditField has no title style.\n");
2102 return SetProperty("titleText", var);
2106 _Edit::GetTitleTextColor(EditStatus status) const
2111 case EDIT_STATUS_NORMAL:
2112 var = GetProperty("normalTitleTextColor");
2115 case EDIT_STATUS_DISABLED:
2116 var = GetProperty("disabledTitleTextColor");
2119 case EDIT_STATUS_HIGHLIGHTED:
2120 var = GetProperty("highlightedTitleTextColor");
2123 case EDIT_STATUS_PRESSED:
2124 var = GetProperty("pressedTitleTextColor");
2131 return var.ToColor();
2135 _Edit::SetTitleTextColor(EditStatus status, const Color& color)
2137 result r = E_SUCCESS;
2143 case EDIT_STATUS_NORMAL:
2144 r = SetProperty("normalTitleTextColor", var);
2147 case EDIT_STATUS_DISABLED:
2148 r = SetProperty("disabledTitleTextColor", var);
2151 case EDIT_STATUS_HIGHLIGHTED:
2152 r = SetProperty("highlightedTitleTextColor", var);
2155 case EDIT_STATUS_PRESSED:
2156 r = SetProperty("pressedTitleTextColor", var);
2168 _Edit::GetInputStyle(void) const
2170 return __inputStyle;
2174 _Edit::SetKeypadCommandButtonVisible(bool visible)
2176 Variant var(visible);
2178 return SetProperty("overlayKeypadCommandButtonVisible", var);
2182 _Edit::GetKeypadCommandButton(void) const
2184 return _pEditPresenter->GetKeypadCommandButton();
2189 _Edit::SetKeypadCommandButton(CommandButtonPosition position, const String& text, int actionId)
2191 SysTryReturn(NID_UI_CTRL, (__inputStyle != INPUT_STYLE_FULLSCREEN), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to show the keypad due to a wrong input style.");
2193 return _pEditPresenter->SetKeypadCommandButton(position, text, actionId);
2197 _Edit::GetKeypadBounds(Rectangle& rect) const
2199 return _pEditPresenter->GetKeypadBounds(rect);
2203 _Edit::SendExpandableEditAreaEvent(_ExpandableEditAreaEventStatus status, int selectedTokenIndex)
2205 if (__pExpandableEditAreaEvent)
2207 IEventArg* pEventArg = _ExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(status, selectedTokenIndex);
2208 SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
2210 __pExpandableEditAreaEvent->Fire(*pEventArg);
2217 _Edit::SendScrollPanelEvent(CoreScrollPanelStatus eventstatus)
2219 if (__pScrollPanelEvent)
2221 IEventArg* pEventArg = _ScrollPanelEvent::CreateScrollPanelEventArgN(eventstatus);
2222 SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _CoreScrollPanelEventArg.");
2224 __pScrollPanelEvent->Fire(*pEventArg);
2231 _Edit::SendKeypadEvent(CoreKeypadAction keypadAction, CoreKeypadEventStatus eventstatus)
2235 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(keypadAction, eventstatus);
2236 SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _KeypadEventArg.");
2238 __pKeypadEvent->Fire(*pEventArg);
2245 _Edit::SendTextEvent(CoreTextEventStatus textEventStatus)
2247 if (__pTextAccessibilityElement)
2249 __pTextAccessibilityElement->SetLabel(GetText());
2254 IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(textEventStatus);
2255 SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
2257 __pTextEvent->Fire(*pEventArg);
2264 _Edit::SendTextBlockEvent(int start, int end)
2266 if (__pTextBlockEvent)
2268 IEventArg* pTextBlockEventArg = _TextBlockEvent::CreateTextBlockEventArgN(start, end);
2269 SysTryReturn(NID_UI_CTRL, pTextBlockEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _TextBlockEventArg.");
2271 __pTextBlockEvent->Fire(*pTextBlockEventArg);
2278 _Edit::SendLinkEvent(const String& text, LinkType linkType, const String& link)
2282 IEventArg* pLinkEventArg = _LinkEvent::CreateLinkEventArgN(text, linkType, link);
2283 SysTryReturn(NID_UI_CTRL, pLinkEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _LinkEventArg.");
2285 __pLinkEvent->Fire(*pLinkEventArg);
2292 _Edit::SendLanguageEvent(LanguageCode prevLanguageCode, LanguageCode currentLanguageCode)
2294 if (__pLanguageEvent)
2296 IEventArg* pLanguageEventArg = _LanguageEvent::CreateLanguageEventArgN(prevLanguageCode, currentLanguageCode);
2297 SysTryReturn(NID_UI_CTRL, pLanguageEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
2299 __pLanguageEvent->Fire(*pLanguageEventArg);
2306 _Edit::AttachScrollPanelEvent(void)
2308 _ScrollPanel* pScrollPanelCore = dynamic_cast<_ScrollPanel*>(GetParent());
2309 if (pScrollPanelCore)
2311 if (__pScrollPanelEvent)
2313 pScrollPanelCore->SetScrollPanelEvent(__pScrollPanelEvent);
2315 pScrollPanelCore->SetControlKeypadBinding(this);
2322 _Edit::DetachScrollPanelEvent(void)
2324 _ScrollPanel* pScrollPanelCore = dynamic_cast<_ScrollPanel*>(GetParent());
2325 if (pScrollPanelCore)
2327 if (__pScrollPanelEvent && (pScrollPanelCore->GetScrollPanelEvent() == __pScrollPanelEvent))
2329 pScrollPanelCore->SetScrollPanelEvent(null);
2331 pScrollPanelCore->SetControlKeypadBinding(null);
2338 _Edit::IsKeypadCommandButtonVisible(void) const
2340 Variant var = GetProperty("overlayKeypadCommandButtonVisible");
2342 return var.ToBool();
2346 _Edit::GetKeypadCommandButtonText(CommandButtonPosition position) const
2348 SysTryReturn(NID_UI_CTRL, (__inputStyle != INPUT_STYLE_FULLSCREEN), String(), E_SYSTEM, "[E_SYSTEM] Unable to show the keypad due to a wrong input style.");
2350 return _pEditPresenter->GetKeypadCommandButtonText(position);
2354 _Edit::GetKeypadCommandButtonActionId(CommandButtonPosition position) const
2356 SysTryReturn(NID_UI_CTRL, (__inputStyle != INPUT_STYLE_FULLSCREEN), -1, E_SYSTEM, "[E_SYSTEM] Unable to show the keypad due to a wrong input style.");
2358 return _pEditPresenter->GetKeypadCommandButtonActionId(position);
2362 _Edit::GetCursorBounds(bool isAbsRect, Rectangle& cursorBounds) const
2364 return _pEditPresenter->GetCursorBounds(isAbsRect, cursorBounds);
2368 _Edit::GetCursorPositionAt(const Point& touchPoint) const
2370 return _pEditPresenter->GetCursorPositionAt(touchPoint);
2374 _Edit::SetCursorDisabled(bool disabled)
2376 return _pEditPresenter->SetCursorDisabled(disabled);
2380 _Edit::SetPropertyAutoResizingEnabled(const Variant& enable)
2382 result r = E_SUCCESS;
2384 r = _pEditPresenter->SetAutoResizingEnabled(enable.ToBool());
2390 _Edit::GetPropertyAutoResizingEnabled(void) const
2392 return Variant(_pEditPresenter->IsAutoResizingEnabled());
2396 _Edit::SetPropertyCursorPosition(const Variant& position)
2398 result r = E_SUCCESS;
2399 int textLength = GetTextLength();
2400 int cursorPos = position.ToInt();
2402 SysTryReturn(NID_UI_CTRL, (cursorPos >= 0 && cursorPos <= textLength), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] This position is out of range.");
2404 r = _pEditPresenter->SetCursorPosition(cursorPos);
2410 _Edit::GetPropertyCursorPosition(void) const
2412 return Variant(_pEditPresenter->GetCursorPosition());
2416 _Edit::SetPropertyDisabledColor(const Variant& color)
2418 __color[EDIT_STATUS_DISABLED].backgroundColor = color.ToColor();
2424 _Edit::GetPropertyDisabledColor(void) const
2426 return Variant(__color[EDIT_STATUS_DISABLED].backgroundColor);
2430 _Edit::SetPropertyDisabledTextColor(const Variant& color)
2432 __color[EDIT_STATUS_DISABLED].textColor = color.ToColor();
2438 _Edit::GetPropertyDisabledTextColor(void) const
2440 return Variant(__color[EDIT_STATUS_DISABLED].textColor);
2444 _Edit::SetPropertyGuideText(const Variant& guideText)
2446 if (__pTextAccessibilityElement)
2448 __pTextAccessibilityElement->SetLabel(guideText.ToString());
2451 return _pEditPresenter->SetGuideText(guideText.ToString());
2455 _Edit::GetPropertyGuideText(void) const
2457 return Variant(_pEditPresenter->GetGuideText());
2461 _Edit::SetPropertyGuideTextColor(const Variant& color)
2463 __guideTextColor = color.ToColor();
2469 _Edit::GetPropertyGuideTextColor(void) const
2471 return Variant(__guideTextColor);
2475 _Edit::SetPropertyKeypadActionEnabled(const Variant& enabled)
2477 return _pEditPresenter->SetKeypadActionEnabled(enabled.ToBool());
2481 _Edit::GetPropertyKeypadActionEnabled(void) const
2483 return Variant(_pEditPresenter->IsKeypadActionEnabled());
2487 _Edit::SetPropertyKeypadAction(const Variant& action)
2489 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
2491 result r = E_SUCCESS;
2493 r = _pEditPresenter->SetKeypadAction((CoreKeypadAction)action.ToInt());
2499 _Edit::GetPropertyKeypadAction(void) const
2501 return Variant((int)_pEditPresenter->GetKeypadAction());
2505 _Edit::SetPropertyLineSpacing(const Variant& lineSpacing)
2507 __lineSpacing = lineSpacing.ToInt();
2513 _Edit::GetPropertyLineSpacing(void) const
2515 return Variant(__lineSpacing);
2519 _Edit::SetPropertyNormalColor(const Variant& color)
2521 __color[EDIT_STATUS_NORMAL].backgroundColor = color.ToColor();
2527 _Edit::GetPropertyNormalColor(void) const
2529 return Variant(__color[EDIT_STATUS_NORMAL].backgroundColor);
2533 _Edit::SetPropertyPressedColor(const Variant& color)
2535 __color[EDIT_STATUS_PRESSED].backgroundColor = color.ToColor();
2541 _Edit::GetPropertyPressedColor(void) const
2543 return Variant(__color[EDIT_STATUS_PRESSED].backgroundColor);
2547 _Edit::SetPropertyHighlightedColor(const Variant& color)
2549 __color[EDIT_STATUS_HIGHLIGHTED].backgroundColor = color.ToColor();
2555 _Edit::GetPropertyHighlightedColor(void) const
2557 return Variant(__color[EDIT_STATUS_HIGHLIGHTED].backgroundColor);
2561 _Edit::SetPropertyTextSize(const Variant& textSize)
2563 int fontMinSize = 0;
2564 int size = textSize.ToInt();
2565 result r = E_SUCCESS;
2567 GET_FIXED_VALUE_CONFIG(EDIT::FONT_MIN_SIZE, _CONTROL_ORIENTATION_PORTRAIT, fontMinSize);
2568 SysTryReturn(NID_UI_CTRL, size >= fontMinSize, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid size is given.");
2570 r = _pEditPresenter->SetTextSize(size);
2578 _Edit::GetPropertyTextSize(void) const
2580 return Variant(__textSize);
2584 _Edit::SetPropertyNormalTextColor(const Variant& color)
2586 __color[EDIT_STATUS_NORMAL].textColor = color.ToColor();
2592 _Edit::GetPropertyNormalTextColor(void) const
2594 return Variant(__color[EDIT_STATUS_NORMAL].textColor);
2598 _Edit::SetPropertyHighlightedTextColor(const Variant& color)
2600 __color[EDIT_STATUS_HIGHLIGHTED].textColor = color.ToColor();
2606 _Edit::GetPropertyHighlightedTextColor(void) const
2608 return Variant(__color[EDIT_STATUS_HIGHLIGHTED].textColor);
2612 _Edit::SetPropertyPressedTextColor(const Variant& color)
2614 __color[EDIT_STATUS_PRESSED].textColor = color.ToColor();
2620 _Edit::GetPropertyPressedTextColor(void) const
2622 return Variant(__color[EDIT_STATUS_PRESSED].textColor);
2626 _Edit::SetPropertyKeypadEnabled(const Variant& enabled)
2628 _pEditPresenter->SetKeypadEnabled(enabled.ToBool());
2634 _Edit::GetPropertyKeypadEnabled(void) const
2636 return Variant(_pEditPresenter->IsKeypadEnabled());
2640 _Edit::SetPropertyKeypadStyle(const Variant& style)
2642 SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != (KeypadStyle)style.ToInt()), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
2644 return _pEditPresenter->SetKeypadStyle((KeypadStyle)style.ToInt());
2648 _Edit::GetPropertyKeypadStyle(void) const
2650 return Variant((int)_pEditPresenter->GetKeypadStyle());
2654 _Edit::SetPropertyLowerCaseModeEnabled(const Variant& enabled)
2656 _pEditPresenter->SetLowerCaseModeEnabled(enabled.ToBool());
2662 _Edit::GetPropertyLowerCaseModeEnabled(void) const
2664 return Variant(_pEditPresenter->IsLowerCaseModeEnabled());
2668 _Edit::SetPropertyOverlayKeypadCommandButtonVisible(const Variant& visible)
2670 return _pEditPresenter->SetKeypadCommandButtonVisible(visible.ToBool());
2674 _Edit::GetPropertyOverlayKeypadCommandButtonVisible(void) const
2676 return Variant(_pEditPresenter->IsKeypadCommandButtonVisible());
2680 _Edit::SetPropertyText(const Variant& text)
2682 return _pEditPresenter->SetText(text.ToString());
2686 _Edit::GetPropertyText(void) const
2688 return Variant(_pEditPresenter->GetText());
2692 _Edit::SetPropertyViewModeEnabled(const Variant& enabled)
2694 return _pEditPresenter->SetViewModeEnabled(enabled.ToBool());
2698 _Edit::GetPropertyViewModeEnabled(void) const
2700 return Variant(_pEditPresenter->IsViewModeEnabled());
2704 _Edit::SetPropertyAutoLinkMask(const Variant& autoLinks)
2706 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
2708 return _pEditPresenter->SetAutoLinkMask(autoLinks.ToULong());
2712 _Edit::GetPropertyAutoLinkMask(void) const
2714 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), Variant((unsigned long)LINK_TYPE_NONE), E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
2716 return Variant(_pEditPresenter->GetAutoLinkMask());
2720 _Edit::SetPropertyTitleText(const Variant& titleText)
2722 return _pEditPresenter->SetTitleText(titleText.ToString());
2726 _Edit::GetPropertyTitleText(void) const
2728 return Variant(_pEditPresenter->GetTitleText());
2732 _Edit::SetPropertyNormalTitleTextColor(const Variant& color)
2734 __color[EDIT_STATUS_NORMAL].titleTextColor = color.ToColor();
2740 _Edit::GetPropertyNormalTitleTextColor(void) const
2742 return Variant(__color[EDIT_STATUS_NORMAL].titleTextColor);
2746 _Edit::SetPropertyDisabledTitleTextColor(const Variant& color)
2748 __color[EDIT_STATUS_DISABLED].titleTextColor = color.ToColor();
2754 _Edit::GetPropertyDisabledTitleTextColor(void) const
2756 return Variant(__color[EDIT_STATUS_DISABLED].titleTextColor);
2760 _Edit::SetPropertyHighlightedTitleTextColor(const Variant& color)
2762 __color[EDIT_STATUS_HIGHLIGHTED].titleTextColor = color.ToColor();
2768 _Edit::GetPropertyHighlightedTitleTextColor(void) const
2770 return Variant(__color[EDIT_STATUS_HIGHLIGHTED].titleTextColor);
2774 _Edit::SetPropertyPressedTitleTextColor(const Variant& color)
2776 __color[EDIT_STATUS_PRESSED].titleTextColor = color.ToColor();
2782 _Edit::GetPropertyPressedTitleTextColor(void) const
2784 return Variant(__color[EDIT_STATUS_PRESSED].titleTextColor);
2788 _Edit::SetPropertyBlockedTextColor(const Variant& color)
2790 __blockTextColor.blockTextColor = color.ToColor();
2791 __blockTextColor.used = true;
2797 _Edit::GetPropertyBlockedTextColor(void) const
2799 return Variant(__blockTextColor.blockTextColor);
2803 _Edit::SetPropertyTopMargin(const Variant& margin)
2805 SysTryReturn(NID_UI_CTRL, margin.ToInt() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
2807 __topMargin = margin.ToInt();
2813 _Edit::GetPropertyTopMargin(void) const
2815 return Variant(__topMargin);
2819 _Edit::SetPropertyBottomMargin(const Variant& margin)
2821 SysTryReturn(NID_UI_CTRL, margin.ToInt() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
2823 __bottomMargin = margin.ToInt();
2829 _Edit::GetPropertyBottomMargin(void) const
2831 return Variant(__bottomMargin);
2835 _Edit::SetPropertyLeftMargin(const Variant& margin)
2837 SysTryReturn(NID_UI_CTRL, margin.ToInt() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
2839 __leftMargin = margin.ToInt();
2845 _Edit::GetPropertyLeftMargin(void) const
2847 return Variant(__leftMargin);
2851 _Edit::SetPropertyRightMargin(const Variant& margin)
2853 SysTryReturn(NID_UI_CTRL, margin.ToInt() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
2855 __rightMargin = margin.ToInt();
2861 _Edit::GetPropertyRightMargin(void) const
2863 return Variant(__rightMargin);
2866 }}} // Tizen::Ui::Controls