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 FUiCtrlGroupItem.cpp
20 * @brief This is the implementation file for GroupItem class.
22 * This header file contains the implementation of GroupItem class.
25 #include <FBaseSysLog.h>
26 #include <FUiCtrlGroupItem.h>
27 #include "FUiCtrl_GroupItemImpl.h"
28 #include "FUi_CoordinateSystemUtils.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Graphics;
33 namespace Tizen { namespace Ui { namespace Controls
36 GroupItem::GroupItem(void)
41 GroupItem::~GroupItem(void)
48 GroupItem::Construct(const Dimension& itemSize)
50 return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize));
54 GroupItem::Construct(const FloatDimension& itemSize)
58 _GroupItemImpl* pGroupItemImpl = _GroupItemImpl::GetInstance(*this);
59 SysAssertf((pGroupItemImpl == null),
60 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
62 pGroupItemImpl = _GroupItemImpl::CreateGroupItemImpN(this, itemSize);
63 SysTryReturn(NID_UI_CTRL, (pGroupItemImpl != null), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
65 _pImpl = pGroupItemImpl;
71 GroupItem::SetBackgroundBitmap(const Bitmap* pBitmap)
73 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
75 return _pImpl->SetBackgroundBitmap(pBitmap);
79 GroupItem::SetBackgroundColor(const Color& color)
81 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
83 return _pImpl->SetBackgroundColor(color);
87 GroupItem::GetBackgroundColor(void) const
89 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
91 return _pImpl->GetBackgroundColor();
95 GroupItem::SetTextColor(const Color& color)
97 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
99 return _pImpl->SetTextColor(color);
103 GroupItem::GetTextColor(void) const
105 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
107 return _pImpl->GetTextColor();
111 GroupItem::SetTextSize(int size)
113 return SetTextSize(_CoordinateSystemUtils::ConvertToFloat(size));
117 GroupItem::SetTextSize(float size)
119 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
121 return _pImpl->SetTextSize(size);
125 GroupItem::GetTextSize(void) const
127 return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF());
131 GroupItem::GetTextSizeF(void) const
133 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
135 return _pImpl->GetTextSize();
140 GroupItem::SetElement(const String& text, const Bitmap* pBitmap)
142 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
144 return _pImpl->SetElement(text, pBitmap);
147 }}} //Tizen::Ui::Controls