2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0/
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 <FSys_SettingInfoImpl.h>
29 #include "FUi_AccessibilityContainer.h"
30 #include "FUi_AccessibilityElement.h"
31 #include "FUi_CoordinateSystemUtils.h"
32 #include "FUi_IAccessibilityListener.h"
33 #include "FUi_UiEventManager.h"
34 #include "FUiAnim_VisualElement.h"
35 #include "FUiCtrl_Edit.h"
36 #include "FUiCtrl_EditPresenter.h"
37 #include "FUiCtrl_ScrollPanel.h"
39 using namespace Tizen::Base;
40 using namespace Tizen::Base::Runtime;
41 using namespace Tizen::Base::Utility;
42 using namespace Tizen::Graphics;
43 using namespace Tizen::Ui;
44 using namespace Tizen::Ui::Animations;
45 using namespace Tizen::Locales;
46 using namespace Tizen::Graphics::_Text;
47 using namespace Tizen::Base::Collection;
48 using namespace Tizen::System;
50 namespace Tizen { namespace Ui { namespace Controls
52 const int EDIT_GESTURE_TAP_INTERVAL = 400;
53 const int EDIT_GESTURE_TAP_MOVE_ALLOWANCE = 50;
55 class _EditInternalTouchEventListener
56 : public _ITouchEventListener
57 , virtual public _IUiEventListener
58 , virtual public Tizen::Base::Runtime::IEventListener
62 _EditInternalTouchEventListener(const _Edit& edit);
64 * This is the destructor for this class.
66 virtual ~_EditInternalTouchEventListener(void) {}
69 * Notifies when an entity is touch pressed.
71 * @param[in] source The source of the event
72 * @param[in] currentPosition The current position
73 * @param[in] touchInfo The touch event information
75 virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
78 * Notifies when an entity is touch released.
80 * @param[in] source The source of the event
81 * @param[in] currentPosition The current position
82 * @param[in] touchInfo The touch event information
84 virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
87 * Notifies when an entity is touch moved.
89 * @param[in] source The source of the event
90 * @param[in] currentPosition The current position
91 * @param[in] touchInfo The touch event information
93 virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
96 * Notifies when an entity is touch cancelled.
98 * @param[in] source The source of the event
99 * @param[in] currentPosition The current position
100 * @param[in] touchInfo The touch event information
102 virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo){return false;};
106 }; // _ITouchEventListener
108 _EditInternalTouchEventListener::_EditInternalTouchEventListener(const _Edit& edit)
110 __pEdit = const_cast< _Edit* >(&edit);
114 _EditInternalTouchEventListener::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
116 _EditPresenter* pEditPresenter = __pEdit->GetPresenter();
117 SysTryReturn(NID_UI_CTRL, pEditPresenter, false, E_INVALID_STATE, "[E_INVALID_STATE] pEditPresenter is null.");
119 if (pEditPresenter->IsCopyPasteManagerExist())
121 pEditPresenter->FinishTextComposition();
122 if (pEditPresenter->IsCopyPastePopup(source))
124 return false; // CopyPastePopup is touched
126 else if (pEditPresenter->IsCopyPasteHandle(source))
128 pEditPresenter->ReleaseCopyPastePopup();
131 else if (pEditPresenter->IsCopyPastePopupExist())
144 _EditInternalTouchEventListener::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
146 _EditPresenter* pEditPresenter = __pEdit->GetPresenter();
147 SysTryReturn(NID_UI_CTRL, pEditPresenter, false, E_INVALID_STATE, "[E_INVALID_STATE] pEditPresenter is null.");
149 if (pEditPresenter->IsCopyPasteManagerExist())
151 if (!pEditPresenter->IsCopyPastePopup(source) && !pEditPresenter->IsCopyPasteHandle(source))
153 if (pEditPresenter->IsCopyPastePopupExist())
157 else if (__pEdit == &source)
163 pEditPresenter->InitializeCopyPasteManager();
172 _EditInternalTouchEventListener::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
174 _EditPresenter* pEditPresenter = __pEdit->GetPresenter();
175 SysTryReturn(NID_UI_CTRL, pEditPresenter, false, E_INVALID_STATE, "[E_INVALID_STATE] pEditPresenter is null.");
177 if (pEditPresenter->IsCopyPasteManagerExist())
179 if (!pEditPresenter->IsCopyPastePopup(source) && !pEditPresenter->IsCopyPasteHandle(source))
181 if (pEditPresenter->IsCopyPastePopupExist())
183 if (pEditPresenter->IsCopyPasteHandleExist())
185 pEditPresenter->ReleaseCopyPastePopup();
190 pEditPresenter->InitializeCopyPasteManager();
194 else if (__pEdit == &source)
198 else if (pEditPresenter->IsCopyPasteHandleExist())
200 pEditPresenter->InitializeCopyPasteManager();
209 IMPLEMENT_PROPERTY(_Edit);
212 : _pEditPresenter(null)
213 , __bottomMargin(-1.0f)
214 , __leftMargin(-1.0f)
215 , __lineSpacing(-1.0f)
216 , __rightMargin(-1.0f)
219 , __editStyle(EDIT_STYLE_NORMAL)
220 , __borderRoundStyle(false)
221 , __ellipsisPosition(ELLIPSIS_POSITION_END)
222 , __inputStyle(INPUT_STYLE_OVERLAY)
223 , __isConstructed(false)
224 , __guideTextColor(Color())
225 , __pressedGuideTextColor(Color())
226 , __isSettingGuideTextColor(false)
227 , __pDefaultBackgroundEffectBitmap(null)
228 , __pDefaultFocusBitmap(null)
229 , __pGestureFlick(null)
230 , __pGestureLongPress(null)
231 , __pGestureTap(null)
232 , __pEditInternalTouchEventListener(null)
233 , __pExpandableEditAreaEvent(null)
234 , __pKeypadEvent(null)
235 , __pLanguageEvent(null)
237 , __pScrollPanelEvent(null)
238 , __pTextBlockEvent(null)
240 , __pTextAccessibilityElement(null)
241 , __pClearButtonTextAccessibilityElement(null)
242 , __pToolbarAccessibilityElement(null)
243 , __isAccessibilityCreated(false)
244 , __isFullScreenKeypadEdit(false)
245 , __internalFocus(false)
246 , __isDestroyed(false)
247 , __pTextFilter(null)
249 , __isTouchMoving(false)
250 , __isSearchFieldFocused(false)
251 , __isTextEventEnabled(true)
253 for (int status = 0; status < EDIT_COLOR_MAX; status++)
255 __pBackgroundBitmap[status] = null;
258 for (int status = 0; status < EDIT_COLOR_MAX; status++)
260 __pDefaultBackgroundBitmap[status] = null;
263 __blockTextColor.used = false;
264 __blockTextColor.blockTextColor = Color();
269 delete _pEditPresenter;
270 _pEditPresenter = null;
272 for (int status = 0; status < EDIT_COLOR_MAX; status++)
274 if (__pBackgroundBitmap[status])
276 delete __pBackgroundBitmap[status];
277 __pBackgroundBitmap[status] = null;
280 if (__pDefaultBackgroundBitmap[status])
282 delete __pDefaultBackgroundBitmap[status];
283 __pDefaultBackgroundBitmap[status] = null;
287 if (__pDefaultBackgroundEffectBitmap)
289 delete __pDefaultBackgroundEffectBitmap;
290 __pDefaultBackgroundEffectBitmap = null;
293 if (__pDefaultFocusBitmap)
295 delete __pDefaultFocusBitmap;
296 __pDefaultFocusBitmap = null;
299 if (__pTextBlockEvent)
301 delete __pTextBlockEvent;
302 __pTextBlockEvent = null;
313 delete __pKeypadEvent;
314 __pKeypadEvent = null;
317 if (__pScrollPanelEvent)
319 delete __pScrollPanelEvent;
320 __pScrollPanelEvent = null;
323 if (__pLanguageEvent)
325 delete __pLanguageEvent;
326 __pLanguageEvent = null;
331 _ITouchFlickGestureEventListener* pListener = dynamic_cast< _ITouchFlickGestureEventListener* >(this);
332 __pGestureFlick->RemoveGestureListener(*pListener);
333 RemoveGestureDetector(*__pGestureFlick);
334 delete __pGestureFlick;
335 __pGestureFlick = null;
338 if (__pGestureLongPress)
340 _ITouchLongPressGestureEventListener* pListener = dynamic_cast< _ITouchLongPressGestureEventListener* >(this);
341 __pGestureLongPress->RemoveGestureListener(*pListener);
342 RemoveGestureDetector(*__pGestureLongPress);
343 delete __pGestureLongPress;
344 __pGestureLongPress = null;
349 _ITouchTapGestureEventListener* pListener = dynamic_cast< _ITouchTapGestureEventListener* >(this);
350 __pGestureTap->RemoveGestureListener(*pListener);
351 RemoveGestureDetector(*__pGestureTap);
352 delete __pGestureTap;
353 __pGestureTap = null;
356 if (__pEditInternalTouchEventListener)
358 _UiEventManager::GetInstance()->RemoveTouchEventListener(*__pEditInternalTouchEventListener);
359 delete __pEditInternalTouchEventListener;
360 __pEditInternalTouchEventListener = null;
369 if (__pExpandableEditAreaEvent)
371 delete __pExpandableEditAreaEvent;
372 __pExpandableEditAreaEvent = null;
375 if (__pTextAccessibilityElement)
377 __pTextAccessibilityElement->Activate(false);
378 __pTextAccessibilityElement = null;
380 if (__pClearButtonTextAccessibilityElement)
382 __pClearButtonTextAccessibilityElement->Activate(false);
383 __pClearButtonTextAccessibilityElement = null;
385 if (__pToolbarAccessibilityElement)
387 __pToolbarAccessibilityElement->Activate(false);
388 __pToolbarAccessibilityElement = null;
391 _SettingInfoImpl::RemoveSettingEventListenerForInternal(*this);
395 _Edit::CreateEditN(void)
397 _EditPresenter* pPresenter = _EditPresenter::CreateInstanceN();
398 if (pPresenter == null)
400 SetLastResult(E_OUT_OF_MEMORY);
405 result r = E_SUCCESS;
406 _VisualElement* pBaseVisualElement = null;
407 _Edit* pEdit = new (std::nothrow) _Edit;
408 SysTryCatch(NID_UI_CTRL, pEdit, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
410 pBaseVisualElement = pEdit->GetVisualElement();
411 if (pBaseVisualElement)
413 r = pBaseVisualElement->SetSurfaceOpaque(false);
414 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
417 pEdit->AcquireHandle();
419 r = pEdit->SetPresenter(*pPresenter);
420 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
432 _Edit::Initialize(int editStyle, InputStyle inputStyle, int limitLength, GroupStyle groupStyle)
434 result r = E_SUCCESS;
436 SetEditStyle(editStyle);
438 r = LoadDefaultBackgroundBitmap(groupStyle);
439 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to load Bitmaps", GetErrorMessage(r));
441 InitializeColorInformation();
443 r = _pEditPresenter->Initialize(*this);
444 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to construct", GetErrorMessage(r));
446 r = _pEditPresenter->SetTextLimitLength(limitLength);
447 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to set limit length", GetErrorMessage(r));
449 __inputStyle = inputStyle;
450 if (inputStyle == INPUT_STYLE_OVERLAY)
452 if (!(editStyle & EDIT_STYLE_FLEXIBLE) && !(editStyle & EDIT_STYLE_VIEWER))
454 _pEditPresenter->SetKeypadCommandButtonVisible(true);
458 _pEditPresenter->SetEditGroupStyle(groupStyle);
460 __textSize = _pEditPresenter->GetTextSize();
462 __pGestureFlick = new (std::nothrow) _TouchFlickGestureDetector;
463 SysTryReturn(NID_UI_CTRL, __pGestureFlick, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create touch flick gesture.");
464 r = AddGestureDetector(*__pGestureFlick);
465 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r));
466 r = __pGestureFlick->AddGestureListener(*this);
467 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r));
469 __pGestureLongPress = new (std::nothrow) _TouchLongPressGestureDetector;
470 SysTryReturn(NID_UI_CTRL, __pGestureLongPress, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create touch long press gesture.");
471 r = AddGestureDetector(*__pGestureLongPress);
472 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture detector", GetErrorMessage(r));
473 r = __pGestureLongPress->AddGestureListener(*this);
474 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r));
476 __pGestureTap = new (std::nothrow) _TouchTapGestureDetector;
477 SysTryReturn(NID_UI_CTRL, __pGestureTap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create touch tap gesture.");
479 r = __pGestureTap->SetTapInterval(EDIT_GESTURE_TAP_INTERVAL);
480 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to set TapInterval", GetErrorMessage(r));
482 r = __pGestureTap->SetMoveAllowance(EDIT_GESTURE_TAP_MOVE_ALLOWANCE);
483 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to set TapMoveAllowance", GetErrorMessage(r));
485 r = AddGestureDetector(*__pGestureTap);
486 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture detector", GetErrorMessage(r));
487 r = __pGestureTap->AddGestureListener(*this);
488 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r));
490 __pEditInternalTouchEventListener = new (std::nothrow) _EditInternalTouchEventListener(*this);
491 SysTryReturn(NID_UI_CTRL, __pEditInternalTouchEventListener, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create internal touch listener.");
492 r = _UiEventManager::GetInstance()->AddTouchEventListener(*__pEditInternalTouchEventListener);
493 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Unable to add internal event listener", GetErrorMessage(r));
495 __isConstructed = true;
497 _AccessibilityContainer* pEditAccessibilityContainer = GetAccessibilityContainer();
498 if (pEditAccessibilityContainer)
500 pEditAccessibilityContainer->Activate(true);
502 if (pEditAccessibilityContainer)
504 __pTextAccessibilityElement = new _AccessibilityElement(true);
505 __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
507 if ((GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT))
509 __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText());
513 __pTextAccessibilityElement->SetLabel(GetGuideText() + GetText());
516 __pTextAccessibilityElement->SetTrait(L"Edit Field");
517 __pTextAccessibilityElement->SetName(L"EditText");
518 pEditAccessibilityContainer->AddElement(*__pTextAccessibilityElement);
520 if (__editStyle & EDIT_STYLE_CLEAR && GetTextLength())
522 __pClearButtonTextAccessibilityElement = new _AccessibilityElement(true);
523 __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
524 __pClearButtonTextAccessibilityElement->SetLabel(L"all clear");
525 __pClearButtonTextAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
526 __pClearButtonTextAccessibilityElement->SetName(L"EditFieldClearButton");
527 pEditAccessibilityContainer->AddElement(*__pClearButtonTextAccessibilityElement);
530 __isAccessibilityCreated = true;
533 r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
534 SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
540 _Edit::InitializeColorInformation(void)
542 GET_COLOR_CONFIG(EDIT::BG_NORMAL, __color[EDIT_STATUS_NORMAL].backgroundColor);
543 GET_COLOR_CONFIG(EDIT::BG_PRESSED, __color[EDIT_STATUS_PRESSED].backgroundColor);
544 GET_COLOR_CONFIG(EDIT::BG_HIGHLIGHTED, __color[EDIT_STATUS_HIGHLIGHTED].backgroundColor);
545 GET_COLOR_CONFIG(EDIT::BG_DISABLED, __color[EDIT_STATUS_DISABLED].backgroundColor);
547 GET_COLOR_CONFIG(EDIT::TITLE_TEXT_NORMAL, __color[EDIT_STATUS_NORMAL].titleTextColor);
548 GET_COLOR_CONFIG(EDIT::TITLE_TEXT_PRESSED, __color[EDIT_STATUS_PRESSED].titleTextColor);
549 GET_COLOR_CONFIG(EDIT::TITLE_TEXT_HIGHLIGHTED, __color[EDIT_STATUS_HIGHLIGHTED].titleTextColor);
550 GET_COLOR_CONFIG(EDIT::TITLE_TEXT_DISABLED, __color[EDIT_STATUS_DISABLED].titleTextColor);
552 GET_COLOR_CONFIG(EDIT::TEXT_NORMAL, __color[EDIT_STATUS_NORMAL].textColor);
553 GET_COLOR_CONFIG(EDIT::TEXT_PRESSED, __color[EDIT_STATUS_PRESSED].textColor);
554 GET_COLOR_CONFIG(EDIT::TEXT_HIGHLIGHTED, __color[EDIT_STATUS_HIGHLIGHTED].textColor);
555 GET_COLOR_CONFIG(EDIT::TEXT_DISABLED, __color[EDIT_STATUS_DISABLED].textColor);
557 GET_COLOR_CONFIG(EDIT::GUIDE_TEXT_NORMAL, __guideTextColor);
559 memset(__cutlinkColor, 0, sizeof(EditCutlinkColor) * EDIT_LINK_TYPE_MAX);
560 for (int i = 0; i < EDIT_LINK_TYPE_MAX; i++)
562 EditCutLinkType type = (EditCutLinkType) i;
563 GET_COLOR_CONFIG(EDIT::CUT_LINK_TEXT_NORMAL, __cutlinkColor[type].cutlinkFgColor);
564 GET_COLOR_CONFIG(EDIT::CUT_LINK_BG_NORMAL, __cutlinkColor[type].cutlinkBgColor);
571 _Edit::SetPresenter(const _EditPresenter& pPresenter)
573 result r = E_SUCCESS;
575 _pEditPresenter = const_cast< _EditPresenter* >(&pPresenter);
581 _Edit::GetPresenter(void) const
583 return _pEditPresenter;
587 _Edit::GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const
589 if (!GetTextLength())
591 return FloatDimension(GetBoundsF().width, GetBoundsF().height);
594 FloatDimension dimension(0.0f, 0.0f);
595 float textLeftMargin = 0.0f;
596 float textRightMargin = 0.0f;
597 float textTopMargin = 0.0f;
598 float textBottomMargin = 0.0f;
600 _ControlOrientation orientation = GetOrientation();
601 GET_SHAPE_CONFIG(EDIT::AREA_TEXT_LEFT_MARGIN, orientation, textLeftMargin);
602 GET_SHAPE_CONFIG(EDIT::AREA_TEXT_RIGHT_MARGIN, orientation, textRightMargin);
603 GET_SHAPE_CONFIG(EDIT::AREA_TEXT_TOP_MARGIN, orientation, textTopMargin);
604 GET_SHAPE_CONFIG(EDIT::AREA_TEXT_BOTTOM_MARGIN, orientation, textBottomMargin);
606 TextObject* pTextObject = _pEditPresenter->GetTextObject();
610 return FloatDimension(GetBoundsF().width, GetBoundsF().height);
614 TextObjectActionType previousActionType = pTextObject->GetAction();
615 TextObjectWrapType previousWrapType = pTextObject->GetWrap();
616 FloatRectangle previousRect = pTextObject->GetBoundsF();
617 FloatRectangle newRect = previousRect;
619 bool fitToHorizontal = horizontalMode;
620 bool fitToVertical = verticalMode;
624 if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
626 newRect.width = _ControlManager::GetInstance()->GetScreenSizeF().width;
630 newRect.width = _ControlManager::GetInstance()->GetScreenSizeF().height;
632 newRect.width -= (GetBoundsF().x + textLeftMargin + textRightMargin);
636 if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
638 newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().height;
642 newRect.height = _ControlManager::GetInstance()->GetScreenSizeF().width;
644 newRect.height -= (GetBoundsF().y + textTopMargin + textBottomMargin);
647 pTextObject->SetBounds(newRect);
648 pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE);
649 pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
650 pTextObject->Compose();
652 if (fitToHorizontal && fitToVertical)
654 dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
655 if (dimension.width > newRect.width)
657 dimension.width = newRect.width;
659 float height = pTextObject->GetTotalHeightF();
660 if (height <= newRect.height)
662 dimension.height = height;
666 dimension.height = newRect.height;
669 else if (fitToHorizontal)
671 dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength());
672 if (dimension.width > newRect.width)
674 dimension.width = newRect.width;
676 dimension.height = GetBoundsF().height;
678 else if (fitToVertical)
680 float height = pTextObject->GetTotalHeightF();
681 if (height <= newRect.height)
683 dimension.height = height;
687 dimension.height = newRect.height;
689 dimension.width = GetBoundsF().width;
693 pTextObject->SetBounds(previousRect);
694 pTextObject->SetAction(previousActionType);
695 pTextObject->SetWrap(previousWrapType);
696 pTextObject->Compose();
700 dimension.width += textLeftMargin + textRightMargin;
704 dimension.height += textTopMargin + textBottomMargin;
711 _Edit::IsInternalFocused(void) const
713 return __internalFocus;
717 _Edit::GetTextAlignment(void) const
719 return _pEditPresenter->GetTextAlignment();
723 _Edit::SetTextAlignment(HorizontalAlignment alignment)
725 return _pEditPresenter->SetTextAlignment(alignment);
729 _Edit::IsViewModeEnabled(void) const
731 Variant var = GetProperty("viewModeEnabled");
737 _Edit::SetViewModeEnabled(bool enable)
741 return SetProperty("viewModeEnabled", var);
745 _Edit::SetAutoLinkMask(unsigned long autoLinks)
747 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
748 Variant var(autoLinks);
750 return SetProperty("autoLinkMask", var);
754 _Edit::GetAutoLinkMask(void) const
756 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), LINK_TYPE_NONE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
757 Variant var = GetProperty("autoLinkMask");
759 return var.ToULong();
763 _Edit::GetLineSpacing(void) const
765 return _pEditPresenter->GetLineSpacing();
769 _Edit::GetLineSpacingF(void) const
771 return _pEditPresenter->GetLineSpacingF();
775 _Edit::SetLineSpacing(int linePixelGap)
777 return _pEditPresenter->SetLineSpacing(linePixelGap);
781 _Edit::SetLineSpacing(float linePixelGap)
783 return _pEditPresenter->SetLineSpacing(linePixelGap);
787 _Edit::SetMaxLineCount(int maxLineCount)
789 _pEditPresenter->SetMaxLineCount(maxLineCount);
795 _Edit::GetMaxLineCount(void) const
797 return _pEditPresenter->GetMaxLineCount();
801 _Edit::GetHorizontalMargin(EditTextHorizontalMargin marginType) const
803 return _CoordinateSystemUtils::ConvertToInteger(GetHorizontalMarginF(marginType));
807 _Edit::GetHorizontalMarginF(EditTextHorizontalMargin marginType) const
813 case EDIT_TEXT_LEFT_MARGIN:
814 var = GetProperty("leftMargin");
817 case EDIT_TEXT_RIGHT_MARGIN:
818 var = GetProperty("rightMargin");
821 case EDIT_TEXT_HORIZONTAL_MARGIN:
822 var = GetProperty("leftMargin");
829 return var.ToFloat();
834 _Edit::GetVerticalMargin(EditTextVerticalMargin marginType) const
836 return _CoordinateSystemUtils::ConvertToInteger(GetVerticalMarginF(marginType));
840 _Edit::GetVerticalMarginF(EditTextVerticalMargin marginType) const
846 case EDIT_TEXT_TOP_MARGIN:
847 var = GetProperty("topMargin");
850 case EDIT_TEXT_BOTTOM_MARGIN:
851 var = GetProperty("bottomMargin");
854 case EDIT_TEXT_VERTICAL_MARGIN:
855 var = GetProperty("topMargin");
862 return var.ToFloat();
866 _Edit::SetHorizontalMargin(int margin, EditTextHorizontalMargin marginType)
868 float floatMargin = _CoordinateSystemUtils::ConvertToFloat(margin);
870 return SetHorizontalMargin(floatMargin, marginType);
874 _Edit::SetHorizontalMargin(float margin, EditTextHorizontalMargin marginType)
876 result r = E_SUCCESS;
879 SysTryReturn(NID_UI_CTRL, margin > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
883 case EDIT_TEXT_LEFT_MARGIN:
884 r = SetProperty("leftMargin", var);
887 case EDIT_TEXT_RIGHT_MARGIN:
888 r = SetProperty("rightMargin", var);
891 case EDIT_TEXT_HORIZONTAL_MARGIN:
892 r = SetProperty("leftMargin", var);
893 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
894 r = SetProperty("rightMargin", var);
900 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
902 _pEditPresenter->SetClientBounds();
903 r = _pEditPresenter->SetInitialBounds();
904 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
910 _Edit::SetVerticalMargin(int margin, EditTextVerticalMargin marginType)
912 float floatMargin = _CoordinateSystemUtils::ConvertToFloat(margin);
913 return SetVerticalMargin(floatMargin, marginType);
917 _Edit::SetVerticalMargin(float margin, EditTextVerticalMargin marginType)
919 result r = E_SUCCESS;
922 SysTryReturn(NID_UI_CTRL, margin > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
926 case EDIT_TEXT_TOP_MARGIN:
927 r = SetProperty("topMargin", var);
930 case EDIT_TEXT_BOTTOM_MARGIN:
931 r = SetProperty("bottomMargin", var);
934 case EDIT_TEXT_VERTICAL_MARGIN:
935 r = SetProperty("topMargin", var);
936 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
937 r = SetProperty("bottomMargin", var);
943 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
945 _pEditPresenter->SetClientBounds();
946 r = _pEditPresenter->SetInitialBounds();
947 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin.");
953 _Edit::GetTextLimitLength(void) const
955 return _pEditPresenter->GetTextLimitLength();
959 _Edit::SetLimitLength(int limitLength)
961 return _pEditPresenter->SetTextLimitLength(limitLength);
965 _Edit::SetAutoResizingEnabled(bool enable)
969 return SetProperty("autoResizingEnabled", var);
973 _Edit::IsAutoResizingEnabled(void) const
975 Variant var = GetProperty("autoResizingEnabled");
981 _Edit::GetKeypadAction(void) const
983 Variant var = GetProperty("keypadAction");
985 return (CoreKeypadAction) var.ToInt();
989 _Edit::SetKeypadAction(CoreKeypadAction keypadAction)
991 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
992 Variant var((int) keypadAction);
994 return SetProperty("keypadAction", var);
998 _Edit::SetKeypadActionEnabled(bool enabled)
1000 Variant var(enabled);
1002 return SetProperty("keypadActionEnabled", var);
1006 _Edit::GetKeypadActionEnabled(void) const
1008 Variant var = GetProperty("keypadActionEnabled");
1010 return var.ToBool();
1014 _Edit::GetKeypadStyle(void) const
1016 Variant var = GetProperty("keypadStyle");
1018 return (KeypadStyle) var.ToInt();
1022 _Edit::SetKeypadStyle(KeypadStyle keypadStyle)
1024 SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != keypadStyle), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
1025 Variant var((int) keypadStyle);
1027 return SetProperty("keypadStyle", var);
1031 _Edit::SetKeypadNormalNumberStyle(bool enable)
1033 return _pEditPresenter->SetKeypadNormalNumberStyle(enable);
1037 _Edit::IsTextPredictionEnabled(void) const
1039 return _pEditPresenter->IsTextPredictionEnabled();
1043 _Edit::SetTextPredictionEnabled(bool enable)
1045 return _pEditPresenter->SetTextPredictionEnabled(enable);
1049 _Edit::UpdateAccessibilityElement(EditAccessibilityElementType type)
1051 if (!__isAccessibilityCreated)
1056 if (__editStyle & EDIT_STYLE_CLEAR)
1058 _AccessibilityContainer* pEditAccessibilityContainer = GetAccessibilityContainer();
1059 if (pEditAccessibilityContainer)
1061 if (!GetTextLength())
1063 if (__pClearButtonTextAccessibilityElement)
1065 __pClearButtonTextAccessibilityElement->Activate(false);
1070 if (__pClearButtonTextAccessibilityElement && !__pClearButtonTextAccessibilityElement->IsActivated())
1072 __pClearButtonTextAccessibilityElement->Activate(true);
1074 else if (!__pClearButtonTextAccessibilityElement)
1076 __pClearButtonTextAccessibilityElement = new _AccessibilityElement(true);
1077 __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
1078 __pClearButtonTextAccessibilityElement->SetLabel(L"all clear");
1079 __pClearButtonTextAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
1080 __pClearButtonTextAccessibilityElement->SetName(L"EditFieldClearButton");
1081 pEditAccessibilityContainer->AddElement(*__pClearButtonTextAccessibilityElement);
1089 case EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT:
1090 if (__pTextAccessibilityElement)
1092 __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
1093 if ((GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT))
1095 __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText());
1099 __pTextAccessibilityElement->SetLabel(GetGuideText() + GetText());
1104 case EDIT_ACCESSIBILITY_ELEMENT_TYPE_CLEAR_ICON:
1105 if (__pClearButtonTextAccessibilityElement)
1107 __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
1119 _Edit::SetFullScreenKeypadEdit(bool enabled)
1121 __isFullScreenKeypadEdit = enabled;
1127 _Edit::IsFullScreenKeypadEdit(void)
1129 return __isFullScreenKeypadEdit;
1133 _Edit::HideKeypad(void)
1135 return _pEditPresenter->HideKeypad(true);
1139 _Edit::GetTextSize(void) const
1141 return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF());
1145 _Edit::GetTextSizeF(void) const
1147 Variant size = GetProperty("textSize");
1149 return size.ToFloat();
1153 _Edit::SetTextSize(int size)
1155 return SetTextSize(_CoordinateSystemUtils::ConvertToFloat(size));
1159 _Edit::SetTextSize(float size)
1163 return SetProperty("textSize", Variant(size));
1167 _Edit::GetColor(EditStatus status) const
1172 case EDIT_STATUS_NORMAL:
1173 color = GetProperty("normalColor");
1176 case EDIT_STATUS_DISABLED:
1177 color = GetProperty("disabledColor");
1180 case EDIT_STATUS_HIGHLIGHTED:
1181 color = GetProperty("highlightedColor");
1184 case EDIT_STATUS_PRESSED:
1185 color = GetProperty("pressedColor");
1192 return color.ToColor();
1196 _Edit::GetTextColor(EditTextColor type) const
1198 Variant variantColor;
1202 case EDIT_TEXT_COLOR_NORMAL:
1203 variantColor = GetProperty("normalTextColor");
1204 color = variantColor.ToColor();
1207 case EDIT_TEXT_COLOR_DISABLED:
1208 variantColor = GetProperty("disabledTextColor");
1209 color = variantColor.ToColor();
1212 case EDIT_TEXT_COLOR_HIGHLIGHTED:
1213 variantColor = GetProperty("highlightedTextColor");
1214 color = variantColor.ToColor();
1217 case EDIT_TEXT_COLOR_LINK:
1218 color = __cutlinkColor[EDIT_LINK_TYPE_URL].cutlinkFgColor;
1229 _Edit::GetTextColor(EditStatus status) const
1231 Variant variantColor;
1236 case EDIT_STATUS_NORMAL:
1237 variantColor = GetProperty("normalTextColor");
1238 color = variantColor.ToColor();
1241 case EDIT_STATUS_DISABLED:
1242 variantColor = GetProperty("disabledTextColor");
1243 color = variantColor.ToColor();
1246 case EDIT_STATUS_HIGHLIGHTED:
1247 variantColor = GetProperty("highlightedTextColor");
1248 color = variantColor.ToColor();
1251 case EDIT_STATUS_PRESSED:
1252 variantColor = GetProperty("pressedTextColor");
1253 color = variantColor.ToColor();
1264 _Edit::SetBackgroundBitmap(EditStatus status, const Bitmap& bitmap)
1266 result r = E_SUCCESS;
1268 Bitmap* pNewBitmap = _BitmapImpl::CloneN(bitmap);
1269 SysTryReturn(NID_UI_CTRL, pNewBitmap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
1271 delete __pBackgroundBitmap[status];
1272 __pBackgroundBitmap[status] = pNewBitmap;
1278 _Edit::SetColor(EditStatus status, const Color& color)
1280 result r = E_SUCCESS;
1284 case EDIT_STATUS_NORMAL:
1285 r = SetProperty("normalColor", Variant(color));
1288 case EDIT_STATUS_DISABLED:
1289 r = SetProperty("disabledColor", Variant(color));
1292 case EDIT_STATUS_HIGHLIGHTED:
1293 r = SetProperty("highlightedColor", Variant(color));
1296 case EDIT_STATUS_PRESSED:
1297 r = SetProperty("pressedColor", Variant(color));
1304 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Unable to set color.", GetErrorMessage(r));
1310 _Edit::SetTextColor(EditTextColor type, const Color& color)
1312 result r = E_SUCCESS;
1313 EditCutlinkColor autoLinkColorInfo;
1317 case EDIT_TEXT_COLOR_NORMAL:
1318 r = SetProperty("normalTextColor", Variant(color));
1319 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
1322 case EDIT_TEXT_COLOR_DISABLED:
1323 r = SetProperty("disabledTextColor", Variant(color));
1324 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
1327 case EDIT_TEXT_COLOR_HIGHLIGHTED:
1328 r = SetProperty("highlightedTextColor", Variant(color));
1329 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
1331 r = SetProperty("pressedTextColor", Variant(color));
1332 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
1335 case EDIT_TEXT_COLOR_LINK:
1336 GetCutlinkColorInfo(EDIT_LINK_TYPE_URL, &autoLinkColorInfo);
1337 autoLinkColorInfo.cutlinkFgColor = color;
1338 SetCutlinkColorInfo(EDIT_LINK_TYPE_URL, autoLinkColorInfo);
1339 SetCutlinkColorInfo(EDIT_LINK_TYPE_EMAIL, autoLinkColorInfo);
1340 SetCutlinkColorInfo(EDIT_LINK_TYPE_PHONE_NUM, autoLinkColorInfo);
1352 _Edit::GetText(int start, int end) const
1354 SysTryReturn(NID_UI_CTRL, (start > -1 && end > -1), String(), E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The invalid argument(start = %d, end = %d) is given.");
1356 return _pEditPresenter->GetText(start, end);
1360 _Edit::AddExpandableEditAreaEventListener(const _IExpandableEditAreaEventListener& listener)
1362 if (__pExpandableEditAreaEvent == null)
1364 __pExpandableEditAreaEvent = _ExpandableEditAreaEvent::CreateInstanceN(*this);
1365 SysTryReturn(NID_UI_CTRL, __pExpandableEditAreaEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1368 return __pExpandableEditAreaEvent->AddListener(listener);
1372 _Edit::RemoveExpandableEditAreaEventListener(const _IExpandableEditAreaEventListener& listener)
1374 SysTryReturn(NID_UI_CTRL, __pExpandableEditAreaEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1376 return __pExpandableEditAreaEvent->RemoveListener(listener);
1380 _Edit::AddUiLinkEventListener(const _IUiLinkEventListener& listener)
1382 if (__pLinkEvent == null)
1384 __pLinkEvent = _LinkEvent::CreateInstanceN(*this);
1385 SysTryReturn(NID_UI_CTRL, __pLinkEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1388 return __pLinkEvent->AddListener(listener);
1392 _Edit::RemoveUiLinkEventListener(const _IUiLinkEventListener& listener)
1394 SysTryReturn(NID_UI_CTRL, __pLinkEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1396 return __pLinkEvent->RemoveListener(listener);
1400 _Edit::AddTextBlockEventListener(const _ITextBlockEventListener& listener)
1402 if (__pTextBlockEvent == null)
1404 __pTextBlockEvent = _TextBlockEvent::CreateInstanceN(*this);
1405 SysTryReturn(NID_UI_CTRL, __pTextBlockEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1408 return __pTextBlockEvent->AddListener(listener);
1412 _Edit::RemoveTextBlockEventListener(const _ITextBlockEventListener& listener)
1414 SysTryReturn(NID_UI_CTRL, __pTextBlockEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1416 __pTextBlockEvent->RemoveListener(listener);
1422 _Edit::AddKeypadEventListener(const _IKeypadEventListener& listener)
1424 if (__pKeypadEvent == null)
1426 __pKeypadEvent = _KeypadEvent::CreateInstanceN(*this);
1427 SysTryReturn(NID_UI_CTRL, __pKeypadEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1430 return __pKeypadEvent->AddListener(listener);
1434 _Edit::RemoveKeypadEventListener(const _IKeypadEventListener& listener)
1436 SysTryReturn(NID_UI_CTRL, __pKeypadEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1438 __pKeypadEvent->RemoveListener(listener);
1444 _Edit::AddTextEventListener(const _ITextEventListener& listener)
1446 if (__pTextEvent == null)
1448 __pTextEvent = _TextEvent::CreateInstanceN(*this);
1449 SysTryReturn(NID_UI_CTRL, __pTextEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1452 return __pTextEvent->AddListener(listener);
1456 _Edit::RemoveTextEventListener(const _ITextEventListener& listener)
1458 SysTryReturn(NID_UI_CTRL, __pTextEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1459 __pTextEvent->RemoveListener(listener);
1465 _Edit::AddScrollPanelEventListener(const _IScrollPanelEventListener& listener)
1467 if (__pScrollPanelEvent == null)
1469 if (__inputStyle != INPUT_STYLE_OVERLAY)
1471 SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1476 __pScrollPanelEvent = _ScrollPanelEvent::CreateScrollPanelEventN(*this);
1477 SysTryReturn(NID_UI_CTRL, __pScrollPanelEvent,
1478 E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
1482 return __pScrollPanelEvent->AddListener(listener);
1486 _Edit::RemoveScrollPanelEventListener(const _IScrollPanelEventListener& listener)
1488 SysTryReturn(NID_UI_CTRL, __pScrollPanelEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1489 __pScrollPanelEvent->RemoveListener(listener);
1495 _Edit::AddActionEventListener(const _IActionEventListener& listener)
1497 _pEditPresenter->AddActionEventListener(listener);
1503 _Edit::RemoveActionEventListener(const _IActionEventListener& listener)
1505 _pEditPresenter->RemoveActionEventListener(listener);
1511 _Edit::AddLanguageEventListener(const _ILanguageEventListener& listener)
1513 if (__pLanguageEvent == null)
1515 __pLanguageEvent = _LanguageEvent::CreateInstanceN(*this);
1517 SysTryReturn(NID_UI_CTRL, __pLanguageEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.")
1519 __pLanguageEvent->AddListener(listener);
1526 _Edit::RemoveLanguageEventListener(const _ILanguageEventListener& listener)
1528 SysTryReturn(NID_UI_CTRL, __pLanguageEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
1530 __pLanguageEvent->RemoveListener(listener);
1536 _Edit::GetRemainingLength(void) const
1538 return _pEditPresenter->GetRemainingLength();
1542 _Edit::SetLowerCaseModeEnabled(bool enable)
1544 Variant var(enable);
1546 SetProperty("lowerCaseModeEnabled", var);
1552 _Edit::IsLowerCaseModeEnabled(void) const
1554 Variant var = GetProperty("lowerCaseModeEnabled");
1556 return var.ToBool();
1560 _Edit::SetCursorPosition(int position)
1562 int textLength = GetTextLength();
1563 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.");
1565 Variant var(position);
1567 return SetProperty("cursorPosition", var);
1571 _Edit::GetCursorPosition(void) const
1573 Variant var = GetProperty("cursorPosition");
1579 _Edit::GetText(void) const
1581 Variant var = GetProperty("text");
1583 return var.ToString();
1587 _Edit::GetTextLength(void) const
1589 return _pEditPresenter->GetTextLength();
1593 _Edit::SetText(const String& text)
1597 return SetProperty("text", var);
1601 _Edit::InsertTextAtCursorPosition(const String& text)
1603 return _pEditPresenter->InsertTextAtCursorPosition(text);
1607 _Edit::InsertCharacterAt(int index, const Character& character)
1609 return _pEditPresenter->InsertCharacterAt(index, character);
1613 _Edit::InsertTextAt(int index, const String& text)
1615 return _pEditPresenter->InsertTextAt(index, text);
1619 _Edit::AppendText(const String& text)
1621 return _pEditPresenter->AppendText(text);
1625 _Edit::AppendCharacter(const Character& character)
1627 return _pEditPresenter->AppendCharacter(character);
1631 _Edit::InsertTextAt(int position, const String& text, const Bitmap& textImage)
1633 return _pEditPresenter->InsertTextAt(position, text, textImage);
1637 _Edit::AppendText(const String& text, const Bitmap& textImage)
1639 return _pEditPresenter->InsertTextAt(_pEditPresenter->GetTextLength(), text, textImage);
1643 _Edit::ClearText(void)
1645 return _pEditPresenter->ClearText();
1649 _Edit::DeleteCharacterAt(int index)
1651 return _pEditPresenter->DeleteCharacterAt(index);
1655 _Edit::DeleteCharacterAtCursorPosition(void)
1657 return _pEditPresenter->DeleteCharacterAtCursorPosition();
1661 _Edit::GetCurrentTextRange(int& start, int& end) const
1663 _pEditPresenter->GetCurrentTextRange(start, end);
1669 _Edit::SetGuideText(const String& guideText)
1671 Variant var(guideText);
1673 SetProperty("guideText", var);
1679 _Edit::GetGuideText(void) const
1681 Variant var = GetProperty("guideText");
1683 return var.ToString();
1687 _Edit::GetGuideTextColor(void) const
1689 Variant color = GetProperty("guideTextColor");
1691 return color.ToColor();
1695 _Edit::SetGuideTextColor(const Color& color)
1697 __isSettingGuideTextColor = true;
1699 return SetProperty("guideTextColor", Variant(color));
1703 _Edit::SetKeypadEnabled(bool enable)
1705 Variant var(enable);
1707 SetProperty("keypadEnabled", var);
1713 _Edit::IsKeypadEnabled(void) const
1715 Variant var = GetProperty("keypadEnabled");
1717 return var.ToBool();
1721 _Edit::ShowKeypad(void)
1723 SysTryReturn(NID_UI_CTRL, (HasParent() && GetParent()), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The keypad couldn't be shown.");
1724 SysTryReturn(NID_UI_CTRL, (IsKeypadEnabled() && (__inputStyle == INPUT_STYLE_OVERLAY)), E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] The keypad couldn't be shown.");
1726 if (IsInternalFocused())
1728 return _pEditPresenter->ShowKeypad(false);
1732 return _pEditPresenter->ShowKeypad();
1737 _Edit::GetTextLineCount(void) const
1739 return _pEditPresenter->GetTextLineCount();
1743 _Edit::GetTextTotalHeight(void) const
1745 return _pEditPresenter->GetTextTotalHeight();
1749 _Edit::GetTextTotalHeightF(void) const
1751 return _pEditPresenter->GetTextTotalHeightF();
1755 _Edit::SetBlockTextColor(const Color& color)
1759 return SetProperty("blockedTextColor", var);
1763 _Edit::GetBlockTextColor(void) const
1767 if (__blockTextColor.used)
1769 var = GetProperty("blockedTextColor");
1773 var = GetProperty("highlightedColor");
1776 return var.ToColor();
1780 _Edit::GetBlockRange(int& start, int& end) const
1782 _pEditPresenter->GetBlockRange(start, end);
1788 _Edit::SetBlockRange(int start, int end)
1790 return _pEditPresenter->SetBlockRange(start, end);
1794 _Edit::GetWordPosition(int cursorPos, int& startPos, int& endPos) const
1796 _pEditPresenter->GetWordPosition(cursorPos, startPos, endPos);
1802 _Edit::GetTextImageRangeAt(int postion, int& startPosition, int& endPosition) const
1804 return _pEditPresenter->GetTextImageRangeAt(postion, startPosition, endPosition);
1808 _Edit::BeginTextBlock(void)
1810 return _pEditPresenter->BeginTextBlock();
1814 _Edit::ReleaseTextBlock(void)
1816 return _pEditPresenter->ReleaseTextBlock();
1820 _Edit::IsBlocked(void) const
1822 return _pEditPresenter->IsBlocked();
1826 _Edit::CopyText(void)
1828 return _pEditPresenter->CopyText();
1832 _Edit::CutText(void)
1834 return _pEditPresenter->CutText();
1838 _Edit::PasteText(void)
1840 return _pEditPresenter->PasteText();
1844 _Edit::RemoveTextBlock(void)
1846 return _pEditPresenter->RemoveTextBlock();
1850 _Edit::IsClipped(void) const
1852 return _pEditPresenter->IsClipped();
1856 _Edit::SetCurrentLanguage(LanguageCode languageCode)
1858 return _pEditPresenter->SetCurrentLanguage(languageCode);
1862 _Edit::GetCurrentLanguage(LanguageCode& language) const
1864 return _pEditPresenter->GetCurrentLanguage(language);
1868 _Edit::CalculateAbsoluteCursorBounds(int index, FloatRectangle& absCursorRect)
1870 return _pEditPresenter->CalculateAbsoluteCursorBounds(index, absCursorRect);
1876 Canvas* pCanvas = GetCanvasN();
1877 SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create instance.");
1879 _pEditPresenter->Draw(*pCanvas);
1887 _Edit::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
1889 return _pEditPresenter->OnTouchPressed(source, touchinfo);
1893 _Edit::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
1895 return _pEditPresenter->OnTouchCanceled(source, touchinfo);
1899 _Edit::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1901 if ((__editStyle ^ EDIT_STYLE_VIEWER) && !__isTouchMoving)
1903 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, this);
1905 __isTouchMoving = false;
1907 return _pEditPresenter->OnTouchReleased(source, touchinfo);
1911 _Edit::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1913 __isTouchMoving = true;
1915 return _pEditPresenter->OnTouchMoved(source, touchinfo);
1919 _Edit::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
1921 return _pEditPresenter->OnKeyPressed(source, keyInfo);
1925 _Edit::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
1927 return _pEditPresenter->OnKeyReleased(source, keyInfo);
1931 _Edit::OnNotifiedN(const _Control& source, IList* pArgs)
1933 return _pEditPresenter->OnNotifiedN(pArgs);
1938 _Edit::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture)
1940 float xDistance = 0.0f;
1941 float yDistance = 0.0f;
1942 gesture.GetDistance(xDistance, yDistance);
1943 FloatPoint flickPoint(xDistance, yDistance);
1945 _pEditPresenter->InitializeCopyPasteManager();
1947 _pEditPresenter->StartFlickAnimation(flickPoint, gesture.GetDuration());
1953 _Edit::OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture)
1959 _Edit::OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture)
1961 _pEditPresenter->OnLongPressGestureDetected();
1967 _Edit::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture)
1973 _Edit::OnTapGestureDetected(_TouchTapGestureDetector& gesture)
1975 _pEditPresenter->OnTapGestureDetected();
1981 _Edit::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
1987 _Edit::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem)
1989 _pEditPresenter->OnClipboardPopupClosed(pClipboardItem);
1995 _Edit::OnFocusGained(const _Control& source)
1997 __internalFocus = true;
1998 return _pEditPresenter->OnFocusGained();
2002 _Edit::OnFocusLost(const _Control& source)
2004 __internalFocus = false;
2005 _pEditPresenter->OnFocusLost();
2006 _Control::OnFocusLost(source);
2012 _Edit::OnAttachedToMainTree(void)
2014 if (__isAccessibilityCreated)
2019 if (__pTextAccessibilityElement)
2021 __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
2023 if (__pClearButtonTextAccessibilityElement)
2025 __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
2032 _Edit::OnBoundsChanged(void)
2034 if (__isConstructed)
2036 SysAssertf(_pEditPresenter != null, "_pEditPresenter is null");
2038 if (!((GetEditStyle() & EDIT_STYLE_FLEXIBLE) == false))
2040 if (_pEditPresenter->IsUpdateInitialBounds())
2042 FloatRectangle editBounds = GetBoundsF();
2043 if (__previousBounds.height != editBounds.height || __previousBounds.width != editBounds.width)
2045 _pEditPresenter->SetControlInitialBounds(editBounds);
2049 _pEditPresenter->SetControlInitialPosition(FloatPoint(editBounds.x, editBounds.y));
2051 __previousBounds = editBounds;
2055 __previousBounds = GetBoundsF();
2059 _pEditPresenter->Resize();
2061 if (__isAccessibilityCreated)
2063 if (__pTextAccessibilityElement)
2065 __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
2068 if (__pClearButtonTextAccessibilityElement)
2070 __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
2079 _Edit::OnChangeLayout(_ControlOrientation orientation)
2081 result r = _pEditPresenter->ChangeLayout(orientation);
2088 _Edit::OnScrollPanelBoundsChanged(void)
2090 _pEditPresenter->OnScrollPanelBoundsChanged();
2096 _Edit::OnFontChanged(Font* pFont)
2098 _pEditPresenter->OnFontChanged(pFont);
2100 _Control::OnFontChanged(pFont);
2106 _Edit::OnFontInfoRequested(unsigned long& style, float& size)
2108 _pEditPresenter->OnFontInfoRequested(style, size);
2114 _Edit::OnDetachingFromMainTree(void)
2116 __isDestroyed = true;
2117 if (_pEditPresenter->IsBounded())
2119 DetachScrollPanelEvent();
2125 _Edit::OnVisibleStateChanged(void)
2127 if (GetVisibleState() == false)
2129 if (_pEditPresenter->IsCopyPasteManagerExist())
2131 _pEditPresenter->InitializeCopyPasteManager();
2139 _Edit::OnAncestorEnableStateChanged(const _Control& control)
2141 bool enableState = false;
2142 enableState = control.GetEnableState();
2146 if (_pEditPresenter->IsCopyPasteManagerExist())
2148 _pEditPresenter->InitializeCopyPasteManager();
2151 if (__internalFocus)
2153 if (_pEditPresenter->IsKeypadEnabled())
2155 _pEditPresenter->HideKeypad(true);
2161 __internalFocus = false;
2171 _Edit::OnAncestorVisibleStateChanged(const _Control& control)
2173 bool visibleState = false;
2174 visibleState = control.GetVisibleState();
2178 if (_pEditPresenter->IsCopyPasteManagerExist())
2180 _pEditPresenter->InitializeCopyPasteManager();
2183 if (__internalFocus)
2185 if (_pEditPresenter->IsKeypadEnabled())
2187 _pEditPresenter->HideKeypad(true);
2193 __internalFocus = false;
2203 _Edit::IsDestroyed(void) const
2205 return __isDestroyed;
2209 _Edit::GetEditStyle(void) const
2215 _Edit::SetEditStyle(unsigned long style)
2217 __editStyle = style;
2223 _Edit::SetBorderRoundStyleEnabled(bool enable)
2225 __borderRoundStyle = enable;
2231 _Edit::IsBorderRoundStyleEnabled(void) const
2233 return __borderRoundStyle;
2237 _Edit::IsUsbKeyboardConnected(void) const
2239 return _pEditPresenter->IsUsbKeyboardConnected();
2243 _Edit::IsKeypadExist(void) const
2245 return _pEditPresenter->IsKeypadExist();
2249 _Edit::IsClipboardExist(void) const
2251 return _pEditPresenter->IsClipboardExist();
2255 _Edit::CheckKeypadExist(_ControlOrientation orientation)
2257 return _pEditPresenter->CheckKeypadExist(orientation);
2261 _Edit::SetAutoShrinkModeEnabled(bool enable)
2263 _pEditPresenter->SetAutoShrinkModeEnabled(enable);
2269 _Edit::IsAutoShrinkModeEnabled(void) const
2271 return _pEditPresenter->IsAutoShrinkModeEnabled();
2275 _Edit::GetEllipsisPosition(void) const
2277 return __ellipsisPosition;
2281 _Edit::SetEllipsisPosition(EllipsisPosition position)
2283 __ellipsisPosition = position;
2284 _pEditPresenter->SetEllipsisPosition(position);
2290 _Edit::GetCutlinkColorInfo(EditCutLinkType type, EditCutlinkColor* colorInfo) const
2292 *colorInfo = __cutlinkColor[type];
2298 _Edit::SetCutlinkColorInfo(EditCutLinkType type, EditCutlinkColor colorInfo)
2300 __cutlinkColor[type] = colorInfo;
2306 _Edit::GetBackgroundBitmap(EditStatus status) const
2308 return __pBackgroundBitmap[status];
2312 _Edit::LoadDefaultBackgroundBitmap(GroupStyle groupStyle)
2314 result r = E_SUCCESS;
2318 case GROUP_STYLE_NONE:
2319 r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
2320 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2321 r = GET_BITMAP_CONFIG_N(EDIT::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
2322 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2323 r = GET_BITMAP_CONFIG_N(EDIT::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
2324 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2325 r = GET_BITMAP_CONFIG_N(EDIT::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
2326 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2327 r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
2328 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2331 case GROUP_STYLE_SINGLE:
2332 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
2333 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2334 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
2335 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2336 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
2337 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2338 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
2339 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2340 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
2341 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2344 case GROUP_STYLE_TOP:
2345 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
2346 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2347 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
2348 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2349 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
2350 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2351 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
2352 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2353 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
2354 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2357 case GROUP_STYLE_MIDDLE:
2358 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
2359 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2360 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
2361 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2362 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
2363 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2364 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
2365 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2366 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
2367 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2370 case GROUP_STYLE_BOTTOM:
2371 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
2372 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2373 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
2374 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2375 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
2376 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2377 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
2378 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2379 r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
2380 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2384 r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
2385 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2386 r = GET_BITMAP_CONFIG_N(EDIT::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
2387 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2388 r = GET_BITMAP_CONFIG_N(EDIT::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
2389 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2390 r = GET_BITMAP_CONFIG_N(EDIT::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
2391 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2392 r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
2393 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2400 for (int status = 0; status < EDIT_COLOR_MAX; status++)
2402 if (__pDefaultBackgroundBitmap[status])
2404 delete __pDefaultBackgroundBitmap[status];
2405 __pDefaultBackgroundBitmap[status] = null;
2409 delete __pDefaultBackgroundEffectBitmap;
2410 __pDefaultBackgroundEffectBitmap = null;
2416 _Edit::ReplaceDefaultBackgroundBitmapForSearchBar(void)
2418 result r = E_SUCCESS;
2420 for (int status = 0; status < EDIT_COLOR_MAX; status++)
2422 if (__pDefaultBackgroundBitmap[status])
2424 delete __pDefaultBackgroundBitmap[status];
2425 __pDefaultBackgroundBitmap[status] = null;
2429 if (__pDefaultBackgroundEffectBitmap)
2431 delete __pDefaultBackgroundEffectBitmap;
2432 __pDefaultBackgroundEffectBitmap = null;
2435 r = GET_BITMAP_CONFIG_N(SEARCHBAR::EDIT_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
2436 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2437 r = GET_BITMAP_CONFIG_N(SEARCHBAR::EDIT_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
2438 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2439 r = GET_BITMAP_CONFIG_N(SEARCHBAR::EDIT_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
2440 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2441 r = GET_BITMAP_CONFIG_N(SEARCHBAR::EDIT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
2442 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2443 r = GET_BITMAP_CONFIG_N(SEARCHBAR::EDIT_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
2444 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2445 r = GET_BITMAP_CONFIG_N(SEARCHBAR::EDIT_BG_FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultFocusBitmap);
2446 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
2448 _pEditPresenter->SetSearchBarFlag(true);
2453 for (int status = 0; status < EDIT_COLOR_MAX; status++)
2455 if (__pDefaultBackgroundBitmap[status])
2457 delete __pDefaultBackgroundBitmap[status];
2458 __pDefaultBackgroundBitmap[status] = null;
2462 delete __pDefaultBackgroundEffectBitmap;
2463 __pDefaultBackgroundEffectBitmap = null;
2469 _Edit::SetSearchFieldFocus(bool state)
2471 __isSearchFieldFocused = state;
2476 _Edit::IsSearchFieldFocused(void) const
2478 return __isSearchFieldFocused;
2482 _Edit::GetDefaultBackgroundBitmap(EditStatus status) const
2484 return __pDefaultBackgroundBitmap[status];
2488 _Edit::IsCustomDefaultBackgroundBitmap(EditStatus status) const
2490 bool isCustomBitmap = false;
2494 case EDIT_STATUS_NORMAL:
2495 isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_NORMAL);
2498 case EDIT_STATUS_DISABLED:
2499 isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_DISABLED);
2502 case EDIT_STATUS_HIGHLIGHTED:
2503 isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_HIGHLIGHTED);
2506 case EDIT_STATUS_PRESSED:
2507 isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_PRESSED);
2511 isCustomBitmap = false;
2515 return isCustomBitmap;
2519 _Edit::GetDefaultBackgroundEffectBitmap(void) const
2521 return __pDefaultBackgroundEffectBitmap;
2525 _Edit::GetDefaultFocusBitmap(void) const
2527 return __pDefaultFocusBitmap;
2531 _Edit::IsSettingGuideTextColor(void) const
2533 return __isSettingGuideTextColor;
2537 _Edit::SetFont(const Font& font)
2539 return _pEditPresenter->SetFont(font);
2543 _Edit::GetFontType(String& typefaceName, unsigned long& styleMask) const
2545 _pEditPresenter->GetFontType(typefaceName, styleMask);
2549 _Edit::SetFontType(const String& typefaceName, unsigned long styleMask)
2551 return _pEditPresenter->SetFontType(typefaceName, styleMask);
2555 _Edit::GetTextStyle(void) const
2557 return _pEditPresenter->GetTextStyle();
2561 _Edit::SetTextStyle(unsigned long style)
2563 return _pEditPresenter->SetTextStyle(style);
2567 _Edit::GetTitleText(void) const
2569 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");
2571 Variant var = GetProperty("titleText");
2573 return var.ToString();
2577 _Edit::SetTitleText(const String& title)
2579 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");
2582 return SetProperty("titleText", var);
2586 _Edit::GetTitleTextColor(EditStatus status) const
2591 case EDIT_STATUS_NORMAL:
2592 var = GetProperty("normalTitleTextColor");
2595 case EDIT_STATUS_DISABLED:
2596 var = GetProperty("disabledTitleTextColor");
2599 case EDIT_STATUS_HIGHLIGHTED:
2600 var = GetProperty("highlightedTitleTextColor");
2603 case EDIT_STATUS_PRESSED:
2604 var = GetProperty("pressedTitleTextColor");
2611 return var.ToColor();
2615 _Edit::SetTitleTextColor(EditStatus status, const Color& color)
2617 result r = E_SUCCESS;
2623 case EDIT_STATUS_NORMAL:
2624 r = SetProperty("normalTitleTextColor", var);
2627 case EDIT_STATUS_DISABLED:
2628 r = SetProperty("disabledTitleTextColor", var);
2631 case EDIT_STATUS_HIGHLIGHTED:
2632 r = SetProperty("highlightedTitleTextColor", var);
2635 case EDIT_STATUS_PRESSED:
2636 r = SetProperty("pressedTitleTextColor", var);
2648 _Edit::GetInputStyle(void) const
2650 return __inputStyle;
2654 _Edit::SetKeypadCommandButtonVisible(bool visible)
2656 Variant var(visible);
2658 return SetProperty("overlayKeypadCommandButtonVisible", var);
2662 _Edit::GetKeypadCommandButton(void) const
2664 return _pEditPresenter->GetKeypadCommandButton();
2669 _Edit::SetKeypadCommandButton(CommandButtonPosition position, const String& text, int actionId)
2671 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.");
2673 return _pEditPresenter->SetKeypadCommandButton(position, text, actionId);
2677 _Edit::GetKeypadBounds(FloatRectangle& rect) const
2679 return _pEditPresenter->GetKeypadBounds(rect);
2683 _Edit::GetClipboardHeight(void) const
2685 return _pEditPresenter->GetClipboardHeight();
2689 _Edit::SendExpandableEditAreaEvent(_ExpandableEditAreaEventStatus status, int newLineCount)
2691 if (__pExpandableEditAreaEvent)
2693 IEventArg* pEventArg = _ExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(status, newLineCount);
2694 SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
2696 __pExpandableEditAreaEvent->Fire(*pEventArg);
2703 _Edit::SendScrollPanelEvent(CoreScrollPanelStatus eventstatus)
2705 if (__pScrollPanelEvent)
2707 IEventArg* pEventArg = _ScrollPanelEvent::CreateScrollPanelEventArgN(eventstatus);
2708 SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _CoreScrollPanelEventArg.");
2710 __pScrollPanelEvent->Fire(*pEventArg);
2717 _Edit::SendKeypadEvent(CoreKeypadAction keypadAction, CoreKeypadEventStatus eventstatus)
2721 IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(keypadAction, eventstatus);
2722 SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _KeypadEventArg.");
2724 __pKeypadEvent->Fire(*pEventArg);
2731 _Edit::SendTextEvent(CoreTextEventStatus textEventStatus)
2733 if (__inputStyle == INPUT_STYLE_FULLSCREEN)
2735 _pEditPresenter->DeleteFullscreenKeypad();
2738 if (__pTextEvent && IsTextEventEnabled())
2740 IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(textEventStatus);
2741 SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
2743 __pTextEvent->Fire(*pEventArg);
2750 _Edit::SendTextBlockEvent(int start, int end)
2752 if (__pTextBlockEvent)
2754 IEventArg* pTextBlockEventArg = _TextBlockEvent::CreateTextBlockEventArgN(start, end);
2755 SysTryReturn(NID_UI_CTRL, pTextBlockEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _TextBlockEventArg.");
2757 __pTextBlockEvent->Fire(*pTextBlockEventArg);
2764 _Edit::SendLinkEvent(const String& text, LinkType linkType, const String& link)
2768 IEventArg* pLinkEventArg = _LinkEvent::CreateLinkEventArgN(text, linkType, link);
2769 SysTryReturn(NID_UI_CTRL, pLinkEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _LinkEventArg.");
2771 __pLinkEvent->Fire(*pLinkEventArg);
2778 _Edit::SendLanguageEvent(LanguageCode prevLanguageCode, LanguageCode currentLanguageCode)
2780 if (__pLanguageEvent)
2782 IEventArg* pLanguageEventArg = _LanguageEvent::CreateLanguageEventArgN(prevLanguageCode, currentLanguageCode);
2783 SysTryReturn(NID_UI_CTRL, pLanguageEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
2785 __pLanguageEvent->Fire(*pLanguageEventArg);
2792 _Edit::AttachScrollPanelEvent(void)
2794 _ScrollPanel* pScrollPanelCore = dynamic_cast< _ScrollPanel* >(GetParent());
2795 if (pScrollPanelCore)
2797 if (__pScrollPanelEvent)
2799 pScrollPanelCore->SetScrollPanelEvent(__pScrollPanelEvent);
2801 pScrollPanelCore->SetControlKeypadBinding(this);
2808 _Edit::DetachScrollPanelEvent(void)
2810 _ScrollPanel* pScrollPanelCore = dynamic_cast< _ScrollPanel* >(GetParent());
2811 if (pScrollPanelCore)
2813 if (__pScrollPanelEvent && (pScrollPanelCore->GetScrollPanelEvent() == __pScrollPanelEvent))
2815 pScrollPanelCore->SetScrollPanelEvent(null);
2817 pScrollPanelCore->SetControlKeypadBinding(null);
2824 _Edit::IsKeypadCommandButtonVisible(void) const
2826 Variant var = GetProperty("overlayKeypadCommandButtonVisible");
2828 return var.ToBool();
2832 _Edit::GetKeypadCommandButtonText(CommandButtonPosition position) const
2834 SysTryReturn(NID_UI_CTRL, (__inputStyle != INPUT_STYLE_FULLSCREEN), String(), E_SYSTEM, "[E_SYSTEM] Unable to show the keypad due to a wrong input style.");
2836 return _pEditPresenter->GetKeypadCommandButtonText(position);
2840 _Edit::GetKeypadCommandButtonActionId(CommandButtonPosition position) const
2842 SysTryReturn(NID_UI_CTRL, (__inputStyle != INPUT_STYLE_FULLSCREEN), -1, E_SYSTEM, "[E_SYSTEM] Unable to show the keypad due to a wrong input style.");
2844 return _pEditPresenter->GetKeypadCommandButtonActionId(position);
2848 _Edit::GetCursorBounds(bool isAbsRect, FloatRectangle& cursorBounds) const
2850 return _pEditPresenter->GetCursorBounds(isAbsRect, cursorBounds);
2854 _Edit::GetCursorPositionAt(const FloatPoint& touchPoint) const
2856 return _pEditPresenter->GetCursorPositionAt(touchPoint);
2860 _Edit::SetCursorDisabled(bool disabled)
2862 _pEditPresenter->SetCursorDisabled(disabled);
2868 _Edit::SetPropertyAutoResizingEnabled(const Variant& enable)
2870 result r = E_SUCCESS;
2872 r = _pEditPresenter->SetAutoResizingEnabled(enable.ToBool());
2878 _Edit::GetPropertyAutoResizingEnabled(void) const
2880 return Variant(_pEditPresenter->IsAutoResizingEnabled());
2884 _Edit::SetPropertyCursorPosition(const Variant& position)
2886 result r = E_SUCCESS;
2887 int textLength = GetTextLength();
2888 int cursorPos = position.ToInt();
2890 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.");
2892 r = _pEditPresenter->SetCursorPosition(cursorPos);
2898 _Edit::GetPropertyCursorPosition(void) const
2900 return Variant(_pEditPresenter->GetCursorPosition());
2904 _Edit::SetPropertyDisabledColor(const Variant& color)
2906 __color[EDIT_STATUS_DISABLED].backgroundColor = color.ToColor();
2912 _Edit::GetPropertyDisabledColor(void) const
2914 return Variant(__color[EDIT_STATUS_DISABLED].backgroundColor);
2918 _Edit::SetPropertyDisabledTextColor(const Variant& color)
2920 __color[EDIT_STATUS_DISABLED].textColor = color.ToColor();
2926 _Edit::GetPropertyDisabledTextColor(void) const
2928 return Variant(__color[EDIT_STATUS_DISABLED].textColor);
2932 _Edit::SetPropertyGuideText(const Variant& guideText)
2934 if (__pTextAccessibilityElement)
2936 __pTextAccessibilityElement->SetLabel(guideText.ToString());
2939 return _pEditPresenter->SetGuideText(guideText.ToString());
2943 _Edit::GetPropertyGuideText(void) const
2945 return Variant(_pEditPresenter->GetGuideText());
2949 _Edit::SetPropertyGuideTextColor(const Variant& color)
2951 __guideTextColor = color.ToColor();
2957 _Edit::GetPropertyGuideTextColor(void) const
2959 return Variant(__guideTextColor);
2963 _Edit::SetPropertyKeypadActionEnabled(const Variant& enabled)
2965 return _pEditPresenter->SetKeypadActionEnabled(enabled.ToBool());
2969 _Edit::GetPropertyKeypadActionEnabled(void) const
2971 return Variant(_pEditPresenter->IsKeypadActionEnabled());
2975 _Edit::SetPropertyKeypadAction(const Variant& action)
2977 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
2979 result r = E_SUCCESS;
2981 r = _pEditPresenter->SetKeypadAction((CoreKeypadAction) action.ToInt());
2987 _Edit::GetPropertyKeypadAction(void) const
2989 return Variant((int) _pEditPresenter->GetKeypadAction());
2993 _Edit::SetPropertyLineSpacing(const Variant& lineSpacing)
2995 __lineSpacing = lineSpacing.ToFloat();
3001 _Edit::GetPropertyLineSpacing(void) const
3003 return Variant(__lineSpacing);
3007 _Edit::SetPropertyNormalColor(const Variant& color)
3009 __color[EDIT_STATUS_NORMAL].backgroundColor = color.ToColor();
3015 _Edit::GetPropertyNormalColor(void) const
3017 return Variant(__color[EDIT_STATUS_NORMAL].backgroundColor);
3021 _Edit::SetPropertyPressedColor(const Variant& color)
3023 __color[EDIT_STATUS_PRESSED].backgroundColor = color.ToColor();
3029 _Edit::GetPropertyPressedColor(void) const
3031 return Variant(__color[EDIT_STATUS_PRESSED].backgroundColor);
3035 _Edit::SetPropertyHighlightedColor(const Variant& color)
3037 __color[EDIT_STATUS_HIGHLIGHTED].backgroundColor = color.ToColor();
3043 _Edit::GetPropertyHighlightedColor(void) const
3045 return Variant(__color[EDIT_STATUS_HIGHLIGHTED].backgroundColor);
3049 _Edit::SetPropertyTextSize(const Variant& textSize)
3051 int fontMinSize = 0;
3052 float size = textSize.ToFloat();
3053 result r = E_SUCCESS;
3055 GET_FIXED_VALUE_CONFIG(EDIT::FONT_MIN_SIZE, _CONTROL_ORIENTATION_PORTRAIT, fontMinSize);
3056 int floatFontMinSize = _CoordinateSystemUtils::ConvertToFloat(fontMinSize);
3057 SysTryReturn(NID_UI_CTRL, size >= floatFontMinSize, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid size is given.");
3059 r = _pEditPresenter->SetTextSize(size);
3067 _Edit::GetPropertyTextSize(void) const
3069 return Variant(__textSize);
3073 _Edit::SetPropertyNormalTextColor(const Variant& color)
3075 __color[EDIT_STATUS_NORMAL].textColor = color.ToColor();
3081 _Edit::GetPropertyNormalTextColor(void) const
3083 return Variant(__color[EDIT_STATUS_NORMAL].textColor);
3087 _Edit::SetPropertyHighlightedTextColor(const Variant& color)
3089 __color[EDIT_STATUS_HIGHLIGHTED].textColor = color.ToColor();
3095 _Edit::GetPropertyHighlightedTextColor(void) const
3097 return Variant(__color[EDIT_STATUS_HIGHLIGHTED].textColor);
3101 _Edit::SetPropertyPressedTextColor(const Variant& color)
3103 __color[EDIT_STATUS_PRESSED].textColor = color.ToColor();
3109 _Edit::GetPropertyPressedTextColor(void) const
3111 return Variant(__color[EDIT_STATUS_PRESSED].textColor);
3115 _Edit::SetPropertyKeypadEnabled(const Variant& enabled)
3117 _pEditPresenter->SetKeypadEnabled(enabled.ToBool());
3123 _Edit::GetPropertyKeypadEnabled(void) const
3125 return Variant(_pEditPresenter->IsKeypadEnabled());
3129 _Edit::SetPropertyKeypadStyle(const Variant& style)
3131 if (!(GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
3133 SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != (KeypadStyle) style.ToInt()), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
3136 return _pEditPresenter->SetKeypadStyle((KeypadStyle) style.ToInt());
3140 _Edit::GetPropertyKeypadStyle(void) const
3142 return Variant((int) _pEditPresenter->GetKeypadStyle());
3146 _Edit::SetPropertyLowerCaseModeEnabled(const Variant& enabled)
3148 _pEditPresenter->SetLowerCaseModeEnabled(enabled.ToBool());
3154 _Edit::GetPropertyLowerCaseModeEnabled(void) const
3156 return Variant(_pEditPresenter->IsLowerCaseModeEnabled());
3160 _Edit::SetPropertyOverlayKeypadCommandButtonVisible(const Variant& visible)
3162 return _pEditPresenter->SetKeypadCommandButtonVisible(visible.ToBool());
3166 _Edit::GetPropertyOverlayKeypadCommandButtonVisible(void) const
3168 return Variant(_pEditPresenter->IsKeypadCommandButtonVisible());
3172 _Edit::SetPropertyText(const Variant& text)
3174 return _pEditPresenter->SetText(text.ToString());
3178 _Edit::GetPropertyText(void) const
3180 return Variant(_pEditPresenter->GetText());
3184 _Edit::SetPropertyViewModeEnabled(const Variant& enabled)
3186 return _pEditPresenter->SetViewModeEnabled(enabled.ToBool());
3190 _Edit::GetPropertyViewModeEnabled(void) const
3192 return Variant(_pEditPresenter->IsViewModeEnabled());
3196 _Edit::SetPropertyAutoLinkMask(const Variant& autoLinks)
3198 SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
3200 return _pEditPresenter->SetAutoLinkMask(autoLinks.ToULong());
3204 _Edit::GetPropertyAutoLinkMask(void) const
3206 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.");
3208 return Variant(_pEditPresenter->GetAutoLinkMask());
3212 _Edit::SetPropertyTitleText(const Variant& titleText)
3214 return _pEditPresenter->SetTitleText(titleText.ToString());
3218 _Edit::GetPropertyTitleText(void) const
3220 return Variant(_pEditPresenter->GetTitleText());
3224 _Edit::SetPropertyNormalTitleTextColor(const Variant& color)
3226 __color[EDIT_STATUS_NORMAL].titleTextColor = color.ToColor();
3232 _Edit::GetPropertyNormalTitleTextColor(void) const
3234 return Variant(__color[EDIT_STATUS_NORMAL].titleTextColor);
3238 _Edit::SetPropertyDisabledTitleTextColor(const Variant& color)
3240 __color[EDIT_STATUS_DISABLED].titleTextColor = color.ToColor();
3246 _Edit::GetPropertyDisabledTitleTextColor(void) const
3248 return Variant(__color[EDIT_STATUS_DISABLED].titleTextColor);
3252 _Edit::SetPropertyHighlightedTitleTextColor(const Variant& color)
3254 __color[EDIT_STATUS_HIGHLIGHTED].titleTextColor = color.ToColor();
3260 _Edit::GetPropertyHighlightedTitleTextColor(void) const
3262 return Variant(__color[EDIT_STATUS_HIGHLIGHTED].titleTextColor);
3266 _Edit::SetPropertyPressedTitleTextColor(const Variant& color)
3268 __color[EDIT_STATUS_PRESSED].titleTextColor = color.ToColor();
3274 _Edit::GetPropertyPressedTitleTextColor(void) const
3276 return Variant(__color[EDIT_STATUS_PRESSED].titleTextColor);
3280 _Edit::SetPropertyBlockedTextColor(const Variant& color)
3282 __blockTextColor.blockTextColor = color.ToColor();
3283 __blockTextColor.used = true;
3289 _Edit::GetPropertyBlockedTextColor(void) const
3291 return Variant(__blockTextColor.blockTextColor);
3295 _Edit::SetPropertyTopMargin(const Variant& margin)
3297 SysTryReturn(NID_UI_CTRL, margin.ToFloat() > 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
3299 __topMargin = margin.ToFloat();
3305 _Edit::GetPropertyTopMargin(void) const
3307 return Variant(__topMargin);
3311 _Edit::SetPropertyBottomMargin(const Variant& margin)
3313 SysTryReturn(NID_UI_CTRL, margin.ToFloat() > 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
3315 __bottomMargin = margin.ToFloat();
3321 _Edit::GetPropertyBottomMargin(void) const
3323 return Variant(__bottomMargin);
3327 _Edit::SetPropertyLeftMargin(const Variant& margin)
3329 SysTryReturn(NID_UI_CTRL, margin.ToFloat() > 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
3331 __leftMargin = margin.ToFloat();
3337 _Edit::GetPropertyLeftMargin(void) const
3339 return Variant(__leftMargin);
3343 _Edit::SetPropertyRightMargin(const Variant& margin)
3345 SysTryReturn(NID_UI_CTRL, margin.ToFloat() > 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
3347 __rightMargin = margin.ToFloat();
3353 _Edit::GetPropertyRightMargin(void) const
3355 return Variant(__rightMargin);
3359 _Edit::ValidatePastedText(const String& pastedText, String& replacedText)
3361 bool enable = false;
3364 enable = __pTextFilter->ValidatePastedText(pastedText, replacedText);
3371 _Edit::SetEditTextFilter(IEditTextFilter* pFilter)
3373 __pTextFilter = pFilter;
3374 _pEditPresenter->SetEditTextFilter(this);
3380 _Edit::SendOpaqueCommand(const String& command)
3382 _pEditPresenter->SendOpaqueCommand(command);
3388 _Edit::OnSettingChanged(String& key)
3390 const wchar_t* LOCALE_LANGUAGE = L"http://tizen.org/setting/locale.language";
3391 if (key == LOCALE_LANGUAGE)
3393 _pEditPresenter->UpdateKeypadCommandString();
3397 _AccessibilityElement*
3398 _Edit::GetTextAccessibilityElement(void) const
3400 return __pTextAccessibilityElement;
3404 _Edit::SetPasswordVisible(bool visible)
3406 return _pEditPresenter->SetPasswordVisible(visible);
3410 _Edit::IsPasswordVisible(void) const
3412 return _pEditPresenter->IsPasswordVisible();
3416 _Edit::IsClearIconPressed(void) const
3418 return _pEditPresenter->IsClearIconPressed();
3422 _Edit::SetTextEventEnabled(bool enable)
3424 __isTextEventEnabled = enable;
3429 _Edit::IsTextEventEnabled(void) const
3431 return __isTextEventEnabled;
3434 }}} // Tizen::Ui::Controls