*/
Tizen::Graphics::Rectangle GetButtonBounds(ButtonPosition position) const;
+
/**
* Gets the position and size of the specified button item.
*
Tizen::Graphics::FloatRectangle GetButtonBoundsF(ButtonPosition position) const;
+ /**
+ * Checks whether the option button item is set.
+ *
+ * @since 2.2
+ *
+ * @return @c true if the option button item is set, @n
+ * else @c false
+ * @exception E_SUCCESS The method is successful.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ */
+ bool IsOptionButtonSet(void) const;
+
+
+ /**
+ * Gets the state of the option button.
+ *
+ * @since 2.2
+ *
+ * @return The state of the option button, @n
+ * else @c BUTTON_ITEM_STATUS_NORMAL if an error occurs.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
+ * The option button is not set.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ */
+ ButtonItemStatus GetOptionButtonStatus(void) const;
+
+
+ /**
+ * Removes the option button item.
+ *
+ * @since 2.2
+ *
+ * @return An error code
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM A system error has occurred.
+ * @remarks If the option button item is not set, the method will return @c E_SUCCESS.
+ */
+ result RemoveOptionButton(void);
+
+
+ /**
+ * Enables or disables the option button.
+ *
+ * @since 2.2
+ *
+ * @return An error code
+ * @param[in] enable Set to @c true to enable the option button, @n
+ * else @c false
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
+ * The option button item is not set.
+ * @exception E_SYSTEM A system error has occurred.
+ */
+ result SetOptionButtonEnabled(bool enable);
+
+
+ /**
+ * Sets the option button.
+ *
+ * @since 2.2
+ *
+ * @return An error code
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
+ * There are more than 3 footer items.
+ * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n
+ * The operation is not supported when the style of the %Footer control is ::FOOTER_STYLE_TAB. @n
+ * @exception E_SYSTEM A system error has occurred.
+ * @remarks
+ * - If the left button is already set, then the button is replaced with the option button.
+ */
+ result SetOptionButton(void);
+
+
protected:
//
//This method is for internal use only. Using this method can cause behavioral, security-related,
return pFooterImpl->SetButtonNumberedBadgeIcon(position, number);
}
+bool
+Footer::IsOptionButtonSet(void) const
+{
+ ClearLastResult();
+
+ const _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this);
+
+ SysAssertf(pFooterImpl != null,
+ "Not yet constructed. Construct() should be called before use.");
+
+ return pFooterImpl->IsOptionButtonSet();
+}
+
+ButtonItemStatus
+Footer::GetOptionButtonStatus(void) const
+{
+ ClearLastResult();
+
+ const _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this);
+
+ SysAssertf(pFooterImpl != null,
+ "Not yet constructed. Construct() should be called before use.");
+
+ return pFooterImpl->GetOptionButtonStatus();
+}
+
+result
+Footer::RemoveOptionButton(void)
+{
+ _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this);
+
+ SysAssertf(pFooterImpl != null,
+ "Not yet constructed. Construct() should be called before use.");
+
+ return pFooterImpl->RemoveOptionButton();
+}
+
+result
+Footer::SetOptionButtonEnabled(bool enable)
+{
+ _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this);
+
+ SysAssertf(pFooterImpl != null,
+ "Not yet constructed. Construct() should be called before use.");
+
+ return pFooterImpl->SetOptionButtonEnabled(enable);
+}
+
+result
+Footer::SetOptionButton(void)
+{
+ _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this);
+
+ SysAssertf(pFooterImpl != null,
+ "Not yet constructed. Construct() should be called before use.");
+
+ return pFooterImpl->SetOptionButton();
+}
+
}}} // Tizen::Ui::Controls
"[E_SYSTEM] A Back button exists.");
}
+ if (position == BUTTON_POSITION_LEFT)
+ {
+ SysTryReturnResult(NID_UI_CTRL, (IsOptionButtonSet() == false), E_SYSTEM,
+ "[E_SYSTEM] A Option button exists.");
+ }
+
SysTryReturnResult(NID_UI_CTRL, (count <= FOOTER_MAX_ITEM_COUNT_WITH_BUTTON), E_SYSTEM,
"[E_SYSTEM] If the item count is larger then 3, no button can be set.");
}
else if (__style == FOOTER_STYLE_SEGMENTED_TEXT || __style == FOOTER_STYLE_SEGMENTED_ICON || __style == FOOTER_STYLE_SEGMENTED_ICON_TEXT
|| __style == FOOTER_STYLE_BUTTON_TEXT || __style == FOOTER_STYLE_BUTTON_ICON || __style == FOOTER_STYLE_BUTTON_ICON_TEXT)
{
- if (IsButtonSet(BUTTON_POSITION_LEFT))
+ if (IsBackButtonSet() || IsOptionButtonSet())
{
- SysTryReturnResult(NID_UI_CTRL, (count < 3), E_MAX_EXCEEDED,
- "[E_MAX_EXCEEDED] The number of items have exceeded the maximum limit.");
+ SysTryReturnResult(NID_UI_CTRL, (count < 4), E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The number of items have exceeded the maximum limit.");
}
else
{
- if (IsBackButtonSet())
+ if (IsButtonSet(BUTTON_POSITION_RIGHT) || IsButtonSet(BUTTON_POSITION_LEFT))
{
- SysTryReturnResult(NID_UI_CTRL, (count < 4), E_MAX_EXCEEDED,
+ SysTryReturnResult(NID_UI_CTRL, (count < 3), E_MAX_EXCEEDED,
"[E_MAX_EXCEEDED] The number of items have exceeded the maximum limit.");
}
else
{
- if (IsButtonSet(BUTTON_POSITION_RIGHT))
- {
- SysTryReturnResult(NID_UI_CTRL, (count < 3), E_MAX_EXCEEDED,
- "[E_MAX_EXCEEDED] The number of items have exceeded the maximum limit.");
- }
- else
- {
- SysTryReturnResult(NID_UI_CTRL, (count < 4), E_MAX_EXCEEDED,
- "[E_MAX_EXCEEDED] The number of items have exceeded the maximum limit.");
- }
+ SysTryReturnResult(NID_UI_CTRL, (count < 4), E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The number of items have exceeded the maximum limit.");
}
}
}
return viewStyle;
}
+bool
+_FooterImpl::IsOptionButtonSet(void) const
+{
+ return GetCore().IsButtonSet(OPTION_BUTTON);
+}
+
+
+ButtonItemStatus
+_FooterImpl::GetOptionButtonStatus(void) const
+{
+ SysTryReturn(NID_UI_CTRL, (IsOptionButtonSet() == true), BUTTON_ITEM_STATUS_NORMAL, E_INVALID_OPERATION,
+ "[E_INVALID_OPERATION] A Option button doesn't exist");
+
+ _ButtonStatus buttonStatus;
+
+ buttonStatus = GetCore().GetButtonStatus(OPTION_BUTTON);
+
+ return ConvertButtonItemStatus(buttonStatus);
+}
+
+
+result
+_FooterImpl::RemoveOptionButton(void)
+{
+ return GetCore().RemoveButtonAt(OPTION_BUTTON);
+}
+
+
+result
+_FooterImpl::SetOptionButtonEnabled(bool enable)
+{
+ return GetCore().SetButtonEnabled(OPTION_BUTTON, enable);
+}
+
+
+result
+_FooterImpl::SetOptionButton(void)
+{
+ SysTryReturnResult(NID_UI_CTRL, (__style != FOOTER_STYLE_TAB), E_UNSUPPORTED_OPERATION,
+ "[E_UNSUPPORTED_OPERATION] The current Footer style does not support the operation.");
+
+ if ((__style == FOOTER_STYLE_SEGMENTED_TEXT || __style == FOOTER_STYLE_SEGMENTED_ICON || __style == FOOTER_STYLE_SEGMENTED_ICON_TEXT) && GetItemCount() > 4)
+ {
+ SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Unable to set the option button.");
+ return E_SYSTEM;
+ }
+ else if ((__style == FOOTER_STYLE_BUTTON_ICON || __style == FOOTER_STYLE_BUTTON_TEXT || __style == FOOTER_STYLE_BUTTON_ICON_TEXT) && GetItemCount() > 5)
+ {
+ SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Unable to set the option button.");
+ return E_SYSTEM;
+ }
+
+ _Button* pButton = _Button::CreateButtonN();
+
+ float buttonHeight = 0.0f;
+ float buttonWidth = 0.0f;
+ float iconSize = 0.0f;
+
+ GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, GetCore().GetOrientation(), buttonHeight);
+ GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetCore().GetOrientation(), buttonWidth);
+ GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_ICON_SIZE, GetCore().GetOrientation(), iconSize);
+
+ pButton->SetBounds(FloatRectangle(0.0f, 0.0f, buttonWidth, buttonHeight));
+
+ Bitmap* pBackgroundNormalBitmap = null;
+ Bitmap* pBackgroundDisabledBitmap = null;
+ Bitmap* pBackgroundPressedBitmap = null;
+ Bitmap* pBackgroundHighlightedBitmap = null;
+
+ Bitmap* pColorReplacedBitmap = null;
+
+ Bitmap* pBackIconNormalBitmap = null;
+ Bitmap* pBackIconDisabledBitmap = null;
+ Bitmap* pBackIconPressedBitmap = null;
+ Bitmap* pBackIconHighlightedBitmap = null;
+
+ Bitmap* pBackIconNormalEffectBitmap = null;
+ Bitmap* pBackIconDisabledEffectBitmap = null;
+ Bitmap* pBackIconPressedEffectBitmap = null;
+ Bitmap* pBackIconHighlightedEffectBitmap = null;
+
+ GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundNormalBitmap);
+ GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundDisabledBitmap);
+ GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundPressedBitmap);
+ GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundHighlightedBitmap);
+
+ GET_BITMAP_CONFIG_N(FOOTER::MORE_ICON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconNormalBitmap);
+ GET_BITMAP_CONFIG_N(FOOTER::MORE_ICON_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconDisabledBitmap);
+ GET_BITMAP_CONFIG_N(FOOTER::MORE_ICON_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconPressedBitmap);
+ GET_BITMAP_CONFIG_N(FOOTER::MORE_ICON_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconHighlightedBitmap);
+
+ bool customTheme = false;
+
+ customTheme = IS_CUSTOM_BITMAP(FOOTER::MORE_ICON_NORMAL);
+ if (customTheme == false)
+ {
+ GET_BITMAP_CONFIG_N(FOOTER::MORE_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconNormalEffectBitmap);
+ }
+
+ customTheme = IS_CUSTOM_BITMAP(FOOTER::MORE_ICON_DISABLED);
+ if (customTheme == false)
+ {
+ GET_BITMAP_CONFIG_N(FOOTER::MORE_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconDisabledEffectBitmap);
+ }
+
+ customTheme = IS_CUSTOM_BITMAP(FOOTER::MORE_ICON_PRESSED);
+ if (customTheme == false)
+ {
+ GET_BITMAP_CONFIG_N(FOOTER::MORE_ICON_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconPressedEffectBitmap);
+ }
+
+ customTheme = IS_CUSTOM_BITMAP(FOOTER::MORE_ICON_HIGHLIGHTED);
+ if (customTheme == false)
+ {
+ GET_BITMAP_CONFIG_N(FOOTER::MORE_ICON_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconHighlightedEffectBitmap);
+ }
+
+ if (pBackgroundNormalBitmap)
+ {
+ pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA),
+ GetCore().GetButtonColor(_BUTTON_STATUS_NORMAL));
+ pButton->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *pColorReplacedBitmap);
+ delete pColorReplacedBitmap;
+
+ delete pBackgroundNormalBitmap;
+ }
+
+ if (pBackgroundDisabledBitmap)
+ {
+ pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA),
+ GetCore().GetButtonColor(_BUTTON_STATUS_DISABLED));
+ pButton->SetBackgroundBitmap(_BUTTON_STATUS_DISABLED, *pColorReplacedBitmap);
+ delete pColorReplacedBitmap;
+
+ delete pBackgroundDisabledBitmap;
+ }
+
+ if (pBackgroundPressedBitmap)
+ {
+ pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA),
+ GetCore().GetButtonColor(_BUTTON_STATUS_PRESSED));
+ pButton->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *pColorReplacedBitmap);
+ delete pColorReplacedBitmap;
+
+ delete pBackgroundPressedBitmap;
+ }
+
+ if (pBackgroundHighlightedBitmap)
+ {
+ pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA),
+ GetCore().GetButtonColor(_BUTTON_STATUS_HIGHLIGHTED));
+ pButton->SetBackgroundBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pColorReplacedBitmap);
+ delete pColorReplacedBitmap;
+
+ delete pBackgroundHighlightedBitmap;
+ }
+
+ Color normalColor;
+ Color disabledColor;
+ Color pressedColor;
+ Color highlightedColor;
+
+ GET_COLOR_CONFIG(FOOTER::MORE_ICON_NORMAL, normalColor);
+ GET_COLOR_CONFIG(FOOTER::MORE_ICON_DISABLED, disabledColor);
+ GET_COLOR_CONFIG(FOOTER::MORE_ICON_PRESSED, pressedColor);
+ GET_COLOR_CONFIG(FOOTER::MORE_ICON_HIGHLIGHTED, highlightedColor);
+
+ if (pBackIconNormalBitmap)
+ {
+ pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor);
+
+ if (pColorReplacedBitmap)
+ {
+ pColorReplacedBitmap->Scale(FloatDimension(iconSize, iconSize));
+ pButton->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap);
+
+ delete pColorReplacedBitmap;
+ }
+
+ delete pBackIconNormalBitmap;
+ }
+
+ if (pBackIconDisabledBitmap)
+ {
+ pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), disabledColor);
+
+ if (pColorReplacedBitmap)
+ {
+ pColorReplacedBitmap->Scale(FloatDimension(iconSize, iconSize));
+ pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap);
+
+ delete pColorReplacedBitmap;
+ }
+
+ delete pBackIconDisabledBitmap;
+ }
+
+ if (pBackIconPressedBitmap)
+ {
+ pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor);
+
+ if (pColorReplacedBitmap)
+ {
+ pColorReplacedBitmap->Scale(FloatDimension(iconSize, iconSize));
+ pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap);
+
+ delete pColorReplacedBitmap;
+ }
+
+ delete pBackIconPressedBitmap;
+ }
+
+ if (pBackIconHighlightedBitmap)
+ {
+ pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), highlightedColor);
+
+ if (pColorReplacedBitmap)
+ {
+ pColorReplacedBitmap->Scale(FloatDimension(iconSize, iconSize));
+ pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap);
+
+ delete pColorReplacedBitmap;
+ }
+
+ delete pBackIconHighlightedBitmap;
+ }
+
+ if (pBackIconNormalEffectBitmap)
+ {
+ pButton->SetEffectBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap);
+ delete pBackIconNormalEffectBitmap;
+ }
+ if (pBackIconDisabledEffectBitmap)
+ {
+ pButton->SetEffectBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pBackIconDisabledEffectBitmap);
+ delete pBackIconDisabledEffectBitmap;
+ }
+ if (pBackIconPressedEffectBitmap)
+ {
+ pButton->SetEffectBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pBackIconPressedEffectBitmap);
+ delete pBackIconPressedEffectBitmap;
+ }
+ if (pBackIconHighlightedEffectBitmap)
+ {
+ pButton->SetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pBackIconHighlightedEffectBitmap);
+ delete pBackIconHighlightedEffectBitmap;
+ }
+
+ return GetCore().SetButton(OPTION_BUTTON, pButton);
+}
+
class _FooterMaker
: public _UiBuilderControlMaker
{
, __pToolbarPresenter(null)
, __pActionEventListener(null)
, __pBackEventListener(null)
+ , __pOptionEventListener(null)
, __pLongPressGesture(null)
, __pFlickGesture(null)
, __pToolbarBackgroundBitmap(null)
, __pItems(null)
, __pTitleBadgeIcon(null)
, __backActionId(-1)
+ , __optionActionId(-1)
, __itemCount(0)
, __style(TOOLBAR_TITLE)
, __transparent(false)
__pButtonItems[RIGHT_BUTTON] = null;
__pButtonItems[BACK_BUTTON] = null;
__pButtonItems[MIDDLE_BUTTON] = null;
+ __pButtonItems[OPTION_BUTTON] = null;
for (int i = 0; i < TOOLBAR_ANIMATION_POSITION_MAX; i++)
{
__pBackEventListener = null;
}
+ if (__pOptionEventListener)
+ {
+ __pOptionEventListener = null;
+ }
+
if (__pLongPressGesture != null)
{
__pLongPressGesture->RemoveGestureListener(*this);
pButton->SetPosition(FloatPoint((toolbarWidth - buttonWidth - horizontalMargin)/2, verticalMargin));
break;
+ case OPTION_BUTTON:
+ if (IsButtonSet(LEFT_BUTTON) == true)
+ {
+ RemoveButtonAt(LEFT_BUTTON);
+ }
+
+ pButton->SetPosition(FloatPoint(0.0f, 0.0f));
+ if (__pOptionEventListener)
+ {
+ pButton->AddActionEventListener(*__pOptionEventListener);
+ pButton->SetActionId(__optionActionId);
+ }
+ break;
+
default:
break;
}
}
- if (position != BACK_BUTTON && __pActionEventListener != null)
+ if (!(position == BACK_BUTTON || position == OPTION_BUTTON) && __pActionEventListener != null)
{
pButton->AddActionEventListener(*__pActionEventListener);
}
case MIDDLE_BUTTON:
name = L"MiddleButtonText";
break;
+ case OPTION_BUTTON:
+ name = L"OptionButtonText";
+ break;
default:
return;
break;
pButtonElement->SetLabel("Back");
pButtonElement->SetTrait("Button");
}
+ else if (position == OPTION_BUTTON)
+ {
+ pButtonElement->SetLabel("Option");
+ pButtonElement->SetTrait("Button");
+ }
else
{
pButtonElement->SetTrait(L"Button");
return;
}
+void
+_Toolbar::SetOptionEventListener(const Controls::_IActionEventListener& listener, int actionId)
+{
+ __optionActionId = actionId;
+ __pOptionEventListener = const_cast<_IActionEventListener*>(&listener);
+
+ return;
+}
+
result
_Toolbar::SetPresenter(const _ToolbarPresenter& toolbarPresenter)
{
GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
totalWidth += itemMinimumWidth;
}
+ else if (IsButtonSet(OPTION_BUTTON))
+ {
+ GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
+ totalWidth += itemMinimumWidth;
+ }
+
if (IsButtonSet(RIGHT_BUTTON))
{
GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
totalWidth += itemMinimumWidth;
}
+ else if (IsButtonSet(OPTION_BUTTON))
+ {
+ GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
+ totalWidth += itemMinimumWidth;
+ }
+
if (IsButtonSet(RIGHT_BUTTON))
{
GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
{
if (__pButtonItems[LEFT_BUTTON])
{
- if (__pButtonItems[BACK_BUTTON])
+ if (__pButtonItems[BACK_BUTTON]) // L,B
{
- __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
- (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
+ (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
- footerButtonItemWidth, footerButtonItemHeight));
+ __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
- __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
- }
- else
- {
- if (__style != TOOLBAR_SOFTKEY)
+ __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+ else
{
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
+ __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
(__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, sipButtonItemTopMargin,
+ __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
footerButtonItemWidth, footerButtonItemHeight));
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
__pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
}
+ }
+ else // L, R
+ {
+ if (__style != TOOLBAR_SOFTKEY)
+ {
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
+ (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
+
+ __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
+
+ __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+ else
+ {
+ __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
+ (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
+
+ __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
+
+ __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+ }
else
{
if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"")
__pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - softkeyDimension.width, __itemArea.height - softkeyDimension.height,
softkeyDimension.width, softkeyDimension.height));
}
- }
-
- if (__style != TOOLBAR_SOFTKEY)
- {
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
- footerButtonItemWidth, footerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
- }
- else
- {
if (__pButtonItems[LEFT_BUTTON]->GetText() == L"")
{
__pButtonItems[LEFT_BUTTON]->SetPosition(FloatPoint(0.0f, __itemArea.height - __pButtonItems[LEFT_BUTTON]->GetSizeF().height));
}
else
{
- if (__pButtonItems[BACK_BUTTON])
+ if (__pButtonItems[BACK_BUTTON]) // B
{
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
+
+ __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
__pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
(__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
__pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
}
- else
+ else // R
{
if (__style != TOOLBAR_SOFTKEY)
{
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
+
+ __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+
__pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
(__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
}
else if (__pButtonItems[LEFT_BUTTON])
{
- if (__pButtonItems[BACK_BUTTON])
+ if (__pButtonItems[BACK_BUTTON]) // L B
{
- __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
- (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
+ (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
- footerButtonItemWidth, footerButtonItemHeight));
+ __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
- __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
- }
- else
- {
- if (__style != TOOLBAR_SOFTKEY)
+ __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+ else
{
+ __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
+ (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
+
__pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
footerButtonItemWidth, footerButtonItemHeight));
+ __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
__pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
}
+ }
+ else // L
+ {
+ if (__style != TOOLBAR_SOFTKEY)
+ {
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
+
+ __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+ else
+ {
+ __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
+
+ __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+ }
else
{
if (__pButtonItems[LEFT_BUTTON]->GetText() == L"")
}
}
}
- else
+ else //B
{
if (__pButtonItems[BACK_BUTTON])
{
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
+ __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+
__pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
(__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
__pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
}
+ else
+ {
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+ footerButtonItemWidth, footerButtonItemHeight));
+ __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ }
+ }
}
}
}
else if (__itemCount == 3)
{
- if (__pButtonItems[LEFT_BUTTON])
+ if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[OPTION_BUTTON])
{
if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
{
{
if (__pButtonItems[BACK_BUTTON])
{
- rightMargin = footerLeftMargin;
- itemButtonRightGap = footerLeftMargin;
- __itemArea.width -= (leftMargin + itemButtonRightGap + iconSize + rightMargin);
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ rightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (leftMargin + itemButtonRightGap + iconSize + itemButtonRightGap + iconSize + rightMargin);
+ leftMargin += (itemButtonRightGap + iconSize);
+ }
+ else
+ {
+ rightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (leftMargin + itemButtonRightGap + iconSize + rightMargin);
+ }
}
else
{
- __itemArea.width -= leftMargin * 2;
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ rightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (leftMargin + itemButtonRightGap + iconSize + rightMargin);
+ leftMargin += (itemButtonRightGap + iconSize);
+ }
+ else
+ {
+ __itemArea.width -= leftMargin * 2;
+ }
}
blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - dividerWidth * 3) / 4;
}
else if (__itemCount == 3)
{
- if (__pButtonItems[LEFT_BUTTON])
+ if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[OPTION_BUTTON])
{
if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
{
{
if (__pButtonItems[BACK_BUTTON])
{
- tabRightMargin = footerLeftMargin;
- itemButtonRightGap = footerLeftMargin;
- __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ tabRightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + itemButtonRightGap + iconSize + tabRightMargin);
+ tabLeftMargin += (itemButtonRightGap + iconSize);
+ }
+ else
+ {
+ tabRightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ }
}
else
{
- __itemArea.width -= tabLeftMargin * 2;
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ tabRightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ tabLeftMargin += (itemButtonRightGap + iconSize);
+ }
+ else
+ {
+ __itemArea.width -= tabLeftMargin * 2;
+ }
}
blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - dividerWidth * 3) / 4;
{
if (__pButtonItems[BACK_BUTTON])
{
- tabRightMargin = footerLeftMargin;
- itemButtonRightGap = footerLeftMargin;
- __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ tabRightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + itemButtonRightGap + iconSize + tabRightMargin);
+ tabLeftMargin += (itemButtonRightGap + iconSize);
+ }
+ else
+ {
+ tabRightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ }
}
else
{
- __itemArea.width -= tabLeftMargin * 2;
+ if (__pButtonItems[OPTION_BUTTON])
+ {
+ tabRightMargin = footerLeftMargin;
+ itemButtonRightGap = footerLeftMargin;
+ __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ tabLeftMargin += (itemButtonRightGap + iconSize);
+ }
+ else
+ {
+ __itemArea.width -= tabLeftMargin * 2;
+ }
}
blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = blockWidth[4] = (__itemArea.width - dividerWidth * 4) / 5;
virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
+ bool IsOptionButtonSet(void) const;
+
+ ButtonItemStatus GetOptionButtonStatus(void) const;
+
+ result RemoveOptionButton(void);
+
+ result SetOptionButtonEnabled(bool enable);
+
+ result SetOptionButton(void);
+
private:
result CheckItemValidate(const FooterItem& item);
RIGHT_BUTTON,
BACK_BUTTON,
MIDDLE_BUTTON,
+ OPTION_BUTTON,
BUTTON_MAX
};
void SetBackEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener, int actionId);
+ void SetOptionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener, int actionId);
+
virtual result OnAttachedToMainTree(void);
virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
Tizen::Ui::Controls::_IActionEventListener* __pBackEventListener;
+ Tizen::Ui::Controls::_IActionEventListener* __pOptionEventListener;
+
_TouchLongPressGestureDetector* __pLongPressGesture;
_TouchFlickGestureDetector* __pFlickGesture;
int __backActionId;
+ int __optionActionId;
+
int __itemCount;
ToolbarStyle __style;
DECLARE_COLOR_CONFIG(DIVIDER_LINE_RIGHT_NORMAL, 92);
DECLARE_COLOR_CONFIG(DIVIDER_LINE_LEFT_TRANSLUCENT_NORMAL, 93);
DECLARE_COLOR_CONFIG(DIVIDER_LINE_RIGHT_TRANSLUCENT_NORMAL, 94);
+ DECLARE_COLOR_CONFIG(MORE_ICON_NORMAL, 95);
+ DECLARE_COLOR_CONFIG(MORE_ICON_DISABLED, 96);
+ DECLARE_COLOR_CONFIG(MORE_ICON_PRESSED, 97);
+ DECLARE_COLOR_CONFIG(MORE_ICON_HIGHLIGHTED, 98);
// BITMAP
DECLARE_IMAGE_CONFIG(BG_NORMAL, 1);
DECLARE_IMAGE_CONFIG(TRANSLUCENT_BG_NORMAL, 2);
ADD_COLOR_CONFIG(DIVIDER_LINE_LEFT_TRANSLUCENT_NORMAL, $B0227);
ADD_COLOR_CONFIG(DIVIDER_LINE_RIGHT_TRANSLUCENT_NORMAL, $B0228);
+ ADD_COLOR_CONFIG(MORE_ICON_NORMAL, $B052L1);
+ ADD_COLOR_CONFIG(MORE_ICON_DISABLED, $B052L1D);
+ ADD_COLOR_CONFIG(MORE_ICON_PRESSED, $B052L1P);
+ ADD_COLOR_CONFIG(MORE_ICON_HIGHLIGHTED, $B052L1);
+
// BITMAP
ADD_IMAGE_CONFIG(BG_NORMAL, #00_toolbar_bg.#.png);
ADD_IMAGE_CONFIG(TRANSLUCENT_BG_NORMAL, #00_toolbar_bg.#.png);