2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 FUiCtrlListItemBase.cpp
20 * @brief This is the implementation file for ListItemBase class.
22 * This file contains the implementation of ListItemBase class.
25 #include <FBaseSysLog.h>
26 #include <FUiCtrlListItemBase.h>
27 #include "FUiCtrl_ListContextItemImpl.h"
28 #include "FUiCtrl_ListItemBaseImpl.h"
29 #include "FUi_CoordinateSystemUtils.h"
31 using namespace Tizen::Base;
32 using namespace Tizen::Graphics;
34 namespace Tizen { namespace Ui { namespace Controls
37 ListItemBase::ListItemBase(void)
42 ListItemBase::~ListItemBase(void)
49 ListItemBase::Construct(const Dimension& itemSize, ListAnnexStyle style)
51 return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize), style);
55 ListItemBase::Construct(const FloatDimension& itemSize, ListAnnexStyle style)
59 _ListItemBaseImpl* pImpl = _ListItemBaseImpl::GetInstance(*this);
60 SysAssertf(pImpl == null,
61 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
63 pImpl = _ListItemBaseImpl::CreateListItemBaseImplN(this, itemSize, style);
64 SysTryReturn(NID_UI_CTRL, pImpl != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
72 ListItemBase::SetBackgroundBitmap(ListItemDrawingStatus status, const Bitmap* pBitmap)
74 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
76 return _pImpl->SetBackgroundBitmap(status, pBitmap);
80 ListItemBase::SetBackgroundColor(ListItemDrawingStatus status, const Color& color)
82 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
84 return _pImpl->SetBackgroundColor(status, color);
88 ListItemBase::GetBackgroundColor(ListItemDrawingStatus status) const
90 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
92 return _pImpl->GetBackgroundColor(status);
96 ListItemBase::SetContextItem(const ListContextItem* pItem)
98 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
100 return _pImpl->SetContextItem(_ListContextItemImpl::GetInstance(*pItem));
104 ListItemBase::SetDescriptionText(const String& text)
106 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
108 return _pImpl->SetDescriptionText(text);
112 ListItemBase::SetDescriptionTextColor(const Color& color)
114 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
116 return _pImpl->SetDescriptionTextColor(color);
120 ListItemBase::GetAnnexWidth(ListAnnexStyle style)
122 return _CoordinateSystemUtils::ConvertToInteger(GetAnnexWidthF(style));
126 ListItemBase::GetAnnexWidthF(ListAnnexStyle style)
128 return _ListItemBaseImpl::GetAnnexWidth(style);
131 }}} // Tizen::Ui::Controls