_EditInternalTouchEventListener::_EditInternalTouchEventListener(const _Edit& edit)
{
- __pEdit = const_cast<_Edit*>(&edit);
+ __pEdit = const_cast< _Edit* >(&edit);
}
bool
}
if (__pDefaultBackgroundBitmap[status])
- {
+ {
delete __pDefaultBackgroundBitmap[status];
__pDefaultBackgroundBitmap[status] = null;
- }
+ }
}
if (__pDefaultBackgroundEffectBitmap)
if (__pGestureFlick)
{
- _ITouchFlickGestureEventListener* pListener = dynamic_cast<_ITouchFlickGestureEventListener*>(this);
+ _ITouchFlickGestureEventListener* pListener = dynamic_cast< _ITouchFlickGestureEventListener* >(this);
__pGestureFlick->RemoveGestureListener(*pListener);
RemoveGestureDetector(*__pGestureFlick);
delete __pGestureFlick;
if (__pGestureLongPress)
{
- _ITouchLongPressGestureEventListener* pListener = dynamic_cast<_ITouchLongPressGestureEventListener*>(this);
+ _ITouchLongPressGestureEventListener* pListener = dynamic_cast< _ITouchLongPressGestureEventListener* >(this);
__pGestureLongPress->RemoveGestureListener(*pListener);
RemoveGestureDetector(*__pGestureLongPress);
delete __pGestureLongPress;
if (__pGestureTap)
{
- _ITouchTapGestureEventListener* pListener = dynamic_cast<_ITouchTapGestureEventListener*>(this);
+ _ITouchTapGestureEventListener* pListener = dynamic_cast< _ITouchTapGestureEventListener* >(this);
__pGestureTap->RemoveGestureListener(*pListener);
RemoveGestureDetector(*__pGestureTap);
delete __pGestureTap;
__isConstructed = true;
_AccessibilityContainer* pEditAccessibilityContainer = GetAccessibilityContainer();
- if(pEditAccessibilityContainer)
+ if (pEditAccessibilityContainer)
{
pEditAccessibilityContainer->Activate(true);
}
if (pEditAccessibilityContainer)
{
__pTextAccessibilityElement = new _AccessibilityElement(true);
- __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
- if ((GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT))
- {
- __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText());
- }
- else
- {
- __pTextAccessibilityElement->SetLabel(GetGuideText() + GetText());
- }
-
+ __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
+ __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText());
__pTextAccessibilityElement->SetTrait(L"Edit Field");
__pTextAccessibilityElement->SetName(L"EditText");
pEditAccessibilityContainer->AddElement(*__pTextAccessibilityElement);
{
result r = E_SUCCESS;
- _pEditPresenter = const_cast<_EditPresenter*>(&pPresenter);
+ _pEditPresenter = const_cast< _EditPresenter* >(&pPresenter);
return r;
}
return FloatDimension(GetBoundsF().width, GetBoundsF().height);
}
- FloatDimension dimension(0.0f,0.0f);
+ FloatDimension dimension(0.0f, 0.0f);
float textLeftMargin = 0.0f;
float textRightMargin = 0.0f;
float textTopMargin = 0.0f;
dimension.height += textTopMargin + textBottomMargin;
}
- return dimension;
+ return dimension;
}
bool
_Edit::SetVerticalMargin(int margin, EditTextVerticalMargin marginType)
{
float floatMargin = _CoordinateSystemUtils::ConvertToFloat(margin);
- return SetVerticalMargin( floatMargin, marginType);
+ return SetVerticalMargin(floatMargin, marginType);
}
result
{
Variant var = GetProperty("keypadAction");
- return (CoreKeypadAction)var.ToInt();
+ return (CoreKeypadAction) var.ToInt();
}
result
_Edit::SetKeypadAction(CoreKeypadAction keypadAction)
{
SysTryReturn(NID_UI_CTRL, (__inputStyle == INPUT_STYLE_OVERLAY), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The current state unable to this operation.");
- Variant var((int)keypadAction);
+ Variant var((int) keypadAction);
return SetProperty("keypadAction", var);
}
{
Variant var = GetProperty("keypadStyle");
- return (KeypadStyle)var.ToInt();
+ return (KeypadStyle) var.ToInt();
}
result
_Edit::SetKeypadStyle(KeypadStyle keypadStyle)
{
SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != keypadStyle), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
- Variant var((int)keypadStyle);
+ Variant var((int) keypadStyle);
return SetProperty("keypadStyle", var);
}
}
}
- switch(type)
+ switch (type)
{
- case EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT:
- if (__pTextAccessibilityElement)
+ case EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT:
+ if (__pTextAccessibilityElement)
+ {
+ __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
+ if ((GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT))
{
- __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
- if ((GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT))
- {
- __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText());
- }
- else
- {
- __pTextAccessibilityElement->SetLabel(GetGuideText() + GetText());
- }
+ __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText());
}
- break;
- case EDIT_ACCESSIBILITY_ELEMENT_TYPE_CLEAR_ICON:
- if (__pClearButtonTextAccessibilityElement)
+ else
{
- __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
+ __pTextAccessibilityElement->SetLabel(GetGuideText() + GetText());
}
- break;
- default:
- break;
+ }
+ break;
+
+ case EDIT_ACCESSIBILITY_ELEMENT_TYPE_CLEAR_ICON:
+ if (__pClearButtonTextAccessibilityElement)
+ {
+ __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
+ }
+ break;
+
+ default:
+ break;
}
return;
{
case EDIT_TEXT_COLOR_NORMAL:
variantColor = GetProperty("normalTextColor");
- color = variantColor.ToColor();
+ color = variantColor.ToColor();
break;
case EDIT_TEXT_COLOR_DISABLED:
variantColor = GetProperty("disabledTextColor");
- color = variantColor.ToColor();
+ color = variantColor.ToColor();
break;
case EDIT_TEXT_COLOR_HIGHLIGHTED:
variantColor = GetProperty("highlightedTextColor");
- color = variantColor.ToColor();
+ color = variantColor.ToColor();
break;
case EDIT_TEXT_COLOR_LINK:
switch (type)
{
case EDIT_TEXT_COLOR_NORMAL:
- r = SetProperty("normalTextColor", Variant(color));
+ r = SetProperty("normalTextColor", Variant(color));
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
break;
case EDIT_TEXT_COLOR_DISABLED:
- r = SetProperty("disabledTextColor", Variant(color));
+ r = SetProperty("disabledTextColor", Variant(color));
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
break;
case EDIT_TEXT_COLOR_HIGHLIGHTED:
- r = SetProperty("highlightedTextColor", Variant(color));
+ r = SetProperty("highlightedTextColor", Variant(color));
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
- r = SetProperty("pressedTextColor", Variant(color));
+ r = SetProperty("pressedTextColor", Variant(color));
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] System error occurred.", GetErrorMessage(r));
break;
{
__pScrollPanelEvent = _ScrollPanelEvent::CreateScrollPanelEventN(*this);
SysTryReturn(NID_UI_CTRL, __pScrollPanelEvent,
- E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+ E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
}
}
if (__pTextAccessibilityElement)
{
- __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
+ __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
}
if (__pClearButtonTextAccessibilityElement)
{
_pEditPresenter->Resize();
- if(__isAccessibilityCreated)
+ if (__isAccessibilityCreated)
{
if (__pTextAccessibilityElement)
{
- __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
+ __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
}
if (__pClearButtonTextAccessibilityElement)
{
result r = E_SUCCESS;
- switch(groupStyle)
- {
- case GROUP_STYLE_NONE:
- r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- break;
- case GROUP_STYLE_SINGLE:
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- break;
- case GROUP_STYLE_TOP:
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- break;
- case GROUP_STYLE_MIDDLE:
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- break;
- case GROUP_STYLE_BOTTOM:
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- break;
- default:
- r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
- break;
+ switch (groupStyle)
+ {
+ case GROUP_STYLE_NONE:
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ break;
+
+ case GROUP_STYLE_SINGLE:
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ break;
+
+ case GROUP_STYLE_TOP:
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ break;
+
+ case GROUP_STYLE_MIDDLE:
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ break;
+
+ case GROUP_STYLE_BOTTOM:
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ break;
+
+ default:
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ break;
}
return r;
case EDIT_STATUS_NORMAL:
isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_NORMAL);
break;
+
case EDIT_STATUS_DISABLED:
isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_DISABLED);
break;
+
case EDIT_STATUS_HIGHLIGHTED:
isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_HIGHLIGHTED);
break;
+
case EDIT_STATUS_PRESSED:
isCustomBitmap = IS_CUSTOM_BITMAP(EDIT::BG_PRESSED);
break;
+
default:
isCustomBitmap = false;
break;
result
_Edit::AttachScrollPanelEvent(void)
{
- _ScrollPanel* pScrollPanelCore = dynamic_cast<_ScrollPanel*>(GetParent());
+ _ScrollPanel* pScrollPanelCore = dynamic_cast< _ScrollPanel* >(GetParent());
if (pScrollPanelCore)
{
if (__pScrollPanelEvent)
result
_Edit::DetachScrollPanelEvent(void)
{
- _ScrollPanel* pScrollPanelCore = dynamic_cast<_ScrollPanel*>(GetParent());
+ _ScrollPanel* pScrollPanelCore = dynamic_cast< _ScrollPanel* >(GetParent());
if (pScrollPanelCore)
{
if (__pScrollPanelEvent && (pScrollPanelCore->GetScrollPanelEvent() == __pScrollPanelEvent))
result r = E_SUCCESS;
- r = _pEditPresenter->SetKeypadAction((CoreKeypadAction)action.ToInt());
+ r = _pEditPresenter->SetKeypadAction((CoreKeypadAction) action.ToInt());
return r;
}
Variant
_Edit::GetPropertyKeypadAction(void) const
{
- return Variant((int)_pEditPresenter->GetKeypadAction());
+ return Variant((int) _pEditPresenter->GetKeypadAction());
}
result
{
if (!(GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
{
- SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != (KeypadStyle)style.ToInt()), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
+ SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != (KeypadStyle) style.ToInt()), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
}
- return _pEditPresenter->SetKeypadStyle((KeypadStyle)style.ToInt());
+ return _pEditPresenter->SetKeypadStyle((KeypadStyle) style.ToInt());
}
Variant
_Edit::GetPropertyKeypadStyle(void) const
{
- return Variant((int)_pEditPresenter->GetKeypadStyle());
+ return Variant((int) _pEditPresenter->GetKeypadStyle());
}
result
Variant
_Edit::GetPropertyAutoLinkMask(void) const
{
- 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.");
+ 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.");
return Variant(_pEditPresenter->GetAutoLinkMask());
}
}
void
-_Edit::SendOpaqueCommand (const String& command)
+_Edit::SendOpaqueCommand(const String& command)
{
_pEditPresenter->SendOpaqueCommand(command);
}
}
+_AccessibilityElement*
+_Edit::GetTextAccessibilityElement(void) const
+{
+ return __pTextAccessibilityElement;
+}
+
}}} // Tizen::Ui::Controls
#include "FUiCtrl_Scroll.h"
#include "FUi_Math.h"
#include "FUi_CoordinateSystemUtils.h"
+#include "FUi_AccessibilityContainer.h"
+#include "FUi_AccessibilityElement.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
{
const float segments[3][3] = {{0.0f, 0.01f, 0.37f}, {0.37f, 0.72f, 0.888f}, {0.888f, 0.9999f, 1.0f}};
float timeProgressValue = timeProgress;
- int segmentsLength = 3; //Length of the segments array
- int index = (int)floor(segmentsLength * timeProgressValue);
+ int segmentsLength = 3; //Length of the segments array
+ int index = (int) floor(segmentsLength * timeProgressValue);
if (index >= segmentsLength)
{
index = segmentsLength - 1;
float progressValue = (timeProgressValue - index * (1.0 / segmentsLength)) * segmentsLength;
float segmentAtIndex[3];
- for(int i = 0; i < 3; i++)
+ for (int i = 0; i < 3; i++)
{
segmentAtIndex[i] = segments[index][i];
}
float __textPixelWidth;
float __textPixelHeight;
_VisualElement* __pVisualElement;
-}; // _Token
+}; // _Token
_Token::_Token(void)
: pTextObject(null)
}
int length = text.GetLength();
- wchar_t* pTempString = const_cast <wchar_t*>(text.GetPointer());
+ wchar_t* pTempString = const_cast< wchar_t* >(text.GetPointer());
SysTryReturnResult(NID_UI_CTRL, pTempString != null, E_SYSTEM, "A system error has occurred. Token text string is null.");
__pTextBuffer = new (std::nothrow) wchar_t[(length + 1) * (sizeof(wchar_t))];
pTextObject->RemoveAll(true);
- TextSimple* pSimpleText = new (std::nothrow)TextSimple(__pTextBuffer, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, pFont);
+ TextSimple* pSimpleText = new (std::nothrow) TextSimple(__pTextBuffer, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, pFont);
SysTryCatch(NID_UI_CTRL, pSimpleText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pTextObject->AppendElement(*pSimpleText);
, __pTokenBgPressedEffectBitmap(null)
, __pressedTokenIndex(-1)
, __isEditingToken(false)
- , __edittingTokenIndex(-1)
+ , __editingTokenIndex(-1)
, __clientRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
, __initTextRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
, __isEditModeEnabled(true)
, __editContentFontSize(0.0f)
, __trackTokenIndex(-1)
, __isAnimationInProgress(false)
+ , __focusOutIndex(-1)
+ , __accessibilityElements()
{
}
{
result r = E_SUCCESS;
float descriptionTextSize = 0.0f;
- Font *pFont = null;
+ Font* pFont = null;
float editFontSize = 0.0f;
__pDescriptionTextTextObject = new (std::nothrow) TextObject();
__pTimingFunction = null;
}
+ RemoveChildAccessibilityElements();
+
return E_SUCCESS;
}
pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_MIDDLE);
}
- __pTokenEdit = dynamic_cast <_TokenEdit*>(GetEditView());
+ __pTokenEdit = dynamic_cast< _TokenEdit* >(GetEditView());
SysTryReturnResult(NID_UI_CTRL, __pTokenEdit != null, E_SYSTEM, "A system error has occurred. The _Token instance is null.");
_TokenEditModel* pTokenEditModel = new (std::nothrow) _TokenEditModel();
{
bool isCustomBitmap = IS_CUSTOM_BITMAP(TOKENEDIT::BG_NORMAL);
//Checking IsBlocked() is additional check for handler movement in token edit mode
- if ((__isEditingToken) && (__edittingTokenIndex >= 0))
+ if ((__isEditingToken) && (__editingTokenIndex >= 0))
{
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
_VisualElement* pTokenVisualElement = pToken->GetVisualElement();
_VisualElement* pCursorVisualElement = GetCursorVisualElement();
SysTryReturnResult(NID_UI_CTRL, pCursorVisualElement != null, E_SYSTEM, "A system error has occurred. Failed to get cursor visual element.");
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
SysTryReturnResult(NID_UI_CTRL, pTokenCanvas != null, E_SYSTEM, "A system error has occurred. Failed to get canvas of the token.");
_EditPresenter::DrawText(*pTokenCanvas);
+
InitializeCursor();
delete pTokenCanvas;
if (__isTokenEditingFinished)
{
__isEditingToken = false;
- __edittingTokenIndex = -1;
+ __editingTokenIndex = -1;
_EditPresenter::SetTextSize(__editContentFontSize);
__isTokenEditingFinished = false;
{
Bitmap* pReplacementColorBackgroundBitmap = null;
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken == null || pToken->pTextObject == null)
{
SysLog(NID_UI_CTRL, "[E_SYSTEM] The _Token instance is null");
r = pToken->Construct(inputTokenString, GetFont());
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct token.", GetErrorMessage(r));
- r = __pTokenList->Add(static_cast <Object&>(*pToken));
+ r = __pTokenList->Add(static_cast< Object& >(*pToken));
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
tokenCount = __pTokenList->GetCount();
r = CheckTokenScrolling();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to process scroll.", GetErrorMessage(r));
+ AppendTokenAccessibilityElement();
+ UpdateTokenAccessibilityBounds();
+
return r;
CATCH:
r = MakeToken(token);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- if (__edittingTokenIndex >= 0)
+ if (__editingTokenIndex >= 0)
{
- SetEditingTokenTextBounds(__edittingTokenIndex);
+ SetEditingTokenTextBounds(__editingTokenIndex);
_EditPresenter::SetCursorPosition(__previousCursorPosition);
}
for (int i = 0; i < GetTokenCount(); i++)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
- SysTryCatch(NID_UI_CTRL, pToken != null, ,r = E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
+ SysTryCatch(NID_UI_CTRL, pToken != null, , r = E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
r = pToken->SetBounds(pToken->displayRect);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set bounds", GetErrorMessage(r));
}
+ InsertTokenAccessibilityElementAt(index);
+
if (isUser)
{
- if (__edittingTokenIndex >= 0)
+ if (__editingTokenIndex >= 0)
{
- if (index <= __edittingTokenIndex)
+ if (index <= __editingTokenIndex)
{
- __edittingTokenIndex++;
+ __editingTokenIndex++;
}
- __pressedTokenIndex = __edittingTokenIndex;
+ __pressedTokenIndex = __editingTokenIndex;
- SetEditingTokenTextBounds(__edittingTokenIndex);
+ SetEditingTokenTextBounds(__editingTokenIndex);
_EditPresenter::SetCursorPosition(__previousCursorPosition);
}
else if (__pressedTokenIndex >= index)
SysTryReturn(NID_UI_CTRL, index >= 0 && index < __pTokenList->GetCount(), tempString, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] index (%d) is out of range.", index);
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(index));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
if (pToken)
{
tempString = pToken->GetText();
}
else
{
- if(__isAnimationInProgress)
+ if (__isAnimationInProgress)
{
- return __pTokenList->GetCount() -1;
+ return __pTokenList->GetCount() - 1;
}
else
{
result r = E_SUCCESS;
SysTryReturnResult(NID_UI_CTRL, index >= 0 && index < __pTokenList->GetCount(), E_OUT_OF_RANGE, "index (%d) is out of range.", index);
- if (index == __edittingTokenIndex && isClearText)
+ if (index == __editingTokenIndex && isClearText)
{
_VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
SysTryReturnResult(NID_UI_CTRL, pEditVisualElement, E_SYSTEM, "A system error has occurred. Failed to get root visual element.");
r = pEditVisualElement->AttachChild(*pCursorVisualElement);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
- __edittingTokenIndex = -1;
+ __editingTokenIndex = -1;
__isEditingToken = false;
__pressedTokenIndex = -1;
__isTokenEditingFinished = true;
for (int i = 0; i < GetTokenCount(); i++)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
SysTryReturnResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "A system error has occurred. The _Token instance is null");
r = pToken->SetBounds(pToken->displayRect);
r = CheckTokenScrolling();
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to process scroll.");
+ RemoveTokenAccessibilityElementAt(index);
+ UpdateTokenAccessibilityBounds();
+
if (isClearText)
{
- if (index > __edittingTokenIndex)
+ if (index > __editingTokenIndex)
{
- SetEditingTokenTextBounds(__edittingTokenIndex);
+ SetEditingTokenTextBounds(__editingTokenIndex);
_EditPresenter::SetCursorPosition(__previousCursorPosition);
}
- if (index < __edittingTokenIndex)
+ if (index < __editingTokenIndex)
{
- if (__edittingTokenIndex > 0)
+ if (__editingTokenIndex > 0)
{
- __edittingTokenIndex--;
- __pressedTokenIndex = __edittingTokenIndex;
+ __editingTokenIndex--;
+ __pressedTokenIndex = __editingTokenIndex;
- SetEditingTokenTextBounds(__edittingTokenIndex);
+ SetEditingTokenTextBounds(__editingTokenIndex);
_EditPresenter::SetCursorPosition(__previousCursorPosition);
}
}
FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF();
String titleText = __pTokenEdit->GetTitleText();
- if(!_FloatCompare(GetDescriptionTextRect().width, __previousTitleWidth))
+ if (!_FloatCompare(GetDescriptionTextRect().width, __previousTitleWidth))
{
__descriptionTextRectForScroll = GetDescriptionTextRect();
__previousTitleWidth = GetDescriptionTextRect().width;
bool findPrevTokenLoopFlag = true;
for (; index < tokenCount; index++)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(index));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
if (index == 0)
pToken->displayRect.x = __descriptionTextRectForScroll.x + __descriptionTextRectForScroll.width + descriptionTextRightMargin;
pToken->displayRect.y = __descriptionTextRectForScroll.y + __scrollValue;
}
- else // Set description text.
+ else // Set description text.
{
pToken->displayRect.x = leftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
pToken->displayRect.y = tokenTopMargin + __scrollValue + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) + __lineSpacing;
{
if (findPrevTokenLoopFlag)
{
- pPreviousToken = static_cast <_Token*>(__pTokenList->GetAt(index - 1));
+ pPreviousToken = static_cast< _Token* >(__pTokenList->GetAt(index - 1));
findPrevTokenLoopFlag = false;
}
float tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - rightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
- if (tokenTextLeftMargin + pToken->GetTextPixelWidth() + tokenTextRightMargin > tempTextWidth) // Line change
+ if (tokenTextLeftMargin + pToken->GetTextPixelWidth() + tokenTextRightMargin > tempTextWidth) // Line change
{
pToken->displayRect.x = leftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
pToken->displayRect.y = pPreviousToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing;
else
{
pToken->displayRect.x = pPreviousToken->displayRect.x + pPreviousToken->displayRect.width +
- tokenHorizontalSpacing;
+ tokenHorizontalSpacing;
pToken->displayRect.y = pPreviousToken->displayRect.y;
}
result r = E_SUCCESS;
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(ndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(ndex));
SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
r = pToken->SetBounds(pToken->displayRect);
float
_TokenEditPresenter::GetMaxTextHeight(void)
{
- Font *pFont = null;
+ Font* pFont = null;
float maxHeight = __editContentFontSize;
pFont = GetFont();
tokenTextRect.height = textObjectMaxHeight;
SetTextBounds(tokenTextRect);
+ //set cursor bounds with tokenTextRect
+ __pTokenEdit->SetCursorAccessibilityBounds(tokenTextRect);
return r;
}
_Token* pToken = null;
// SetTextBounds from last token
- pToken = static_cast <_Token*>(__pTokenList->GetAt(tokenCount - 1));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(tokenCount - 1));
SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
float tempTextRectWidth = 0.0f;
tokenTextRect.height = textObjectMaxHeight;
SetTextBounds(tokenTextRect);
+ if (__pressedTokenIndex < 0) // Set cursor as global focused element if no token is selected
+ {
+ __pTokenEdit->SetCursorAccessibilityBounds(tokenTextRect);
+ }
+
}
else
{
{
if ((__isPopupVisible == true || __isLongPressed == true) && __pressedTokenIndex >= 0)
{
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__pressedTokenIndex));
SysTryReturn(NID_UI_CTRL, pToken, Rectangle(), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Unable to get valid token.");
_ControlOrientation orientation = __pTokenEdit->GetOrientation();
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenTextVerticalMargin);
- FloatRectangle textBoundsF(pToken->displayRect.x + tokenTextLeftMargin, pToken->displayRect.y + (tokenTextVerticalMargin /2.0f), pToken->displayRect.width - (tokenTextLeftMargin * 2.0f), pToken->displayRect.height - tokenTextVerticalMargin);
+ FloatRectangle textBoundsF(pToken->displayRect.x + tokenTextLeftMargin, pToken->displayRect.y + (tokenTextVerticalMargin / 2.0f), pToken->displayRect.width - (tokenTextLeftMargin * 2.0f), pToken->displayRect.height - tokenTextVerticalMargin);
Rectangle textBounds = _CoordinateSystemUtils::ConvertToInteger(textBoundsF);
return textBounds;
{
if ((__isPopupVisible == true || __isLongPressed == true) && __pressedTokenIndex >= 0)
{
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__pressedTokenIndex));
SysTryReturn(NID_UI_CTRL, pToken, FloatRectangle(), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Unable to get valid token.");
_ControlOrientation orientation = __pTokenEdit->GetOrientation();
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenTextVerticalMargin);
- FloatRectangle textBounds(pToken->displayRect.x + tokenTextLeftMargin, pToken->displayRect.y + (tokenTextVerticalMargin /2.0f), pToken->displayRect.width - (tokenTextLeftMargin * 2.0f), pToken->displayRect.height - tokenTextVerticalMargin);
+ FloatRectangle textBounds(pToken->displayRect.x + tokenTextLeftMargin, pToken->displayRect.y + (tokenTextVerticalMargin / 2.0f), pToken->displayRect.width - (tokenTextLeftMargin * 2.0f), pToken->displayRect.height - tokenTextVerticalMargin);
return textBounds;
}
{
if (__isEditingToken)
{
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
SysTryReturnResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "A system error has occurred. The _Token instance is null");
pToken->isTextCut = true;
int length = descriptionText.GetLength();
FloatDimension textSize;
- wchar_t* pTempString = const_cast <wchar_t*>(descriptionText.GetPointer());
+ wchar_t* pTempString = const_cast< wchar_t* >(descriptionText.GetPointer());
SysAssertf(__pDescriptionTextTextObject != null, "The TextObject instance is null.");
__pDescriptionTextTextObject->RemoveAll(true);
- pSimpleText = new (std::nothrow)TextSimple(pTempString, length, TEXT_ELEMENT_SOURCE_TYPE_INTERNAL);
+ pSimpleText = new (std::nothrow) TextSimple(pTempString, length, TEXT_ELEMENT_SOURCE_TYPE_INTERNAL);
__pDescriptionTextTextObject->AppendElement(*pSimpleText);
textSize = __pDescriptionTextTextObject->GetTextExtentF(0, length);
{
result r = E_SUCCESS;
FloatRectangle tempDescriptionTextRect;
+ FloatRectangle descriptionTextRect(__descriptionTextRect);
Canvas* pDescriptionTextCanvas = null;
Font* pDescriptionFont = null;
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
- __pDescriptionTextVisualElement->SetBounds(FloatRectangle(__descriptionTextRect.x, (__descriptionTextRectForScroll.y + __scrollValue), __descriptionTextRect.width, __descriptionTextRect.height));
+ descriptionTextRect.y = __descriptionTextRectForScroll.y + __scrollValue;
+ __pDescriptionTextVisualElement->SetBounds(descriptionTextRect);
+ UpdateTitleAccessibilityBounds(descriptionTextRect); // Update title accessibility bounds to same as DescriptionTextVisualElement bounds
pDescriptionTextCanvas = __pDescriptionTextVisualElement->GetCanvasN();
if (pDescriptionTextCanvas == null)
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_MIN_WIDTH, orientation, tokenMinimumSize);
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(index));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF();
int tokenCount = __pTokenList->GetCount();
for (int i = 0; i < tokenCount; i++)
{
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
FloatRectangle tokenRect = pToken->displayRect;
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_SIZE, orientation, tokenFontSize);
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(index));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
SysTryReturnResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "A system error has occurred. The _Token instance is null");
FloatRectangle tempTextDspRect;
for (int i = 0; i < tokenCount; i++)
{
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
result r = E_SUCCESS;
int currentYPosition = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).y;
- if(_FloatCompare(__prevScrollValue, 0.0f))
+ if (_FloatCompare(__prevScrollValue, 0.0f))
{
__prevScrollValue = currentYPosition;
}
- else // Adjust moved y position to all tokens.
+ else // Adjust moved y position to all tokens.
{
- if (__isNeedToScroll) // Need to scroll
+ if (__isNeedToScroll) // Need to scroll
{
float tempDefference = __prevScrollValue - currentYPosition;
for (int i = 0; i < tokenCount; i++)
{
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
}
int prevPressedTokenIndex = __pressedTokenIndex;
- int prevEditedTokenIndex = __edittingTokenIndex;
+ int prevEditedTokenIndex = __editingTokenIndex;
result r = E_SUCCESS;
if (IsFocused())
if (__isEditModeEnabled && __pressedTokenIndex != -1 && __pressedTokenIndex == tokenIndex)
{
//Comment below to Block Copy & Paste functionality in Token Edit mode
- __edittingTokenIndex = __pressedTokenIndex;
+ __editingTokenIndex = __pressedTokenIndex;
__isEditingToken = true;
__isTokenEditingFinished = false;
- if (prevEditedTokenIndex != __edittingTokenIndex)
+ if (prevEditedTokenIndex != __editingTokenIndex)
{
- SetEditingTokenTextBounds(__edittingTokenIndex);
+ SetEditingTokenTextBounds(__editingTokenIndex);
}
SetCursorDisabled(false);
}
_Token* pToken = null;
_VisualElement* pTokenVisualElement = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(prevPressedTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(prevPressedTokenIndex));
bool isParentChanged = false;
if (pToken)
r = InsertTokenAt(prevPressedTokenIndex, inputTokenString);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
- pToken = static_cast <_Token*>(__pTokenList->GetAt(prevPressedTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(prevPressedTokenIndex));
if (pToken)
{
pToken->currTokenLength = inputTokenString.GetLength();
ClearText();
//Flex height adjusted since token can move to another line
AdjustFlexibleHeight();
- __edittingTokenIndex = -1;
+ __editingTokenIndex = -1;
__isTokenEditingFinished = true;
__isEditingToken = false;
_EditPresenter::SetTextSize(__editContentFontSize);
_Token* pToken = null;
_VisualElement* pTokenVisualElement = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__pressedTokenIndex));
bool isParentChanged = false;
if (pToken)
_Token* pToken = null;
_VisualElement* pTokenVisualElement = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
bool isParentChanged = false;
if (pToken)
}
__pressedTokenIndex = tokenIndex;
- RemoveTokenAt(__edittingTokenIndex);
+ RemoveTokenAt(__editingTokenIndex);
if (inputTokenString.GetLength() > 0)
{
- InsertTokenAt(__edittingTokenIndex, inputTokenString);
+ InsertTokenAt(__editingTokenIndex, inputTokenString);
if (isParentChanged)
{
}
__isEditingToken = false;
- __edittingTokenIndex = -1;
+ __editingTokenIndex = -1;
_EditPresenter::SetTextSize(__editContentFontSize);
__isTokenEditingFinished = false;
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenVerticalSpacing);
int tokenCount = GetTokenCount();
- if (tokenCount == 0) // There is no token to scroll
+ if (tokenCount == 0) // There is no token to scroll
{
__isNeedToScroll = false;
__maxScrollValue = 0.0f;
return E_SUCCESS;
}
- _Token* pToken = static_cast<_Token*>(__pTokenList->GetAt(tokenCount - 1));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(tokenCount - 1));
SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
float newScrollValue = 0.0f;
if (scrollToCursorPosition)
{
FloatRectangle cursorBounds;
- GetCursorBounds(false, cursorBounds);
+ GetCursorBounds(false, cursorBounds);
newScrollValue = cursorBounds.y + cursorBounds.height - __scrollValue + tokenBottomMargin - __pTokenEdit->GetBoundsF().height;
__isScrollValueModified = true;
}
}
else
{
- if(!_FloatCompare(__scrollValue, 0.0f))
+ if (!_FloatCompare(__scrollValue, 0.0f))
{
__scrollValue = 0.0f;
- __maxScrollValue = 0.0f; // To prevent unnecessary token scrolling.
+ __maxScrollValue = 0.0f; // To prevent unnecessary token scrolling.
RecalculateTokenBounds(__scrollValue);
__isTokenScrolling = false;
}
result
_TokenEditPresenter::SetTokenVisualElementBounds(int index, const FloatRectangle& bounds)
{
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(index));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
SysTryReturnResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "A system error has occurred. The _Token instance is null.");
return pToken->SetBounds(pToken->displayRect);
}
}
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(GetTokenCount() - 1));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(GetTokenCount() - 1));
if (pToken == null)
{
return E_SUCCESS;
for (int i = 0; i < tokenCount; i++)
{
tempInitialBounds = intialBounds;
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
SysTryReturn(NID_UI_CTRL, pToken != null, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
FloatRectangle displayBounds = pToken->displayRect;
for (int i = 0; i < tokenCount; i++)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
SetFlexBounds(tempRect);
- SetEditingTokenTextBounds(__edittingTokenIndex, false);
+ SetEditingTokenTextBounds(__editingTokenIndex, false);
if (!__isFocus)
{
StartCursorTimer();
}
+ RefreshAccessibilityElements();
+
return _EditPresenter::OnFocusGained();
}
_EditPresenter::StopTitleSlidingTimer();
__isTitleSliding = false;
- if (__edittingTokenIndex >= 0)
+ if (__editingTokenIndex >= 0)
{
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
if (GetText().GetLength() > 0)
}
else
{
- RemoveTokenAt(__edittingTokenIndex, true);
+ RemoveTokenAt(__editingTokenIndex, true);
}
}
}
_Token* pToken = null;
for (int i = 0; i < tokenCount; i++)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
pToken->SetBounds(pToken->displayRect);
r = SetInitialBounds();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating", GetErrorMessage(r));
+ UpdateTokenAccessibilityBounds();
+
__scrollValue = 0.0f;
r = CalculateTokenPositionFromIndex(0);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
for (int i = visibleTokenCount; i < tokenCount; i++)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
_VisualElement* pTokenVisualElement = pToken->GetVisualElement();
FloatRectangle intialWindowBounds = GetInitialBoundsF();
SetFlexBounds(intialWindowBounds);
- SetEditingTokenTextBounds(__edittingTokenIndex, false);
+ SetEditingTokenTextBounds(__editingTokenIndex, false);
__descriptionTextRect.y = __descriptionTextRectForScroll.y + __scrollValue;
}
pTextObject->Compose();
}
+ RemoveChildAccessibilityElements();
+ __pTokenEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT);
+
return _EditPresenter::OnFocusLost();
}
_TouchInfo TouchInfo(touchinfo);
if (tokenIndex != -1)
{
- if (tokenIndex == __edittingTokenIndex)
+ if (tokenIndex == __editingTokenIndex)
{
__touchPressInfo.x = touchinfo.GetCurrentPosition().x;
__touchPressInfo.y = touchinfo.GetCurrentPosition().y;
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
float tokenX = pToken->displayRect.x;
if (GetTokenCount())
{
//Set token bounds appropriately On Fast flick of scroll bar
- if (!(__isEditingToken || __edittingTokenIndex >= 0))
+ if (!(__isEditingToken || __editingTokenIndex >= 0))
{
SetTokenBoundsByTouchInfo(touchinfo);
}
_TouchInfo TouchInfo(touchinfo);
_Token* pToken = null;
- if (__edittingTokenIndex >= 0)
+ if (__editingTokenIndex >= 0)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
int tokenX = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.x);
CoreKeypadAction keypadaction = GetKeypadAction();
__pTokenEdit->SendKeypadEvent(keypadaction, CORE_KEYPAD_EVENT_STATUS_ENTERACTION);
- if (__edittingTokenIndex != -1)
+ if (__editingTokenIndex != -1)
{
_VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pEditVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element.");
_Token* pToken = null;
_VisualElement* pTokenVisualElement = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
inputTokenString = replacementString;
}
- r = RemoveTokenAt(__edittingTokenIndex);
+ r = RemoveTokenAt(__editingTokenIndex);
_EditPresenter::SetTextSize(__editContentFontSize);
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
if (inputTokenString.GetLength() > 0)
{
- r = InsertTokenAt(__edittingTokenIndex, inputTokenString);
+ r = InsertTokenAt(__editingTokenIndex, inputTokenString);
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
SysTryReturnVoidResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
pToken->currTokenLength = inputTokenString.GetLength();
for (int i = 0; i < lastTokenIndex + 1; i++)
{
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
AdjustFlexibleHeight();
__pressedTokenIndex = -1;
__isTokenEditingFinished = true;
- __edittingTokenIndex = -1;
+ __editingTokenIndex = -1;
__isEditingToken = false;
CheckTokenScrolling();
__previousCursorPosition = GetCursorPosition();
_Token* pToken = null;
- if (__edittingTokenIndex >= 0)
+ if (__editingTokenIndex >= 0)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
SysTryReturnVoidResult(NID_UI_CTRL, pToken, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
pToken->ResetToken(GetText());
- TrimTokenAndAdjustEllipsisAt(__edittingTokenIndex);
+ TrimTokenAndAdjustEllipsisAt(__editingTokenIndex);
float tokenHeight = 0.0f;
float tokenVerticalSpacing = 0.0f;
SetTextBounds(textBounds);
}
- if (__edittingTokenIndex < 0)
+ if (__editingTokenIndex < 0)
{
CheckTokenScrolling();
}
_Token* pToken = null;
_VisualElement* pTokenVisualElement = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
}
}
- RemoveTokenAt(__edittingTokenIndex);
+ RemoveTokenAt(__editingTokenIndex);
- CalculateTokenPositionFromIndex(__edittingTokenIndex);
- for (int i = __edittingTokenIndex; i < __lastTokenIndex + 1; i++)
+ CalculateTokenPositionFromIndex(__editingTokenIndex);
+ for (int i = __editingTokenIndex; i < __lastTokenIndex + 1; i++)
{
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
pToken->SetBounds(pToken->displayRect);
}
__pressedTokenIndex = -1;
- __edittingTokenIndex = -1;
+ __editingTokenIndex = -1;
__isEditingToken = false;
_EditPresenter::SetTextSize(__editContentFontSize);
__isTokenEditingFinished = false;
_Token* pToken = null;
_VisualElement* pTokenVisualElement = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__pressedTokenIndex));
if (pToken)
{
for (int i = __pressedTokenIndex; i < __lastTokenIndex + 1; i++)
{
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
pToken->SetBounds(pToken->displayRect);
}
}
+
}
else
{
_VisualElement* pTokenVisualElement = null;
if (__animatingIndex == (GetTokenCount() - 1))
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(GetTokenCount() - 1));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(GetTokenCount() - 1));
if (pToken)
{
pTokenVisualElement = pToken->GetVisualElement();
pTokenVisualElement->RemoveAnimation(L"TokenAnimation");
}
}
- pToken = static_cast <_Token*>(__pTokenList->GetAt(GetTokenCount() - 1));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(GetTokenCount() - 1));
if (pToken)
{
pTokenVisualElement = pToken->GetVisualElement();
}
}
+ __pTokenEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT);
+
DrawText();
__pTokenEdit->Invalidate();
return;
}
}
- if (__pressedTokenIndex >= 0 && __edittingTokenIndex < 0 && !__isEditingToken)
+ if (__pressedTokenIndex >= 0 && __editingTokenIndex < 0 && !__isEditingToken)
{
RemoveTokenAt(__pressedTokenIndex);
__pTokenEdit->Invalidate();
_Token* pToken = null;
- if (__edittingTokenIndex >= 0 && __isEditingToken)
+ if (__editingTokenIndex >= 0 && __isEditingToken)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
_EditPresenter::SetCursorPosition(start);
pToken->ResetToken(GetText());
- TrimTokenAndAdjustEllipsisAt(__edittingTokenIndex);
+ TrimTokenAndAdjustEllipsisAt(__editingTokenIndex);
}
}
bool
_TokenEditPresenter::OnTapGestureDetected(void)
{
- if (__edittingTokenIndex >= 0)
+ if (__editingTokenIndex >= 0)
{
__isPopupVisible = true;
}
bool
_TokenEditPresenter::CheckCopyPastePopupShowStatus(void)
{
- if (__edittingTokenIndex < 0)
- {
- float controlHeight = __pTokenEdit->GetBoundsF().height;
- FloatRectangle cursorBounds;
- GetCursorBounds(false, cursorBounds);
- if (cursorBounds.y > controlHeight)
- {
- return true;
- }
- }
+ if (__editingTokenIndex < 0)
+ {
+ float controlHeight = __pTokenEdit->GetBoundsF().height;
+ FloatRectangle cursorBounds;
+ GetCursorBounds(false, cursorBounds);
+ if (cursorBounds.y > controlHeight)
+ {
+ return true;
+ }
+ }
- return false;
+ return false;
}
bool
void
_TokenEditPresenter::OnCursorTimerExpired(void)
{
- if (__edittingTokenIndex != -1)
+ if (__editingTokenIndex != -1)
{
if (!IsFocused())
{
FloatRectangle cursorRect;
- _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
SysTryReturnVoidResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
//Set Editing token bounds for text scroll and cursor position calculation (SetTextBounds should have been done prior to this)
bool
_TokenEditPresenter::IsTextBlockedInTokenEdit(void) const
{
- if ((IsBlocked() == true) && (__isEditingToken) && (__edittingTokenIndex >= 0))
+ if ((IsBlocked() == true) && (__isEditingToken) && (__editingTokenIndex >= 0))
{
return true;
}
//Allow touch move only in horizontal direction when editing token
_TouchInfo TouchInfo(touchinfo);
_Token* pToken = null;
- if (__edittingTokenIndex >= 0)
+ if (__editingTokenIndex >= 0)
{
if (__touchPressInfo.y > 0.0f)
{
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
if (pToken)
{
float tokenX = pToken->displayRect.x;
}
void
-_TokenEditPresenter::OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally)
+_TokenEditPresenter::OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally)
{
__isAnimationInProgress = false;
RemoveTokenAt(GetTokenCount() - 1);
for (int i = GetTokenCount() - 1; i < GetTokenCount() - 1 + 1; i++)
{
_Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
if (pToken)
{
pToken->SetBounds(pToken->displayRect);
}
}
+
if (__lastTokenIndex == __pressedTokenIndex)
{
__pressedTokenIndex--;
DrawToken();
+ __pTokenEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT);
+
return;
}
if (__isEditingToken)
{
- if (__edittingTokenIndex >= 0 && __edittingTokenIndex < GetTokenCount())
+ if (__editingTokenIndex >= 0 && __editingTokenIndex < GetTokenCount())
{
String inputTokenString = GetText();
String replacementString = inputTokenString;
if (inputTokenString.GetLength() > 0)
{
- int index = __edittingTokenIndex;
- RemoveTokenAt(__edittingTokenIndex, true);
+ int index = __editingTokenIndex;
+ RemoveTokenAt(__editingTokenIndex, true);
InsertTokenAt(index, inputTokenString);
}
}
return _EditPresenter::OnKeyPressed(source, keyInfo);
}
+
+String
+_TokenEditPresenter::GetTextAccessibilityElementText(void) const
+{
+ String tokenText;
+ String spaceText = " ";
+ _Token* pToken = null;
+ int tokenCount = GetTokenCount();
+ static const int readTokenCount = 2;
+ if (tokenCount > 0)
+ {
+ for (int index = 0; index < readTokenCount; index++)
+ {
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
+ SysTryReturn(NID_UI_CTRL, pToken, tokenText, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
+
+ if (index < (readTokenCount - 1))
+ {
+ tokenText += pToken->GetText() + spaceText;
+ }
+ else
+ {
+ String moreTokenText;
+ int moreTokenCount = tokenCount - readTokenCount;
+ if (moreTokenCount > 0)
+ {
+ moreTokenText.Format(15, L"and %d more", moreTokenCount);
+ }
+ tokenText += pToken->GetText() + spaceText + moreTokenText;
+ }
+ }
+ }
+ return tokenText;
+}
+
+void
+_TokenEditPresenter::RefreshAccessibilityElements(void)
+{
+ RemoveChildAccessibilityElements();
+ AddChildAccessibilityElements();
+
+ return;
+}
+
+result
+_TokenEditPresenter::AddChildAccessibilityElements(void)
+{
+ //Accessibility Elements added to the container upon focus gained
+ //1.Title
+ //2.Token(s)
+ //3. __accessibilityElements 0 - title 1 - token 0
+
+ result r = E_SUCCESS;
+ _AccessibilityContainer* pContainer = __pTokenEdit->GetAccessibilityContainer();
+
+ __pTokenEdit->AddTitleAccessibilityElement();
+ int tokenCount = GetTokenCount();
+
+ for (int index = 0; index < tokenCount; index++)
+ {
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
+ SysTryReturn(NID_UI_CTRL, pToken != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
+
+ if (pContainer)
+ {
+ _AccessibilityElement* pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnResult(NID_UI_CTRL, pAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ String labelText = pToken->GetText();
+ pAccessibilityElement->SetBounds(pToken->displayRect);
+ pAccessibilityElement->SetLabel(labelText);
+ pContainer->AddElement(*pAccessibilityElement);
+ __accessibilityElements.Add(pAccessibilityElement);
+ }
+ }
+
+ __pTokenEdit->AddCursorAccessibilityElement();
+
+ return r;
+}
+
+void
+_TokenEditPresenter::RemoveChildAccessibilityElements(void)
+{
+ _AccessibilityContainer* pContainer = __pTokenEdit->GetAccessibilityContainer();
+ _AccessibilityElement* pAccessibilityElement = null;
+
+ __pTokenEdit->RemoveTitleAccessibilityElement();
+
+ while (__accessibilityElements.GetCount() > 0)
+ {
+ if ((__accessibilityElements.GetAt(0, pAccessibilityElement)) == E_SUCCESS)
+ {
+ __accessibilityElements.RemoveAt(0);
+ pContainer->RemoveElement(*pAccessibilityElement);
+ }
+ }
+
+ __pTokenEdit->RemoveCursorAccessibilityElement();
+
+ return;
+}
+
+result
+_TokenEditPresenter::AppendTokenAccessibilityElement(void)
+{
+ result r = E_SUCCESS;
+ int tokenCount = GetTokenCount();
+
+ _AccessibilityContainer* pContainer = __pTokenEdit->GetAccessibilityContainer();
+
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(tokenCount - 1));
+ SysTryReturn(NID_UI_CTRL, pToken != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
+
+ if (pContainer)
+ {
+ _AccessibilityElement* pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnResult(NID_UI_CTRL, pAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ String labelText = pToken->GetText();
+ pAccessibilityElement->SetBounds(pToken->displayRect);
+ pAccessibilityElement->SetLabel(labelText);
+ pAccessibilityElement->SetHint(L"double tap to edit");
+ pContainer->AddElement(*pAccessibilityElement);
+ __accessibilityElements.Add(pAccessibilityElement);
+ }
+
+ return r;
+}
+
+result
+_TokenEditPresenter::InsertTokenAccessibilityElementAt(int index)
+{
+ result r = E_SUCCESS;
+
+ _AccessibilityContainer* pContainer = __pTokenEdit->GetAccessibilityContainer();
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
+ SysTryReturn(NID_UI_CTRL, pToken != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
+
+ if (pContainer)
+ {
+ _AccessibilityElement* pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnResult(NID_UI_CTRL, pAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ String labelText = pToken->GetText();
+ pAccessibilityElement->SetBounds(pToken->displayRect);
+ pAccessibilityElement->SetLabel(labelText);
+ pContainer->AddElement(*pAccessibilityElement);
+ __accessibilityElements.InsertAt(pAccessibilityElement, index);
+ }
+
+ return r;
+}
+
+void
+_TokenEditPresenter::RemoveTokenAccessibilityElementAt(int index)
+{
+ _AccessibilityContainer* pContainer = __pTokenEdit->GetAccessibilityContainer();
+ _AccessibilityElement* pAccessibilityElement = null;
+
+ if (pContainer)
+ {
+ if (__accessibilityElements.GetCount() > 0)
+ {
+ if ((__accessibilityElements.GetAt(index, pAccessibilityElement)) == E_SUCCESS)
+ {
+ __accessibilityElements.RemoveAt(index);
+ pContainer->RemoveElement(*pAccessibilityElement);
+ }
+ }
+ }
+ return;
+}
+
+result
+_TokenEditPresenter::UpdateTokenAccessibilityBounds(void)
+{
+ result r = E_SUCCESS;
+ int tokenCount = GetTokenCount();
+ _AccessibilityElement* pAccessibilityElement = null;
+
+ for (int index = 0; index < tokenCount; index++)
+ {
+ _Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
+ SysTryReturn(NID_UI_CTRL, pToken != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
+
+ if ((__accessibilityElements.GetAt(index, pAccessibilityElement)) == E_SUCCESS)
+ {
+ pAccessibilityElement->SetBounds(pToken->displayRect);
+ }
+ }
+ return r;
+}
+
+result
+_TokenEditPresenter::UpdateTitleAccessibilityBounds(const FloatRectangle& titleBounds)
+{
+ _AccessibilityElement* pTitleAccessibilityElement = __pTokenEdit->GetTitleTextAccessibilityElement();
+
+ if (!pTitleAccessibilityElement)
+ {
+ return E_SUCCESS;
+ }
+
+ pTitleAccessibilityElement->SetBounds(titleBounds);
+
+ return E_SUCCESS;
+}
+
+result
+_TokenEditPresenter::ScrollToFocusedTokenAccessibilityElement(const _AccessibilityElement& element)
+{
+ result r = E_SUCCESS;
+ int focusedTokenIndex = -1;
+ int tokenCount = GetTokenCount();
+ FloatRectangle focusedTokenRectangle;
+ float newScrollValue = 0.0f;
+ float tokenTopMargin = 0.0f;
+ float tokenBottomMargin = 0.0f;
+ _ControlOrientation orientation = __pTokenEdit->GetOrientation();
+ _AccessibilityElement* pAccessibilityElement = null;
+
+ GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
+ GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
+
+ FloatRectangle tokenEditRect = __pTokenEdit->GetBoundsF();
+
+ pAccessibilityElement = const_cast< _AccessibilityElement* >(&element);
+ r = __accessibilityElements.IndexOf(pAccessibilityElement, focusedTokenIndex);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+
+ if ((focusedTokenIndex > -1) && (focusedTokenIndex < tokenCount))
+ {
+ _Token* pToken = null;
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(focusedTokenIndex));
+
+ focusedTokenRectangle = pToken->displayRect;
+
+ float focusedTokenPosition = focusedTokenRectangle.y + focusedTokenRectangle.height;
+
+ if ((focusedTokenRectangle.y > 0) && (focusedTokenPosition < tokenEditRect.height))
+ {
+ DrawToken();
+ }
+ else
+ {
+ if (focusedTokenRectangle.y < 0)
+ {
+ newScrollValue = focusedTokenRectangle.y - tokenTopMargin - __scrollValue;
+ }
+ else
+ {
+ newScrollValue = focusedTokenPosition - tokenEditRect.height + tokenBottomMargin - __scrollValue;
+ }
+
+ r = RecalculateTokenBounds(newScrollValue);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ }
+
+ __accessibilityElements.GetAt(focusedTokenIndex, pAccessibilityElement);
+ _AccessibilityManager* pAccessibilityManager = _AccessibilityManager::GetInstance();
+ pAccessibilityManager->SetGlobalFocusedElement(*pAccessibilityElement);
+ pAccessibilityManager->RequestToDrawFocusUi();
+ }
+
+ return r;
+}
+
+bool
+_TokenEditPresenter::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ if (__focusOutIndex < 0) // Not a token accessibility element
+ {
+ return false;
+ }
+
+ _Token* pToken = null;
+ _AccessibilityElement* pCurrentElement = const_cast< _AccessibilityElement* >(&element);
+ _AccessibilityElement* pPreviousAccessibilityElement = null;
+ _AccessibilityElement* pNextAccessibilityElement = null;
+ __accessibilityElements.GetAt(__focusOutIndex, pPreviousAccessibilityElement);
+
+ if (pPreviousAccessibilityElement && pPreviousAccessibilityElement->GetAbsoluteBounds().y > element.GetAbsoluteBounds().y) //Left flick
+ {
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__focusOutIndex - 1));
+ if (pToken)
+ {
+ if (pToken->displayRect.y < 0.0f && __focusOutIndex > 0)
+ {
+ __accessibilityElements.GetAt(__focusOutIndex - 1, pNextAccessibilityElement);
+ ScrollToFocusedTokenAccessibilityElement(*pNextAccessibilityElement);
+ }
+ }
+ }
+
+ if (pPreviousAccessibilityElement && pPreviousAccessibilityElement->GetAbsoluteBounds().y < element.GetAbsoluteBounds().y) //Right flick
+ {
+ pToken = static_cast< _Token* >(__pTokenList->GetAt(__focusOutIndex + 1));
+ if (pToken)
+ {
+ if (pToken->displayRect.y + pToken->displayRect.height > __pTokenEdit->GetBoundsF().height)
+ {
+ __accessibilityElements.GetAt(__focusOutIndex + 1, pNextAccessibilityElement);
+ ScrollToFocusedTokenAccessibilityElement(*pNextAccessibilityElement);
+ }
+ }
+ }
+
+ if (pToken == null) //Draw Cursor Accessibility Element
+ {
+ _AccessibilityElement* pCursorAccessibilityElement = __pTokenEdit->GetCursorAccessibilityElement();
+ if (pCursorAccessibilityElement && pPreviousAccessibilityElement && pCursorAccessibilityElement != pPreviousAccessibilityElement)
+ {
+ if (GetTextBoundsF().y - pPreviousAccessibilityElement->GetBounds().y > pPreviousAccessibilityElement->GetBounds().height) //check for different lines
+ {
+ float height = GetTextBoundsF().height + pPreviousAccessibilityElement->GetBounds().y + pPreviousAccessibilityElement->GetBounds().height;
+ if (pCurrentElement == pCursorAccessibilityElement && height > __pTokenEdit->GetBoundsF().height)
+ {
+ float tokenBottomMargin = 0.0f;
+ GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, tokenBottomMargin);
+ float newScrollValue = GetTextBoundsF().height + tokenBottomMargin - __scrollValue;
+ RecalculateTokenBounds(newScrollValue);
+ _AccessibilityManager::GetInstance()->SetGlobalFocusedElement(*(__pTokenEdit->GetCursorAccessibilityElement()));
+ _AccessibilityManager::GetInstance()->RequestToDrawFocusUi();
+ }
+ }
+ }
+ }
+
+ __focusOutIndex = -1;
+ UpdateTokenAccessibilityBounds();
+
+ return false;
+}
+
+bool
+_TokenEditPresenter::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ _AccessibilityElement* pAccessibilityElement = null;
+ pAccessibilityElement = const_cast< _AccessibilityElement* >(&element);
+ __accessibilityElements.IndexOf(pAccessibilityElement, __focusOutIndex);
+
+ return false;
+}
+
}}} //Tizen::Ui::Controls