Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_ListViewItemProviderAdaptor.h
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        FUiCtrl_ListViewItemProviderAdaptor.h
20  * @brief       This is the header file for the __ListViewItemProviderAdaptor class.
21  *
22  * This header file contains the declarations of the __ListViewItemProviderAdaptor class.
23  */
24
25 #ifndef _FUI_CTRL_INTERNAL_LIST_VIEW_ITEM_PROVIDER_ADAPTOR_H_
26 #define _FUI_CTRL_INTERNAL_LIST_VIEW_ITEM_PROVIDER_ADAPTOR_H_
27
28 #include <FUiControl.h>
29 #include <FUiCtrlIListViewItemProvider.h>
30 #include "FUiCtrl_IUiListViewItemEventListener.h"
31 #include "FUiCtrl_LinkedList.h"
32 #include "FUiCtrl_TableViewItemProviderAdaptor.h"
33
34 namespace Tizen { namespace Ui { namespace Controls
35 {
36
37 class _IListItemCommon;
38 class _ListViewItem;
39
40 class _ListViewItemProviderAdaptor
41         : public _TableViewItemProviderAdaptor
42 {
43 public:
44 // Lifecycle
45         _ListViewItemProviderAdaptor(const IListViewItemProvider& provider);
46
47         virtual ~_ListViewItemProviderAdaptor(void);
48
49 // Operation
50         void SetItemProvider(const IListViewItemProvider& provider);
51
52         virtual _IListItemCommon* LoadItem(int groupIndex, int itemIndex);
53
54         virtual result UnloadItem(_IListItemCommon* pListItem, int groupIndex, int itemIndex);
55
56         virtual result DeleteItem(_IListItemCommon* pListItem, int groupIndex, int itemIndex);
57
58         virtual bool UpdateItem(_IListItemCommon* pItem, int groupIndex, int itemIndex);
59
60         virtual int GetItemCount(int groupIndex = 0) const;
61
62         virtual int GetGroupCount(void) const;
63
64         virtual int GetDefaultItemHeight(void);
65
66         virtual int GetDefaultGroupItemHeight(void);
67
68         bool SetDescriptionTextShowState(int itemIndex, bool show);
69
70         bool IsDescriptionTextShown(int itemIndex) const;
71
72         void SetListViewItemEventListener(Tizen::Ui::Controls::_IUiListViewItemEventListener& listener);
73
74         void SetItemFont(const Tizen::Base::String& fontName);
75
76         void SetItemNeedsLazyDeletion(_ListViewItem* pItem);
77
78 private:
79         _ListViewItemProviderAdaptor(const _ListViewItemProviderAdaptor& rhs);
80
81         _ListViewItemProviderAdaptor& operator =(const _ListViewItemProviderAdaptor& rhs);
82
83 // Variable
84 private:
85         IListViewItemProvider* __pListViewProvider;
86         _LinkedList <short> __descriptionTextShowItem;
87         _IUiListViewItemEventListener* __pEventListener;
88         Tizen::Base::String __fontName;
89         int __itemAverageHeight;
90         int __itemLoadedCount;
91         int __countOfAllItems;
92         _ListViewItem* __pItemNeedsLazyDeletion;
93 };  // _ListViewItemProviderAdaptor
94
95 }}} // Tizen::Ui::Controls
96
97 #endif // _FUI_CTRL_INTERNAL_LIST_VIEW_ITEM_PROVIDER_ADAPTOR_H_
98