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 FUiCtrl_ExpandableListData.cpp
20 * @brief This is the implementation file for _MainItem, _SubItem & _ExpandableListItemDataProvider class.
25 #include <FBaseSysLog.h>
26 #include "FUiCtrl_ExpandableListData.h"
27 #include "FUiCtrl_ExpandableListImpl.h"
28 #include "FUiCtrl_CustomListImpl.h"
30 using namespace Tizen::Base::Collection;
32 namespace Tizen { namespace Ui { namespace Controls
35 _MainItem::_MainItem(void)
39 , pCustomItemData(null)
43 _MainItem::~_MainItem(void)
45 subItemList.RemoveAll(!isExpanded);
46 actualSubItemList.RemoveAll(true);
50 _SubItem::_SubItem(bool removeItemData)
52 , pCustomItemData(null)
53 , isDeleteNeeded(removeItemData)
57 _SubItem::~_SubItem(void)
61 delete pCustomItemData;
62 pCustomItemData = null;
67 _ExpandableListItemDataProvider::_ExpandableListItemDataProvider(_ExpandableListImpl* pList)
72 _ExpandableListItemDataProvider::~_ExpandableListItemDataProvider(void)
78 _ExpandableListItemDataProvider::GetItemCount(void)
83 return __pList->__mainList.GetCount();
90 _ExpandableListItemDataProvider::CreateItem(int index, int itemWidth)
92 _MainItem* pMainItem = null;
93 _SubItem* pSubItem = null;
94 _CustomItemData* pCustomItemData = null;
96 pMainItem = dynamic_cast<_MainItem*>(__pList->__mainList.GetAt(index));
100 return pCustomItemData = dynamic_cast<_CustomItemData*>(pMainItem->pCustomItemData);
103 pSubItem = dynamic_cast<_SubItem*>(__pList->__mainList.GetAt(index));
105 if (pSubItem != null)
107 return pCustomItemData = dynamic_cast<_CustomItemData*>(pSubItem->pCustomItemData);
114 _ExpandableListItemDataProvider::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
119 }}} // Tizen::Ui::Controls