2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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 FUiCtrlTableViewItem.cpp
20 * @brief This file contains implementation of TableViewItem class
25 #include <FUiCtrlTableViewItem.h>
26 #include <FUiCtrlTableViewContextItem.h>
27 #include "FUiCtrl_TableViewItemImpl.h"
28 #include "FUiCtrl_ListItemBaseImpl.h"
30 namespace Tizen { namespace Ui { namespace Controls
33 TableViewItem::TableViewItem(void)
39 TableViewItem::~TableViewItem(void)
45 TableViewItem::Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style)
48 _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
49 SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
51 pImpl = _TableViewItemImpl::CreateTableViewItemImplN(this, itemSize, style);
53 SysTryReturn(NID_UI_CTRL, pImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
55 _pControlImpl = pImpl;
61 TableViewItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style)
63 return Construct(layout, layout, itemSize, style);
67 TableViewItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style)
70 _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
71 SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
73 pImpl = _TableViewItemImpl::CreateTableViewItemImplN(this, itemSize, style, &(const_cast <Layout&>(portraitLayout)), &(const_cast <Layout&>(landscapeLayout)));
75 SysTryReturn(NID_UI_CTRL, pImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
77 _pControlImpl = pImpl;
83 TableViewItem::SetContextItem(const TableViewContextItem* pItem)
85 _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this);
86 SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
88 _TableViewItemImpl* pItemImpl = null;
91 pItemImpl = const_cast<_TableViewItemImpl*>(_TableViewItemImpl::GetInstance(*pItem));
94 pImpl->SetContextItem(pItemImpl);
98 TableViewItem::GetAnnexWidth(TableViewAnnexStyle style)
100 return _TableViewItemImpl::GetAnnexWidth(style);
103 }}} // Tizen::Ui::Controls