Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrlTableViewGroupItem.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                 FUiCtrlTableViewGroupItem.cpp
20 * @brief                This is the implementation file for TableViewGroupItem class.
21 *
22 * This header file contains the implementation of TableViewGroupItem class.
23 */
24
25 #include <FUiCtrlTableViewGroupItem.h>
26 #include "FUiCtrl_TableViewItemImpl.h"
27 #include "FUi_CoordinateSystemUtils.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::Graphics;
31
32 namespace Tizen { namespace Ui { namespace Controls
33 {
34
35 TableViewGroupItem::TableViewGroupItem(void)
36 {
37 }
38
39 TableViewGroupItem::~TableViewGroupItem(void)
40 {
41 }
42
43 result
44 TableViewGroupItem::Construct(const Dimension& itemSize)
45 {
46         return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize));
47 }
48
49 result
50 TableViewGroupItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize)
51 {
52         return Construct(layout, layout, _CoordinateSystemUtils::ConvertToFloat(itemSize));
53 }
54
55 result
56 TableViewGroupItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize)
57 {
58         return Construct(portraitLayout, landscapeLayout, _CoordinateSystemUtils::ConvertToFloat(itemSize));
59 }
60
61 result
62 TableViewGroupItem::Construct(const FloatDimension& itemSize)
63 {
64         result r = E_SUCCESS;
65
66         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
67         SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
68
69         pImpl = _TableViewItemImpl::CreateTableViewItemImplN(this, itemSize);
70
71         r = GetLastResult();
72         SysTryReturn(NID_UI_CTRL, pImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
73
74         _pControlImpl = pImpl;
75
76         return r;
77 }
78
79 result
80 TableViewGroupItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize)
81 {
82         return Construct(layout, layout, itemSize);
83 }
84
85 result
86 TableViewGroupItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatDimension& itemSize)
87 {
88         result r = E_SUCCESS;
89
90         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
91         SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
92
93         pImpl = _TableViewItemImpl::CreateTableViewItemImplN(this, itemSize, TABLE_VIEW_ANNEX_STYLE_NORMAL, &(const_cast <Layout&>(portraitLayout)), &(const_cast <Layout&>(landscapeLayout)));
94
95         r = GetLastResult();
96         SysTryReturn(NID_UI_CTRL, pImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
97
98         _pControlImpl = pImpl;
99
100         return r;
101 }
102
103
104 }}} //Tizen::Ui::Controls