using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
namespace Tizen { namespace Ui { namespace Controls
{
}
result
-ContextMenu::Construct(const Tizen::Graphics::Point& point, ContextMenuStyle style)
+ContextMenu::Construct(const Point& point, ContextMenuStyle style)
{
result r = E_SUCCESS;
}
result
-ContextMenu::Construct(const Tizen::Graphics::FloatPoint& point, ContextMenuStyle style)
+ContextMenu::Construct(const FloatPoint& point, ContextMenuStyle style)
{
result r = E_SUCCESS;
}
result
-ContextMenu::Construct(const Tizen::Graphics::Point& point, ContextMenuStyle style, ContextMenuAnchorDirection direction)
+ContextMenu::Construct(const Point& point, ContextMenuStyle style, ContextMenuAnchorDirection direction)
{
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl == null,
FloatPoint floatPoint = _CoordinateSystemUtils::ConvertToFloat(point);
pImpl = _ContextMenuImpl::CreateContextMenuImplN(this, floatPoint, style, direction);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
_pControlImpl = pImpl;
}
result
-ContextMenu::Construct(const Tizen::Graphics::FloatPoint& point, ContextMenuStyle style, ContextMenuAnchorDirection direction)
+ContextMenu::Construct(const FloatPoint& point, ContextMenuStyle style, ContextMenuAnchorDirection direction)
{
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl == null,
// Create a ContextMenu Impl
pImpl = _ContextMenuImpl::CreateContextMenuImplN(this, point, style, direction);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
_pControlImpl = pImpl;
}
void
-ContextMenu::AddActionEventListener(Tizen::Ui::IActionEventListener& listener)
+ContextMenu::AddActionEventListener(IActionEventListener& listener)
{
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
}
void
-ContextMenu::RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener)
+ContextMenu::RemoveActionEventListener(IActionEventListener& listener)
{
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
}
result
-ContextMenu::AddItem(const Tizen::Base::String& text, int actionId)
+ContextMenu::AddItem(const String& text, int actionId)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
r = pImpl->AddItem(text, actionId, null, null, null);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::AddItem(const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap& normalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+ContextMenu::AddItem(const String& text, int actionId, const Bitmap& normalBitmap,
+ const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style != CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument at style.");
- return E_INVALID_ARG;
- }
+ SysTryReturnResult(NID_UI_CTRL, style == CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style is not of type CONTEXT_MENU_STYLE_LIST.");
r = pImpl->AddItem(text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::AddItem(const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, int actionId)
+ContextMenu::AddItem(const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, int actionId)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style == CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] Invalid argument at style.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, style != CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style cannot be of type CONTEXT_MENU_STYLE_LIST.");
- r = pImpl->AddItem(Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, null);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pImpl->AddItem(String(""), actionId, &normalBitmap, pPressedBitmap, null);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::AddItem(const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap,
+ContextMenu::AddItem(const Bitmap& normalBitmap, const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap,
int actionId)
{
// check whether the ContextMenu was created.
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style == CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] Invalid argument at style.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, style != CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style cannot be of type CONTEXT_MENU_STYLE_LIST.");
- r = pImpl->AddItem(Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pImpl->AddItem(String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::InsertItemAt(int index, const Tizen::Base::String& text, int actionId)
+ContextMenu::InsertItemAt(int index, const String& text, int actionId)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
- if (index > GetItemCount() || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- return E_OUT_OF_RANGE;
- }
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index <= GetItemCount(), E_OUT_OF_RANGE, "The specified index is not valid(index = %d).", index);
r = pImpl->InsertItem(index, text, actionId, null, null, null);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::InsertItemAt(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap& normalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+ContextMenu::InsertItemAt(int index, const String& text, int actionId, const Bitmap& normalBitmap,
+ const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style != CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] Invalid argument at style.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, style == CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style is not of type CONTEXT_MENU_STYLE_LIST.");
- if (index > GetItemCount() || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- return E_OUT_OF_RANGE;
- }
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index <= GetItemCount(), E_OUT_OF_RANGE, "The specified index (%d) is out of range.", index);
r = pImpl->InsertItem(index, text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::InsertItemAt(int index, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
+ContextMenu::InsertItemAt(int index, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap,
int actionId)
{
// check whether the ContextMenu was created.
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style == CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] Invalid argument at style.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, style != CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style cannot be of type CONTEXT_MENU_STYLE_LIST.");
- if (index > GetItemCount() || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- return E_OUT_OF_RANGE;
- }
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index <= GetItemCount(), E_OUT_OF_RANGE, "The specified index (%d) is out of range.", index);
- r = pImpl->InsertItem(index, Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, null);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pImpl->InsertItem(index, String(""), actionId, &normalBitmap, pPressedBitmap, null);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::InsertItemAt(int index, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap,
+ContextMenu::InsertItemAt(int index, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap,
int actionId)
{
// check whether the ContextMenu was created.
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style == CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] Invalid argument at style.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, style != CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style cannot be of type CONTEXT_MENU_STYLE_LIST.");
- if (index > GetItemCount() || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- return E_OUT_OF_RANGE;
- }
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index <= GetItemCount(), E_OUT_OF_RANGE, "The specified index (%d) is out of range.", index);
- r = pImpl->InsertItem(index, Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pImpl->InsertItem(index, String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::SetItemAt(int index, const Tizen::Base::String& text, int actionId)
+ContextMenu::SetItemAt(int index, const String& text, int actionId)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
- if (index >= GetItemCount() || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- return E_OUT_OF_RANGE;
- }
+ SysTryReturnResult(NID_UI_CTRL, index < GetItemCount() && index >= 0, E_OUT_OF_RANGE, "The specified index (%d) is out of range.", index);
r = pImpl->SetItem(index, text, actionId, null, null, null);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::SetItemAt(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap& normalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+ContextMenu::SetItemAt(int index, const String& text, int actionId, const Bitmap& normalBitmap,
+ const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style != CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] Invalid argument at style.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, style == CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style is not of type CONTEXT_MENU_STYLE_LIST.");
- if (index >= GetItemCount() || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- return E_OUT_OF_RANGE;
- }
+ SysTryReturnResult(NID_UI_CTRL, index < GetItemCount() && index >= 0, E_OUT_OF_RANGE, "The specified index (%d) is out of range.", index);
r = pImpl->SetItem(index, text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::SetItemAt(int index, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
+ContextMenu::SetItemAt(int index, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap,
int actionId)
{
// check whether the ContextMenu was created.
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style == CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] Invalid argument at style.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, style != CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style cannot be of type CONTEXT_MENU_STYLE_LIST.");
- if (index >= GetItemCount() || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- return E_OUT_OF_RANGE;
- }
+ SysTryReturnResult(NID_UI_CTRL, index < GetItemCount() && index >= 0, E_OUT_OF_RANGE, "The specified index (%d) is out of range.", index);
- r = pImpl->SetItem(index, Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, null);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pImpl->SetItem(index, String(""), actionId, &normalBitmap, pPressedBitmap, null);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::SetItemAt(int index, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap,
+ContextMenu::SetItemAt(int index, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap,
int actionId)
{
// check whether the ContextMenu was created.
result r = E_SUCCESS;
ContextMenuStyle style = pImpl->GetPublicStyle();
- if (style == CONTEXT_MENU_STYLE_LIST)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] Invalid argument at style.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, style != CONTEXT_MENU_STYLE_LIST, E_INVALID_ARG, "Invalid argument is used. The style cannot be of type CONTEXT_MENU_STYLE_LIST.");
-// if (index >= MAX_ITEM_COUNT || index < 0)
- if (index >= GetItemCount() || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- return E_OUT_OF_RANGE;
- }
+ SysTryReturnResult(NID_UI_CTRL, index < GetItemCount() && index >= 0, E_OUT_OF_RANGE, "The specified index (%d) is out of range.", index);
- r = pImpl->SetItem(index, Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pImpl->SetItem(index, String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result r = E_SUCCESS;
r = pImpl->RemoveItemAt(index);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result r = E_SUCCESS;
r = pImpl->RemoveAllItems();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
const _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
-// if (index > MAX_ITEM_COUNT || index < 0)
- if (index >= GetItemCount() || index < 0)
- {
- SysTryReturn(NID_UI_CTRL, false, -1, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
- }
+ SysTryReturn(NID_UI_CTRL, index < GetItemCount() && index >= 0, -1, E_OUT_OF_RANGE, "The specified index (%d) is out of range.", index);
return pImpl->GetItemActionIdAt(index);
}
-Tizen::Graphics::Color
+Color
ContextMenu::GetItemTextColor(ContextMenuItemStatus status) const
{
// check whether the ContextMenu was created.
const _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::Color color = pImpl->GetItemTextColor(status);
+ Color color = pImpl->GetItemTextColor(status);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Tizen::Graphics::Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
return color;
}
result
-ContextMenu::SetItemTextColor(ContextMenuItemStatus status, const Tizen::Graphics::Color& color)
+ContextMenu::SetItemTextColor(ContextMenuItemStatus status, const Color& color)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
r = pImpl->SetItemTextColor(status, color);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::SetAnchorPosition(const Tizen::Graphics::Point& position)
+ContextMenu::SetAnchorPosition(const Point& position)
{
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = E_SUCCESS;
FloatPoint floatPosition = _CoordinateSystemUtils::ConvertToFloat(position);
r = pImpl->SetAnchorPosition(floatPosition.x, floatPosition.y);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result
-ContextMenu::SetAnchorPosition(const Tizen::Graphics::FloatPoint& position)
+ContextMenu::SetAnchorPosition(const FloatPoint& position)
{
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = E_SUCCESS;
r = pImpl->SetAnchorPosition(position.x, position.y);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
-Tizen::Graphics::Point
+Point
ContextMenu::GetAnchorPosition(void) const
{
const _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::FloatPoint position = pImpl->GetAnchorPosition();
+ FloatPoint position = pImpl->GetAnchorPosition();
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Tizen::Graphics::Point(0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Point(0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
return _CoordinateSystemUtils::ConvertToInteger(position);
}
-Tizen::Graphics::FloatPoint
+FloatPoint
ContextMenu::GetAnchorPositionF(void) const
{
const _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::FloatPoint position = pImpl->GetAnchorPosition();
+ FloatPoint position = pImpl->GetAnchorPosition();
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Tizen::Graphics::FloatPoint(0.0f, 0.0f), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatPoint(0.0f, 0.0f), r, "[%s] Propagating.", GetErrorMessage(r));
return position;
}
-Tizen::Graphics::Color
+Color
ContextMenu::GetColor(void) const
{
// check whether the ContextMenu was created.
const _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::Color color = pImpl->GetColor();
+ Color color = pImpl->GetColor();
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Tizen::Graphics::Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
return color;
}
result
-ContextMenu::SetColor(const Tizen::Graphics::Color& color)
+ContextMenu::SetColor(const Color& color)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
result r = E_SUCCESS;
r = pImpl->SetColor(color);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
-Tizen::Graphics::Color
+Color
ContextMenu::GetItemColor(ContextMenuItemStatus status) const
{
// check whether the ContextMenu was created.
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryReturn(NID_UI_CTRL, (status != CONTEXT_MENU_ITEM_STATUS_NORMAL), Color(0, 0, 0, 0), E_INVALID_STATE,
- "[E_INVALID_ARG] CONTEXT_MENU_ITEM_STATUS_NORMAL is not supported.");
+ "[%s] Invalid argument is used. CONTEXT_MENU_ITEM_STATUS_NORMAL is not supported.", GetErrorMessage(E_INVALID_ARG));
- Tizen::Graphics::Color color = pImpl->GetItemColor(status);
+ Color color = pImpl->GetItemColor(status);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Tizen::Graphics::Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
return color;
}
result
-ContextMenu::SetItemColor(ContextMenuItemStatus status, const Tizen::Graphics::Color& color)
+ContextMenu::SetItemColor(ContextMenuItemStatus status, const Color& color)
{
// check whether the ContextMenu was created.
_ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
- SysTryReturn(NID_UI_CTRL, (status != CONTEXT_MENU_ITEM_STATUS_NORMAL), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] CONTEXT_MENU_ITEM_STATUS_NORMAL is not supported.");
+ SysTryReturnResult(NID_UI_CTRL, (status != CONTEXT_MENU_ITEM_STATUS_NORMAL), E_INVALID_ARG,
+ "Invalid argument is used. CONTEXT_MENU_ITEM_STATUS_NORMAL is not supported.");
result r = E_SUCCESS;
r = pImpl->SetItemColor(status, color);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
result r = E_SUCCESS;
r = pImpl->SetMaxVisibleItemsCount(maxItemsCount);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
// Create _OptionMenuImpl
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::CreateOptionMenuImplN(*this);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pOptionMenuImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, pOptionMenuImpl != null, r, "Propagating.");
// Set _OptionMenuImpl
_pControlImpl = pOptionMenuImpl;
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->AddActionEventListener(listener);
- SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
void
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->RemoveActionEventListener(listener);
- SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
result
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->AddItem(text, actionId, null, null, null);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->AddItem(String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->AddItem(text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->InsertItemAt(mainIndex, text, actionId, null, null, null);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->InsertItemAt(mainIndex, String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->InsertItemAt(mainIndex, text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->SetItemAt(mainIndex, text, actionId, null, null, null);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->SetItemAt(mainIndex, String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->SetItemAt(mainIndex, text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->RemoveItemAt(mainIndex);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
pOptionMenuImpl->RemoveAllItems();
result r = GetLastResult();
- SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
return;
}
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
int count = pOptionMenuImpl->GetItemCount();
result r = GetLastResult();
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
int index = pOptionMenuImpl->GetItemIndexFromActionId(actionId);
result r = GetLastResult();
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
int actionId = pOptionMenuImpl->GetItemActionIdAt(mainIndex);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), -1, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
return actionId;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->AddSubItem(mainIndex, text, actionId);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->InsertSubItemAt(mainIndex, subIndex, text, actionId);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->SetSubItemAt(mainIndex, subIndex, text, actionId);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->RemoveSubItemAt(mainIndex, subIndex);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
int count = pOptionMenuImpl->GetSubItemCount(mainIndex);
- result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (count >= 0), -1, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ SysTryReturn(NID_UI_CTRL, (count >= 0), -1, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
return count;
}
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
int index = pOptionMenuImpl->GetSubItemIndexFromActionId(actionId);
result r = GetLastResult();
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
int actionId = pOptionMenuImpl->GetSubItemActionIdAt(mainIndex, subIndex);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), -1, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
return actionId;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->SetItemTextColor(status, color);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
Color color = pOptionMenuImpl->GetItemTextColor(status);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
return color;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->SetItemColor(status, color);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryReturn(NID_UI_CTRL, (status != OPTION_MENU_ITEM_STATUS_NORMAL), Color(0, 0, 0, 0), E_INVALID_ARG,
- "[E_INVALID_ARG] OPTION_MENU_ITEM_STATUS_NORMAL is not supported.");
+ "[%s] Invalid argument is used. OPTION_MENU_ITEM_STATUS_NORMAL is not supported.", GetErrorMessage(E_INVALID_ARG));
Color color = pOptionMenuImpl->GetItemColor(status);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
return color;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->SetColor(color);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
Color color = pOptionMenuImpl->GetColor();
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
return color;
}
ClearLastResult();
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = pOptionMenuImpl->SetMaxVisibleItemsCount(maxItemsCount);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return r;
}
ClearLastResult();
const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ SysAssertf(pOptionMenuImpl != null, "Not yet constructed. Construct() should be called before use.");
int count = pOptionMenuImpl->GetMaxVisibleItemsCount();
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), -1, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
return count;
}
using namespace Tizen::Graphics;
using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui;
namespace Tizen { namespace Ui { namespace Controls
{
float floatWidth = _CoordinateSystemUtils::ConvertToFloat(width);
pImpl = _TabBarImpl::CreateTabBarImplN(this, FloatRectangle(floatX, floatY, floatWidth, 0.0f));
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, pImpl, r, "Propagating.");
_pControlImpl = pImpl;
pImpl = _TabBarImpl::CreateTabBarImplN(this, FloatRectangle(x, y, width, 0.0f));
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, pImpl, r, "Propagating.");
_pControlImpl = pImpl;
{
_TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
- SysTryReturn(NID_UI_CTRL, item.__pTabBarItemImpl != null, E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] Input TabBarItem is not constructed.\n");
+ SysTryReturnResult(NID_UI_CTRL, item.__pTabBarItemImpl != null, E_INVALID_ARG,
+ "Invalid argument is used. Input TabBarItem is not constructed.\n");
return pImpl->AddItem(item.GetText(), item.GetActionId());
}
{
_TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
- SysTryReturn(NID_UI_CTRL, item.__pTabBarItemImpl != null, E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] Input TabBarItem is not constructed.\n");
+ SysTryReturnResult(NID_UI_CTRL, item.__pTabBarItemImpl != null, E_INVALID_ARG,
+ "Invalid argument is used. Input TabBarItem is not constructed.\n");
return pImpl->InsertItemAt(index, item.GetText(), item.GetActionId());
}
-Tizen::Graphics::Color
+Color
TabBar::GetColor(void) const
{
const _TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
return pImpl->GetItemCount();
}
-Tizen::Graphics::Color
+Color
TabBar::GetSelectedItemColor(void) const
{
const _TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
return pImpl->GetSelectedItemColor();
}
-Tizen::Graphics::Color
+Color
TabBar::GetItemTextColor(TabBarItemStatus status) const
{
const _TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
}
result
-TabBar::SetColor(const Tizen::Graphics::Color& color)
+TabBar::SetColor(const Color& color)
{
_TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
{
_TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
- SysTryReturn(NID_UI_CTRL, item.__pTabBarItemImpl != null, E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] Input TabBarItem is not constructed.\n");
+ SysTryReturnResult(NID_UI_CTRL, item.__pTabBarItemImpl != null, E_INVALID_ARG,
+ "Invalid argument is used. Input TabBarItem is not constructed.\n");
return pImpl->SetItemAt(index, item.GetText(), item.GetActionId());
}
}
result
-TabBar::SetItemTextColor(TabBarItemStatus status, const Tizen::Graphics::Color& color)
+TabBar::SetItemTextColor(TabBarItemStatus status, const Color& color)
{
_TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
}
result
-TabBar::SetSelectedItemColor(const Tizen::Graphics::Color& color)
+TabBar::SetSelectedItemColor(const Color& color)
{
_TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
}
void
-TabBar::AddActionEventListener(Tizen::Ui::IActionEventListener& listener)
+TabBar::AddActionEventListener(IActionEventListener& listener)
{
_TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
void
-TabBar::RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener)
+TabBar::RemoveActionEventListener(IActionEventListener& listener)
{
_TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
#include "FUiCtrl_TabBarItemImpl.h"
using namespace Tizen::Ui::Controls;
+using namespace Tizen::Base;
namespace Tizen { namespace Ui { namespace Controls
{
}
result
-TabBarItem::Construct(const Tizen::Base::String& text, int actionId)
+TabBarItem::Construct(const String& text, int actionId)
{
SysAssertf(__pTabBarItemImpl == null,
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
result
TabBarItem::SetActionId(int actionId)
{
-
- SysTryReturnResult(NID_UI_CTRL, __pTabBarItemImpl != null, E_INVALID_STATE, "This instance is not constructed");
+ SysTryReturnResult(NID_UI_CTRL, __pTabBarItemImpl != null, E_INVALID_STATE, "__pTabBarItemImpl must not be null");
SysTryReturnResult(NID_UI_CTRL, actionId >= 0, E_INVALID_ARG, "The action ID of the item must be a positive integer.");
int
TabBarItem::GetActionId(void) const
{
- SysTryReturn(NID_UI_CTRL, __pTabBarItemImpl != null, -1, E_INVALID_STATE, "This instance is not constructed");
+ SysTryReturn(NID_UI_CTRL, __pTabBarItemImpl != null, -1, E_INVALID_STATE, "[%s] __pTabBarItemImpl must not be null", GetErrorMessage(E_INVALID_STATE));
SetLastResult(E_SUCCESS);
return __pTabBarItemImpl->GetActionId();
}
-Tizen::Base::String
+String
TabBarItem::GetText(void) const
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, __pTabBarItemImpl != null, Tizen::Base::String(), E_INVALID_STATE, "This instance is not constructed");
+ SysTryReturn(NID_UI_CTRL, __pTabBarItemImpl != null, String(), E_INVALID_STATE, "[%s] __pTabBarItemImpl must not be null", GetErrorMessage(E_INVALID_STATE));
SetLastResult(E_SUCCESS);
return __pTabBarItemImpl->GetText();
}
result
-TabBarItem::SetText(const Tizen::Base::String& text)
+TabBarItem::SetText(const String& text)
{
- SysTryReturnResult(NID_UI_CTRL, __pTabBarItemImpl != null, E_INVALID_STATE, "This instance is not constructed");
+ SysTryReturnResult(NID_UI_CTRL, __pTabBarItemImpl != null, E_INVALID_STATE, "__pTabBarItemImpl must not be null");
__pTabBarItemImpl->SetText(text);
using namespace Tizen::Graphics;
using namespace Tizen::Media;
using namespace Tizen::Ui::Animations;
+using namespace Tizen::Ui;
namespace {
static const float TOUCH_PRESS_THRESHOLD_INSENSITIVE = 0.16f;
_ContextMenu::CreateContextMenuN(const FloatPoint& point, enum ContextMenuCoreStyle style, enum ContextMenuCoreAlign contextMenuAlign)
{
_ContextMenu* pContextMenu = new (std::nothrow) _ContextMenu(point, style, contextMenuAlign);
- SysTryReturn(NID_UI_CTRL, pContextMenu != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pContextMenu != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
result r = E_SUCCESS;
pContextMenu->__pScrollPanel->SetFocusable(false);
_Scroll* pScroll = pContextMenu->__pScrollPanel->GetScrollBar();
- SysTryCatch(NID_UI_CTRL, pScroll, , E_INVALID_STATE, "[E_INVALID_STATE] _Scroll isn't constructed");
+ SysTryCatch(NID_UI_CTRL, pScroll, , E_INVALID_STATE,
+ "[%s] pScroll is in invalid state. _Scroll is not constructed.", GetErrorMessage(E_INVALID_STATE));
pScroll->SetContextMenuScrollType(true);
pContextMenu->AttachChild(*(pContextMenu->__pScrollPanel));
// load bitmap of a background and arrow
r = LoadBitmap();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to load bitmap.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to load bitmap.");
r = __actionId.Construct();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to construct arraylist.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to construct arraylist.");
if (__style == CONTEXT_MENU_CORE_STYLE_LIST)
{
_IContextMenuPresenter* pPresenter = new (std::nothrow) _ContextMenuListPresenter(this);
- SysTryReturnResult(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
SetPresenter(*pPresenter);
else
{
_IContextMenuPresenter* pPresenter = new (std::nothrow) _ContextMenuGridPresenter(this);
- SysTryReturnResult(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
SetPresenter(*pPresenter);
Color itemTextSelectedColor;
r = SetBounds(FloatRectangle(0.0f, 0.0f, screen.width, screen.height));
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "SetBounds failed.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set bounds.");
SetMovable(false);
SetResizable(false);
if (pOwner == null)
{
__pCurrentFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturn(NID_UI_CTRL, __pCurrentFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available.");
+ SysTryReturnResult(NID_UI_CTRL, __pCurrentFrame != null, E_SYSTEM, "Failed to get current frame instance.");
_Form* pForm = __pCurrentFrame->GetCurrentForm();
pForm != null ? SetOwner(pForm) : SetOwner(__pCurrentFrame);
}
r = __pContextMenuPresenter->CalculateWindowRect();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Propagating.");
if (__pScrollPanel != null)
{
result r = E_SUCCESS;
r = __pContextMenuPresenter->AddItem(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to add a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to add a item.");
__actionId.Add(actionId);
result r = E_SUCCESS;
r = __pContextMenuPresenter->InsertItem(index, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to insert a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to insert a item.");
__actionId.InsertAt(actionId, index);
result r = E_SUCCESS;
r = __pContextMenuPresenter->SetItem(index, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to set a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set a item.");
__actionId.SetAt(actionId, index);
result r = E_SUCCESS;
r = __pContextMenuPresenter->DeleteItem(index);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to remove a item.");
__actionId.RemoveAt(index);
result r = E_SUCCESS;
r = __pContextMenuPresenter->DeleteItemAll();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove all items.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to remove all items.");
__actionId.RemoveAll();
{
int count = __actionId.GetCount();
int actionId = -1;
+
result r = E_SUCCESS;
if (count <= 0 || index >= count)
{
int showCount = count.ToInt();
- if (showCount < 1)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Count is invalid.");
- return E_INVALID_ARG;
- }
-
+ SysTryReturnResult(NID_UI_CTRL, showCount > 0, E_INVALID_ARG, "Invalid argument is used. Count is invalid.");
__showItemCount = showCount;
Variant
_ContextMenu::GetPropertyMaxVisibleItemsCount(void) const
{
- return Tizen::Ui::Variant(__showItemCount);
+ return Variant(__showItemCount);
}
int
result r;
r = SetProperty("maxVisibleItemsCount", Variant(count));
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to set property.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set show item count.");
if (__style == CONTEXT_MENU_CORE_STYLE_LIST)
{
r = __pContextMenuPresenter->CalculateWindowRect();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to calculate window.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to calculate window.");
}
return E_SUCCESS;
Variant
_ContextMenu::GetPropertyColor(void) const
{
- return Tizen::Ui::Variant(__backgroundColor);
+ return Variant(__backgroundColor);
}
result
Variant
_ContextMenu::GetPropertyNormalItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[CONTEXT_MENU_CORE_ITEM_STATUS_NORMAL]);
+ return Variant(__itemColor[CONTEXT_MENU_CORE_ITEM_STATUS_NORMAL]);
}
result
Variant
_ContextMenu::GetPropertyPressedItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[CONTEXT_MENU_CORE_ITEM_STATUS_PRESSED]);
+ return Variant(__itemColor[CONTEXT_MENU_CORE_ITEM_STATUS_PRESSED]);
}
result
Variant
_ContextMenu::GetPropertyHighlightedItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[CONTEXT_MENU_CORE_ITEM_STATUS_HIGHLIGHTED]);
+ return Variant(__itemColor[CONTEXT_MENU_CORE_ITEM_STATUS_HIGHLIGHTED]);
}
result
Variant
_ContextMenu::GetPropertyNormalItemTextColor(void) const
{
- return Tizen::Ui::Variant(__textColor[CONTEXT_MENU_CORE_ITEM_STATUS_NORMAL]);
+ return Variant(__textColor[CONTEXT_MENU_CORE_ITEM_STATUS_NORMAL]);
}
result
Variant
_ContextMenu::GetPropertyPressedItemTextColor(void) const
{
- return Tizen::Ui::Variant(__textColor[CONTEXT_MENU_CORE_ITEM_STATUS_PRESSED]);
+ return Variant(__textColor[CONTEXT_MENU_CORE_ITEM_STATUS_PRESSED]);
}
result
Variant
_ContextMenu::GetPropertyHighlightedItemTextColor(void) const
{
- return Tizen::Ui::Variant(__textColor[CONTEXT_MENU_CORE_ITEM_STATUS_HIGHLIGHTED]);
+ return Variant(__textColor[CONTEXT_MENU_CORE_ITEM_STATUS_HIGHLIGHTED]);
}
result
}
result
-_ContextMenu::AddActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener)
+_ContextMenu::AddActionEventListener(const _IActionEventListener& listener)
{
result r = E_SUCCESS;
if (__pActionEvent == null)
{
__pActionEvent = _ActionEvent::CreateInstanceN(*this);
- SysTryReturn(NID_UI_CTRL, __pActionEvent != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
- "[E_OUT_OF_MEMORY] Memory allocation failed.")
+ SysTryReturnResult(NID_UI_CTRL, __pActionEvent != null, GetLastResult(), "Propagating.")
r = __pActionEvent->AddListener(listener);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to remove an action event listener.")
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to remove action event listener.")
}
return r;
}
result
-_ContextMenu::RemoveActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener)
+_ContextMenu::RemoveActionEventListener(const _IActionEventListener& listener)
{
- SysTryReturn(NID_UI_CTRL, __pActionEvent != null, E_INVALID_STATE, E_INVALID_STATE,
- "[E_INVALID_STATE] The action event instance isn't constructed.")
+ SysTryReturnResult(NID_UI_CTRL, __pActionEvent != null, E_INVALID_STATE,
+ "__pActionEvent must not be null.")
result r = E_SUCCESS;
r = __pActionEvent->RemoveListener(listener);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove an action event listener")
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to remove action event listener.")
return r;
}
-Tizen::Ui::Controls::_ActionEvent*
+_ActionEvent*
_ContextMenu::GetActionEvent(void) const
{
return __pActionEvent;
}
result
-_ContextMenu::LoadColorReplacedBitmap(const Tizen::Graphics::Color& color)
+_ContextMenu::LoadColorReplacedBitmap(const Color& color)
{
// Delete old bitmap
if (__pBackgroundNormalBitmap != null)
GET_REPLACED_BITMAP_CONFIG_N(CONTEXTMENU::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, color, __pBackgroundNormalBitmap);
r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s]Failed to load bitmap.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
return r;
result r;
GET_REPLACED_BITMAP_CONFIG_N(CONTEXTMENU::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __itemColor[CONTEXT_MENU_CORE_ITEM_STATUS_PRESSED], __pPressedBitmap);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s]Failed to load bitmap.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
return __pPressedBitmap;
}
}
void
-_ContextMenu::OnFontChanged(Tizen::Graphics::Font* pFont)
+_ContextMenu::OnFontChanged(Font* pFont)
{
return __pContextMenuPresenter->OnFontChanged(pFont);
}
#include "FUi_ResourceManager.h"
#include "FUiCtrl_ActionEvent.h"
#include "FUiCtrl_IActionEventListener.h"
-
#include "FUiCtrl_ContextMenuGridPresenter.h"
using namespace Tizen::Graphics;
LoadShape();
__pModel = new (std::nothrow) _ContextMenuModel;
- SysTryCatch(NID_UI_CTRL, __pModel != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+ SysTryReturnResult(NID_UI_CTRL, __pModel != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
r = __pModel->Construct();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create data instance.");
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pFont = __pContextMenu->GetFallbackFont();
r = GetLastResult();
SysTryCatch(NID_UI_CTRL, (__pFont != null), , r, "[%s] Propagating.", GetErrorMessage(r));
__pTextObject = new (std::nothrow) TextObject();
- SysTryCatch(NID_UI_CTRL, __pTextObject, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create data instance.");
+ SysTryCatch(NID_UI_CTRL, __pTextObject, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pTextObject->Construct();
__pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
}
_ContextMenuItem*
-_ContextMenuGridPresenter::CreateItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuGridPresenter::CreateItemN(const Base::String& text, int actionId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
_ContextMenuItem* pItem = _ContextMenuItem::CreateContextMenuItemN();
- SysTryReturn(NID_UI_CTRL, pItem != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pItem != null, null, GetLastResult(), "[%s] pItem must not be null.", GetErrorMessage(GetLastResult()));
ContextMenuItemDrawingType itemType = CONTEXT_MENU_ITEM_DRAWING_TYPE_NONE;
result r = E_SUCCESS;
}
result
-_ContextMenuGridPresenter::AddItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* normalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuGridPresenter::AddItem(const Base::String& text, int actionId, const Bitmap* pNormalBitmap,
+ const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
- _ContextMenuItem* pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ _ContextMenuItem* pItem = CreateItemN(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
result r = __pModel->AddItem(pItem);
if (r != E_SUCCESS)
{
result rt = __pModel->RemoveItem(__pModel->GetItemCount() - 1);
- SysTryReturn(NID_UI_CTRL, rt == E_SUCCESS, rt, rt, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnResult(NID_UI_CTRL, rt == E_SUCCESS, rt, "Propagating.");
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to add item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to adjust item layout.");
}
return r;
}
result
-_ContextMenuGridPresenter::InsertItem(int index, const Tizen::Base::String& text, int actionId,
- const Tizen::Graphics::Bitmap* normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuGridPresenter::InsertItem(int index, const String& text, int actionId,
+ const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
- if (text.GetLength() == 0 && normalBitmap == null && pPressedBitmap == null)
- {
- return E_INVALID_ARG;
- }
+ SysTryReturnResult(NID_UI_CTRL, (text.GetLength() != 0 || pNormalBitmap != null || pPressedBitmap != null), E_INVALID_ARG,
+ "Invalid argument(s) is used. If text is empty then pNormalBitmap or pPressedBitmap must not be null.");
_ContextMenuItem* pItem = null;
- pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ pItem = CreateItemN(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
result r = __pModel->InsertItem(pItem, index);
if (r != E_SUCCESS)
{
delete pItem;
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to insert item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to insert item.");
}
r = AdjustItemLayout();
if (r != E_SUCCESS)
{
result rt = __pModel->RemoveItem(index);
- SysTryReturn(NID_UI_CTRL, rt == E_SUCCESS, rt, rt, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnResult(NID_UI_CTRL, rt == E_SUCCESS, rt, "Propagating.");
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to insert item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to adjust item layout.");
}
return E_SUCCESS;
}
result
-_ContextMenuGridPresenter::SetItem(int index, const Tizen::Base::String& text, int actionId,
- const Tizen::Graphics::Bitmap* normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuGridPresenter::SetItem(int index, const String& text, int actionId,
+ const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
- if (text.GetLength() == 0 && normalBitmap == null && pPressedBitmap == null)
- {
- return E_INVALID_ARG;
- }
+ SysTryReturnResult(NID_UI_CTRL, (text.GetLength() != 0 || pNormalBitmap != null || pPressedBitmap != null), E_INVALID_ARG,
+ "Invalid argument(s) is used. If text is empty then pNormalBitmap or pPressedBitmap must not be null.");
_ContextMenuItem* pItem = null;
- pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ pItem = CreateItemN(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
+
result r = __pModel->SetItem(pItem, index);
if (r != E_SUCCESS)
{
delete pItem;
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to set item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to set item.");
}
r = AdjustItemLayout();
if (r != E_SUCCESS)
{
result rt = __pModel->RemoveItem(index);
- SysTryReturn(NID_UI_CTRL, rt == E_SUCCESS, rt, rt, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnResult(NID_UI_CTRL, rt == E_SUCCESS, rt, "Propagating.");
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to set item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to adjust item layout.");
}
return E_SUCCESS;
{
int itemCount = __pContextMenu->GetItemCount();
- if (itemCount <= 0 || index >= itemCount || index < 0)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "Invalid argument.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, itemCount > 0, E_INVALID_STATE, "__pContextMenu is in invalid state. Itemcount must be > 0.");
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index < itemCount , E_INVALID_ARG, "Invalid argument is used. Index (%d) is not valid", index);
result r = __pModel->RemoveItem(index);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to delete item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to delete item.");
return r;
}
{
int itemCount = __pContextMenu->GetItemCount();
- if (itemCount <= 0)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "Invalid argument.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, itemCount > 0, E_INVALID_STATE, "__pContextMenu is in invalid state. Itemcount must be > 0.");
result r = __pModel->RemoveAllItem();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to delete item all.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to delete all items.");
return r;
}
result r = E_SUCCESS;
r = AdjustItemLayout();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
r = CalculateRect();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
AdjustItemPosition();
result
_ContextMenuGridPresenter::CalculateRect(void)
{
- Tizen::Graphics::FloatRectangle windowRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // ContextMenu window itself
- Tizen::Graphics::FloatRectangle bodyRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // bg surronding showing items, relative to window
- Tizen::Graphics::FloatRectangle arrowRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // relative to window
- Tizen::Graphics::FloatRectangle itemRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // relative to window
+ FloatRectangle windowRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // ContextMenu window itself
+ FloatRectangle bodyRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // bg surronding showing items, relative to window
+ FloatRectangle arrowRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // relative to window
+ FloatRectangle itemRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // relative to window
float bodyTopMargin = __topMargin;
float bodyBottomMargin = __bottomMargin;
FloatPoint anchorPosition = __pContextMenu->GetAnchorPosition();
FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF();
+
if (__pContextMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE)
{
screen.SetSize(screen.height, screen.width);
return GetLastResult();
}
-Tizen::Graphics::FloatDimension
+FloatDimension
_ContextMenuGridPresenter::AdjustItemLayoutIconStyle(void)
{
ClearLastResult();
float itemHeight = __itemHeight + __itemGap;
FloatDimension layoutSize(0.0f, 0.0f);
- if (itemCount > MAX_ITEM_COUNT)
- {
- SetLastResult(E_MAX_EXCEEDED);
- return layoutSize;
- }
+ SysTryReturn(NID_UI_CTRL, itemCount <= MAX_ITEM_COUNT, layoutSize, E_MAX_EXCEEDED,
+ "[%s] ItemCount exceeds the maximum limit.", GetErrorMessage(E_MAX_EXCEEDED));
countPerLine = GetCountPerLine(itemCount);
}
-Tizen::Graphics::FloatDimension
+FloatDimension
_ContextMenuGridPresenter::AdjustItemLayoutTabStyle(void)
{
ClearLastResult();
}
int
-_ContextMenuGridPresenter::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const
+_ContextMenuGridPresenter::GetItemIndexFromPosition(const FloatPoint& point) const
{
int index = -1;
int itemCount = __pModel->GetItemCount();
result r = E_SUCCESS;
Canvas* pCanvas = __pContextMenu->GetCanvasN();
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ r = GetLastResult();
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
// Clear canvas for drawing area of the ContextMenu.
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
- Tizen::Graphics::FloatRectangle bounds(__pContextMenu->GetWindowRect());
- pCanvas->Clear(Tizen::Graphics::FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
+ FloatRectangle bounds(__pContextMenu->GetWindowRect());
+ pCanvas->Clear(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
r = DrawBackground(pCanvas);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to draw background.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to draw background.");
r = DrawArrow(pCanvas);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to draw arrow.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to draw arrow.");
r = DrawItem(pCanvas);
result
_ContextMenuGridPresenter::DrawBackground(Canvas* pCanvas)
{
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "A system error occurred. pCanvas is null.");
result r = E_SUCCESS;
- Tizen::Graphics::FloatRectangle bodyRect = __pContextMenu->GetBodyRect();
+ FloatRectangle bodyRect = __pContextMenu->GetBodyRect();
const Bitmap* pBackgroundNormalBitmap = __pContextMenu->GetBackgroundNormalBitmap();
const Bitmap* pBackgroundEffectBitmap = __pContextMenu->GetBackgroundEffectBitmap();
result
_ContextMenuGridPresenter::DrawArrow(Canvas* pCanvas)
{
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "A system error occurred. pCanvas is null.");
result r = E_SUCCESS;
- Tizen::Graphics::FloatRectangle arrowRect = __pContextMenu->GetArrowRect();
+ FloatRectangle arrowRect = __pContextMenu->GetArrowRect();
ContextMenuCoreDropPosition dropPosition = __pContextMenu->GetDropPosition();
const Bitmap* pArrowNormalBitmap = __pContextMenu->GetArrowNormalBitmap(dropPosition);
}
result
-_ContextMenuGridPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas)
+_ContextMenuGridPresenter::DrawItem(Canvas* pCanvas)
{
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "A system error occurred. pCanvas is null.");
result r = E_SUCCESS;
TextSimple* pSimpleText = null;
__pTextObject->RemoveAll();
pSimpleText = new (std::nothrow)TextSimple(const_cast <mchar*>(text.GetPointer()), text.GetLength());
- SysTryReturn(NID_UI_CTRL, pSimpleText != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pSimpleText != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
__pTextObject->AppendElement(*pSimpleText);
__pTextObject->SetForegroundColor(__pContextMenu->GetTextColor(itemStatus), 0, __pTextObject->GetTextLength());
Color contentHighlightedColor;
GET_COLOR_CONFIG(FOCUSUI::CONTENT_BG_HIGHLIGHTED, contentHighlightedColor);
+
Bitmap* pBitmap = null;
result r = GET_REPLACED_BITMAP_CONFIG_N(FOCUSUI::FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, contentHighlightedColor, pBitmap);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to load bitmap.");
}
result
-_ContextMenuGridPresenter::DrawLine(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::FloatPoint point1, Tizen::Graphics::FloatPoint point2, bool drawVLine)
+_ContextMenuGridPresenter::DrawLine(Canvas* pCanvas, FloatPoint point1, FloatPoint point2, bool drawVLine)
{
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "A system error occurred. pCanvas is null.");
result r = E_SUCCESS;
if (pContainer != null)
{
_AccessibilityElement* pElementContextMenu = new (std::nothrow) _AccessibilityElement(true);
- SysTryReturnVoidResult(NID_UI_CTRL, pElementContextMenu, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pElementContextMenu, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pElementContextMenu->SetSupportOperatingGesture(false);
+
pElementContextMenu->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
pElementContextMenu->SetHintWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_IS_OPEN_DOUBLE_TAP_TO_CLOSE_THE_POP_UP_T_TTS");
+
pElementContextMenu->SetBounds(FloatRectangle(0.0f, 0.0f, __pContextMenu->GetBoundsF().width, __pContextMenu->GetBoundsF().height));
pContainer->AddElement(*pElementContextMenu);
__pContextMenu->AddAccessibilityElement(*pElementContextMenu);
pElement->SetName(L"ContextMenuItem" + Integer::ToString(i));
if (pItem->GetType() == CONTEXT_MENU_ITEM_DRAWING_TYPE_BITMAP)
{
- pElement->SetLabelWithStringId("IDS_TPLATFORM_BODY_ICON");
+ pElement->SetLabelWithStringId("IDS_TPLATFORM_BODY_ICON.");
}
else
{
pElement->SetLabel(pItem->GetText());
}
- pElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
+ pElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS.");
pElement->SetBounds(pItem->GetDrawRect());
pContainer->AddElement(*pElement);
__pContextMenu->AddAccessibilityElement(*pElement);
}
result
-_ContextMenuGridPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap)
+_ContextMenuGridPresenter::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, const Bitmap& bitmap)
{
result r = E_SUCCESS;
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(bitmap))
{
r = canvas.DrawNinePatchedBitmap(bounds, bitmap);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Fail to draw ninepatched bitmap.")
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to draw ninepatched bitmap.")
}
else
{
r = canvas.DrawBitmap(bounds, bitmap);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Fail to draw bitmap.")
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to draw bitmap.")
}
return r;
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
namespace Tizen { namespace Ui { namespace Controls
{
}
_ContextMenu* pCore = _ContextMenu::CreateContextMenuN(point, coreStyle, contextMenuAlign);
- SysTryReturn(NID_UI_CTRL, pCore != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pCore != null, null, GetLastResult(), "[%s] Propogating.", GetErrorMessage(GetLastResult()));
_ContextMenuImpl* pImpl = new (std::nothrow) _ContextMenuImpl(pPublic, pCore, style);
r = CheckConstruction(pCore, pImpl);
}
result
-_ContextMenuImpl::AddItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuImpl::AddItem(const Base::String& text, int actionId, const Bitmap* pNormalBitmap,
+ const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->AddItem(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
}
result
-_ContextMenuImpl::InsertItem(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuImpl::InsertItem(int index, const String& text, int actionId, const Bitmap* pNormalBitmap,
+ const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->InsertItem(index, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
}
result
-_ContextMenuImpl::SetItem(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuImpl::SetItem(int index, const String& text, int actionId, const Bitmap* pNormalBitmap,
+ const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->SetItem(index, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
}
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
if (index >= GetItemCount() || index < 0)
{
- SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index);
+ SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[%s] The specified index is not valid(index = %d).", GetErrorMessage(E_OUT_OF_RANGE), index);
// E_OUT_OF_RANGE is for API version 2.0 over
return (_AppInfo::GetApiVersion() <= _API_VERSION_2_0 && _AppInfo::IsOspCompat())?E_SYSTEM:E_OUT_OF_RANGE;
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->RemoveAllItems();
}
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->SetAnchorPosition(x, y);
}
-Tizen::Graphics::FloatPoint
+FloatPoint
_ContextMenuImpl::GetAnchorPosition(void) const
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
- Tizen::Graphics::FloatPoint point;
+ FloatPoint point;
point = __pContextMenu->GetAnchorPosition();
return point;
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->GetItemCount();
}
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->SetShowItemCount(maxItemsCount);
}
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->GetShowItemCount();
}
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->GetItemIndexAt(actionId);
}
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->GetItemActionIdAt(index);
}
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
result r = E_SUCCESS;
r = __pContextMenu->SetColor(color);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to set color.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set color.");
return r;
}
-Tizen::Graphics::Color
+Color
_ContextMenuImpl::GetColor(void) const
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
return __pContextMenu->GetColor();
}
result
-_ContextMenuImpl::SetItemTextColor(ContextMenuItemStatus status, const Tizen::Graphics::Color& color)
+_ContextMenuImpl::SetItemTextColor(ContextMenuItemStatus status, const Color& color)
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
result r = E_SUCCESS;
switch (status)
break;
default:
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument at ContextMenuItemStatus.");
+ SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument is used. ContextMenuItemStatus parameter is invalid.");
r = E_INVALID_ARG;
break;
}
}
-Tizen::Graphics::Color
+Color
_ContextMenuImpl::GetItemTextColor(ContextMenuItemStatus status) const
{
ClearLastResult();
SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::Color color(0, 0, 0, 0);
+ Color color(0, 0, 0, 0);
switch (status)
{
break;
default:
- SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument at ContextMenuItemStatus.");
+ SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument is used. ContextMenuItemStatus parameter is invalid.");
break;
}
return color;
}
result
-_ContextMenuImpl::SetItemColor(ContextMenuItemStatus status, const Tizen::Graphics::Color& color)
+_ContextMenuImpl::SetItemColor(ContextMenuItemStatus status, const Color& color)
{
ClearLastResult();
break;
default:
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument at ContextMenuItemStatus.");
+ SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument is used. ContextMenuItemStatus parameter is invalid.");
r = E_INVALID_ARG;
break;
}
}
-Tizen::Graphics::Color
+Color
_ContextMenuImpl::GetItemColor(ContextMenuItemStatus status) const
{
ClearLastResult();
SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::Color color(0, 0, 0, 0);
+ Color color(0, 0, 0, 0);
switch (status)
{
break;
default:
- SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument at ContextMenuItemStatus.");
+ SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument is used. ContextMenuItemStatus parameter is invalid.");
break;
}
}
result
-_ContextMenuImpl::AddActionEventListener(Tizen::Ui::IActionEventListener& listener)
+_ContextMenuImpl::AddActionEventListener(IActionEventListener& listener)
{
ClearLastResult();
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
-
result r = E_SUCCESS;
if (__pPublicActionEvent == null)
{
__pPublicActionEvent = _PublicActionEvent::CreateInstanceN(GetPublic());
- SysTryReturn(NID_UI_CTRL, __pPublicActionEvent != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
- "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, __pPublicActionEvent != null, GetLastResult(),"Propagating.");
}
r = __pPublicActionEvent->AddListener(listener);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to add an action event listener.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to add action event listener.");
r = __pContextMenu->AddActionEventListener(*this);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to add an action event listener.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to add action event listener.");
return r;
}
result
-_ContextMenuImpl::RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener)
+_ContextMenuImpl::RemoveActionEventListener(IActionEventListener& listener)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, __pPublicActionEvent != null, E_INVALID_STATE, E_INVALID_STATE,
- "[E_INVALID_STATE] This instance isn't constructed.")
- SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use.");
+ SysTryReturnResult(NID_UI_CTRL, __pPublicActionEvent != null, E_INVALID_STATE,
+ "__pPublicActionEvent must not be null.")
result r = E_SUCCESS;
r = __pPublicActionEvent->RemoveListener(listener);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove an action event listener.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to remove action event listener.");
r = __pContextMenu->RemoveActionEventListener(*this);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove an action event listener.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to remove action event listener.");
return r;
}
void
-_ContextMenuImpl::OnActionPerformed(const Tizen::Ui::_Control& source, int actionId)
+_ContextMenuImpl::OnActionPerformed(const _Control& source, int actionId)
{
ClearLastResult();
_ContextMenuItem* pItem = null;
pItem = new (std::nothrow) _ContextMenuItem();
- if (pItem == null)
- {
- SetLastResult(E_OUT_OF_MEMORY);
- return null;
- }
+ SysTryReturn(NID_UI_CTRL, pItem != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pItem->AcquireHandle();
{
pContainer->Activate(true);
_AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true);
- SysTryReturnVoidResult(NID_UI_CTRL, pElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pElement, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
pElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
}
result
-_ContextMenuItem::SetText(const Tizen::Base::String& text)
+_ContextMenuItem::SetText(const String& text)
{
- if (text.GetLength() <= 0)
- {
- return E_INVALID_ARG;
- }
+ SysTryReturnResult(NID_UI_CTRL, text.GetLength() > 0, E_INVALID_ARG, "Invalid argument is used. Length of text must be greater than 0");
__text = text;
return E_SUCCESS;
}
-const Tizen::Base::String&
+const String&
_ContextMenuItem::GetText(void) const
{
return __text;
}
result
-_ContextMenuItem::SetBitmap(ContextMenuItemDrawingStatus status, const Tizen::Graphics::Bitmap* pBitmap)
+_ContextMenuItem::SetBitmap(ContextMenuItemDrawingStatus status, const Bitmap* pBitmap)
{
- if (status < CONTEXT_MENU_ITEM_DRAWING_STATUS_NORMAL || status > CONTEXT_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED)
- {
- return E_INVALID_ARG;
- }
+ SysTryReturnResult(NID_UI_CTRL, (status >= CONTEXT_MENU_ITEM_DRAWING_STATUS_NORMAL && status <= CONTEXT_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED),
+ E_INVALID_ARG, "Invalid argument is used. The status is not valid.");
- SysTryReturn(NID_UI_CTRL, (status != CONTEXT_MENU_ITEM_DRAWING_STATUS_NORMAL || pBitmap != null), E_INVALID_ARG,
- E_INVALID_ARG,
- "[E_INVALID_ARG] The normal bitmap must not be null.");
+ SysTryReturnResult(NID_UI_CTRL, (status != CONTEXT_MENU_ITEM_DRAWING_STATUS_NORMAL || pBitmap != null),
+ E_INVALID_ARG, "Invalid argument is used. The normal bitmap must not be null.");
Bitmap* pClonedBitmap = _BitmapImpl::CloneN(*pBitmap);
return E_SUCCESS;
}
-const Tizen::Graphics::Bitmap*
+const Bitmap*
_ContextMenuItem::GetBitmap(ContextMenuItemDrawingStatus status) const
{
if (status < CONTEXT_MENU_ITEM_DRAWING_STATUS_NORMAL || status > CONTEXT_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED)
}
void
-_ContextMenuItem::SetSize(Tizen::Graphics::FloatDimension size)
+_ContextMenuItem::SetSize(FloatDimension size)
{
__size = size;
}
-Tizen::Graphics::FloatDimension
+FloatDimension
_ContextMenuItem::GetSize(void) const
{
return __size;
}
void
-_ContextMenuItem::SetDrawRect(Tizen::Graphics::FloatRectangle rect)
+_ContextMenuItem::SetDrawRect(FloatRectangle rect)
{
__drawRect = rect;
}
-Tizen::Graphics::FloatRectangle
+FloatRectangle
_ContextMenuItem::GetDrawRect(void) const
{
return __drawRect;
}
void
-_ContextMenuItem::SetPressedDrawRect(Tizen::Graphics::FloatRectangle rect)
+_ContextMenuItem::SetPressedDrawRect(FloatRectangle rect)
{
__pressedDrawRect = rect;
}
-Tizen::Graphics::FloatRectangle
+FloatRectangle
_ContextMenuItem::GetPressedDrawRect(void) const
{
return __pressedDrawRect;
if (__pUpperDividerLineLabel == null)
{
__pUpperDividerLineLabel = _Label::CreateLabelN();
- SysTryReturnVoidResult(NID_UI_CTRL, __pUpperDividerLineLabel, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnVoidResult(NID_UI_CTRL, __pUpperDividerLineLabel, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
AttachChild(*__pUpperDividerLineLabel);
if (__pBackgroundLabel == null)
{
__pBackgroundLabel = _Label::CreateLabelN();
- SysTryReturnVoidResult(NID_UI_CTRL, __pBackgroundLabel, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnVoidResult(NID_UI_CTRL, __pBackgroundLabel, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
__pBackgroundLabel->SetTouchPressThreshold(TOUCH_PRESS_THRESHOLD_INSENSITIVE);
AttachChild(*__pBackgroundLabel);
if (__pLowerDividerLineLabel == null)
{
__pLowerDividerLineLabel = _Label::CreateLabelN();
- SysTryReturnVoidResult(NID_UI_CTRL, __pLowerDividerLineLabel, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnVoidResult(NID_UI_CTRL, __pLowerDividerLineLabel, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
AttachChild(*__pLowerDividerLineLabel);
}
void
-_ContextMenuItem::OnFontChanged(Tizen::Graphics::Font* pFont)
+_ContextMenuItem::OnFontChanged(Font* pFont)
{
String fontName = _Control::GetFont();
LoadShape();
__pModel = new (std::nothrow) _ContextMenuModel;
- SysTryCatch(NID_UI_CTRL, __pModel != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+ SysTryReturnResult(NID_UI_CTRL, __pModel != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
r = __pModel->Construct();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create data instance.");
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = GetLastResult(), GetLastResult(), "[%s] Memory allocation failed.", GetErrorMessage(GetLastResult()));
__pFont = __pContextMenu->GetFallbackFont();
r = GetLastResult();
}
_ContextMenuItem*
-_ContextMenuListPresenter::CreateItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuListPresenter::CreateItemN(const Base::String& text, int actionId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
_ContextMenuItem* pItem = _ContextMenuItem::CreateContextMenuItemN();
- SysTryReturn(NID_UI_CTRL, pItem != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pItem != null, null, GetLastResult(), "[%s] pItem must not be null.", GetErrorMessage(GetLastResult()));
ContextMenuItemDrawingType itemType = CONTEXT_MENU_ITEM_DRAWING_TYPE_TEXT;
_Label* pLabel = null;
}
result
-_ContextMenuListPresenter::AddItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* normalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuListPresenter::AddItem(const Base::String& text, int actionId, const Bitmap* pNormalBitmap,
+ const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
- _ContextMenuItem* pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ _ContextMenuItem* pItem = CreateItemN(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
result r = __pModel->AddItem(pItem);
if (r != E_SUCCESS)
{
delete pItem;
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to add item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to add item.");
}
return r;
}
result
-_ContextMenuListPresenter::InsertItem(int index, const Tizen::Base::String& text, int actionId,
- const Tizen::Graphics::Bitmap* normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuListPresenter::InsertItem(int index, const String& text, int actionId,
+ const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
- if (text.GetLength() == 0 && normalBitmap == null && pPressedBitmap == null)
- {
- return E_INVALID_ARG;
- }
+
+ SysTryReturnResult(NID_UI_CTRL, (text.GetLength() != 0 || pNormalBitmap != null || pPressedBitmap != null), E_INVALID_ARG,
+ "Invalid argument(s) is used. If text is empty then pNormalBitmap or pPressedBitmap must not be null.");
_ContextMenuItem* pItem = null;
- pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ pItem = CreateItemN(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
result r = __pModel->InsertItem(pItem, index);
if (r != E_SUCCESS)
{
delete pItem;
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to add item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to add item.");
}
return E_SUCCESS;
}
result
-_ContextMenuListPresenter::SetItem(int index, const Tizen::Base::String& text, int actionId,
- const Tizen::Graphics::Bitmap* normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
- const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+_ContextMenuListPresenter::SetItem(int index, const String& text, int actionId,
+ const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap,
+ const Bitmap* pHighlightedBitmap)
{
_ContextMenuItem* pItem = null;
result r = E_SUCCESS;
- if (text.GetLength() == 0 && normalBitmap == null && pPressedBitmap == null)
- {
- return E_INVALID_ARG;
- }
+ SysTryReturnResult(NID_UI_CTRL, (text.GetLength() != 0 || pNormalBitmap != null || pPressedBitmap != null), E_INVALID_ARG,
+ "Invalid argument(s) is used. If text is empty then pNormalBitmap or pPressedBitmap must not be null.");
pItem = __pModel->GetItem(index);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pItem != null, r, r, "Failed to get the item.");
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, r, "Failed to get the item.");
r = __pContextMenu->GetScrollPanel()->DetachChild(*pItem);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to detach item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to detach item.");
- pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ pItem = CreateItemN(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
r = __pModel->SetItem(pItem, index);
if (r != E_SUCCESS)
{
delete pItem;
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to add item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to add item.");
}
CalculateItemMaximumWidth();
_ContextMenuItem* pItem = null;
result r = E_SUCCESS;
- if (__pContextMenu->GetItemCount() <= 0)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "Invalid argument.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, __pContextMenu->GetItemCount() > 0, E_INVALID_STATE, "__pContextMenu is in invalid state. Item count is less than or equal to zero.");
pItem = __pModel->GetItem(index);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pItem != null, r, r, "Failed to get the item.");
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, r, "Failed to get the item.");
r = __pContextMenu->GetScrollPanel()->DetachChild(*pItem);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to detach item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to detach item.");
r = __pModel->RemoveItem(index);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to delete item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to delete item.");
CalculateItemMaximumWidth();
result
_ContextMenuListPresenter::DeleteItemAll(void)
{
- if (__pContextMenu->GetItemCount() <= 0)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "Invalid argument.");
- return E_INVALID_STATE;
- }
+ SysTryReturnResult(NID_UI_CTRL, __pContextMenu->GetItemCount() > 0, E_INVALID_STATE, "__pContextMenu is in invalid state. Item count is less than or equal to zero.");
__pContextMenu->GetScrollPanel()->DetachAllChildren();
result r = __pModel->RemoveAllItem();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to delete item all.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to delete item all.");
return r;
}
result
_ContextMenuListPresenter::CalculateRect(void)
{
- Tizen::Graphics::FloatRectangle windowRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // ContextMenu window itself
- Tizen::Graphics::FloatRectangle bodyRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // bg surronding showing items, relative to window
- Tizen::Graphics::FloatRectangle arrowRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // relative to window
- Tizen::Graphics::FloatRectangle itemRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // relative to window
+ FloatRectangle windowRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // ContextMenu window itself
+ FloatRectangle bodyRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // bg surronding showing items, relative to window
+ FloatRectangle arrowRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // relative to window
+ FloatRectangle itemRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // relative to window
float bodyTopMargin = __topMargin;
float bodyBottomMargin = __bottomMargin;
}
-Tizen::Graphics::FloatDimension
+FloatDimension
_ContextMenuListPresenter::AdjustItemLayoutStyle(void)
{
int itemMaxCount = CalculateShowItemCount();
_ContextMenuItem* pItem = null;
pItem = __pModel->GetItem(i);
- SysTryReturn(NID_UI_CTRL, pItem != null, , E_SYSTEM, "[E_SYSTEM] A system error occurred. Unable to get the item.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pItem != null, E_SYSTEM, "[%s] A system error occurred. Unable to get the item.", GetErrorMessage(E_SYSTEM));
CalculateItemSize(pItem->GetText(), pItem->GetType(), textArea, itemSize);
}
int
-_ContextMenuListPresenter::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const
+_ContextMenuListPresenter::GetItemIndexFromPosition(const FloatPoint& point) const
{
int index = -1;
int itemCount = __pModel->GetItemCount();
result r = E_SUCCESS;
Canvas* pCanvas = __pContextMenu->GetCanvasN();
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ r = GetLastResult();
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "Propagating.");
// Clear canvas for drawing area of the ContextMenu.
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
- Tizen::Graphics::FloatRectangle bounds(__pContextMenu->GetWindowRect());
- pCanvas->Clear(Tizen::Graphics::FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
+ FloatRectangle bounds(__pContextMenu->GetWindowRect());
+ pCanvas->Clear(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
r = DrawBackground(pCanvas);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to draw background.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to draw background.");
r = DrawArrow(pCanvas);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to draw arrow.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to draw arrow.");
delete pCanvas;
result
_ContextMenuListPresenter::DrawBackground(Canvas* pCanvas)
{
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "A system error has occurred. pCanvas is null.");
result r = E_SUCCESS;
- Tizen::Graphics::FloatRectangle bodyRect = __pContextMenu->GetBodyRect();
+ FloatRectangle bodyRect = __pContextMenu->GetBodyRect();
const Bitmap* pBackgroundNormalBitmap = __pContextMenu->GetBackgroundNormalBitmap();
const Bitmap* pBackgroundEffectBitmap = __pContextMenu->GetBackgroundEffectBitmap();
result
_ContextMenuListPresenter::DrawArrow(Canvas* pCanvas)
{
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "A system error has occurred. pCanvas is null.");
result r = E_SUCCESS;
- Tizen::Graphics::FloatRectangle arrowRect = __pContextMenu->GetArrowRect();
+ FloatRectangle arrowRect = __pContextMenu->GetArrowRect();
ContextMenuCoreDropPosition dropPosition = __pContextMenu->GetDropPosition();
const Bitmap* pArrowNormalBitmap = __pContextMenu->GetArrowNormalBitmap(dropPosition);
}
void
-_ContextMenuListPresenter::OnFontChanged(Tizen::Graphics::Font* pFont)
+_ContextMenuListPresenter::OnFontChanged(Font* pFont)
{
__pFont = pFont;
String fontName = __pContextMenu->GetFont();
if (pContainerContextMenu != null)
{
_AccessibilityElement* pElementContextMenu = new (std::nothrow) _AccessibilityElement(true);
- SysTryReturnVoidResult(NID_UI_CTRL, pElementContextMenu, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pElementContextMenu, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pElementContextMenu->SetSupportOperatingGesture(false);
pElementContextMenu->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
}
result
-_ContextMenuListPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap)
+_ContextMenuListPresenter::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, const Bitmap& bitmap)
{
result r = E_SUCCESS;
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(bitmap))
{
result r = __items.Construct(DEFAULT_ITEM_COUNT);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to construct ArrayList.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to construct ArrayList.");
return r;
}
result
_ContextMenuModel::AddItem(_ContextMenuItem* pItem)
{
- if (IsValidItem(pItem) == false)
- {
- return E_SYSTEM;
- }
+ SysTryReturnResult(NID_UI_CTRL, IsValidItem(pItem), E_SYSTEM, "A system error has occurred. pItem is not valid.");
return __items.Add(*pItem);
}
result
_ContextMenuModel::InsertItem( _ContextMenuItem* pItem, int index)
{
- if (IsValidItem(pItem) == false)
- {
- return E_SYSTEM;
- }
+ SysTryReturnResult(NID_UI_CTRL, IsValidItem(pItem), E_SYSTEM, "A system error has occurred. pItem is not valid.");
return __items.InsertAt(*pItem, index);
}
if (IsValidItem(pItem) == false)
{
_ContextMenuItem* pTargetItem = GetItem(index);
- if (pItem == null || pTargetItem == null || pItem->GetActionId() != pTargetItem->GetActionId())
- {
- return E_SYSTEM;
- }
+
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, E_SYSTEM, "A system error has occurred. pItem must not be null.");
+ SysTryReturnResult(NID_UI_CTRL, pTargetItem != null, E_SYSTEM, "A system error has occurred. pTargetItem must not be null.");
+ SysTryReturnResult(NID_UI_CTRL, pItem->GetActionId() == pTargetItem->GetActionId(), E_SYSTEM, "A system error has occurred. ActionId of pItem and pTargetItem does not match.");
}
return __items.SetAt(*pItem, index, true);
using namespace Tizen::Graphics;
using namespace Tizen::Base;
using namespace Tizen::Media;
+using namespace Tizen::Ui;
using namespace Tizen::Ui::Animations;
using namespace Runtime;
GET_SHAPE_CONFIG(OPTIONMENU::LIST_ITEM_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, minHeight);
pOptionMenu = new (std::nothrow) _OptionMenu();
- SysTryReturn(NID_UI_CTRL, pOptionMenu != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pOptionMenu != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
r = pOptionMenu->CreateRootVisualElement();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
pScrollPanel->SetTouchPressThreshold(TOUCH_PRESS_THRESHOLD_INSENSITIVE);
pScroll = pScrollPanel->GetScrollBar();
- SysTryCatch(NID_UI_CTRL, pScroll, , E_INVALID_STATE, "[E_INVALID_STATE] _Scroll isn't constructed");
+ SysTryCatch(NID_UI_CTRL, pScroll, , E_INVALID_STATE, "[%s] _Scroll is not constructed", GetErrorMessage(E_INVALID_STATE));
pScroll->SetContextMenuScrollType(true);
pOptionMenu->AttachChild(*(pScrollPanel));
// load bitmap of a background and arrow
r = LoadBitmap();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to load bitmap.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to load bitmap.");
r = __actionId.Construct();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to construct arraylist.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to construct arraylist.");
_OptionMenuPresenter* pPresenter = new (std::nothrow) _OptionMenuPresenter(this);
- SysTryReturnResult(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
SetPresenter(*pPresenter);
screen = _ControlManager::GetInstance()->GetScreenSizeF();
r = SetBounds(FloatRectangle(0.0f, 0.0f, screen.width, screen.height));
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "SetBounds failed.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set option menu bounds.");
SetMovable(false);
SetResizable(false);
if (pOwner == null)
{
__pCurrentFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturn(NID_UI_CTRL, __pCurrentFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available.");
+ SysTryReturnResult(NID_UI_CTRL, __pCurrentFrame != null, E_SYSTEM, "Current frame instance is not available.");
_Form* pForm = __pCurrentFrame->GetCurrentForm();
pForm != null ? SetOwner(pForm) : SetOwner(__pCurrentFrame);
}
r = __pOptionMenuPresenter->CalculateWindowRect();
+
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
GetEcoreEvasMgr()->GetEcoreEvas()->SetWindowBounds(*this, GetBoundsF());
{
result r = E_SUCCESS;
- SysTryReturn(NID_UI_CTRL, (GetItemIndexFromActionId(actionId) == -1), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred."
+ SysTryReturnResult(NID_UI_CTRL, (GetItemIndexFromActionId(actionId) == -1), E_SYSTEM, "A system error has occurred."
" The option menu already has an item with the same action id (%d)", actionId);
r = __pOptionMenuPresenter->AddItem(text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to add a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to add a item.");
__actionId.Add(actionId);
{
result r = E_SUCCESS;
- SysTryReturn(NID_UI_CTRL, (GetItemIndexFromActionId(actionId) == -1), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred."
+ SysTryReturnResult(NID_UI_CTRL, (GetItemIndexFromActionId(actionId) == -1), E_SYSTEM, "A system error has occurred."
" The option menu already has an item with the same action id (%d)", actionId);
r = __pOptionMenuPresenter->InsertItem(mainIndex, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to add a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to add a item.");
__actionId.InsertAt(actionId, mainIndex);
result r = E_SUCCESS;
r = __pOptionMenuPresenter->SetItem(mainIndex, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to set a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set a item.");
__actionId.SetAt(actionId, mainIndex);
_OptionMenu::AddSubItem(int mainIndex, const String& text, int actionId)
{
result r = __pOptionMenuPresenter->AddSubItem(mainIndex, text, actionId);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating.");
if (__pSubMenu != null && mainIndex == __subMenuIndex)
{
_OptionMenu::InsertSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
result r = __pOptionMenuPresenter->InsertSubItemAt(mainIndex, subIndex, text, actionId);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating.");
if (__pSubMenu != null && mainIndex == __subMenuIndex)
{
_OptionMenu::SetSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
result r = __pOptionMenuPresenter->SetSubItemAt(mainIndex, subIndex, text, actionId);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating.");
if (__pSubMenu != null && mainIndex == __subMenuIndex)
{
_OptionMenu::RemoveSubItemAt(int mainIndex, int subIndex)
{
result r = __pOptionMenuPresenter->RemoveSubItemAt(mainIndex, subIndex);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating.");
if (__pSubMenu != null && mainIndex == __subMenuIndex)
{
if (__pSubMenu->GetOwner() == null)
{
_Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM,
- E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
+ SysTryReturnResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "This instance is not constructed.");
_Form* pForm = pFrame->GetCurrentForm();
if (pForm != null)
result
_OptionMenu::DestroySubMenu(void)
{
- if (__pSubMenu == null)
- {
- return E_SYSTEM;
- }
+ SysTryReturnResult(NID_UI_CTRL, __pSubMenu != null, E_SYSTEM, "A system error has occured. __pSubMenu is null.");
__pSubMenu->Close();
delete __pSubMenu;
result r = E_SUCCESS;
r = __pOptionMenuPresenter->InsertItem(index, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to insert a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to insert a item.");
__actionId.InsertAt(actionId, index);
result r = E_SUCCESS;
r = __pOptionMenuPresenter->SetItem(index, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to set a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set a item.");
__actionId.SetAt(actionId, index);
result r = E_SUCCESS;
r = __pOptionMenuPresenter->DeleteItem(index);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove a item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to remove a item.");
__actionId.RemoveAt(index);
{
int showCount = count.ToInt();
- if (showCount < 1)
- {
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Count is invalid.");
- return E_INVALID_ARG;
- }
+ SysTryReturnResult(NID_UI_CTRL, showCount > 0, E_INVALID_ARG, "Invalid argument is used. Count is invalid.");
__showItemCount = showCount;
Variant
_OptionMenu::GetPropertyMaxVisibleItemsCount(void) const
{
- return Tizen::Ui::Variant(__showItemCount);
+ return Variant(__showItemCount);
}
int
result r;
r = SetProperty("maxVisibleItemsCount", Variant(count));
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to set property.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set property.");
if (__isAttachedToMainTree)
{
__backgroundColor = color.ToColor();
result r = LoadColorReplacedBitmap(__backgroundColor);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] A system error occurred. Failed to load the color replacement bitmap.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to load the color replacement bitmap.");
return E_SUCCESS;
}
Variant
_OptionMenu::GetPropertyColor(void) const
{
- return Tizen::Ui::Variant(__backgroundColor);
+ return Variant(__backgroundColor);
}
result
_OptionMenu::SetMaxVisibleItemsCount(int maxItemsCount)
{
result r = SetPropertyMaxVisibleItemsCount(maxItemsCount);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
__isMaxVisibleCountSet = true;
Variant
_OptionMenu::GetPropertyNormalItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[OPTION_MENU_CORE_ITEM_STATUS_NORMAL]);
+ return Variant(__itemColor[OPTION_MENU_CORE_ITEM_STATUS_NORMAL]);
}
result
Variant
_OptionMenu::GetPropertyPressedItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[OPTION_MENU_CORE_ITEM_STATUS_PRESSED]);
+ return Variant(__itemColor[OPTION_MENU_CORE_ITEM_STATUS_PRESSED]);
}
result
Variant
_OptionMenu::GetPropertyHighlightedItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED]);
+ return Variant(__itemColor[OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED]);
}
result
Variant
_OptionMenu::GetPropertyNormalItemTextColor(void) const
{
- return Tizen::Ui::Variant(__textColor[OPTION_MENU_CORE_ITEM_STATUS_NORMAL]);
+ return Variant(__textColor[OPTION_MENU_CORE_ITEM_STATUS_NORMAL]);
}
result
Variant
_OptionMenu::GetPropertyPressedItemTextColor(void) const
{
- return Tizen::Ui::Variant(__textColor[OPTION_MENU_CORE_ITEM_STATUS_PRESSED]);
+ return Variant(__textColor[OPTION_MENU_CORE_ITEM_STATUS_PRESSED]);
}
result
Variant
_OptionMenu::GetPropertyHighlightedItemTextColor(void) const
{
- return Tizen::Ui::Variant(__textColor[OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED]);
+ return Variant(__textColor[OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED]);
}
result
if (__pActionEvent == null)
{
__pActionEvent = _ActionEvent::CreateInstanceN(*this);
- SysTryReturn(NID_UI_CTRL, __pActionEvent != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, __pActionEvent != null, GetLastResult(), "Propagating.");
r = __pActionEvent->AddListener(listener);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to remove an action event listener.");
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to remove action event listener.");
}
return r;
result
_OptionMenu::RemoveActionEventListener(const _IActionEventListener& listener)
{
- SysTryReturn(NID_UI_CTRL, __pActionEvent != null, E_INVALID_STATE, E_INVALID_STATE,
- "[E_INVALID_STATE] The action event instance isn't constructed.");
+ SysTryReturnResult(NID_UI_CTRL, __pActionEvent != null, E_INVALID_STATE,
+ "The action event instance isn't constructed.");
result r = E_SUCCESS;
r = __pActionEvent->RemoveListener(listener);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove an action event listener");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to remove action event listener");
return r;
}
{
IEventArg* pArg = _ActionEvent::CreateActionEventArgN(actionId);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (pArg != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, (pArg != null), r, "Propagating.");
r = __pActionEvent->Fire(*pArg);
const Bitmap* pPressedBitmap, const Bitmap *pHighlightedBitmap)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0 && mainIndex <= GetItemCount()), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is invalid.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, (mainIndex >= 0 && mainIndex <= GetItemCount()), E_INVALID_ARG,
+ "Invalid argument is used. The specified main index (%d) is invalid.", mainIndex);
return GetCore().InsertItemAt(mainIndex, text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
}
const Bitmap* pPressedBitmap, const Bitmap *pHighlightedBitmap)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0 && mainIndex < GetItemCount()), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is invalid.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, (mainIndex >= 0 && mainIndex < GetItemCount()), E_INVALID_ARG,
+ "Invalid argument is used. The specified main index (%d) is invalid.", mainIndex);
return GetCore().SetItemAt(mainIndex, text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
}
_OptionMenuImpl::RemoveItemAt(int mainIndex)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0 && mainIndex < GetItemCount()), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is invalid.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, (mainIndex >= 0 && mainIndex < GetItemCount()), E_INVALID_ARG,
+ "Invalid argument is used. The specified main index (%d) is invalid.", mainIndex);
return GetCore().RemoveItemAt(mainIndex);
}
{
ClearLastResult();
SysTryReturn(NID_UI_CTRL, (mainIndex >= 0 && mainIndex < GetItemCount()), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is invalid.", mainIndex);
+ "[%s] Invalid argument is used. The specified main index (%d) is invalid.", GetErrorMessage(E_INVALID_ARG), mainIndex);
return GetCore().GetItemActionIdAt(mainIndex);
}
_OptionMenuImpl::AddSubItem(int mainIndex, const String& text, int actionId)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG,
+ "Invalid argument is used. The specified main index (%d) is negative.", mainIndex);
return GetCore().AddSubItem(mainIndex, text, actionId);
}
_OptionMenuImpl::InsertSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
- SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified sub index (%d) is negative.", subIndex);
+ SysTryReturnResult(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG,
+ "Invalid argument is used. The specified main index (%d) is negative.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG,
+ "Invalid argument is used. The specified sub index (%d) is negative.", subIndex);
return GetCore().InsertSubItemAt(mainIndex, subIndex, text, actionId);
}
_OptionMenuImpl::SetSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
- SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified sub index (%d) is negative.", subIndex);
+ SysTryReturnResult(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG,
+ "Invalid argument is used. The specified main index (%d) is negative.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG,
+ "Invalid argument is used. The specified sub index (%d) is negative.", subIndex);
return GetCore().SetSubItemAt(mainIndex, subIndex, text, actionId);
}
_OptionMenuImpl::RemoveSubItemAt(int mainIndex, int subIndex)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
- SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified sub index (%d) is negative.", subIndex);
+ SysTryReturnResult(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG,
+ "Invalid argument is used. The specified main index (%d) is negative.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG,
+ "Invalid argument is used. The specified sub index (%d) is negative.", subIndex);
return GetCore().RemoveSubItemAt(mainIndex, subIndex);
}
{
ClearLastResult();
SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
+ "[%s] Invalid argument is used. The specified main index (%d) is negative.", GetErrorMessage(E_INVALID_ARG), mainIndex);
return GetCore().GetSubItemCount(mainIndex);
}
{
ClearLastResult();
SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
+ "[%s] Invalid argument is used. The specified main index (%d) is negative.", GetErrorMessage(E_INVALID_ARG), mainIndex);
SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified sub index (%d) is negative.", subIndex);
+ "[%s] Invalid argument is used. The specified sub index (%d) is negative.", GetErrorMessage(E_INVALID_ARG), subIndex);
return GetCore().GetSubItemActionIdAt(mainIndex, subIndex);
}
break;
default:
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument at OptionMenuItemStatus.");
+ SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument is used. OptionMenuItemStatus param is invalid.");
r = E_INVALID_ARG;
break;
}
{
ClearLastResult();
- Tizen::Graphics::Color color(0, 0, 0, 0);
+ Color color(0, 0, 0, 0);
switch (status)
{
break;
default:
- SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument at OptionMenuItemStatus.");
+ SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument is used. OptionMenuItemStatus param is invalid.");
break;
}
break;
default:
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument at OptionMenuItemStatus.");
+ SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument is used. OptionMenuItemStatus param is invalid.");
r = E_INVALID_ARG;
break;
}
{
ClearLastResult();
- Tizen::Graphics::Color color(0, 0, 0, 0);
+ Color color(0, 0, 0, 0);
switch (status)
{
break;
default:
- SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument at OptionMenuItemStatus.");
+ SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument is used. OptionMenuItemStatus parma is invalid.");
break;
}
_OptionMenuItem* pItem = null;
pItem = new (std::nothrow) _OptionMenuItem();
- if (pItem == null)
- {
- SetLastResult(E_OUT_OF_MEMORY);
- return null;
- }
+ SysTryReturn(NID_UI_CTRL, pItem != null, null , E_OUT_OF_MEMORY, "[%s] Memory allocation falied.", GetErrorMessage(E_OUT_OF_MEMORY));
pItem->AcquireHandle();
if (__pSubItems == null)
{
__pSubItems = new (std::nothrow) ArrayList;
- SysTryReturn(NID_UI_CTRL, (__pSubItems != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, __pSubItems != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
result r = __pSubItems->Construct();
if (r != E_SUCCESS)
}
}
- SysTryReturn(NID_UI_CTRL, (index >= 0 && index <= __pSubItems->GetCount()), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified index (%d) is greater than the available items count.", index);
+ SysTryReturnResult(NID_UI_CTRL, (index >= 0 && index <= __pSubItems->GetCount()), E_INVALID_ARG,
+ "Invalid argument is used. The specified index (%d) is greater than the available items count.", index);
return __pSubItems->InsertAt(subItem, index);
}
result
_OptionMenuItem::RemoveSubItemAt(int index)
{
- SysTryReturn(NID_UI_CTRL, (__pSubItems != null), E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. The sub items list is null.");
- SysTryReturn(NID_UI_CTRL, (index >= 0 && index < __pSubItems->GetCount()), E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. The specified index (%d) is greater than the available items count.", index);
+ SysTryReturnResult(NID_UI_CTRL, __pSubItems != null, E_SYSTEM,
+ "A system error has occurred. The sub items list is null.");
+ SysTryReturnResult(NID_UI_CTRL, (index >= 0 && index < __pSubItems->GetCount()), E_SYSTEM,
+ "A system error has occurred. The specified index (%d) is greater than the available items count.", index);
return __pSubItems->RemoveAt(index, true);
}
_OptionMenuItem*
_OptionMenuItem::GetSubItem(int index)
{
- SysTryReturn(NID_UI_CTRL, (__pSubItems != null), null, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. The sub items list is null.", index);
+ SysTryReturn(NID_UI_CTRL, __pSubItems != null, null, E_SYSTEM,
+ "[%s] A system error has occurred. The sub items list is null.", GetErrorMessage(E_SYSTEM), index);
SysTryReturn(NID_UI_CTRL, (index >= 0 && index < __pSubItems->GetCount()), null, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. The specified index (%d) is greater than the available items count.", index);
+ "[%s] A system error has occurred. The specified index (%d) is greater than the available items count.", GetErrorMessage(E_SYSTEM), index);
return static_cast<_OptionMenuItem*>(__pSubItems->GetAt(index));
}
{
pContainer->Activate(true);
_AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true);
- SysTryReturnVoidResult(NID_UI_CTRL, pElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pElement, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
pElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
result
_OptionMenuItem::SetBitmap(OptionMenuItemDrawingStatus status, const Bitmap* pBitmap)
{
- if (status < OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL || status > OPTION_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED)
- {
- return E_INVALID_ARG;
- }
+ SysTryReturnResult(NID_UI_CTRL, (status >= OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL && status <= OPTION_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED),
+ E_INVALID_ARG, "Invalid argument is used. The status is not valid.");
- SysTryReturn(NID_UI_CTRL, (status != OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL || pBitmap != null), E_INVALID_ARG,
- E_INVALID_ARG, "[E_INVALID_ARG] The normal bitmap must not be null.");
+ SysTryReturnResult(NID_UI_CTRL, (status != OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL || pBitmap != null),
+ E_INVALID_ARG, "Invalid argument is used. The normal bitmap must not be null.");
Bitmap* pClonedBitmap = _BitmapImpl::CloneN(*pBitmap);
}
void
-_OptionMenuItem::SetSize(Tizen::Graphics::FloatDimension size)
+_OptionMenuItem::SetSize(FloatDimension size)
{
__size = size;
}
-Tizen::Graphics::FloatDimension
+FloatDimension
_OptionMenuItem::GetSize(void) const
{
return __size;
}
void
-_OptionMenuItem::SetDrawRect(Tizen::Graphics::FloatRectangle rect)
+_OptionMenuItem::SetDrawRect(FloatRectangle rect)
{
__drawRect = rect;
}
}
void
-_OptionMenuItem::SetPressedDrawRect(Tizen::Graphics::FloatRectangle rect)
+_OptionMenuItem::SetPressedDrawRect(FloatRectangle rect)
{
__pressedDrawRect = rect;
}
if (__pArrowLabel == null)
{
__pArrowLabel = _Label::CreateLabelN();
- SysTryCatch(NID_UI_CTRL, (__pArrowLabel != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, __pArrowLabel != null, , r, "[%s] Propagating.", GetErrorMessage(r));
AttachChild(*__pArrowLabel);
if (__pUpperDividerLineLabel == null)
{
__pUpperDividerLineLabel = _Label::CreateLabelN();
- SysTryReturnVoidResult(NID_UI_CTRL, __pUpperDividerLineLabel, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnVoidResult(NID_UI_CTRL, __pUpperDividerLineLabel, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
AttachChild(*__pUpperDividerLineLabel);
if (__pBackgroundLabel == null)
{
__pBackgroundLabel = _Label::CreateLabelN();
- SysTryReturnVoidResult(NID_UI_CTRL, __pBackgroundLabel, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturnVoidResult(NID_UI_CTRL, __pBackgroundLabel, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
__pBackgroundLabel->SetTouchPressThreshold(TOUCH_PRESS_THRESHOLD_INSENSITIVE);
AttachChild(*__pBackgroundLabel);
{
GET_REPLACED_BITMAP_CONFIG_N(OPTIONMENU::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __selectedBgColor, __pSelectedBgBitmap);
__pBackgroundLabel->SetBackgroundBitmap(*__pSelectedBgBitmap);
-
}
else
{
}
void
-_OptionMenuItem::OnFontChanged(Tizen::Graphics::Font* pFont)
+_OptionMenuItem::OnFontChanged(Font* pFont)
{
String fontName = _Control::GetFont();
_OptionMenuModel::Construct(void)
{
result r = __items.Construct();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to construct ArrayList.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to construct ArrayList.");
return r;
}
{
_OptionMenuItem* pMainItem = GetItem(mainIndex);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (pItem != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, r, "Propagating.");
r = pMainItem->InsertSubItemAt(*pItem, pMainItem->GetSubItemCount());
}
{
_OptionMenuItem* pMainItem = GetItem(mainIndex);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (pItem != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, r, "Propagating.");
r = pMainItem->InsertSubItemAt(*pItem, subIndex);
{
_OptionMenuItem* pItem = GetItem(mainIndex, subIndex);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (pItem != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, r, "Propagating.");
OptionMenuItemDrawingType itemType = OPTION_MENU_ITEM_DRAWING_TYPE_TEXT;
if (subIndex == INVALID_INDEX)
{
int index = GetItemIndexFromActionId(actionId);
- SysTryReturn(NID_UI_CTRL, (index < 0 || mainIndex == index), E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. The specified actionId (%d) is not valid", actionId);
+ SysTryReturnResult(NID_UI_CTRL, (index < 0 || mainIndex == index), E_SYSTEM,
+ "A system error has occurred. The specified actionId (%d) is not valid", actionId);
}
else
{
_OptionMenuItem* pMainItem = GetItem(mainIndex);
- SysTryReturn(NID_UI_CTRL, (pMainItem != null), E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. The specified main index (%d) does not exists.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, pMainItem != null, E_SYSTEM,
+ "A system error has occurred. The specified main index (%d) does not exists.", mainIndex);
int index = pMainItem->GetSubItemIndexFromActionId(actionId);
- SysTryReturn(NID_UI_CTRL, (index < 0 || subIndex == index), E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. The specified actionId (%d) is not valid", actionId);
+ SysTryReturnResult(NID_UI_CTRL, (index < 0 || subIndex == index), E_SYSTEM,
+ "A system error has occurred. The specified actionId (%d) is not valid", actionId);
}
_Label* pLabel = null;
_OptionMenuItem* pMainItem = GetItem(mainIndex);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (pMainItem != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, pMainItem != null, r, "Propagating.");
- SysTryReturn(NID_UI_CTRL,
- (subIndex > INVALID_INDEX && subIndex < pMainItem->GetSubItemCount()), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified sub index (%d) is out of range.", subIndex);
+ SysTryReturnResult(NID_UI_CTRL,
+ (subIndex > INVALID_INDEX && subIndex < pMainItem->GetSubItemCount()), E_INVALID_ARG,
+ "Invalid argument is used. The specified sub index (%d) is out of range.", subIndex);
return pMainItem->RemoveSubItemAt(subIndex);
}
_OptionMenuItem* pItem = null;
pItem = static_cast <_OptionMenuItem*>(__items.GetAt(selectedIndex));
- SysTryReturnVoidResult(NID_UI_CTRL, (pItem != null), E_SYSTEM, "[E_SYSTEM] A system error occurred. Item is null.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pItem != null, E_SYSTEM, "[%s] A system error has occurred. pItem must not be null.", GetErrorMessage(E_SYSTEM));
pItem->SetAndInvalidate(false);
}
LoadShape();
__pModel = new (std::nothrow) _OptionMenuModel;
- SysTryCatch(NID_UI_CTRL, __pModel != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, __pModel != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
r = __pModel->Construct();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pFont = __pOptionMenu->GetFallbackFont();
r = GetLastResult();
}
_OptionMenuItem*
-_OptionMenuPresenter::CreateItem(const String& text, int actionId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap, bool isSubItem)
+_OptionMenuPresenter::CreateItemN(const String& text, int actionId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap, bool isSubItem)
{
_OptionMenuItem* pItem = _OptionMenuItem::CreateOptionMenuItemN();
- SysTryReturn(NID_UI_CTRL, pItem != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pItem != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
OptionMenuItemDrawingType itemType = OPTION_MENU_ITEM_DRAWING_TYPE_TEXT;
_Label* pLabel = null;
result
_OptionMenuPresenter::AddItem(const String& text, int actionId, const Bitmap* normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
- _OptionMenuItem* pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ _OptionMenuItem* pItem = CreateItemN(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
result r = __pModel->AddItem(pItem);
if (r != E_SUCCESS)
{
delete pItem;
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to add item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to add item.");
}
return r;
result
_OptionMenuPresenter::AddSubItem(int mainIndex, const String& text, int actionId)
{
- SysTryReturn(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid mainIndex %d.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), E_INVALID_ARG, "Invalid argument is used. mainIndex (%d) is invalid.", mainIndex);
- _OptionMenuItem* pItem = CreateItem(text, actionId, null, null, null, true);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ _OptionMenuItem* pItem = CreateItemN(text, actionId, null, null, null, true);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
result r = __pModel->AddItem(pItem, mainIndex);
if (r != E_SUCCESS)
{
delete pItem;
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to add item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to add item.");
}
return r;
_OptionMenuPresenter::InsertItem(int mainIndex, const String& text, int actionId, const Bitmap* normalBitmap,
const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
- _OptionMenuItem* pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ _OptionMenuItem* pItem = CreateItemN(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
result r = __pModel->InsertItemAt(pItem, mainIndex);
if (r != E_SUCCESS)
{
delete pItem;
- SysTryReturn(NID_UI_CTRL, false, r, r, "Failed to add item.");
+ SysTryReturnResult(NID_UI_CTRL, false, r, "Failed to add item.");
}
return E_SUCCESS;
result
_OptionMenuPresenter::InsertSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
- SysTryReturn(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid mainIndex %d.", mainIndex);
- SysTryReturn(NID_UI_CTRL, subIndex >=0 && subIndex <= __pModel->GetSubItemCount(mainIndex), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid subIndex %d.", subIndex);
+ SysTryReturnResult(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), E_INVALID_ARG, " Invalid argument is used. mainIndex (%d) is invalid.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, subIndex >=0 && subIndex <= __pModel->GetSubItemCount(mainIndex), E_INVALID_ARG, " Invalid subIndex %d.", subIndex);
- _OptionMenuItem* pItem = CreateItem(text, actionId, null, null, null, true);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ _OptionMenuItem* pItem = CreateItemN(text, actionId, null, null, null, true);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, GetLastResult(), "Failed to create item.");
result r = __pModel->InsertItemAt(pItem, mainIndex, subIndex);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating.");
return E_SUCCESS;
}
result
_OptionMenuPresenter::SetSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
- SysTryReturn(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid mainIndex %d.", mainIndex);
- SysTryReturn(NID_UI_CTRL, subIndex >=0 && subIndex < __pModel->GetSubItemCount(mainIndex), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid subIndex %d.", subIndex);
+ SysTryReturnResult(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), E_INVALID_ARG, "Invalid argument is used. mainIndex (%d) is invalid.", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, subIndex >=0 && subIndex < __pModel->GetSubItemCount(mainIndex), E_INVALID_ARG, "Invalid argument is used. SubIndex (%d) is invalid.", subIndex);
result r = __pModel->SetItemAt(mainIndex, text, actionId, null, null, null, __itemFontSize, subIndex);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating.");
return E_SUCCESS;
}
result
_OptionMenuPresenter::RemoveSubItemAt(int mainIndex, int subIndex)
{
- SysTryReturn(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid mainIndex %d.", mainIndex);
- SysTryReturn(NID_UI_CTRL, subIndex >=0 && subIndex < __pModel->GetSubItemCount(mainIndex), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid subIndex %d.", subIndex);
+ SysTryReturnResult(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), E_INVALID_ARG, "Invalid argument is used. mainIndex (%d) is invalid", mainIndex);
+ SysTryReturnResult(NID_UI_CTRL, subIndex >=0 && subIndex < __pModel->GetSubItemCount(mainIndex), E_INVALID_ARG, "Invalid argument is used. SubIndex (%d) is invalid.", subIndex);
result r = __pModel->RemoveItem(mainIndex, subIndex);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating.");
return E_SUCCESS;
}
int
_OptionMenuPresenter::GetSubItemCount(int mainIndex) const
{
- SysTryReturn(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), -1, E_INVALID_ARG, "[E_INVALID_ARG] Invalid mainIndex %d.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, mainIndex >=0 && mainIndex < __pModel->GetItemCount(), -1, E_INVALID_ARG, "[%s] Invalid argument is used. mainIndex (%d) is invalid.", GetErrorMessage(E_INVALID_ARG), mainIndex);
return __pModel->GetSubItemCount(mainIndex);
}
_OptionMenuItem* pItem = null;
pItem = __pModel->GetItem(i);
- SysTryReturn(NID_UI_CTRL, pItem != null, , E_SYSTEM, "[E_SYSTEM] A system error occurred. Unable to get the item.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pItem != null, E_SYSTEM, "[%s] A system has error occurred. Unable to get the item.", GetErrorMessage(E_SYSTEM));
CalculateItemSize(pItem->GetText(), pItem->GetType(), textArea, itemSize);
result
_OptionMenuPresenter::SetItem(int index, const String& text, int actionId, const Bitmap* normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
- SysTryReturn(NID_UI_CTRL, index >=0 && index < __pModel->GetItemCount(), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid mainIndex %d.", index);
+ SysTryReturnResult(NID_UI_CTRL, index >=0 && index < __pModel->GetItemCount(), E_INVALID_ARG, "Invalid argument is used. mainIndex (%d) is invalid.", index);
result r = __pModel->SetItemAt(index, text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap, __itemFontSize);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
_OptionMenuItem* pItem = __pModel->GetItem(index);
- if (pItem == null)
- {
- SysLog(NID_UI_CTRL, "Item is null.");
- return r;
- }
-
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, r, "Propagating.");
CalculateItemMaximumWidth();
return r;
result
_OptionMenuPresenter::DeleteItem(int index)
{
- SysTryReturn(NID_UI_CTRL, (index < __pOptionMenu->GetItemCount()), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] The specified main index (%d) is invalid.", index);
+ SysTryReturnResult(NID_UI_CTRL, (index < __pOptionMenu->GetItemCount()), E_INVALID_ARG,
+ "Invalid argument is used. The specified index (%d) is invalid.", index);
result r = __pOptionMenu->GetScrollPanel()->DetachChild(*__pModel->GetItem(index));
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to detach item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to detach item.");
r = __pModel->RemoveItem(index);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to delete item.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to delete item.");
CalculateItemMaximumWidth();
result
_OptionMenuPresenter::DeleteItemAll(void)
{
- SysTryReturn(NID_UI_CTRL, (__pOptionMenu->GetItemCount() > 0), E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] A system error occurred. No items exists.");
+ SysTryReturnResult(NID_UI_CTRL, (__pOptionMenu->GetItemCount() > 0), E_SYSTEM,
+ "A system error has occurred. No items exists.");
__pOptionMenu->GetScrollPanel()->DetachAllChildren();
result r = __pModel->RemoveAllItem();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to delete item all.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to delete all items.");
return r;
}
result r = E_SUCCESS;
Canvas* pCanvas = __pOptionMenu->GetCanvasN();
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ r = GetLastResult();
+ SysTryReturnResult(NID_UI_CTRL, r = E_SUCCESS, r, "Propagating");
// Clear canvas for drawing area of the OptionMenu.
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
result
_OptionMenuPresenter::DrawBackground(Canvas* pCanvas)
{
- SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "A system error has occurred. pCanvas is null");
result r = E_SUCCESS;
if (pContainerOptionMenu != null)
{
_AccessibilityElement* pElementOptionMenu = new (std::nothrow) _AccessibilityElement(true);
- SysTryReturnVoidResult(NID_UI_CTRL, pElementOptionMenu, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pElementOptionMenu, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pElementOptionMenu->SetSupportOperatingGesture(false);
//pElementOptionMenu->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
using namespace Tizen::Base;
using namespace Tizen::Graphics;
using namespace Tizen::Base::Runtime;
+using namespace Tizen::Ui;
namespace Tizen { namespace Ui { namespace Controls
{
_TabBar::CreateTabBarN(void)
{
_TabBar* pTabBar = new (std::nothrow) _TabBar();
- SysTryReturn(NID_UI_CTRL, pTabBar != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pTabBar != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
result r = pTabBar->Initialize();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to Initialize.", GetErrorMessage(r));
_TabBar::Initialize(void)
{
_TabBarPresenter* pTabBarPresenter = new (std::nothrow) _TabBarPresenter(*this);
- SysTryReturn(NID_UI_CTRL, pTabBarPresenter != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pTabBarPresenter != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
result r = pTabBarPresenter->Construct();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
result
-_TabBar::AddItem(const Tizen::Base::String& text, int actionId)
+_TabBar::AddItem(const String& text, int actionId)
{
return __pTabBarPresenter->AddItem(text, actionId);
}
result
-_TabBar::InsertItemAt(int index, const Tizen::Base::String& text, int actionId)
+_TabBar::InsertItemAt(int index, const String& text, int actionId)
{
return __pTabBarPresenter->InsertItemAt(index, text, actionId);
}
result
-_TabBar::SetItemAt(int index, const Tizen::Base::String& text, int actionId)
+_TabBar::SetItemAt(int index, const String& text, int actionId)
{
return __pTabBarPresenter->SetItemAt(index, text, actionId);
}
Variant
_TabBar::GetPropertyColor(void) const
{
- return Tizen::Ui::Variant(__color);
+ return Variant(__color);
}
result
-_TabBar::SetColor(Tizen::Graphics::Color color)
+_TabBar::SetColor(Color color)
{
return SetProperty("color", Variant(color));
}
-Tizen::Graphics::Color
+Color
_TabBar::GetColor(void) const
{
Variant color = GetProperty("color");
Variant
_TabBar::GetPropertyNormalItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[ITEM_STATUS_NORMAL]);
+ return Variant(__itemColor[ITEM_STATUS_NORMAL]);
}
result
Variant
_TabBar::GetPropertySelectedItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[ITEM_STATUS_SELECTED]);
+ return Variant(__itemColor[ITEM_STATUS_SELECTED]);
}
result
Variant
_TabBar::GetPropertyPressedItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[ITEM_STATUS_PRESSED]);
+ return Variant(__itemColor[ITEM_STATUS_PRESSED]);
}
result
Variant
_TabBar::GetPropertyDisabledItemColor(void) const
{
- return Tizen::Ui::Variant(__itemColor[ITEM_STATUS_DISABLED]);
+ return Variant(__itemColor[ITEM_STATUS_DISABLED]);
}
result
-_TabBar::SetItemColor(_TabBarItemStatus itemStatus, Tizen::Graphics::Color color)
+_TabBar::SetItemColor(_TabBarItemStatus itemStatus, Color color)
{
result r = E_SUCCESS;
return r;
}
-Tizen::Graphics::Color
+Color
_TabBar::GetItemColor(_TabBarItemStatus itemStatus) const
{
Color itemColor;
Variant
_TabBar::GetPropertyNormalItemTextColor(void) const
{
- return Tizen::Ui::Variant(__itemTextColor[ITEM_STATUS_NORMAL]);
+ return Variant(__itemTextColor[ITEM_STATUS_NORMAL]);
}
result
Variant
_TabBar::GetPropertySelectedItemTextColor(void) const
{
- return Tizen::Ui::Variant(__itemTextColor[ITEM_STATUS_SELECTED]);
+ return Variant(__itemTextColor[ITEM_STATUS_SELECTED]);
}
result
Variant
_TabBar::GetPropertyPressedItemTextColor(void) const
{
- return Tizen::Ui::Variant(__itemTextColor[ITEM_STATUS_PRESSED]);
+ return Variant(__itemTextColor[ITEM_STATUS_PRESSED]);
}
result
Variant
_TabBar::GetPropertyDisabledItemTextColor(void) const
{
- return Tizen::Ui::Variant(__itemTextColor[ITEM_STATUS_DISABLED]);
+ return Variant(__itemTextColor[ITEM_STATUS_DISABLED]);
}
void
-_TabBar::SetItemTextColor(_TabBarItemStatus status, Tizen::Graphics::Color color)
+_TabBar::SetItemTextColor(_TabBarItemStatus status, Color color)
{
Color itemTextColor;
result r = E_SUCCESS;
}
-Tizen::Graphics::Color
+Color
_TabBar::GetItemTextColor(_TabBarItemStatus status) const
{
Color itemTextColor;
}
_TabBarItem*
-_TabBar::GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const
+_TabBar::GetItemFromPosition(const FloatPoint& position) const
{
return __pTabBarPresenter->GetItemFromPosition(position);
}
GET_SHAPE_CONFIG(TABBAR::HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height);
result r = SetSize(FloatDimension(width, height));
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
__pTabBarPresenter->ResetItemPositionX();
return r;
}
void
-_TabBar::AddActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener)
+_TabBar::AddActionEventListener(const _IActionEventListener& listener)
{
ClearLastResult();
if (__pActionEvent == null || IsFailed(GetLastResult()))
{
- SysLog(NID_UI_CTRL, "[E_INVALID_STATE] System error occured.");
+ SysLog(NID_UI_CTRL, "[%s] System error occured.", GetErrorMessage(E_INVALID_STATE));
SetLastResult(E_INVALID_STATE);
delete __pActionEvent;
return;
}
void
-_TabBar::RemoveActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener)
+_TabBar::RemoveActionEventListener(const _IActionEventListener& listener)
{
- SysTryReturnVoidResult(NID_UI_CTRL, __pActionEvent != null, E_INVALID_STATE, "[E_INVALID_STATE] This instance isn't constructed.")
+ SysTryReturnVoidResult(NID_UI_CTRL, __pActionEvent != null, E_INVALID_STATE, "[%s] This instance isn't constructed.", GetErrorMessage(E_INVALID_STATE))
// Todo : check fail case of RemoveListener
__pActionEvent->RemoveListener(listener);
}
if (__pActionEvent)
{
IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(pItem->GetActionId());
- SysTryReturn(NID_UI_CTRL, pEventArg != null, E_INVALID_STATE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pEventArg != null, E_INVALID_STATE, GetLastResult(), "[%s] Memory allocation failed.", GetErrorMessage(GetLastResult()));
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, this);
__pActionEvent->Fire(*pEventArg);
if (__pActionEvent)
{
IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(pItem->GetActionId());
- SysTryReturn(NID_UI_CTRL, pEventArg != null, E_INVALID_STATE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pEventArg != null, E_INVALID_STATE, GetLastResult(), "[%s] Memory allocation failed.", GetErrorMessage(GetLastResult()));
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, this);
__pActionEvent->Fire(*pEventArg);
using namespace Tizen::Ui;
using namespace Tizen::Graphics;
-using namespace Tizen::Base::Runtime;
+using namespace Tizen::Base;
+using namespace Tizen::Ui;
+using namespace Runtime;
namespace Tizen { namespace Ui { namespace Controls
{
}
_TabBarImpl*
-_TabBarImpl::CreateTabBarImplN(TabBar* pTabBar, const Tizen::Graphics::FloatRectangle& bounds)
+_TabBarImpl::CreateTabBarImplN(TabBar* pTabBar, const FloatRectangle& bounds)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, bounds.width >= 0.0f && bounds.height >= 0.0f, null, E_INVALID_ARG, "[E_INVALID_ARG] The specified width is smaller than minimum size.");
+ SysTryReturn(NID_UI_CTRL, bounds.width >= 0.0f && bounds.height >= 0.0f, null, E_INVALID_ARG, "[%s] Invalid argument is used. The specified width is smaller than minimum size.", GetErrorMessage(E_INVALID_ARG));
float height = 0.0f;
GET_SHAPE_CONFIG(TABBAR::HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height);
result r = E_SUCCESS;
_TabBar* pCore = _TabBar::CreateTabBarN();
- SysTryReturn(NID_UI_CTRL, pCore != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] _TabBar is not constructed.");
+ SysTryReturn(NID_UI_CTRL, pCore != null, null, GetLastResult(), "[%s] Memory allocation failed.", GetErrorMessage(GetLastResult()));
_TabBarImpl* pImpl = new (std::nothrow) _TabBarImpl(pTabBar, pCore);
- r = CheckConstruction(pCore, pImpl);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, pImpl != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
r = pImpl->SetBounds(FloatRectangle(bounds.x, bounds.y, bounds.width, height));
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] SetBounds is failed.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set bounds.", GetErrorMessage(r));
r = pImpl->SetMinimumSize(FloatDimension(pImpl->GetMinimumSizeF().width, height));
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] SetMinimumSize is failed.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set minimum size.", GetErrorMessage(r));
r = pImpl->SetMaximumSize(FloatDimension(pImpl->GetMaximumSizeLimitF().width, height));
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] SetMaximumSize is failed.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set maximum size.", GetErrorMessage(r));
return pImpl;
}
result
-_TabBarImpl::AddItem(const Tizen::Base::String& text, int actionId)
+_TabBarImpl::AddItem(const String& text, int actionId)
{
int itemMaxCnt = 0;
+
GET_FIXED_VALUE_CONFIG(TABBAR::ITEM_COUNT_MAX, GetCore().GetOrientation(), itemMaxCnt);
SysTryReturn(NID_UI_CTRL, GetCore().GetItemCount() < itemMaxCnt, E_MAX_EXCEEDED, E_MAX_EXCEEDED, "[E_MAX_EXCEEDED] The item is not added more than %d.", itemMaxCnt);
}
result
-_TabBarImpl::InsertItemAt(int index, const Tizen::Base::String& text, int actionId)
+_TabBarImpl::InsertItemAt(int index, const String& text, int actionId)
{
int itemMaxCnt = 0;
+
GET_FIXED_VALUE_CONFIG(TABBAR::ITEM_COUNT_MAX, GetCore().GetOrientation(), itemMaxCnt);
SysTryReturn(NID_UI_CTRL, GetCore().GetItemCount() < itemMaxCnt, E_MAX_EXCEEDED, E_MAX_EXCEEDED, "[E_MAX_EXCEEDED] The item is not added more than %d.", itemMaxCnt);
SysTryReturn(NID_UI_CTRL, index >= 0 && index <= GetCore().GetItemCount(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] This index(%d) is invalid.", index);
return GetCore().InsertItemAt(index, text, actionId);
}
-Tizen::Graphics::Color
+Color
_TabBarImpl::GetColor(void) const
{
return GetCore().GetColor();
return GetCore().GetItemCount();
}
-Tizen::Graphics::Color
+Color
_TabBarImpl::GetSelectedItemColor(void) const
{
return GetCore().GetItemColor(ITEM_STATUS_SELECTED);
}
-Tizen::Graphics::Color
+Color
_TabBarImpl::GetItemTextColor(TabBarItemStatus status) const
{
if (status == TAB_BAR_ITEM_STATUS_NORMAL)
return GetCore().GetItemTextColor(ITEM_STATUS_SELECTED);
}
- return Tizen::Graphics::Color(0);
+ return Color(0);
}
int
result
_TabBarImpl::RemoveItemAt(int index)
{
- SysTryReturn(NID_UI_CTRL, index >= 0 && index < GetCore().GetItemCount(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] This index(%d) is invalid.", index);
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index < GetCore().GetItemCount(), E_OUT_OF_RANGE, "This index(%d) is out of range.", index);
return GetCore().RemoveItemAt(index);
}
}
result
-_TabBarImpl::SetColor(const Tizen::Graphics::Color& color)
+_TabBarImpl::SetColor(const Color& color)
{
return GetCore().SetColor(color);
}
result
-_TabBarImpl::SetItemAt(int index, const Tizen::Base::String& text, int actionId)
+_TabBarImpl::SetItemAt(int index, const String& text, int actionId)
{
- SysTryReturn(NID_UI_CTRL, index >= 0 && index < GetCore().GetItemCount(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] This index(%d) is invalid.", index);
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index < GetCore().GetItemCount(), E_OUT_OF_RANGE, "This index(%d) is out of range.", index);
return GetCore().SetItemAt(index, text, actionId);
}
result
_TabBarImpl::SetItemSelected(int index)
{
- SysTryReturn(NID_UI_CTRL, index >= 0 && index < GetCore().GetItemCount(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] This index(%d) is invalid.", index);
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index < GetCore().GetItemCount(), E_OUT_OF_RANGE, "This index(%d) is out of range.", index);
return GetCore().SetItemSelected(index);
}
result
-_TabBarImpl::SetItemTextColor(TabBarItemStatus status, const Tizen::Graphics::Color& color)
+_TabBarImpl::SetItemTextColor(TabBarItemStatus status, const Color& color)
{
if (status == TAB_BAR_ITEM_STATUS_NORMAL)
{
}
result
-_TabBarImpl::SetSelectedItemColor(const Tizen::Graphics::Color& color)
+_TabBarImpl::SetSelectedItemColor(const Color& color)
{
return GetCore().SetItemColor(ITEM_STATUS_SELECTED, color);
}
}
void
-_TabBarImpl::AddActionEventListener(Tizen::Ui::IActionEventListener& listener)
+_TabBarImpl::AddActionEventListener(IActionEventListener& listener)
{
ClearLastResult();
if (__pPublicActionEvent == null || IsFailed(GetLastResult()))
{
- SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[E_INVALID_STATE] System error occurred.");
+ SysLogException(NID_UI_CTRL, E_INVALID_STATE, "[%s] __pPublicActionEvent must not be null.", GetErrorMessage(E_INVALID_STATE));
SetLastResult(E_INVALID_STATE);
delete __pPublicActionEvent;
return;
}
void
-_TabBarImpl::RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener)
+_TabBarImpl::RemoveActionEventListener(IActionEventListener& listener)
{
- SysTryReturnVoidResult(NID_UI_CTRL, __pPublicActionEvent, E_INVALID_STATE, "[E_INVALID_STATE] This instance isn't constructed.")
+ SysTryReturnVoidResult(NID_UI_CTRL, __pPublicActionEvent, E_INVALID_STATE, "[%s] This instance is not constructed yet.", GetErrorMessage(E_INVALID_STATE))
// Todo : check fail case of RemoveListener
__pPublicActionEvent->RemoveListener(listener);
}
void
-_TabBarImpl::OnActionPerformed(const Tizen::Ui::_Control& source, int actionId)
+_TabBarImpl::OnActionPerformed(const _Control& source, int actionId)
{
if (__pPublicActionEvent != null)
{
GetInstance(_UiBuilder* uibuilder)
{
_TabBarMaker* pTabBarMaker = new (std::nothrow) _TabBarMaker(uibuilder);
- SysTryReturn(NID_UI_CTRL, pTabBarMaker != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pTabBarMaker != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
return pTabBarMaker;
};
protected:
- virtual Tizen::Ui::Control*
+ virtual Control*
Make(_UiBuilderControl* pControl)
{
result r = E_SUCCESS;
_UiBuilderControlLayout* pControlProperty = null;
TabBar* pTabBar = null;
- Tizen::Graphics::FloatRectangle rect;
- Tizen::Base::String elementString;
+ FloatRectangle rect;
+ String elementString;
int opacity = 0;
Color color;
//Construct
pTabBar = new (std::nothrow) TabBar();
- SysTryReturn(NID_UI_CTRL, pTabBar != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, pTabBar != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
r = pTabBar->Construct(rect.x, rect.y, rect.width);
if (r != E_SUCCESS)
}
void
-_TabBarItem::SetText(const Tizen::Base::String& text, _ControlOrientation orientation)
+_TabBarItem::SetText(const String& text, _ControlOrientation orientation)
{
float fontSize = 0.0f;
GET_SHAPE_CONFIG(TABBAR::FONT_SIZE, orientation, fontSize);
__text = text;
}
-Tizen::Base::String
+String
_TabBarItem::GetText(void) const
{
return __text;
}
void
-_TabBarItem::SetBounds(const Tizen::Graphics::FloatRectangle& bounds)
+_TabBarItem::SetBounds(const FloatRectangle& bounds)
{
__bounds = bounds;
}
-Tizen::Graphics::FloatRectangle
+FloatRectangle
_TabBarItem::GetBounds(void) const
{
return __bounds;
using namespace Tizen::Graphics;
+using namespace Tizen::Base;
namespace Tizen { namespace Ui { namespace Controls
{
}
result
-_TabBarModel::AddItem(const Tizen::Base::String& text, int actionId, _ControlOrientation orientation)
+_TabBarModel::AddItem(const String& text, int actionId, _ControlOrientation orientation)
{
_TabBarItem* pItem = new (std::nothrow) _TabBarItem(orientation);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
pItem->SetText(text, orientation);
pItem->SetActionId(actionId);
}
result
-_TabBarModel::InsertItemAt(int index, const Tizen::Base::String& text, int actionId, _ControlOrientation orientation)
+_TabBarModel::InsertItemAt(int index, const String& text, int actionId, _ControlOrientation orientation)
{
- SysTryReturn(NID_UI_CTRL, index >= 0 && index <= GetItemCount(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument(%d) is out of range.", index);
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index <= GetItemCount(), E_OUT_OF_RANGE, "The index (%d) is out of range.", index);
if (GetItemCount() == 0)
{
return AddItem(text, actionId, orientation);
}
_TabBarItem* pItem = new (std::nothrow) _TabBarItem(orientation);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
pItem->SetText(text, orientation);
pItem->SetActionId(actionId);
}
result r = __tabBarItems.InsertAt(*pItem, index);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
r = ReCalculateItemPosition(index + 1, orientation);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return E_SUCCESS;
}
result
-_TabBarModel::SetItemAt(int index, const Tizen::Base::String& text, int actionId, _ControlOrientation orientation)
+_TabBarModel::SetItemAt(int index, const String& text, int actionId, _ControlOrientation orientation)
{
_TabBarItem* pItem = static_cast <_TabBarItem*>(__tabBarItems.GetAt(index));
- SysTryReturn(NID_UI_CTRL, pItem != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The %d index item is not exist.", index);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, E_INVALID_ARG, "Invalid argument is used. The item at index (%d) does not exist.", index);
pItem->SetText(text, orientation);
pItem->SetActionId(actionId);
result r = ReCalculateItemPosition(index + 1, orientation);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return E_SUCCESS;
}
_TabBarModel::RemoveItemAt(int index, _ControlOrientation orientation)
{
_TabBarItem* pItem = static_cast <_TabBarItem*>(__tabBarItems.GetAt(index));
- SysTryReturn(NID_UI_CTRL, pItem != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The %d index item is not exist.", index);
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, E_INVALID_ARG, "Invalid argument is used. The item at index(%d) does not exist.", index);
float itemMargin = 0.0f;
GET_SHAPE_CONFIG(TABBAR::ITEM_MARGIN, orientation, itemMargin);
result r = __tabBarItems.RemoveAt(index, true);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
r = ReCalculateItemPosition(index, orientation);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return E_SUCCESS;
}
result
_TabBarModel::ReCalculateItemPosition(int itemIndex, _ControlOrientation orientation)
{
- SysTryReturn(NID_UI_CTRL, itemIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The itemIndex(%d) is negative.");
+ SysTryReturnResult(NID_UI_CTRL, itemIndex >= 0, E_INVALID_ARG, "Invalid argument is used. The itemIndex(%d) is negative.");
int itemCount = __tabBarItems.GetCount();
float itemMargin = 0.0f;
GET_SHAPE_CONFIG(TABBAR::ITEM_MARGIN, orientation, itemMargin);
_TabBarPresenter::Construct(void)
{
__pTabBarModel = new (std::nothrow) _TabBarModel;
- SysTryReturn(NID_UI_CTRL, __pTabBarModel != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturnResult(NID_UI_CTRL, __pTabBarModel != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
result r = E_SUCCESS;
r = LoadBitmap();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
return r;
{
result r = E_SUCCESS;
__pFont = __tabBar.GetFallbackFont();
- SysTryCatch(NID_UI_CTRL, __pFont != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryCatch(NID_UI_CTRL, __pFont != null, r = GetLastResult(), GetLastResult(), "[%s] Propgating.", GetErrorMessage(GetLastResult()));
__pTextObject = new (std::nothrow) TextObject();
- SysTryCatch(NID_UI_CTRL, __pTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryCatch(NID_UI_CTRL, __pTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pTextObject->Construct();
__pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
}
result
-_TabBarPresenter::AddItem(const Tizen::Base::String& text, int actionId)
+_TabBarPresenter::AddItem(const String& text, int actionId)
{
return __pTabBarModel->AddItem(text, actionId, _CONTROL_ORIENTATION_PORTRAIT);
}
result
-_TabBarPresenter::InsertItemAt(int index, const Tizen::Base::String& text, int actionId)
+_TabBarPresenter::InsertItemAt(int index, const String& text, int actionId)
{
if (index <= __pTabBarModel->GetSelectedItemIndex())
{
}
result r = __pTabBarModel->InsertItemAt(index, text, actionId, _CONTROL_ORIENTATION_PORTRAIT);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
return E_SUCCESS;
}
result
-_TabBarPresenter::SetItemAt(int index, const Tizen::Base::String& text, int actionId)
+_TabBarPresenter::SetItemAt(int index, const String& text, int actionId)
{
return __pTabBarModel->SetItemAt(index, text, actionId, _CONTROL_ORIENTATION_PORTRAIT);
}
}
result r = __pTabBarModel->RemoveItemAt(index, _CONTROL_ORIENTATION_PORTRAIT);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
if (GetItemCount() != 0)
{
r = SetItemSelected(0);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
else
{
_TabBarPresenter::SetItemSelected(int index)
{
- SysTryReturn(NID_UI_CTRL, index >= 0 && index < GetItemCount(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index < GetItemCount(), E_OUT_OF_RANGE, "The index (%d) is out of range.", index);
int oldSelectedItemIndex = GetSelectedItemIndex();
if (index == oldSelectedItemIndex)
}
_TabBarItem* pItem = GetItemAt(oldSelectedItemIndex);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
pItem->SetStatus(ITEM_STATUS_NORMAL);
_AccessibilityElement* pElement = pItem->GetAccessibilityElement();
if(pElement != null)
pItem = GetItemAt(index);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
pItem->SetStatus(ITEM_STATUS_SELECTED);
pElement = pItem->GetAccessibilityElement();
if(pElement != null)
}
int
-_TabBarPresenter::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const
+_TabBarPresenter::GetItemIndexFromPosition(const FloatPoint& point) const
{
FloatRectangle clientBounds = __tabBar.GetBoundsF();
}
int
-_TabBarPresenter::GetItemIndexFromAbsPosition(const Tizen::Graphics::FloatPoint& point) const
+_TabBarPresenter::GetItemIndexFromAbsPosition(const FloatPoint& point) const
{
FloatRectangle clientBounds = __tabBar.GetBoundsF();
}
_TabBarItem*
-_TabBarPresenter::GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const
+_TabBarPresenter::GetItemFromPosition(const FloatPoint& position) const
{
SetLastResult(E_SUCCESS);
int index = GetItemIndexFromPosition(position);
- SysTryReturn(NID_UI_CTRL, index != -1, null, E_SYSTEM, "[E_SYSTEM] Item not found.");
+ SysTryReturn(NID_UI_CTRL, index != -1, null, E_SYSTEM, "[%s] A system error has occurred. Item not found.", GetErrorMessage(E_SYSTEM));
return __pTabBarModel->GetItemAt(index);
}
result
_TabBarPresenter::SetTopDrawnItemIndex(int index)
{
- SysTryReturn(NID_UI_CTRL, index >= 0 && index < GetItemCount(),
- E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument(%d) is out of range.", index);
+ SysTryReturnResult(NID_UI_CTRL, index >= 0 && index < GetItemCount(),
+ E_OUT_OF_RANGE, "The index (%d) is out of range.", index);
_TabBarItem* pTopItem = GetItemAt(index);
result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
float distance = pTopItem->GetBounds().x;
_TabBarItem* pLastItem = GetItemAt(GetItemCount() - 1);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
FloatRectangle clientBounds = __tabBar.GetBoundsF();
float movableDistance = (pLastItem->GetBounds().x + pLastItem->GetBounds().width) - (clientBounds.width - __sideMargin * 2.0f - __arrowMargin * 2.0f);
_TabBarPresenter::SetItemStatus(int index, _TabBarItemStatus status)
{
_TabBarItem* pItem = __pTabBarModel->GetItemAt(index);
- SysTryReturn(NID_UI_CTRL, pItem, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Item(%d) not exists.", index);
+ SysTryReturnResult(NID_UI_CTRL, pItem, E_SYSTEM, "A system error has occurred. Item at index (%d) does not exists.", index);
pItem->SetStatus(status);
_TabBarPresenter::GetItemStatus(int index) const
{
_TabBarItem* pItem = __pTabBarModel->GetItemAt(index);
- SysTryReturn(NID_UI_CTRL, pItem, ITEM_STATUS_NORMAL, E_SYSTEM, "[E_SYSTEM] Item(%d) not exists.", index);
+ SysTryReturn(NID_UI_CTRL, pItem, ITEM_STATUS_NORMAL, E_SYSTEM, "[%s] A system error has occured. Item at index (%d) does not exists.", GetErrorMessage(E_SYSTEM), index);
_TabBarItemStatus status = pItem->GetStatus();
while (index < GetItemCount())
{
_TabBarItem* pItem = __pTabBarModel->GetItemAt(index);
- SysTryReturn(NID_UI_CTRL, pItem, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Item(%d) not exists.", index);
+ SysTryReturnResult(NID_UI_CTRL, pItem, E_INVALID_STATE, "Item at index (%d) does not exists.", index);
FloatRectangle bounds = pItem->GetBounds();
bounds.x += distance;
pItem->SetBounds(bounds);
}
result
-_TabBarPresenter::SetReplacementColor(const Tizen::Graphics::Color& color)
+_TabBarPresenter::SetReplacementColor(const Color& color)
{
Bitmap* pColorReplcedBitmap = null;
result r;
+
r = GET_REPLACED_BITMAP_CONFIG_N(TABBAR::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, color, pColorReplcedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Image loading fail.");
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Image loading fail.", GetErrorMessage(E_SYSTEM));
if (__pBgBitmapCached != null)
{
}
result
-_TabBarPresenter::SetItemReplacementColor(_TabBarItemStatus itemStatus, const Tizen::Graphics::Color& color)
+_TabBarPresenter::SetItemReplacementColor(_TabBarItemStatus itemStatus, const Color& color)
{
Bitmap* pColorReplcedBitmap = null;
if (itemStatus == ITEM_STATUS_SELECTED)
{
r = GET_REPLACED_BITMAP_CONFIG_N(TABBAR::ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, color, pColorReplcedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Image loading fail.");
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Image loading fail.", GetErrorMessage(E_SYSTEM));
}
else if (itemStatus == ITEM_STATUS_PRESSED)
{
r = GET_REPLACED_BITMAP_CONFIG_N(TABBAR::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, color, pColorReplcedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Image loading fail.");
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Image loading fail.", GetErrorMessage(E_SYSTEM));
}
else
{
_TabBarPresenter::Draw(void)
{
Canvas* pCanvas = __tabBar.GetCanvasN();
- SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "[E_SYSTEM] It can not get canvas.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "[%s] A system error has occured. Canvas instance must be null.", GetErrorMessage(E_SYSTEM));
FloatRectangle clientBounds = __tabBar.GetBoundsF();
}
_TabBarItem* pItem = GetItemAt(itemIndex);
- SysTryReturn(NID_UI_CTRL, pItem != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Item loading fail.");
+ SysTryReturnResult(NID_UI_CTRL, pItem != null, E_SYSTEM, "Failed to load an item.");
FloatRectangle itemBounds = pItem->GetBounds();
FloatRectangle clientBounds = __tabBar.GetBoundsF();
r = SetTopDrawnItemIndex(firstDrawnItemIndex + 1);
}
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
__tabBar.Invalidate();
_TabBarItem* pFirstItem = __pTabBarModel->GetItemAt(0);
_TabBarItem* pLastItem = __pTabBarModel->GetItemAt(itemCount - 1);
- SysTryReturnVoidResult(NID_UI_CTRL, pFirstItem != null && pLastItem != null, E_SYSTEM, "[E_SYSTEM] Item not found.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pFirstItem != null && pLastItem != null, E_SYSTEM, "[%s] A system error has occurred. Item not found.", GetErrorMessage(E_SYSTEM));
FloatRectangle clientBounds = __tabBar.GetBoundsF();
FloatRectangle firstItemBounds = pFirstItem->GetBounds();
}
void
-_TabBarPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas)
+_TabBarPresenter::DrawItem(Canvas* pCanvas)
{
- SysTryReturnVoidResult(NID_UI_CTRL, __pTextObject != null, E_INVALID_STATE, "[E_INVALID_STATE] TextObject is not constructed.");
+ SysTryReturnVoidResult(NID_UI_CTRL, __pTextObject != null, E_INVALID_STATE, "[%s] TextObject is not constructed.", GetErrorMessage(E_INVALID_STATE));
FloatRectangle clientBounds = pCanvas->GetBoundsF();
drawText = pDrawItem->GetText();
__pTextObject->RemoveAll();
pSimpleText = new (std::nothrow)TextSimple(const_cast <wchar_t*>(drawText.GetPointer()), drawText.GetLength());
- SysTryReturnVoidResult(NID_UI_CTRL, pSimpleText != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] TextSimple is not constructed.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pSimpleText != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pFont = __tabBar.GetFallbackFont();
SysTryReturnVoidResult(NID_UI_CTRL, __pFont != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
}
void
-_TabBarPresenter::DrawBackground(Tizen::Graphics::Canvas* pCanvas)
+_TabBarPresenter::DrawBackground(Canvas* pCanvas)
{
result r = E_SUCCESS;
FloatRectangle clientBounds = __tabBar.GetBoundsF();
}
void
-_TabBarPresenter::DrawArrow(Tizen::Graphics::Canvas* pCanvas)
+_TabBarPresenter::DrawArrow(Canvas* pCanvas)
{
FloatRectangle clientBounds = __tabBar.GetBoundsF();
}
result
-_TabBarPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap)
+_TabBarPresenter::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, const Bitmap& bitmap)
{
result r = E_SUCCESS;
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(bitmap))
virtual result Draw(void);
virtual result DrawBackground(Tizen::Graphics::Canvas* pCanvas);
virtual result DrawArrow(Tizen::Graphics::Canvas* pCanvas);
- virtual result AddItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
- virtual result InsertItem(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
- virtual result SetItem(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ virtual result AddItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ virtual result InsertItem(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ virtual result SetItem(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
virtual result DeleteItem(int index);
virtual result DeleteItemAll(void);
virtual int CalculateShowItemCount(void);
Tizen::Graphics::FloatDimension AdjustItemLayoutTabStyle(void);
bool IsLayoutBitmapOnly(void);
- _ContextMenuItem* CreateItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ _ContextMenuItem* CreateItemN(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
result DrawItem(Tizen::Graphics::Canvas* pCanvas);
result DrawLine(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::FloatPoint point1, Tizen::Graphics::FloatPoint point2, bool drawVLine);
void SetItemSize(_ContextMenuItem* pItem);
void AdjustItemPosition(void);
Tizen::Graphics::FloatDimension AdjustItemLayoutStyle(void);
- _ContextMenuItem* CreateItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ _ContextMenuItem* CreateItemN(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const;
void CalculateItemMaximumWidth(void);
void AdjustItemPosition(void);
Tizen::Graphics::FloatDimension AdjustItemLayoutStyle(void);
- _OptionMenuItem* CreateItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap,
+ _OptionMenuItem* CreateItemN(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap,
const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap, bool isSubItem = false);
int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const;