Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrlTableViewItemBase.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17
18 /**
19 * @file         FUiCtrlTableViewItemBase.cpp
20 * @brief        This file contains implementation of TableViewItemBase class
21 */
22
23 //includes
24 #include <FUiCtrlTableViewItemBase.h>
25 #include "FUiCtrl_TableViewItemImpl.h"
26
27
28 namespace Tizen { namespace Ui { namespace Controls
29 {
30
31 TableViewItemBase::TableViewItemBase(void)
32 {
33         // empty statement
34 }
35
36 TableViewItemBase::~TableViewItemBase(void)
37 {
38         // empty statement
39 }
40
41 result
42 TableViewItemBase::SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap, TableViewItemDrawingStatus status)
43 {
44         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
45         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
46
47         return pImpl->SetBackgroundBitmap(status, pBitmap);
48 }
49
50 void
51 TableViewItemBase::SetBackgroundColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status)
52 {
53         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
54         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
55
56         pImpl->SetBackgroundColor(status, color);
57 }
58
59 Tizen::Graphics::Color
60 TableViewItemBase::GetBackgroundColor(TableViewItemDrawingStatus status) const
61 {
62         const _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
63         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
64
65         return pImpl->GetBackgroundColor(status);
66 }
67
68 result
69 TableViewItemBase::SetIndividualSelectionEnabled(const Tizen::Ui::Control* pControl, bool enable)
70 {
71         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
72         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
73
74         const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl);
75         SysTryReturnResult(NID_UI_CTRL, pControlImpl != null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
76
77         return pImpl->SetIndividualSelectionEnabled(*pControlImpl, enable);
78 }
79
80 bool
81 TableViewItemBase::IsIndividualSelectionEnabled(const Tizen::Ui::Control* pControl)
82 {
83         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
84         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
85
86         const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl);
87         SysTryReturnResult(NID_UI_CTRL, pControlImpl != null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
88
89         return pImpl->IsIndividualSelectionEnabled(*pControlImpl);
90 }
91
92 }}} // Tizen::Ui::Controls
93