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 FUiCtrlTableViewItemBase.cpp
20 * @brief This file contains implementation of TableViewItemBase class
24 #include <FUiCtrlTableViewItemBase.h>
25 #include "FUiCtrl_TableViewItemImpl.h"
28 namespace Tizen { namespace Ui { namespace Controls
31 TableViewItemBase::TableViewItemBase(void)
36 TableViewItemBase::~TableViewItemBase(void)
42 TableViewItemBase::SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap, TableViewItemDrawingStatus status)
44 _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
45 SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
47 return pImpl->SetBackgroundBitmap(status, pBitmap);
51 TableViewItemBase::SetBackgroundColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status)
53 _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
54 SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
56 pImpl->SetBackgroundColor(status, color);
59 Tizen::Graphics::Color
60 TableViewItemBase::GetBackgroundColor(TableViewItemDrawingStatus status) const
62 const _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
63 SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
65 return pImpl->GetBackgroundColor(status);
69 TableViewItemBase::SetIndividualSelectionEnabled(const Tizen::Ui::Control* pControl, bool enable)
71 _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
72 SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
74 const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl);
75 SysTryReturnResult(NID_UI_CTRL, pControlImpl != null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
77 return pImpl->SetIndividualSelectionEnabled(*pControlImpl, enable);
81 TableViewItemBase::IsIndividualSelectionEnabled(const Tizen::Ui::Control* pControl)
83 _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
84 SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
86 const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl);
87 SysTryReturnResult(NID_UI_CTRL, pControlImpl != null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
89 return pImpl->IsIndividualSelectionEnabled(*pControlImpl);
92 }}} // Tizen::Ui::Controls