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"
30 using namespace Tizen::Base;
31 using namespace Tizen::Graphics;
33 namespace Tizen { namespace Ui { namespace Controls
36 ListItemBase::ListItemBase(void)
41 ListItemBase::~ListItemBase(void)
48 ListItemBase::Construct(const Dimension& itemSize, ListAnnexStyle style)
52 _ListItemBaseImpl* pImpl = _ListItemBaseImpl::GetInstance(*this);
53 SysAssertf(pImpl == null,
54 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
56 pImpl = _ListItemBaseImpl::CreateListItemBaseImplN(this, itemSize, style);
57 SysTryReturn(NID_UI_CTRL, pImpl != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
65 ListItemBase::SetBackgroundBitmap(ListItemDrawingStatus status, const Bitmap* pBitmap)
67 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
69 return _pImpl->SetBackgroundBitmap(status, pBitmap);
73 ListItemBase::SetBackgroundColor(ListItemDrawingStatus status, const Color& color)
75 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
77 return _pImpl->SetBackgroundColor(status, color);
81 ListItemBase::GetBackgroundColor(ListItemDrawingStatus status) const
83 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
85 return _pImpl->GetBackgroundColor(status);
89 ListItemBase::SetContextItem(const ListContextItem* pItem)
91 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
93 return _pImpl->SetContextItem(_ListContextItemImpl::GetInstance(*pItem));
97 ListItemBase::SetDescriptionText(const String& text)
99 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
101 return _pImpl->SetDescriptionText(text);
105 ListItemBase::SetDescriptionTextColor(const Color& color)
107 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
109 return _pImpl->SetDescriptionTextColor(color);
113 ListItemBase::SetProgressValue(int value)
115 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
117 return _pImpl->SetProgressValue(value);
121 ListItemBase::SetProgressMargins(int leftMargin, int rightMargin)
123 SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use.");
125 return _pImpl->SetProgressMargins(leftMargin, rightMargin);
129 ListItemBase::GetAnnexWidth(ListAnnexStyle style)
131 return _ListItemBaseImpl::GetAnnexWidth(style);
134 }}} // Tizen::Ui::Controls