2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_DateTimeBarItem.cpp
20 * @brief This is the implementation file for the _DateTimeBarItem class.
23 #include "FUi_ResourceManager.h"
24 #include "FUiCtrl_DateTimeBarItem.h"
26 using namespace Tizen::Graphics;
28 namespace Tizen { namespace Ui { namespace Controls
30 _DateTimeBarItem::_DateTimeBarItem(void)
33 , __status(DATETIMEBAR_ITEM_STATUS_NORMAL)
34 , __bounds(FloatRectangle())
39 _DateTimeBarItem::~_DateTimeBarItem(void)
44 _DateTimeBarItem::CreateInstanceN(_DateTimeBarAlignment alignment, float itemWidth)
46 _DateTimeBarItem* pItem = new (std::nothrow) _DateTimeBarItem;
47 SysTryReturn(NID_UI_CTRL, pItem != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
51 if (alignment == DATETIME_BAR_ALIGN_DOWN)
53 r = GET_SHAPE_CONFIG(DATETIMEBAR::ARROW_HEIGHT, _ControlManager::GetInstance()->GetOrientation(), pItem->__bounds.y);
54 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
57 pItem->__bounds.width = itemWidth;
59 r = GET_SHAPE_CONFIG(DATETIMEBAR::ITEM_HEIGHT, _ControlManager::GetInstance()->GetOrientation(), pItem->__bounds.height);
60 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
70 _DateTimeBarItem::SetActionId(int actionId)
72 __actionId = actionId;
77 _DateTimeBarItem::GetActionId(void) const
83 _DateTimeBarItem::SetText(const Tizen::Base::String& text)
90 _DateTimeBarItem::GetText(void) const
96 _DateTimeBarItem::SetStatus(_DateTimeBarItemStatus status)
102 _DateTimeBarItemStatus
103 _DateTimeBarItem::GetStatus(void) const
109 _DateTimeBarItem::SetBounds(const Tizen::Graphics::FloatRectangle& bounds)
116 _DateTimeBarItem::GetBounds(void) const
121 }}} // Tizen::Ui::Controls