return __pPublicTouchEventListeners;
}
+Tizen::Base::Collection::LinkedListT <Tizen::Base::Runtime::IEventListener*>*
+_ControlImpl::GetKeyEventListener(void) const
+{
+ return __pPublicKeyEventListeners;
+}
+
result
_ControlImpl::AddDragDropEventListener(IDragDropEventListener& listener)
{
, __parentWindowBounds(0.0f, 0.0f, 0.0f, 0.0f)
, __pOwner(null)
, __accessibilityFocusOutIndex(-1)
+ , __isAnimating(false)
{
}
_DateTimeBar::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
{
ClearLastResult();
+ if (__isAnimating)
+ {
+ return true;
+ }
return __pDateTimeBarPresenter->OnTouchPressed(source, touchinfo);
}
_DateTimeBar::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
{
ClearLastResult();
+ if (__isAnimating)
+ {
+ return true;
+ }
return __pDateTimeBarPresenter->OnTouchReleased(source, touchinfo);
}
_DateTimeBar::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
{
ClearLastResult();
+ if (__isAnimating)
+ {
+ return true;
+ }
return __pDateTimeBarPresenter->OnTouchMoved(source, touchinfo);
}
VisualElement* pVisualElement = null;
VisualElementAnimation *pAnimation = null;
+ __isAnimating = true;
pVisualElement = GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get visual element.");
pAnimation = CreateAnimationN(*pVisualElement, false);
Close();
target.SetBounds(bounds);
}
+ __isAnimating = false;
delete pUserData;
}
_EditInternalTouchEventListener::_EditInternalTouchEventListener(const _Edit& edit)
{
- __pEdit = const_cast<_Edit*>(&edit);
+ __pEdit = const_cast< _Edit* >(&edit);
}
bool
, __pressedGuideTextColor(Color())
, __isSettingGuideTextColor(false)
, __pDefaultBackgroundEffectBitmap(null)
+ , __pDefaultFocusBitmap(null)
, __pGestureFlick(null)
, __pGestureLongPress(null)
, __pGestureTap(null)
, __pTextFilter(null)
, __previousBounds()
, __isTouchMoving(false)
+ , __isSearchFieldFocused(false)
{
for (int status = 0; status < EDIT_COLOR_MAX; status++)
{
}
if (__pDefaultBackgroundBitmap[status])
- {
+ {
delete __pDefaultBackgroundBitmap[status];
__pDefaultBackgroundBitmap[status] = null;
- }
+ }
}
if (__pDefaultBackgroundEffectBitmap)
__pDefaultBackgroundEffectBitmap = null;
}
+ if (__pDefaultFocusBitmap)
+ {
+ delete __pDefaultFocusBitmap;
+ __pDefaultFocusBitmap = null;
+ }
+
if (__pTextBlockEvent)
{
delete __pTextBlockEvent;
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));
+ __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");
{
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 leftMargin = 0.0f;
float rightMargin = 0.0f;
float textLeftMargin = 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;
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
r = GET_BITMAP_CONFIG_N(SEARCHBAR::EDIT_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
+ r = GET_BITMAP_CONFIG_N(SEARCHBAR::EDIT_BG_FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultFocusBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
_pEditPresenter->SetSearchBarFlag(true);
return r;
}
+void
+_Edit::SetSearchFieldFocus(bool state)
+{
+ __isSearchFieldFocused = state;
+ return;
+}
+
+bool
+_Edit::IsSearchFieldFocused(void) const
+{
+ return __isSearchFieldFocused;
+}
+
Bitmap*
_Edit::GetDefaultBackgroundBitmap(EditStatus status) const
{
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;
_Edit::GetDefaultBackgroundEffectBitmap(void) const
{
return __pDefaultBackgroundEffectBitmap;
+}
+Bitmap*
+_Edit::GetDefaultFocusBitmap(void) const
+{
+ return __pDefaultFocusBitmap;
}
bool
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
void
_EditDatePresenter::Animate(void)
{
+ SysTryReturnVoidResult(NID_UI_CTRL, !__isAnimating, E_SUCCESS, "Rolling animation is in progress.");
SysAssertf((__pFont != null), "Font instance must not be null.");
(_FontImpl::GetInstance(*__pFont))->SetSize(__dateFontSize);
__pFont->GetTextExtent(newValue, newValue.GetLength(), newTextDim);
__pFont->GetTextExtent(__lastSelectedValue, __lastSelectedValue.GetLength(), oldTextDim);
+ newTextDim.width += 2.0f;
+ oldTextDim.width += 2.0f;
+
if (newTextDim.width > oldTextDim.width)
{
if (r != E_SUCCESS)
{
pNewVisualElement->Destroy();
+ pNewVisualElement = null;
}
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
if (pOldVisualElement == null)
{
pNewVisualElement->Destroy();
+ pNewVisualElement = null;
}
SysTryCatch(NID_UI_CTRL, (pOldVisualElement != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
{
pNewVisualElement->Destroy();
pOldVisualElement->Destroy();
+ pNewVisualElement = null;
+ pOldVisualElement = null;
}
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
__pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
pNewVisualElement->SetBounds(FloatRectangle(0.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
- rect.x = static_cast<int>(__pContentProvider->GetBounds().x);
- rect.y = static_cast<int>(__pContentProvider->GetBounds().y);
- rect.width = static_cast<int>(__pContentProvider->GetBounds().width);
- rect.height = static_cast<int>(__pContentProvider->GetBounds().height);
+ rect.width = __pContentProvider->GetBounds().width;
+ rect.height = __pContentProvider->GetBounds().height;
textPoint.x = (rect.width - oldTextDim.width) / 2.0f;
textPoint.y = (rect.height - oldTextDim.height) / 2.0f;
+ rect.x = __pContentProvider->GetBounds().x - 2.0f;
+ rect.y = __pContentProvider->GetBounds().y;
+ rect.width = __pContentProvider->GetBounds().width + 4.0f;
+
pOldVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
}
else
__pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
pOldVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
- rect.x = static_cast<int>(__pContentProvider->GetBounds().x);
- rect.y = static_cast<int>(__pContentProvider->GetBounds().y);
- rect.width = static_cast<int>(__pContentProvider->GetBounds().width);
- rect.height = static_cast<int>(__pContentProvider->GetBounds().height);
+ rect.width = __pContentProvider->GetBounds().width;
+ rect.height = __pContentProvider->GetBounds().height;
textPoint.x = (rect.width - newTextDim.width) / 2.0f;
textPoint.y = (rect.height - newTextDim.height) / 2.0f;
+ rect.x = __pContentProvider->GetBounds().x - 2.0f;
+ rect.y = __pContentProvider->GetBounds().y;
+ rect.width = __pContentProvider->GetBounds().width + 4.0f;
+
pNewVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
}
-
pCanvas = pEditDateElement->GetCanvasN(rect);
pCanvas->SetBackgroundColor(contentBgColor);
pCanvas->Clear();
delete pCanvas;
+ pCanvas = null;
pEditDateElement->AttachChild(*__pContentProvider);
CATCH:
__isAnimating = false;
__pContentProvider->Destroy();
+ __pContentProvider = null;
delete pNewBoundsAnimation;
pNewBoundsAnimation = null;
pEditDateElement->DetachChild(*__pContentProvider);
__pContentProvider->Destroy();
+ __pContentProvider = null;
Draw();
return;
}
}
+ if (GetSearchBarFlag() && __pEdit->IsFocused() && __pEdit->IsSearchFieldFocused())
+ {
+ Bitmap* pFocusBitmap = null;
+ Bitmap* pReplacementColorFocusBitmap = null;
+
+ Color focusColor;
+ GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_FOCUS, focusColor);
+
+ pFocusBitmap = __pEdit->GetDefaultFocusBitmap();
+
+ pReplacementColorFocusBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pFocusBitmap, Color::GetColor(COLOR_ID_MAGENTA), focusColor);
+
+ if (pReplacementColorFocusBitmap)
+ {
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pReplacementColorFocusBitmap))
+ {
+ canvas.DrawNinePatchedBitmap(editRect, *pReplacementColorFocusBitmap);
+ }
+ else
+ {
+ canvas.DrawBitmap(editRect, *pReplacementColorFocusBitmap);
+ }
+ }
+
+ delete pReplacementColorFocusBitmap;
+ pReplacementColorFocusBitmap = null;
+ }
+
+
if (borderRoundEnable)
{
if (pEditBgBitmap)
__pGuideTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
}
+ __pEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT);
+
return r;
}
void
_EditTimePresenter::Animate(void)
{
+ SysTryReturnVoidResult(NID_UI_CTRL, !__isAnimating, E_SUCCESS, "Rolling animation is in progress.");
SysAssertf((__pFont != null), "Font instance must not be null.");
(_FontImpl::GetInstance(*__pFont))->SetSize(__timeFontSize);
if (r != E_SUCCESS)
{
pNewVisualElement->Destroy();
+ pNewVisualElement = null;
}
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
if (pOldVisualElement == null)
{
pNewVisualElement->Destroy();
+ pNewVisualElement = null;
}
SysTryCatch(NID_UI_CTRL, (pOldVisualElement != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
{
pNewVisualElement->Destroy();
pOldVisualElement->Destroy();
+ pNewVisualElement = null;
+ pOldVisualElement = null;
}
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
CATCH:
__isAnimating = false;
__pContentProvider->Destroy();
+ __pContentProvider = null;
delete pNewBoundsAnimation;
pNewBoundsAnimation = null;
pEditTimeElement->DetachChild(*__pContentProvider);
__pContentProvider->Destroy();
+ __pContentProvider = null;
Draw();
return;
#include "FUi_AccessibilityElement.h"
#include "FUi_AccessibilityManager.h"
#include "FUi_CoordinateSystemUtils.h"
+#include "FUiCtrl_SearchBarImpl.h"
+#include "FUiCtrl_EditFieldImpl.h"
+#include "FUiCtrl_ButtonImpl.h"
+#include <FSys_SettingInfoImpl.h>
+
using namespace Tizen::Graphics;
using namespace Tizen::Ui;
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
using namespace Tizen::Locales;
+using namespace Tizen::System;
namespace Tizen { namespace Ui { namespace Controls
{
, __isUserGuideTextColor(false)
, __isKeypadOpening(false)
, __isupdateContentBounds(false)
+ , __isKeyPressed(false)
+ , __isFocusCallbackToBeFired(true)
+ , __isButtonTextChangedByApp(false)
, __keypadAction(CORE_KEYPAD_ACTION_SEARCH)
, __pBackgroundBitmap(null)
, __backgroundColor(Color())
_SearchBar::~_SearchBar(void)
{
+ SettingInfo::RemoveSettingEventListener(*this);
delete __pSearchBarPresenter;
__pSearchBarPresenter = null;
- if (__pEdit)
- {
- __pEdit->HideKeypad();
-
- __pClippedGroupControl->DetachChild(*__pEdit);
-
- delete __pEdit;
- __pEdit = null;
- }
-
- if (__pCancelButton)
- {
- __pClippedGroupControl->DetachChild(*__pCancelButton);
-
- delete __pCancelButton;
- __pCancelButton = null;
- }
-
if (__pClippedGroupControl)
{
DetachChild(*__pClippedGroupControl);
__pSearchBarPresenter = pPresenter;
CreateAccessibilityElement();
+
+ r = _SettingInfoImpl::AddSettingEventListener(*this);
+ SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
return r;
CATCH:
editBounds.width = (editBounds.width > searchBarMinWidthModeNormal) ? editBounds.width : searchBarMinWidthModeNormal;
editBounds.height = (editBounds.height > searchFieldMinHeight) ? editBounds.height : searchFieldMinHeight;
- __pEdit = _Edit::CreateEditN();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ _SearchBarImpl* pSearchBarImpl = static_cast<_SearchBarImpl*>(GetUserData());
+ __pEdit = &(pSearchBarImpl->GetEditFieldImpl()->GetCore());
- r = __pEdit->Initialize(EDIT_STYLE_NORMAL | EDIT_STYLE_SINGLE_LINE | EDIT_STYLE_CLEAR | EDIT_STYLE_NOSCROLL, INPUT_STYLE_OVERLAY,
- SEARCHBAR_TEXT_LENGTH_MAX);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, __pEdit != null, E_SYSTEM,
+ "[E_SYSTEM] A system error has occured. Failed to get _Edit instance");
__pEdit->SetKeypadCommandButtonVisible(false);
__pEdit->SetBounds(editBounds);
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
- __pCancelButton = _Button::CreateButtonN();
+ _SearchBarImpl* pSearchBarImpl = static_cast<_SearchBarImpl*>(GetUserData());
+ __pCancelButton = &(pSearchBarImpl->GetButtonImpl()->GetCore());
+
+ SysTryReturnResult(NID_UI_CTRL, __pCancelButton != null, E_SYSTEM,
+ "[E_SYSTEM] A system error has occured. Failed to get _Edit instance");
+
r = GetLastResult();
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
result
_SearchBar::SetButtonText(const String& text)
{
+ __isButtonTextChangedByApp = true;
SysTryReturn(NID_UI_CTRL, __pCancelButton, E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] A system error has occurred. The cancel button instance is null.");
return _UI_TOUCH_EVENT_DELIVERY_YES;
}
- SetMode(SEARCH_BAR_MODE_INPUT);
-
return _UI_TOUCH_EVENT_DELIVERY_YES;
}
__pKeypadEvent->Fire(*pEventArg);
}
+ __isKeypadOpening = false;
+
SetContentsArea();
return;
}
bool
_SearchBar::OnFocusGained(const _Control& source)
{
+ if (__isKeyPressed)
+ {
+ __isKeyPressed = false;
+ _Control::OnDrawFocus();
+
+ return true;
+ }
+
if (GetVisibleState() == true)
{
- SetMode(SEARCH_BAR_MODE_INPUT);
__pEdit->SetFocused();
}
- return false;
+ return true;
}
bool
-_SearchBar::OnFocusLost(const _Control& source)
+_SearchBar::OnFocusLost(const _Control &source)
{
- return false;
+ __pEdit->SetSearchFieldFocus(false);
+ _Control::OnFocusLost(source);
+ return true;
}
bool
_SearchBar::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
{
- if (!__pEdit->IsUsbKeyboardConnected())
- {
- return false;
- }
-
_KeyCode keyCode = keyInfo.GetKeyCode();
if (keyCode == _KEY_RIGHT)
{
- if (__isButtonEnabled)
+ if (GetMode() == SEARCH_BAR_MODE_NORMAL)
+ {
+ __pEdit->SetFocused();
+ return true;
+ }
+
+ if (!__isButtonEnabled || __pCancelButton->IsFocused() || !__isUsableCancelButton)
{
- __pEdit->SetFocused(false);
- __pCancelButton->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
- __pCancelButton->SetFocused();
- __pCancelButton->Invalidate(true);
+ return true;
}
+ __pCancelButton->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+ SetFocusCallBackParameter(false);
+ __pCancelButton->SetFocused();
+ __pCancelButton->Invalidate(true);
+
return true;
}
if (__pCancelButton->GetButtonStatus() == _BUTTON_STATUS_HIGHLIGHTED)
{
__pCancelButton->SetButtonStatus(_BUTTON_STATUS_NORMAL);
- __pCancelButton->SetFocused(false);
__pCancelButton->Invalidate();
-
+ __pEdit->SetFocused();
}
if (__pCancelButton->GetButtonStatus() == _BUTTON_STATUS_DISABLED) //Searchbar Button is disabled, left arrow key is pressed
{
__pCancelButton->SetButtonStatus(_BUTTON_STATUS_NORMAL);
SetButtonEnabled(false);
+ __pEdit->SetFocused();
}
- __pEdit->SetFocused();
+ return true;
+ }
+
+ if (keyCode == _KEY_ENTER || keyCode == _KEY_TAB)
+ {
+ if (GetMode() == SEARCH_BAR_MODE_NORMAL)
+ {
+ return false;
+ }
+
+ SetMode(SEARCH_BAR_MODE_NORMAL);
+ __isKeyPressed = true;
+ SetFocused();
return true;
}
return false;
}
-bool
-_SearchBar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+void
+_SearchBar::OnSettingChanged(Tizen::Base::String& key)
{
- return false;
+ if (__isButtonTextChangedByApp || !__isUsableCancelButton)
+ {
+ return;
+ }
+
+ if (key.Equals(L"http://tizen.org/setting/locale.language", false))
+ {
+ String cancelText;
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, cancelText);
+ __pCancelButton->SetText(cancelText);
+ __pCancelButton->Invalidate();
+ }
+
+ return;
}
_Control*
__pAccessibilitySearchBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
__pAccessibilitySearchBarElement->SetName("SearchBar");
pContainer->AddElement(*__pAccessibilitySearchBarElement);
- }
+ }
return;
}
return;
}
+void
+_SearchBar::OnDrawFocus(void)
+{
+ __pEdit->SetSearchFieldFocus(true);
+ return;
+}
+
bool
_SearchBar::IsContentAttachable(const _Control* pContent)
{
return;
}
+void
+_SearchBar::SetFocusCallBackParameter(bool state)
+{
+ __isFocusCallbackToBeFired = state;
+ return;
+}
+
+bool
+_SearchBar::IsFocusCallBackToBeFired(void) const
+{
+ return __isFocusCallbackToBeFired;
+}
}}} // Tizen::Ui::Controls
#include "FUiCtrl_PublicTextEvent.h"
#include "FUiCtrl_SearchBarImpl.h"
#include "FUi_CoordinateSystemUtils.h"
+#include "FUiCtrl_EditFieldImpl.h"
+#include "FUiCtrl_ButtonImpl.h"
using namespace Tizen::App;
using namespace Tizen::Base;
_SearchBarImpl::_SearchBarImpl(SearchBar* pPublic, _SearchBar* pCore)
: _ControlImpl(pPublic, pCore)
, __pSearchBar(pCore)
+ , __pEditField(null)
+ , __pButton(null)
, __pContentControl(null)
, __pPublicActionEvent(null)
, __pPublicKeypadEvent(null)
, __pPublicTextEvent(null)
, __pPublicSearchBarEvent(null)
, __pPublicLanguageEvent(null)
+ , __pPublicFocusEventListeners(null)
{
ClearLastResult();
}
delete __pPublicSearchBarEvent;
__pPublicSearchBarEvent = null;
}
+
+ if (__pEditField)
+ {
+ delete __pEditField;
+ __pEditField = null;
+ }
+
+ if (__pButton)
+ {
+ delete __pButton;
+ __pButton = null;
+ }
+
+ if (__pPublicFocusEventListeners)
+ {
+ delete __pPublicFocusEventListeners;
+ __pPublicFocusEventListeners = null;
+ }
}
_SearchBarImpl*
break;
}
+ __pEditField = new (std::nothrow) EditField();
+ SysTryReturnResult(NID_UI_CTRL, __pEditField, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocate memory.");
+
+ r = __pEditField->Construct(GetBoundsF(), EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY, EDIT_FIELD_TITLE_STYLE_NONE, true);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pEditField->AddFocusEventListener(*this);
+ SysTryReturnResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ __pEditField->AddKeyEventListener(*this);
+ SysTryReturnResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ __pEditFieldImpl = _EditFieldImpl::GetInstance(*__pEditField);
+ SysTryReturnResult(NID_UI_CTRL, __pEditFieldImpl != null, E_SYSTEM,
+ "[E_SYSTEM] A system error has occured. Failed to EditFieldImpl instance");
+
+ String cancelButtonText;
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, cancelButtonText);
+
+ __pButton = new (std::nothrow) Button();
+ SysTryReturnResult(NID_UI_CTRL, __pButton, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocate memory.");
+
+ r = __pButton->Construct(GetBoundsF(), cancelButtonText);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pButton->AddFocusEventListener(*this);
+ SysTryReturnResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ __pButtonImpl = _ButtonImpl::GetInstance(*__pButton);
+ SysTryReturnResult(NID_UI_CTRL, __pButtonImpl != null, E_SYSTEM,
+ "[E_SYSTEM] A system error has occured. Failed to ButtonImpl instance");
+
r = __pSearchBar->Initialize(enableSearchBarButton, coreKeypadAction);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
r = __pSearchBar->AddLanguageEventListener(*this);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ __pPublicFocusEventListeners = CreatePublicEventListenerListN();
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
return r;
}
return;
}
+void
+_SearchBarImpl::OnFocusEventListenerAdded(IFocusEventListener& listener)
+{
+ ClearLastResult();
+ SysTryReturnVoidResult(NID_UI,
+ __pPublicFocusEventListeners->Add(const_cast <IFocusEventListener*>(&listener)) == E_SUCCESS, E_SYSTEM,
+ "[E_SYSTEM] A system error has occured. Failed to add listener.");
+}
+
+void
+_SearchBarImpl::OnFocusEventListenerRemoved(IFocusEventListener& listener)
+{
+ ClearLastResult();
+ SysTryReturnVoidResult(NID_UI,
+ __pPublicFocusEventListeners->Remove(&listener) == E_SUCCESS, E_SYSTEM,
+ "[E_SYSTEM] A system error has occured. Failed to remove listener.");
+}
+
+void
+_SearchBarImpl::OnFocusGained(const Tizen::Ui::Control& source)
+{
+ SetMode(SEARCH_BAR_MODE_INPUT);
+
+ if (!__pSearchBar->IsFocusCallBackToBeFired())
+ {
+ return;
+ }
+
+ IEnumeratorT<IEventListener*>* pEnumerator = __pPublicFocusEventListeners->GetEnumeratorN();
+ if (pEnumerator)
+ {
+ while (pEnumerator->MoveNext() == E_SUCCESS)
+ {
+ IEventListener* pListener = null;
+ pEnumerator->GetCurrent(pListener);
+
+ IFocusEventListener* pFocusEventListener = dynamic_cast <IFocusEventListener*>(pListener);
+
+ if (pFocusEventListener != null )
+ {
+ pFocusEventListener->OnFocusGained(GetPublic());
+ }
+ }
+
+ delete pEnumerator;
+ }
+
+ return;
+}
+
+void
+_SearchBarImpl::OnFocusLost(const Tizen::Ui::Control& source)
+{
+ if (&source == __pEditField && __pButtonImpl->GetCore().GetButtonStatus() != _BUTTON_STATUS_HIGHLIGHTED) //Focus is lost from Edit, and button state is not Highlighted
+ {
+ SetMode(SEARCH_BAR_MODE_NORMAL);
+ }
+
+ if (&source == __pButton) //Button is highlighted and a touch is performed on Edit.
+ {
+ if (__pButtonImpl->GetCore().GetButtonStatus() == _BUTTON_STATUS_HIGHLIGHTED)
+ {
+ __pButtonImpl->GetCore().SetButtonStatus(_BUTTON_STATUS_NORMAL);
+ __pButtonImpl->GetCore().Invalidate();
+ }
+ }
+
+ if (!__pSearchBar->IsFocusCallBackToBeFired())
+ {
+ return;
+ }
+
+ IEnumeratorT<IEventListener*>* pEnumerator = __pPublicFocusEventListeners->GetEnumeratorN();
+ if (pEnumerator)
+ {
+ while (pEnumerator->MoveNext() == E_SUCCESS)
+ {
+ IEventListener* pListener = null;
+ pEnumerator->GetCurrent(pListener);
+
+ IFocusEventListener* pFocusEventListener = dynamic_cast <IFocusEventListener*>(pListener);
+
+ if (pFocusEventListener != null )
+ {
+ pFocusEventListener->OnFocusLost(GetPublic());
+ }
+ }
+
+ delete pEnumerator;
+ }
+
+ return;
+}
+
+void
+_SearchBarImpl::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
+{
+ IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
+ if (pEnumerator)
+ {
+ while (pEnumerator->MoveNext() == E_SUCCESS)
+ {
+ IEventListener* pListener = null;
+ pEnumerator->GetCurrent(pListener);
+
+ IKeyEventListener* pKeyEventListener = dynamic_cast <IKeyEventListener*>(pListener);
+
+ if (pKeyEventListener != null )
+ {
+ pKeyEventListener->OnKeyPressed(GetPublic(), keyCode);
+ }
+ }
+
+ delete pEnumerator;
+ }
+
+ return;
+}
+
+void
+_SearchBarImpl::OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
+{
+ IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
+ if (pEnumerator)
+ {
+ while (pEnumerator->MoveNext() == E_SUCCESS)
+ {
+ IEventListener* pListener = null;
+ pEnumerator->GetCurrent(pListener);
+
+ IKeyEventListener* pKeyEventListener = dynamic_cast <IKeyEventListener*>(pListener);
+
+ if (pKeyEventListener != null )
+ {
+ pKeyEventListener->OnKeyReleased(GetPublic(), keyCode);
+ }
+ }
+
+ delete pEnumerator;
+ }
+
+ return;
+}
+
+void
+_SearchBarImpl::OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
+{
+ IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
+ if (pEnumerator)
+ {
+ while (pEnumerator->MoveNext() == E_SUCCESS)
+ {
+ IEventListener* pListener = null;
+ pEnumerator->GetCurrent(pListener);
+
+ IKeyEventListener* pKeyEventListener = dynamic_cast <IKeyEventListener*>(pListener);
+
+ if (pKeyEventListener != null )
+ {
+ pKeyEventListener->OnKeyLongPressed(GetPublic(), keyCode);
+ }
+ }
+
+ delete pEnumerator;
+ }
+
+ return;
+}
+
KeypadAction
_SearchBarImpl::ConvertKeypadAction(CoreKeypadAction keypadAction) const
{
return publicKeypadAction;
}
+_EditFieldImpl*
+_SearchBarImpl::GetEditFieldImpl(void) const
+{
+ return __pEditFieldImpl;
+}
+
+_ButtonImpl*
+_SearchBarImpl::GetButtonImpl(void) const
+{
+ return __pButtonImpl;
+}
+
class _SearchBarMaker
: public _UiBuilderControlMaker
{
delete __pSearchBarModel;
__pSearchBarModel = null;
- if (__pIconElement)
- {
- __pIconElement->Destroy();
- __pIconElement = null;
- }
-
if (__pReplacedSearchFieldNormalBitmap)
{
delete __pReplacedSearchFieldNormalBitmap;
if (mode == SEARCH_BAR_MODE_NORMAL)
{
+ __pSearchBar->SetFocusCallBackParameter(true);
InitializeViewModeLayout();
SetCancelButtonVisible(false);
SetContainerVisible(false);
{
__pEdit->ClearText();
__pEdit->SetBounds(__searchFieldBounds);
- __pEdit->HideKeypad();
+ if (__pEdit->IsFocused())
+ {
+ __pEdit->HideKeypad();
+ }
}
r = __pSearchBar->SendSearchBarEvent(_SEARCH_BAR_EVENT_MODE_CHANGE);
, __loadedCount(0)
, __isFullUpdate(false)
, __pItemProvider(null)
+ , __isUnloading(false)
, __directDelete(false)
, __forceScroll(false)
, __isCreating(false)
, __groupItemHeight(0)
, __itemCacheSize(0)
, __pItemFormat(null)
- , __isUnloading(false)
{
}
#include <FBaseString.h>
#include <FBaseSysLog.h>
#include <FGrp_BitmapImpl.h>
+#include <FGrp_CoordinateSystemUtils.h>
#include "FUi_ResourceManager.h"
#include "FUi_UiTouchEvent.h"
#include "FUi_TouchTapGestureDetector.h"
#include "FUi_AccessibilityElement.h"
#include "FUiCtrl_SplitPanel.h"
#include "FUiCtrl_SplitPanelPresenter.h"
-#include "FGrp_CoordinateSystemUtils.h"
using namespace Tizen::Ui;
using namespace Tizen::Graphics;
, __splitPanelDividerDirection(SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
, __pSplitPanelEvent(null)
, __dividerTapCount(0)
+ , __isFocusModeEnabled(false)
, __pAccessibilityElement(null)
, __pDividerVisualElement(null)
{
bool
_SplitPanel::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
{
+ if (__isFocusModeEnabled == false)
+ {
+ return false;
+ }
+
return __pSplitPanelPresenter->OnKeyPressed(source, keyInfo);
}
bool
_SplitPanel::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
{
+ if (__isFocusModeEnabled == false)
+ {
+ return false;
+ }
+
return __pSplitPanelPresenter->OnKeyReleased(source, keyInfo);
}
void
_SplitPanel::OnDrawFocus(void)
{
+ __isFocusModeEnabled = true;
__pSplitPanelPresenter->DrawFocus();
return;
}
_SplitPanel::OnFocusLost(const _Control& source)
{
result r = __pSplitPanelPresenter->ReleaseFocus();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
_Control::OnFocusLost(source);
return true;
}
+void
+_SplitPanel::OnFocusModeStateChanged(void)
+{
+ __isFocusModeEnabled = false;
+ __pSplitPanelPresenter->ReleaseFocus();
+
+ return;
+}
+
result
_SplitPanel::SetPane(_Control* pControl, SplitPanelPaneOrder paneOrder)
{
#include <FUiCtrlSplitPanelTypes.h>
#include <FBaseSysLog.h>
#include <FGrp_BitmapImpl.h>
+#include <FGrp_CoordinateSystemUtils.h>
#include "FUi_ResourceManager.h"
#include "FUi_UiTouchEvent.h"
#include "FUiCtrl_SplitPanelPresenter.h"
#include "FUiCtrl_SplitPanel.h"
#include "FUiCtrl_SplitPanelImpl.h"
-#include "FGrp_CoordinateSystemUtils.h"
using namespace Tizen::Ui;
using namespace Tizen::Graphics;
{
FloatPoint point(0.0f, 0.0f);
- ReleaseFocus();
-
point = touchinfo.GetCurrentPosition();
if (CheckDividerTouchRegion(point.x, point.y) == true)
bool
_SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
{
- ReleaseFocus();
-
if (__splitPanelDividerPressed == true)
{
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
FloatPoint point(0.0f, 0.0f);
Bitmap* pThumbBitmap = null;
- ReleaseFocus();
-
if (__pSplitPanel != &source || __splitPanelDividerPressed == false )
{
return false;
DrawFocus(__currentFocusedPane);
}
}
+ else if (keyCode == _KEY_TAB && !__pSplitPanel->IsFocused())
+ {
+ __pSplitPanel->SetFocused(true);
+ }
else
{
return false;
_SplitPanelPresenter::DrawFocus(SplitPanelPaneOrder focusedPane)
{
result r = E_SUCCESS;
- Canvas* pSplitPanelCanvas = null;
+ Canvas* pCanvas = null;
FloatRectangle currentFocusBounds(0.0f, 0.0f, 0.0f, 0.0f);
_Control* pControl = null;
if (pControl != null)
{
- pControl->SetFocused();
- pControl->DrawFocus();
- }
- else
- {
- pSplitPanelCanvas = __pSplitPanel->GetCanvasN();
- SysTryReturnResult(NID_UI_CTRL, (pSplitPanelCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of SplitPanel.");
-
- //give focus
- if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pFocusBitmap))
+ if (pControl->IsFocusable())
{
- r = pSplitPanelCanvas->DrawNinePatchedBitmap(currentFocusBounds, *__pFocusBitmap);
- SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ pControl->SetFocused(true);
+ pControl->DrawFocus();
+
+ return r;
}
else
{
- r = pSplitPanelCanvas->DrawBitmap(currentFocusBounds, *__pFocusBitmap);
- SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ __pSplitPanel->SetFocused(true);
+ currentFocusBounds = pControl->GetBoundsF();
+
+ pCanvas = pControl->GetCanvasN();
+ SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of Control.");
}
+ }
+ else
+ {
+ __pSplitPanel->SetFocused(true);
+
+ pCanvas = __pSplitPanel->GetCanvasN();
+ SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of SplitPanel.");
+ }
- delete pSplitPanelCanvas;
+ //give focus
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pFocusBitmap))
+ {
+ r = pCanvas->DrawNinePatchedBitmap(currentFocusBounds, *__pFocusBitmap);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ else
+ {
+ r = pCanvas->DrawBitmap(currentFocusBounds, *__pFocusBitmap);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
+ delete pCanvas;
+
return r;
CATCH:
- delete pSplitPanelCanvas;
+ delete pCanvas;
return r;
}
}
else
{
- return r;
+ _Control* pFocusedControl = __pSplitPanel->GetPane(__currentFocusedPane);
+ if (pFocusedControl != null)
+ {
+ if (!pFocusedControl->IsFocusable())
+ {
+ Canvas* pPaneCanvas = pFocusedControl->GetCanvasN();
+ SysTryReturnResult(NID_UI_CTRL, (pPaneCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of SplitPanel.");
+
+ panebounds = pFocusedControl->GetBoundsF();
+
+ pPaneCanvas->SetBackgroundColor(pFocusedControl->GetBackgroundColor());
+ pPaneCanvas->Clear(panebounds);
+
+ delete pPaneCanvas;
+ }
+
+ if(!__pSplitPanel->IsFocused())
+ {
+ pFocusedControl->SetFocused(false);
+ __pSplitPanel->SetFocused(true);
+ }
+
+ return r;
+ }
}
pSplitPanelCanvas = __pSplitPanel->GetCanvasN();
_Tab::_Tab(void)
: __pTabPresenter(null)
+ , __isInFocusMode(false)
, __style(_TAB_STYLE_TEXT)
, __currentHighlightedItemIndex(-1)
, __tabStatus(_TAB_STATUS_NORMAL)
{
__pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
}
- if(GetItemCount() > 0)
+ if (GetItemCount() > 0)
{
__currentHighlightedItemIndex = 0;
}
return __pTabPresenter->IsEditModeEnabled();
}
+bool
+_Tab::IsInFocusMode(void) const
+{
+ return __isInFocusMode;
+}
+
result
_Tab::SetBackgroundBitmap(const Bitmap& bitmap)
{
{
return true;
}
-
- if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
- {
- __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
- }
- __currentHighlightedItemIndex = -1;
-
return __pTabPresenter->OnTouchPressed(source, touchinfo);
}
}
_KeyCode keyCode = keyInfo.GetKeyCode();
int itemCount = __pTabPresenter->GetItemCount();
- if(itemCount == 0)
+ if (itemCount == 0 || __isInFocusMode == false)
{
return false;
}
return false;
}
-bool
-_Tab::OnFocusGained(const _Control & source)
+void
+_Tab::OnDrawFocus(void)
{
- if (this != &source)
- {
- return false;
- }
-
- if(__pTabPresenter->GetItemCount() > 0)
+ if (__pTabPresenter->GetItemCount() > 0)
{
__currentHighlightedItemIndex = 0;
}
{
__currentHighlightedItemIndex = -1;
}
- return true;
-}
-
-bool
-_Tab::OnFocusLost(const _Control & source)
-{
- if (this != &source)
+ if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
{
- return false;
+ __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_HIGHLIGHTED);
}
+ __pTabPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
+ __isInFocusMode = true;
+ return;
+}
+void
+_Tab::OnFocusModeStateChanged(void)
+{
if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
{
__pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
}
__currentHighlightedItemIndex = -1;
+ __isInFocusMode = false;
Invalidate();
- return true;
-}
-
-void
-_Tab::OnDrawFocus()
-{
- if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
- {
- __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_HIGHLIGHTED);
- }
- __pTabPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
- return;
}
void
DrawItem(pCanvas);
}
- if (__pTab->GetCurrentHighlightedItemIndex() > -1 && __pTab->IsFocused() && GetItemCount() > 0)
+ if (__pTab->GetCurrentHighlightedItemIndex() > -1 && __pTab->IsInFocusMode() == true && GetItemCount() > 0)
{
DrawResourceBitmap(*pCanvas, GetItemAt(__pTab->GetCurrentHighlightedItemIndex())->GetItemBounds(), __pFocusBitmap);
}
, __pTokenEditPresenter(null)
, __isSelectedTokenTextColorSet(false)
, __pTokenFilter(null)
- , __pDescriptionTextAccessibilityElement(null)
- , __pHiddenTokenCountAccessibilityElement(null)
- , __pExpandableButtonAccessibilityElement(null)
+ , __pTitleTextAccessibilityElement(null)
+ , __pCursorAccessibilityElement(null)
{
GET_COLOR_CONFIG(TOKENEDIT::BG_NORMAL, __tokenColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL]);
GET_COLOR_CONFIG(TOKENEDIT::BG_SELECTED, __tokenColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED]);
{
result r = E_SUCCESS;
- __pTokenFilter = const_cast <_ITokenFilter*>(pFilter);
+ __pTokenFilter = const_cast< _ITokenFilter* >(pFilter);
return r;
}
switch (status)
{
- case EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL :
+ case EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL:
var = GetProperty("normalTokenColor");
break;
- case EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED :
+ case EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED:
var = GetProperty("selectedTokenColor");
break;
- default :
+ default:
break;
}
switch (status)
{
- case EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL :
+ case EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL:
r = SetProperty("normalTokenColor", var);
break;
- case EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED :
+ case EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED:
r = SetProperty("selectedTokenColor", var);
break;
- default :
+ default:
break;
}
__pTokenEditPresenter->SetDescriptionText(title);
r = __pTokenEditPresenter->CalculateDescriptionTextRect(title);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
r = __pTokenEditPresenter->CalculateTokenPositionFromIndex(0);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
r = __pTokenEditPresenter->SetInitialBounds();
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
Invalidate(true);
return r;
ClearLastResult();
__tokenTextColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL] = color.ToColor();
- if(!__isSelectedTokenTextColorSet)
+ if (!__isSelectedTokenTextColorSet)
+ {
__tokenTextColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED] = color.ToColor();
+ }
return E_SUCCESS;
}
return Variant(__tokenTextColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED]);
}
-
result
_TokenEdit::SetPropertyTokenEditModeEnabled(const Variant& enable)
{
pContainer = GetAccessibilityContainer();
if (pContainer)
{
- if (__pDescriptionTextAccessibilityElement)
+ if (__pTitleTextAccessibilityElement)
{
return E_SUCCESS;
}
+ pContainer->AddListener(*this);
+ UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT);
+ }
- if (GetEditStyle() & EDIT_STYLE_TITLE_LEFT)
- {
- __pDescriptionTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
- if (__pDescriptionTextAccessibilityElement)
- {
- __pDescriptionTextAccessibilityElement->SetTrait(L"Edit field");
- pContainer->AddElement(*__pDescriptionTextAccessibilityElement);
- }
- }
+ return E_SUCCESS;
+}
+
+void
+_TokenEdit::OnBoundsChanged(void)
+{
+ SysAssertf(__pTokenEditPresenter != null, "_TokenEditPresenter instance is null");
+
+ __pTokenEditPresenter->OnBoundsChanged();
+
+ return;
+}
+
+bool
+_TokenEdit::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return false;
+}
+
+bool
+_TokenEdit::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return false;
+}
+
+bool
+_TokenEdit::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return false;
+}
+
+bool
+_TokenEdit::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return false;
+}
+
+bool
+_TokenEdit::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return __pTokenEditPresenter->OnAccessibilityFocusIn(control, element);
+}
+
+bool
+_TokenEdit::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return __pTokenEditPresenter->OnAccessibilityFocusOut(control, element);
+}
- if (IsAutoShrinkModeEnabled())
+bool
+_TokenEdit::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return false;
+}
+
+bool
+_TokenEdit::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return false;
+}
+
+bool
+_TokenEdit::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+{
+ return false;
+}
+
+void
+_TokenEdit::UpdateAccessibilityElement(EditAccessibilityElementType type)
+{
+ _AccessibilityElement* pTextAccessibilityElement = _Edit::GetTextAccessibilityElement();
+ String spaceString(L" ");
+ switch (type)
+ {
+ case EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT:
+ if (pTextAccessibilityElement)
{
- __pHiddenTokenCountAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
- if (__pHiddenTokenCountAccessibilityElement)
+ pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
+ if (GetTokenCount())
{
- __pHiddenTokenCountAccessibilityElement->SetTrait(L"Edit field");
- pContainer->AddElement(*__pHiddenTokenCountAccessibilityElement);
+ pTextAccessibilityElement->SetLabel(GetTitleText() + spaceString + __pTokenEditPresenter->GetTextAccessibilityElementText());
}
-
- __pExpandableButtonAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
- if (__pExpandableButtonAccessibilityElement)
+ else
{
- __pExpandableButtonAccessibilityElement->SetTrait(L"EXPAND BUTTON");
- pContainer->AddElement(*__pExpandableButtonAccessibilityElement);
+ pTextAccessibilityElement->SetLabel(GetTitleText() + spaceString + GetGuideText() + GetText());
}
+ pTextAccessibilityElement->SetHint(L"double tap to edit");
}
+ break;
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+_AccessibilityElement*
+_TokenEdit::GetTitleTextAccessibilityElement(void) const
+{
+ return __pTitleTextAccessibilityElement;
+}
+
+_AccessibilityElement*
+_TokenEdit::GetCursorAccessibilityElement(void) const
+{
+ return __pCursorAccessibilityElement;
+}
+
+result
+_TokenEdit::AddTitleAccessibilityElement(void)
+{
+ result r = E_SUCCESS;
+
+ if (!(GetEditStyle() & EDIT_STYLE_TITLE_LEFT))
+ {
+ return r;
}
+ if (__pTitleTextAccessibilityElement)
+ {
+ return r;
+ }
+
+ _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+
+ 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 = GetTitleText();
+ pAccessibilityElement->SetBounds(__pTokenEditPresenter->GetDescriptionTextRect());
+ pAccessibilityElement->SetLabel(labelText);
+ pContainer->AddElement(*pAccessibilityElement);
+ __pTitleTextAccessibilityElement = pAccessibilityElement;
+ }
+
+ return r;
+}
+
+result
+_TokenEdit::AddCursorAccessibilityElement(void)
+{
+ result r = E_SUCCESS;
+
+ if (__pCursorAccessibilityElement)
+ {
+ return r;
+ }
+
+ _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+
+ 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.");
+
+ if (GetTextLength())
+ {
+ pAccessibilityElement->SetLabel(GetText());
+ }
+ else
+ {
+ pAccessibilityElement->SetTrait(L"Edit field");
+ }
+
+ pContainer->AddElement(*pAccessibilityElement);
+
+ __pCursorAccessibilityElement = pAccessibilityElement;
+
+ SetCursorAccessibilityBounds(__pTokenEditPresenter->GetTextBoundsF());
+ }
+
+ return r;
+}
+
+result
+_TokenEdit::SetCursorAccessibilityBounds(const FloatRectangle& cursorBounds)
+{
+ if (!__pCursorAccessibilityElement)
+ {
+ return E_SUCCESS;
+ }
+
+ if (IsInternalFocused()) // Set cursor as global focus accessibility element only in focused mode.
+ {
+ _AccessibilityManager::GetInstance()->SetGlobalFocusedElement(*__pCursorAccessibilityElement);
+ }
+ __pCursorAccessibilityElement->SetBounds(cursorBounds);
+
return E_SUCCESS;
}
void
-_TokenEdit::OnBoundsChanged(void)
+_TokenEdit::RemoveTitleAccessibilityElement(void)
{
- SysAssertf(__pTokenEditPresenter != null, "_TokenEditPresenter instance is null");
+ _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+ if (pContainer)
+ {
+ if (__pTitleTextAccessibilityElement)
+ {
+ pContainer->RemoveElement(*__pTitleTextAccessibilityElement);
+ __pTitleTextAccessibilityElement = null;
+ }
+ }
+}
- __pTokenEditPresenter->OnBoundsChanged();
+void
+_TokenEdit::RemoveCursorAccessibilityElement(void)
+{
+ _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+ if (pContainer)
+ {
+ if (__pCursorAccessibilityElement)
+ {
+ pContainer->RemoveElement(*__pCursorAccessibilityElement);
+ __pCursorAccessibilityElement = null;
+ }
+ }
+}
+
+void
+_TokenEdit::OnDrawFocus(void)
+{
+ //Exit Token editing/pressed mode
+ __pTokenEditPresenter->PrepareFocusUiMode();
+
+ __pTokenEditPresenter->SetDrawFocusState(true);
+
+ RefreshFocusUi();
return;
}
-}}} //Tizen::Ui::Controls
+void
+_TokenEdit::OnFocusModeStateChanged(void)
+{
+ //Reset focus index here
+ __pTokenEditPresenter->SetDrawFocusState(false);
+
+ return;
+}
+
+void
+_TokenEdit::RefreshFocusUi(void)
+{
+ int focusedTokenIndex = __pTokenEditPresenter->GetFocusedTokenIndex();
+
+ if (focusedTokenIndex == -1)
+ {
+ _Control::OnDrawFocus();
+ }
+ else
+ {
+ _Control::OnFocusLost(*this);
+ }
+ return;
+}
+}}} //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);
, __pTokenBgBitmap(null)
, __pTokenBgNormalEffectBitmap(null)
, __pTokenBgPressedEffectBitmap(null)
+ , __pTokenBgReplacementFocusBitmap(null)
+ , __pTokenBgFocusEffectBitmap(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()
+ , __focusedTokenIndex(-1)
+ , __drawFocusState(false)
{
}
{
result r = E_SUCCESS;
float descriptionTextSize = 0.0f;
- Font *pFont = null;
+ Font* pFont = null;
float editFontSize = 0.0f;
__pDescriptionTextTextObject = new (std::nothrow) TextObject();
delete __pTokenBgPressedEffectBitmap;
__pTokenBgPressedEffectBitmap = null;
+ delete __pTokenBgReplacementFocusBitmap;
+ __pTokenBgReplacementFocusBitmap = null;
+
+ delete __pTokenBgFocusEffectBitmap;
+ __pTokenBgFocusEffectBitmap = null;
+
if (__pDescriptionTextVisualElement)
{
__pDescriptionTextVisualElement->Destroy();
__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();
float tokenBottomMargin = 0.0f;
float tokenHeight = 0.0f;
_ControlOrientation orientation = __pTokenEdit->GetOrientation();
+ Color focusTokenColor;
+ Bitmap* pTokenBgFocusBitmap = null;
GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, leftMargin);
GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, rightMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
+ GET_COLOR_CONFIG(TOKENEDIT::BG_FOCUS, focusTokenColor);
// For drawing token in specific area
__clientRect.x = leftMargin;
r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_PRESSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTokenBgPressedEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, pTokenBgFocusBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pTokenBgReplacementFocusBitmap = _BitmapImpl::GetColorReplacedBitmapN(
+ *pTokenBgFocusBitmap,Color::GetColor(COLOR_ID_MAGENTA), focusTokenColor);
+ SysTryCatch(NID_UI_CTRL, __pTokenBgReplacementFocusBitmap != null, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_FOCUS_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTokenBgFocusEffectBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ delete pTokenBgFocusBitmap;
+ pTokenBgFocusBitmap = null;
+
+
__isTokenEditPresenterInitialized = true;
__previousCursorPosition = GetCursorPosition();
delete __pTokenBgNormalEffectBitmap;
__pTokenBgNormalEffectBitmap = null;
+ delete __pTokenBgPressedEffectBitmap;
+ __pTokenBgPressedEffectBitmap = null;
+
+ delete pTokenBgFocusBitmap;
+ pTokenBgFocusBitmap = null;
+
+ delete __pTokenBgReplacementFocusBitmap;
+ __pTokenBgReplacementFocusBitmap = null;
+
return r;
}
{
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;
float tokenTextLeftMargin = 0.0f;
float tokenVerticalSpacing = 0.0f;
bool isCustomBitmap = false;
+ bool isCustomFocusBitmap = false;
SysTryReturn(NID_UI_CTRL, __pTokenEdit != null, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenVerticalSpacing);
isCustomBitmap = IS_CUSTOM_BITMAP(TOKENEDIT::BG_NORMAL);
+ isCustomFocusBitmap = IS_CUSTOM_BITMAP(TOKENEDIT::BG_FOCUS);
+
+
+ if (__drawFocusState)
+ {
+ __pTokenEdit->RefreshFocusUi();
+ }
if (count == -1)
{
{
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");
}
}
+ if (__focusedTokenIndex == i && __drawFocusState && (!__isEditingToken))
+ {
+ if (__pTokenBgReplacementFocusBitmap)
+ {
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgReplacementFocusBitmap))
+ {
+ pTokenCanvas->DrawNinePatchedBitmap(tokenRect, *__pTokenBgReplacementFocusBitmap);
+ }
+ else
+ {
+ pTokenCanvas->DrawBitmap(tokenRect, *__pTokenBgReplacementFocusBitmap);
+ }
+ }
+
+ if (__pTokenBgFocusEffectBitmap && (!isCustomFocusBitmap))
+ {
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgFocusEffectBitmap))
+ {
+ pTokenCanvas->DrawNinePatchedBitmap(tokenRect, *__pTokenBgFocusEffectBitmap);
+ }
+ else
+ {
+ pTokenCanvas->DrawBitmap(tokenRect, *__pTokenBgFocusEffectBitmap);
+ }
+ }
+
+ }
+
pTokenElement->SetAnimationProvider(null);
if (pToken->isImplicitAnimation)
{
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)
{
__pressedTokenIndex++;
}
+ else if ((__focusedTokenIndex >= index) && __drawFocusState)
+ {
+ __focusedTokenIndex++;
+ }
}
return r;
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);
}
}
{
__pressedTokenIndex--;
}
+
+ if (__drawFocusState)
+ {
+ if (index == __focusedTokenIndex)
+ {
+ __focusedTokenIndex = -1;
+ StopCursorTimer();
+ SetCursorDisabled(false);
+ StartCursorTimer();
+ }
+ else if(index >= 0 && index < __focusedTokenIndex)
+ {
+ __focusedTokenIndex--;
+ }
+ }
}
else if (index == __pressedTokenIndex)
{
SetCursorDisabled(false);
StartCursorTimer();
}
+ else if ((index == __focusedTokenIndex) && __drawFocusState)
+ {
+ __focusedTokenIndex = -1;
+ StopCursorTimer();
+ SetCursorDisabled(false);
+ StartCursorTimer();
+ }
return r;
}
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);
if ((__isEditingToken == true) && (__pressedTokenIndex != -1))
{
- _VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
- SysTryReturnResult(NID_UI_CTRL, pEditVisualElement, E_SYSTEM, "A system error has occurred. Failed to get root visual element.");
-
- _VisualElement* pCursorVisualElement = GetCursorVisualElement();
- SysTryReturnResult(NID_UI_CTRL, pCursorVisualElement, E_SYSTEM, "A system error has occurred. Failed to get cursor visual element.");
-
- _Token* pToken = null;
- _VisualElement* pTokenVisualElement = null;
-
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
-
- bool isParentChanged = false;
- if (pToken)
- {
- pTokenVisualElement = pToken->GetVisualElement();
- SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "A system error has occurred. Failed to get token visual element.");
-
- if (pCursorVisualElement->GetParent() != pTokenVisualElement)
- {
- isParentChanged = true;
- result r = E_SUCCESS;
- r = (pCursorVisualElement->GetParent())->DetachChild(*pCursorVisualElement);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pTokenVisualElement->AttachChild(*pCursorVisualElement);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
- }
- }
+ r = AttachCursorToToken();
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
if (__isEditingToken == false)
_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();
}
_TokenEditPresenter::OnFocusLost(void)
{
result r = E_SUCCESS;
+ __isFocus = false;
//Remove pressed state on focus lost
__pressedTokenIndex = -1;
- __isFocus = false;
-
_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();
}
bool
_TokenEditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
{
+ //Remove token focus on touch press
+ __focusedTokenIndex = -1;
+
int tokenIndex = GetTokenIndexFromCoordinate(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()));
__trackTokenIndex = tokenIndex;
_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);
void
_TokenEditPresenter::OnTextCommitted(const String& commitText)
{
- result r = E_SUCCESS;
char enterText[2] = {'\n', };
String enterTextComma(",");
String enterTextSemiColon(";");
+
+ //OnTextCommitted blocked for these cases
+ //1. Tab text not to be handled
+ //2. Token is focused
+ char tapText[2] = {'\t', };
+ if (commitText == tapText)
+ {
+ return;
+ }
+
if ((commitText == enterText) || (commitText == enterTextComma) || (commitText == enterTextSemiColon))
{
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.");
-
- _VisualElement* pCursorVisualElement = GetCursorVisualElement();
- SysTryReturnVoidResult(NID_UI_CTRL, pCursorVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get cursor visual element.");
-
- _Token* pToken = null;
- _VisualElement* pTokenVisualElement = null;
-
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
-
- if (pToken)
- {
- pTokenVisualElement = pToken->GetVisualElement();
- SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
-
- if (pCursorVisualElement->GetParent() != pEditVisualElement)
- {
- r = pCursorVisualElement->GetParent()->DetachChild(*pCursorVisualElement);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
-
- r = pEditVisualElement->AttachChild(*pCursorVisualElement);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
- }
- }
-
- String inputTokenString = GetText();
- String replacementString = inputTokenString;
- bool enable = false;
-
- __pTokenEdit->ProcessTokenFiltering(inputTokenString, replacementString, enable);
- if (enable)
- {
- inputTokenString = replacementString;
- }
-
- r = RemoveTokenAt(__edittingTokenIndex);
- _EditPresenter::SetTextSize(__editContentFontSize);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- if (inputTokenString.GetLength() > 0)
- {
- r = InsertTokenAt(__edittingTokenIndex, inputTokenString);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
- SysTryReturnVoidResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
-
- pToken->currTokenLength = inputTokenString.GetLength();
- }
-
- CalculateTokenPositionFromIndex(0);
- int lastTokenIndex = GetTokenCount() - 1;
- for (int i = 0; i < lastTokenIndex + 1; i++)
- {
- _Token* pToken = null;
- pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
-
- if (pToken)
- {
- pToken->SetBounds(pToken->displayRect);
- }
- }
-
- AdjustFlexibleHeight();
- __pressedTokenIndex = -1;
- __isTokenEditingFinished = true;
- __edittingTokenIndex = -1;
- __isEditingToken = false;
-
- CheckTokenScrolling();
- SetCursorDisabled(false);
-
- if (inputTokenString.GetLength() <= 0)
- {
- SysLog(NID_UI_CTRL, "[E_INVALID_ARG] Invalid argument is used. Token length is (%d)", inputTokenString.GetLength());
- }
-
+ ExitTokenEditingMode();
}
if (GetText().GetLength() > 0)
__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;
if (__isEditingToken == false)
{
__pressedTokenIndex = -1;
+ __focusedTokenIndex = -1;
SetCursorDisabled(false);
}
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 if (__focusedTokenIndex != -1)
+ {
+ RemoveTokenAt(__focusedTokenIndex);
}
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();
return;
}
+ else if (__focusedTokenIndex >= 0 && __editingTokenIndex < 0 && !__isEditingToken)
+ {
+ RemoveTokenAt(__focusedTokenIndex);
+ __pTokenEdit->Invalidate();
+ return;
+ }
//Backspace on Blocked text, delete full block
if (IsBlocked() == true)
_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;
}
-bool
-_TokenEditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+result
+_TokenEditPresenter::AttachCursorToToken(void)
{
- _KeyCode keyCode = keyInfo.GetKeyCode();
+ result r = E_SUCCESS;
- if (IsUsbKeyboardConnected() && (keyInfo.GetKeyModifier() & _KEY_MODIFIER_CTRL))
+ if (__pressedTokenIndex != -1)
{
- switch (keyCode)
+ _VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pEditVisualElement, E_SYSTEM, "A system error has occurred. Failed to get root visual element.");
+
+ _VisualElement* pCursorVisualElement = GetCursorVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pCursorVisualElement, E_SYSTEM, "A system error has occurred. Failed to get cursor visual element.");
+
+ _Token* pToken = null;
+ _VisualElement* pTokenVisualElement = null;
+
+ pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
+ if (pToken)
{
- case _KEY_A:
- case _KEY_C:
- case _KEY_X:
- case _KEY_V:
- if (__isEditingToken)
+ pTokenVisualElement = pToken->GetVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "A system error has occurred. Failed to get token visual element.");
+
+ if (pCursorVisualElement->GetParent() != pTokenVisualElement)
{
- return true;
- }
- break;
+ r = (pCursorVisualElement->GetParent())->DetachChild(*pCursorVisualElement);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
- default:
- break;
+ r = pTokenVisualElement->AttachChild(*pCursorVisualElement);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ }
}
}
- return _EditPresenter::OnKeyPressed(source, keyInfo);
+ return r;
+}
+
+result
+_TokenEditPresenter::DetachCursorFromToken(void)
+{
+ result r = E_SUCCESS;
+
+ if (__pressedTokenIndex != -1)
+ {
+ _VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pEditVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element.");
+
+ _VisualElement* pCursorVisualElement = GetCursorVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pCursorVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get cursor visual element.");
+
+ _Token* pToken = null;
+ _VisualElement* pTokenVisualElement = null;
+
+ pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
+
+ if (pToken)
+ {
+ pTokenVisualElement = pToken->GetVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
+
+ if (pCursorVisualElement->GetParent() != pEditVisualElement)
+ {
+ r = pCursorVisualElement->GetParent()->DetachChild(*pCursorVisualElement);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pEditVisualElement->AttachChild(*pCursorVisualElement);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ }
+ }
+ return r;
}
+
+void
+_TokenEditPresenter::ExitTokenEditingMode(void)
+{
+ result r = E_SUCCESS;
+
+ _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.");
+
+ _VisualElement* pCursorVisualElement = GetCursorVisualElement();
+ SysTryReturnVoidResult(NID_UI_CTRL, pCursorVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get cursor visual element.");
+
+ _Token* pToken = null;
+ _VisualElement* pTokenVisualElement = null;
+
+ pToken = static_cast <_Token*>(__pTokenList->GetAt(__editingTokenIndex));
+
+ if (pToken)
+ {
+ pTokenVisualElement = pToken->GetVisualElement();
+ SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
+
+ if (pCursorVisualElement->GetParent() != pEditVisualElement)
+ {
+ r = pCursorVisualElement->GetParent()->DetachChild(*pCursorVisualElement);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pEditVisualElement->AttachChild(*pCursorVisualElement);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ }
+
+ String inputTokenString = GetText();
+ String replacementString = inputTokenString;
+ bool enable = false;
+
+ __pTokenEdit->ProcessTokenFiltering(inputTokenString, replacementString, enable);
+ if (enable)
+ {
+ inputTokenString = replacementString;
+ }
+
+ r = RemoveTokenAt(__editingTokenIndex);
+
+ _EditPresenter::SetTextSize(__editContentFontSize);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (inputTokenString.GetLength() > 0)
+ {
+ r = InsertTokenAt(__editingTokenIndex, inputTokenString);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ 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();
+ }
+
+ CalculateTokenPositionFromIndex(0);
+ int lastTokenIndex = GetTokenCount() - 1;
+ for (int i = 0; i < lastTokenIndex + 1; i++)
+ {
+ _Token* pToken = null;
+ pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
+
+ if (pToken)
+ {
+ pToken->SetBounds(pToken->displayRect);
+ }
+ }
+
+ AdjustFlexibleHeight();
+ __pressedTokenIndex = -1;
+ __isTokenEditingFinished = true;
+ __editingTokenIndex = -1;
+ __isEditingToken = false;
+
+ CheckTokenScrolling();
+ SetCursorDisabled(false);
+
+ if (inputTokenString.GetLength() <= 0)
+ {
+ SysLog(NID_UI_CTRL, "[E_INVALID_ARG] Invalid argument is used. Token length is (%d)", inputTokenString.GetLength());
+ }
+
+ return;
+}
+
+bool
+_TokenEditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+ bool focusChanged = false;
+ int tokenCount = GetTokenCount();
+ int lastTokenIndex = tokenCount - 1;
+
+ if (IsUsbKeyboardConnected() && (keyInfo.GetKeyModifier() & _KEY_MODIFIER_CTRL))
+ {
+ switch (keyCode)
+ {
+ case _KEY_A:
+ case _KEY_C:
+ case _KEY_X:
+ case _KEY_V:
+ if (__isEditingToken)
+ {
+ return true;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if ((keyCode == _KEY_NUM_LEFT) || (keyCode == _KEY_LEFT))
+ {
+ if (__drawFocusState && (!__isEditingToken) && (tokenCount > 0))
+ {
+ if (__focusedTokenIndex == -1)
+ {
+ if (GetCursorPosition() == 0)
+ {
+ __focusedTokenIndex = lastTokenIndex;
+ if (GetTextLength() > 0)
+ {
+ MakeToken();
+ StopCursorTimer();
+ SetCursorDisabled(true);
+ __pTokenEdit->Invalidate();
+
+ StartCursorTimer();
+
+ return _EditPresenter::OnKeyPressed(source, keyInfo);
+ }
+ focusChanged = true;
+ }
+ }
+ else
+ {
+ if (__focusedTokenIndex > 0)
+ {
+ __focusedTokenIndex--;
+ focusChanged = true;
+ }
+ }
+ }
+ }
+
+ if ((keyCode == _KEY_NUM_RIGHT) || (keyCode == _KEY_RIGHT))
+ {
+ if (__drawFocusState && (!__isEditingToken) && (tokenCount > 0))
+ {
+ if (__focusedTokenIndex != -1)
+ {
+ if (__focusedTokenIndex == lastTokenIndex)
+ {
+ __focusedTokenIndex = -1;
+ focusChanged = true;
+ }
+ else
+ {
+ __focusedTokenIndex++;
+ focusChanged = true;
+ }
+ }
+ }
+ }
+
+ if (focusChanged)
+ {
+ StopCursorTimer();
+ if (__focusedTokenIndex != -1)
+ {
+ SetCursorDisabled(true);
+ }
+ else
+ {
+ SetCursorDisabled(false);
+ }
+ StartCursorTimer();
+ ScrollToFocussedToken();
+ }
+
+ 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;
+}
+
+result
+_TokenEditPresenter::ScrollToFocussedToken(void)
+{
+ result r = E_SUCCESS;
+ FloatRectangle focussedTokenRectangle;
+ float newScrollValue = 0.0f;
+ float tokenTopMargin = 0.0f;
+ float tokenBottomMargin = 0.0f;
+ _ControlOrientation orientation = __pTokenEdit->GetOrientation();
+
+
+ GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
+ GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
+
+ FloatRectangle tokenEditRect = __pTokenEdit->GetBoundsF();
+ if (__focusedTokenIndex == -1)
+ {
+ //Focus bitmap to be reset when no token is focused.
+ DrawToken();
+ }
+ else
+ {
+ _Token* pToken = null;
+ pToken = static_cast <_Token*>(__pTokenList->GetAt(__focusedTokenIndex));
+
+ focussedTokenRectangle = pToken->displayRect;
+
+ float focussedTokenPosition= focussedTokenRectangle.y + focussedTokenRectangle.height ;
+
+ if ((focussedTokenRectangle.y > 0) && (focussedTokenPosition < tokenEditRect.height))
+ {
+ //Focused token is within the tokenEdit boundary
+ DrawToken();
+ }
+ else
+ {
+ if (focussedTokenRectangle.y < 0)
+ {
+ //Focused token is above the upper boundary
+ newScrollValue = focussedTokenRectangle.y - tokenTopMargin - __scrollValue;
+ }
+ else
+ {
+ //Focused token is below the lower boundary
+ newScrollValue = focussedTokenPosition - tokenEditRect.height + tokenBottomMargin - __scrollValue;
+ }
+
+ r = RecalculateTokenBounds(newScrollValue);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ }
+ }
+
+ return r;
+}
+
+void
+_TokenEditPresenter::SetDrawFocusState(bool focusState)
+{
+ if (!focusState)
+ {
+ __focusedTokenIndex = -1;
+ }
+ __drawFocusState = focusState;
+
+ return;
+}
+
+int
+_TokenEditPresenter::GetFocusedTokenIndex(void) const
+{
+ return __focusedTokenIndex;
+}
+
+void
+_TokenEditPresenter::PrepareFocusUiMode(void)
+{
+ if (__editingTokenIndex != -1)
+ {
+ ExitTokenEditingMode();
+ }
+ else if (__pressedTokenIndex != -1)
+ {
+ __pressedTokenIndex = -1;
+ DetachCursorFromToken();
+ StopCursorTimer();
+ SetCursorDisabled(false);
+ __pTokenEdit->Invalidate();
+ StartCursorTimer();
+ }
+
+ return;
+}
+
}}} //Tizen::Ui::Controls
Tizen::Graphics::FloatRectangle __parentWindowBounds;
_Control* __pOwner;
int __accessibilityFocusOutIndex;
+ bool __isAnimating;
}; // _DateTimeBar
}}} // Tizen::Ui::Controls
result SetTextPredictionEnabled(bool enable);
result SetLimitLength(int limitLength);
result SetLineSpacing(int linePixelGap);
- result SetLineSpacing(float linePixelGap);
+ result SetLineSpacing(float linePixelGap);
void SetLowerCaseModeEnabled(bool enable);
void SetMaxLineCount(int maxLineCount);
result SetKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId);
Tizen::Graphics::Bitmap* GetBackgroundBitmap(EditStatus status) const;
result LoadDefaultBackgroundBitmap(GroupStyle groupStyle);
result ReplaceDefaultBackgroundBitmapForSearchBar(void);
+ void SetSearchFieldFocus(bool state);
+ bool IsSearchFieldFocused(void) const;
Tizen::Graphics::Bitmap* GetDefaultBackgroundBitmap(EditStatus status) const;
bool IsCustomDefaultBackgroundBitmap(EditStatus status) const;
Tizen::Graphics::Bitmap* GetDefaultBackgroundEffectBitmap(void) const;
+ Tizen::Graphics::Bitmap* GetDefaultFocusBitmap(void) const;
void GetBlockRange(int& start, int& end) const;
Tizen::Graphics::Color GetBlockTextColor(void) const;
Tizen::Graphics::Color GetColor(EditStatus status) const;
result AppendCharacter(const Tizen::Base::Character& character);
result AppendText(const Tizen::Base::String& text);
result BeginTextBlock(void);
- bool CalculateAbsoluteCursorBounds(int index ,Tizen::Graphics::Rectangle& absCursorRect);
- bool CalculateAbsoluteCursorBounds(int index ,Tizen::Graphics::FloatRectangle& absCursorRect);
+ bool CalculateAbsoluteCursorBounds(int index, Tizen::Graphics::Rectangle& absCursorRect);
+ bool CalculateAbsoluteCursorBounds(int index, Tizen::Graphics::FloatRectangle& absCursorRect);
result ClearText(void);
result CopyText(void);
result CutText(void);
bool IsViewModeEnabled(void) const;
bool IsKeypadEnabled(void) const;
bool IsTextPredictionEnabled(void) const;
- void UpdateAccessibilityElement(EditAccessibilityElementType type);
+ virtual void UpdateAccessibilityElement(EditAccessibilityElementType type);
void SetFullScreenKeypadEdit(bool enabled);
bool IsFullScreenKeypadEdit(void);
bool IsBorderRoundStyleEnabled(void) const;
bool IsInternalFocused(void) const;
bool ValidatePastedText(const Tizen::Base::String& pastedText, Tizen::Base::String& replacedText);
void SetEditTextFilter(IEditTextFilter* pFilter);
- void SendOpaqueCommand (const Tizen::Base::String& command);
+ void SendOpaqueCommand(const Tizen::Base::String& command);
+ _AccessibilityElement* GetTextAccessibilityElement(void) const;
protected:
result SetPresenter(const _EditPresenter& pPresenter);
//Default Bitmap
Tizen::Graphics::Bitmap* __pDefaultBackgroundBitmap[EDIT_COLOR_MAX];
Tizen::Graphics::Bitmap* __pDefaultBackgroundEffectBitmap;
+ Tizen::Graphics::Bitmap* __pDefaultFocusBitmap;
Tizen::Ui::_TouchFlickGestureDetector* __pGestureFlick;
Tizen::Ui::_TouchLongPressGestureDetector* __pGestureLongPress;
IEditTextFilter* __pTextFilter;
Tizen::Graphics::FloatRectangle __previousBounds;
bool __isTouchMoving;
+ bool __isSearchFieldFocused;
}; // _Edit
}}} // Tizen::Ui::Controls
, virtual public Tizen::Base::Runtime::IEventListener
, virtual public Tizen::Ui::_IUiEventListener
, virtual public Tizen::Ui::_IUiEventPreviewer
+ , virtual public Tizen::System::ISettingEventListener
{
DECLARE_CLASS_BEGIN(_SearchBar, _Control);
DECLARE_PROPERTY("buttonActionId", GetPropertyButtonActionId, SetPropertyButtonActionId);
SearchFieldStatus GetCurrentStatus(void);
void SetEditTextFilter(IEditTextFilter* pFilter);
void SendOpaqueCommand (const Tizen::Base::String& command);
+ void SetFocusCallBackParameter(bool state);
+ bool IsFocusCallBackToBeFired(void) const;
virtual _UiTouchEventDelivery OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnFocusLost(const _Control& source);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
- virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
+
+ virtual void OnSettingChanged(Tizen::Base::String& key);
protected:
virtual void OnDraw(void);
result CreateContentsArea(void);
result CreateClippedGroupControl(void);
void CreateAccessibilityElement(void);
- //Tizen::Graphics::Font* CreateEditFontN(const Tizen::Graphics::Font* pFont);
+ virtual void OnDrawFocus(void);
Tizen::Ui::_Control* GetParentForm(void) const;
bool __isUserGuideTextColor;
bool __isKeypadOpening;
bool __isupdateContentBounds;
+ bool __isKeyPressed;
+ bool __isFocusCallbackToBeFired;
+ bool __isButtonTextChangedByApp;
+
CoreKeypadAction __keypadAction;
Tizen::Graphics::Bitmap* __pBackgroundBitmap;
class _PublicActionEvent;
class _PublicTextEvent;
class _PublicTextBlockEvent;
+class EditField;
+class _EditFieldImpl;
+class _ButtonImpl;
class _SearchBarImpl
: public _ControlImpl
, public _ITextBlockEventListener
, public _ITextEventListener
, public _ISearchBarEventListener
- , virtual public Tizen::Base::Runtime::IEventListener
+ , public IKeyEventListener
+ , public IFocusEventListener
{
public:
static _SearchBarImpl* CreateSearchBarImplN(SearchBar* pCore, const Tizen::Graphics::Rectangle& bounds, bool enableSearchBarButton = true, KeypadAction keypadAction = KEYPAD_ACTION_SEARCH);
virtual void OnLanguageChanged(Tizen::Locales::LanguageCode oldLanguage, Tizen::Locales::LanguageCode newLanguage);
+ void OnFocusEventListenerAdded(IFocusEventListener& listener);
+ void OnFocusEventListenerRemoved(IFocusEventListener& listener);
+
+ //Focus Callbacks
+ virtual void OnFocusGained(const Tizen::Ui::Control& source);
+ virtual void OnFocusLost(const Tizen::Ui::Control& source);
+
+ //Key event Callbacks
+ virtual void OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode);
+ virtual void OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode);
+ virtual void OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode);
+
static _SearchBarImpl* GetInstance(SearchBar& searchBar);
static const _SearchBarImpl* GetInstance(const SearchBar& searchBar);
+ _EditFieldImpl* GetEditFieldImpl(void) const;
+ _ButtonImpl* GetButtonImpl(void) const;
+
private:
_SearchBarImpl(const _SearchBarImpl&);
_SearchBarImpl& operator =(const _SearchBarImpl&);
_SearchBar* __pSearchBar;
+ EditField* __pEditField;
+ Button* __pButton;
+ _EditFieldImpl* __pEditFieldImpl;
+ _ButtonImpl* __pButtonImpl;
+
Control* __pContentControl;
_PublicActionEvent* __pPublicActionEvent;
_PublicSearchBarEvent* __pPublicSearchBarEvent;
_PublicLanguageEvent* __pPublicLanguageEvent;
+ PublicEventListenerList* __pPublicFocusEventListeners;
+
}; // _SearchBarImpl
}}} // Tizen::Ui::Controls
virtual void OnDrawFocus(void);
bool OnFocusGained(const _Control& source);
bool OnFocusLost(const _Control& source);
+ void OnFocusModeStateChanged(void);
public:
result AddSplitPanelEventListener(const _ISplitPanelEventListener& listener);
_SplitPanelEvent* __pSplitPanelEvent;
int __dividerTapCount;
+ bool __isFocusModeEnabled;
Tizen::Ui::_AccessibilityElement* __pAccessibilityElement;
void SetEditModeEnabled(bool isEnabled);
bool IsEditModeEnabled(void) const;
+ bool IsInFocusMode(void) const;
+
result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const;
Tizen::Graphics::Bitmap* GetDisabledBackgroundBitmap(void) const;
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
- bool OnFocusGained(const _Control& source);
- bool OnFocusLost(const _Control& source);
virtual void OnDrawFocus(void);
+ virtual void OnFocusModeStateChanged(void);
private:
int GetItemIndex(int actionId);
private:
_TabPresenter* __pTabPresenter;
+ bool __isInFocusMode;
int __style;
int __currentHighlightedItemIndex;
_TabStatus __tabStatus;
#include <FUiCtrlExpandableEditArea.h>
#include "FUiCtrl_Edit.h"
#include "FUiCtrl_ITokenFilter.h"
+#include "FUi_IAccessibilityListener.h"
namespace Tizen { namespace Ui
{
, virtual public Tizen::Ui::_IUiEventPreviewer
, virtual public Tizen::Ui::_ITouchGestureEventListener
, public Tizen::Ui::Controls::_Edit
+ , public Tizen::Ui::_IAccessibilityListener
{
public:
virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
virtual result OnAttachedToMainTree(void);
+ virtual void OnDrawFocus(void);
+ virtual void OnFocusModeStateChanged(void);
+ void RefreshFocusUi(void);
+
+
+ virtual void UpdateAccessibilityElement(EditAccessibilityElementType type);
+ _AccessibilityElement* GetTitleTextAccessibilityElement(void) const;
+ _AccessibilityElement* GetCursorAccessibilityElement(void) const;
+ result AddTitleAccessibilityElement(void);
+ result AddCursorAccessibilityElement(void);
+ result SetCursorAccessibilityBounds(const FloatRectangle& cursorBounds);
+ void RemoveTitleAccessibilityElement(void);
+ void RemoveCursorAccessibilityElement(void);
+
+ //_IAccessibilityListener callbacks
+ virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element);
private:
_TokenEdit(const _TokenEdit& rhs);
_ITokenFilter* __pTokenFilter;
- Tizen::Ui::_AccessibilityElement* __pDescriptionTextAccessibilityElement;
- Tizen::Ui::_AccessibilityElement* __pHiddenTokenCountAccessibilityElement;
- Tizen::Ui::_AccessibilityElement* __pExpandableButtonAccessibilityElement;
-}; // _TokenEdit
+ Tizen::Ui::_AccessibilityElement* __pTitleTextAccessibilityElement;
+ Tizen::Ui::_AccessibilityElement* __pCursorAccessibilityElement;
+}; // _TokenEdit
}}} // Tizen::Ui::Controls
virtual result SetInitialBounds(void);
- result CalculateDescriptionTextRect(const Tizen::Base::String& descriptionText);
+ result CalculateDescriptionTextRect(const Tizen::Base::String& titleText);
virtual void OnCursorTimerExpired(void);
virtual bool OnTapGestureDetected(void);
virtual bool OnLongPressGestureDetected(void);
- virtual void OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally);
- virtual void OnVisualElementAnimationRepeated (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, long currentRepeatCount){}
- virtual void OnVisualElementAnimationStarted (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target){}
+ virtual void OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally);
+ virtual void OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount){}
+ virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target){}
void OnBoundsChanged(void);
virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
virtual void ResetTextBounds(void);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+ Tizen::Graphics::FloatRectangle GetDescriptionTextRect(void) const;
+ String GetTextAccessibilityElementText(void) const;
+ void RefreshAccessibilityElements(void);
+ result AddChildAccessibilityElements(void);
+ void RemoveChildAccessibilityElements(void);
+ result AppendTokenAccessibilityElement(void);
+ result InsertTokenAccessibilityElementAt(int index);
+ void RemoveTokenAccessibilityElementAt(int index);
+ result UpdateTokenAccessibilityBounds(void);
+ result UpdateTitleAccessibilityBounds(const FloatRectangle& titleBounds);
+ result ScrollToFocusedTokenAccessibilityElement(const _AccessibilityElement& element);
+
+ //Accessibility callbacks
+ bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+ bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+
+ result ScrollToFocussedToken(void);
+ result AttachCursorToToken(void);
+ result DetachCursorFromToken(void);
+ void ExitTokenEditingMode(void);
+ void SetDrawFocusState(bool focusState);
+ int GetFocusedTokenIndex(void) const;
+ void PrepareFocusUiMode(void);
+
private:
bool DrawToken(int count = -1);
Tizen::Graphics::Color GetTokenEditColor(const ExpandableEditAreaTokenStatus status) const;
result InitializeTokenVisibilityAt(int index);
bool DrawDescriptionText(void);
result SetDescriptionTextRect(const Tizen::Graphics::FloatRectangle& rect);
- Tizen::Graphics::FloatRectangle GetDescriptionTextRect(void) const;
result TrimTokenAndAdjustEllipsisAt(int index);
int GetTokenIndexFromCoordinate(const Tizen::Graphics::Point point) const;
result SetEditingTokenTextBounds(int index, bool isSetText = true);
Tizen::Graphics::Bitmap* __pTokenBgBitmap;
Tizen::Graphics::Bitmap* __pTokenBgNormalEffectBitmap;
Tizen::Graphics::Bitmap* __pTokenBgPressedEffectBitmap;
+ Tizen::Graphics::Bitmap* __pTokenBgReplacementFocusBitmap;
+ Tizen::Graphics::Bitmap* __pTokenBgFocusEffectBitmap;
int __pressedTokenIndex;
bool __isEditingToken;
- int __edittingTokenIndex;
+ int __editingTokenIndex;
Tizen::Graphics::FloatRectangle __clientRect;
Tizen::Graphics::FloatRectangle __initTextRect;
static const int ANIMATION_DURATION_OPACITY = 83;
+ int __focusOutIndex;
+
+ Tizen::Base::Collection::LinkedListT< _AccessibilityElement* > __accessibilityElements;
+
+ int __focusedTokenIndex;
+
+ bool __drawFocusState;
-}; // _TokenEditPresenter
+}; // _TokenEditPresenter
}}} // Tizen::Ui::Controls
// [ToDo] Rename API: These APIs return collection.
Tizen::Base::Collection::LinkedListT <Tizen::Base::Runtime::IEventListener*>* GetTouchEventListener(void) const;
+ Tizen::Base::Collection::LinkedListT <Tizen::Base::Runtime::IEventListener*>* GetKeyEventListener(void) const;
Tizen::Base::Collection::LinkedListT <Tizen::Base::Runtime::IEventListener*>* GetDragDropEventListener(void) const;
// Queries
DECLARE_COLOR_CONFIG(EDIT_TEXT_NORMAL, 17);
DECLARE_COLOR_CONFIG(EDIT_TEXT_DISABLED, 18);
DECLARE_COLOR_CONFIG(EDIT_TEXT_HIGHLIGHTED, 19);
+ DECLARE_COLOR_CONFIG(EDIT_BG_FOCUS, 20);
+ DECLARE_COLOR_CONFIG(EDIT_BG_PRESSED, 21);
+ DECLARE_COLOR_CONFIG(EDIT_BG_HIGHLIGHTED, 22);
DECLARE_IMAGE_CONFIG(EDIT_BG_NORMAL, 1);
DECLARE_IMAGE_CONFIG(EDIT_BG_DISABLED, 2);
DECLARE_IMAGE_CONFIG(EDIT_BG_HIGHLIGHTED, 3);
DECLARE_IMAGE_CONFIG(EDIT_BG_PRESSED, 4);
- DECLARE_IMAGE_CONFIG(EDIT_BG_EFFECT, 5);
- DECLARE_IMAGE_CONFIG(ICON_NORMAL, 6);
- DECLARE_IMAGE_CONFIG(ICON_EFFECT_NORMAL, 7);
- DECLARE_IMAGE_CONFIG(ICON_DISABLED, 8);
+ DECLARE_IMAGE_CONFIG(EDIT_BG_FOCUS, 5);
+ DECLARE_IMAGE_CONFIG(EDIT_BG_EFFECT, 6);
+ DECLARE_IMAGE_CONFIG(ICON_NORMAL, 7);
+ DECLARE_IMAGE_CONFIG(ICON_EFFECT_NORMAL, 8);
+ DECLARE_IMAGE_CONFIG(ICON_DISABLED, 9);
DECLARE_SHAPE_CONFIG(HORIZONTAL_MARGIN, 1);
DECLARE_SHAPE_CONFIG(VERTICAL_MARGIN, 2);
DECLARE_SHAPE_CONFIG(TEXT_HORIZONTAL_MARGIN, 3);
DECLARE_COLOR_CONFIG(BG_SELECTED, 2);
DECLARE_COLOR_CONFIG(TEXT_NORMAL, 3);
DECLARE_COLOR_CONFIG(TEXT_SELECTED, 4);
+ DECLARE_COLOR_CONFIG(BG_FOCUS, 5);
DECLARE_IMAGE_CONFIG(BG_NORMAL, 1);
DECLARE_IMAGE_CONFIG(BG_NORMAL_EFFECT, 2);
DECLARE_IMAGE_CONFIG(BG_PRESSED_EFFECT, 3);
+ DECLARE_IMAGE_CONFIG(BG_FOCUS, 4);
+ DECLARE_IMAGE_CONFIG(BG_FOCUS_EFFECT, 5);
DECLARE_SHAPE_CONFIG(LEFT_MARGIN, 1);
DECLARE_SHAPE_CONFIG(RIGHT_MARGIN, 2);
DECLARE_SHAPE_CONFIG(TOP_MARGIN, 3);
DECLARE_SHAPE_CONFIG(HIDDEN_TOKEN_COUNT_DISPLAY_HEIGHT, 17);
DECLARE_SHAPE_CONFIG(TOKEN_TITLE_RECT_WIDTH, 18);
DECLARE_END_UI_CONFIG(TOKENEDIT);
-
-#endif //_FUI_RESOURCE_TOKEN_EDIT_CONFIG_H_
\ No newline at end of file
+#endif //_FUI_RESOURCE_TOKEN_EDIT_CONFIG_H_
__pImageKeyTable->Add(ResourceKey(key), _SEARCHBAR::EDIT_BG_PRESSED_IMAGE);
}
{
+ const char* key ="SEARCHBAR::EDIT_BG_FOCUS";
+ __pImageKeyTable->Add(ResourceKey(key), _SEARCHBAR::EDIT_BG_FOCUS_IMAGE);
+ }
+ {
const char* key ="SEARCHBAR::ICON_NORMAL";
__pImageKeyTable->Add(ResourceKey(key), _SEARCHBAR::ICON_NORMAL_IMAGE);
}
ADD_COLOR_CONFIG(AMPM_TEXT_NORMAL, $F031L1);
ADD_COLOR_CONFIG(AMPM_TEXT_PRESSED, $F031L1P);
- ADD_COLOR_CONFIG(AMPM_TEXT_HIGHLIGHTED, $F031L1P);
+ ADD_COLOR_CONFIG(AMPM_TEXT_HIGHLIGHTED, $F031L1);
ADD_COLOR_CONFIG(AMPM_TEXT_DISABLED, $F031L1D);
ADD_COLOR_CONFIG(DIVIDER_LEFT_HALF, $B0224);
ADD_COLOR_CONFIG(BUTTON_TEXT_HIGHLIGHTED, $B052L4);
ADD_COLOR_CONFIG(EDIT_BG_NORMAL, $W031);
+ ADD_COLOR_CONFIG(EDIT_BG_PRESSED, $B0217);
+ ADD_COLOR_CONFIG(EDIT_BG_HIGHLIGHTED, $W031);
ADD_COLOR_CONFIG(EDIT_BG_DISABLED, $W031D);
+ ADD_COLOR_CONFIG(EDIT_BG_FOCUS, $W161);
ADD_COLOR_CONFIG(GUIDE_TEXT_NORMAL, $W032);
ADD_COLOR_CONFIG(GUIDE_TEXT_DISABLED, $W032D);
ADD_COLOR_CONFIG(GUIDE_TEXT_HIGHLIGHTED, $W032);
ADD_IMAGE_CONFIG(EDIT_BG_HIGHLIGHTED, #00_search_edit_field_bg.#.png);
ADD_IMAGE_CONFIG(EDIT_BG_PRESSED, #00_search_edit_field_bg.#.png);
ADD_IMAGE_CONFIG(EDIT_BG_EFFECT, #00_search_edit_field_bg_ef.#.png);
+ ADD_IMAGE_CONFIG(EDIT_BG_FOCUS, #00_search_edit_field_focus.#.png);
ADD_IMAGE_CONFIG(ICON_NORMAL, #00_search_icon.png);
ADD_IMAGE_CONFIG(ICON_DISABLED, #00_search_icon.png);
ADD_COLOR_CONFIG(BG_SELECTED, $W0713);
ADD_COLOR_CONFIG(TEXT_NORMAL, $F011L10);
ADD_COLOR_CONFIG(TEXT_SELECTED, $F011L10);
+ ADD_COLOR_CONFIG(BG_FOCUS, $W0715);
ADD_IMAGE_CONFIG(BG_NORMAL, #00_contacts_button_bg.#.png);
ADD_IMAGE_CONFIG(BG_NORMAL_EFFECT, #00_contacts_button_bg_ef.#.png);
ADD_IMAGE_CONFIG(BG_PRESSED_EFFECT, #00_contacts_button_bg_press_ef.#.png);
+ ADD_IMAGE_CONFIG(BG_FOCUS, #00_contacts_button_focus.#.png);
+ ADD_IMAGE_CONFIG(BG_FOCUS_EFFECT, #00_contacts_button_focus_ef.#.png);
START_UI_CONFIG_MODE(720x1280);
{