Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / controls / FUiCtrlTableViewSimpleItem.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
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         FUiCtrlTableViewSimpleItem.cpp
20 * @brief        This file contains implementation of TableViewSimpleItem class
21 */
22
23
24 //includes
25 #include <FUiCtrlTableViewSimpleItem.h>
26 #include <FUiCtrlLabel.h>
27 #include "FUiCtrl_TableViewItemImpl.h"
28
29
30 using namespace Tizen::Graphics;
31
32 namespace Tizen { namespace Ui { namespace Controls
33 {
34
35 TableViewSimpleItem::TableViewSimpleItem(void)
36         : TableViewItem()
37 {
38         // empty statement
39 }
40
41 TableViewSimpleItem::~TableViewSimpleItem(void)
42 {
43         // empty statement
44 }
45
46 result
47 TableViewSimpleItem::Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style)
48 {
49         return TableViewItem::Construct(itemSize, style);
50 }
51
52 result
53 TableViewSimpleItem::SetItemContents(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap)
54 {
55         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
56         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
57
58         return pImpl->SetSimpleItemContents(text, pBitmap);
59 }
60
61 void
62 TableViewSimpleItem::SetTextColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status)
63 {
64         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
65         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
66
67         pImpl->SetSimpleItemTextColor(color, status);
68 }
69
70 Tizen::Graphics::Color
71 TableViewSimpleItem::GetTextColor(TableViewItemDrawingStatus status) const
72 {
73         const _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
74         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
75
76         return pImpl->GetSimpleItemTextColor(status);
77 }
78
79 result
80 TableViewSimpleItem::SetTextSize(int size)
81 {
82         _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
83         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
84
85         return pImpl->SetSimpleItemTextSize(size);
86 }
87
88 int
89 TableViewSimpleItem::GetTextSize(void) const
90 {
91         const _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
92         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
93
94         return pImpl->GetSimpleItemTextSize();
95 }
96
97 }}}
98