Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_ListItemCommon.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        FUiCtrl_ListItemCommon.cpp
20  * @brief       This is the implementation file for _ListItemCommon class.
21  *
22  * This file contains the implementation of _ListItemCommon class.
23  */
24
25 #include <FBaseSysLog.h>
26 #include "FUiCtrl_ListItemCommon.h"
27
28 namespace Tizen { namespace Ui { namespace Controls
29 {
30
31 _ListItemCommon::_ListItemCommon(void)
32         : __pAppInfo(null)
33         , __refCount(1)
34         , __itemHeight(0)
35         , __checkedState(false)
36         , __enabledState(true)
37         , __itemChanged(true)
38         , __reorderMode(false)
39 {
40 }
41
42 _ListItemCommon::~_ListItemCommon(void)
43 {
44         __pAppInfo = null;
45 }
46
47 int
48 _ListItemCommon::GetItemHeight(void) const
49 {
50         return __itemHeight;
51 }
52
53 void
54 _ListItemCommon::SetItemHeight(int itemHeight)
55 {
56         __itemHeight = itemHeight;
57 }
58
59 void
60 _ListItemCommon::SetChecked(bool checked)
61 {
62         __checkedState = checked;
63 }
64
65 bool
66 _ListItemCommon::IsChecked(void) const
67 {
68         return __checkedState;
69 }
70
71 void
72 _ListItemCommon::SetItemEnabled(bool enabled)
73 {
74         __enabledState = enabled;
75 }
76
77 bool
78 _ListItemCommon::IsItemEnabled(void) const
79 {
80         return __enabledState;
81 }
82
83 bool
84 _ListItemCommon::IsReorderMode(void) const
85 {
86         return __reorderMode;
87 }
88
89 void
90 _ListItemCommon::SetReorderMode(bool enabled)
91 {
92         __reorderMode = enabled;
93 }
94
95 void
96 _ListItemCommon::SetAppInfo(const void* pAppInfo)
97 {
98         __pAppInfo = const_cast<void*>(pAppInfo);
99 }
100
101 void*
102 _ListItemCommon::GetAppInfo(void) const
103 {
104         return __pAppInfo;
105 }
106
107 void
108 _ListItemCommon::SetItemChanged(bool changed)
109 {
110         __itemChanged = changed;
111 }
112
113 bool
114 _ListItemCommon::IsItemChanged(void) const
115 {
116         return __itemChanged;
117 }
118
119 int
120 _ListItemCommon::AddRef(void)
121 {
122         return ++__refCount;
123 }
124
125 int
126 _ListItemCommon::Release(void)
127 {
128         --__refCount;
129         if (__refCount <= 0)
130         {
131                 delete this;
132                 return 0;
133         }
134
135         return __refCount;
136 }
137
138 }}} // Tizen::Ui::Controls