Tizen 2.1 base
[apps/osp/Home.git] / inc / HmCustomIconListProvider.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        HmCustomIconListProvider.h
19  * @brief       This is the class declaration for the IconListItemProviderCustom class
20  * This class contains the functions which are required managing the IconListView's items
21  */
22
23 #ifndef _HM_CUSTOM_ICON_LIST_ITEM_PROVIDER_H_
24 #define _HM_CUSTOM_ICON_LIST_ITEM_PROVIDER_H_
25
26 #include <FBase.h>
27 #include <FUi.h>
28 #include "HmIPageControlItemProvider.h"
29
30 /**
31  * @class       CustomIconListProvider
32  * @brief       Provider implementation for the HmCustomIconListViews in pagging control
33  */
34 class CustomIconListProvider
35         : public Tizen::Base::Object
36         , public Tizen::Ui::Controls::IIconListViewItemProvider
37 {
38 public:
39         /**
40          * Constructor
41          */
42         CustomIconListProvider(int index);
43
44         /**
45          * Destructor
46          */
47         ~CustomIconListProvider(void);
48
49         /**
50          * Gets the value of edit mode
51          */
52         bool GetEditMode(void) const;
53
54         /**
55          * Returns the item, which is getting moved currently
56          */
57         Tizen::Ui::Controls::IconListViewItem* GetMovingItem(void) const;
58
59         /**
60          * Returns the Moving Item's index
61          */
62         int GetMovingItemIndex() const;
63
64         /**
65          * Returns the item provider instance.
66          */
67         IPageControlItemProvider* GetPageControlItemProvider(void);
68
69         /**
70          * Sets the value of edit mode
71          */
72         void SetEditMode(bool editMode);
73
74         /**
75          * Sets the index of this provider object.
76          */
77         void SetIndex(int index);
78
79         /**
80          * Sets the maximum number of icons in a page.
81          */
82         void SetMaxCountOfIcons(int iconCount);
83
84         /**
85          * Sets the Moving items instance
86          */
87         void SetMovingItem(Tizen::Ui::Controls::IconListViewItem* pMovedItem);
88
89         /**
90          * Set the index of moving item, for projecting the expected project.
91          */
92         void SetMovingItemIndex(int movedIndex);
93
94         /**
95          * Sets the item Provider for this panel.
96          */
97         void SetPageControlItemProvider(IPageControlItemProvider* pItemProvider);
98
99         /**
100          * Sets the moving item to be egnored while drawing, as this is an invalid item now
101          */
102         void SetProjectedItemInvalid(bool isInvalid);
103
104         // from IIconListViewItemProvider
105         virtual Tizen::Ui::Controls::IconListViewItem* CreateItem(int index);
106         virtual bool DeleteItem(int index, Tizen::Ui::Controls::IconListViewItem* pItem);
107         virtual int GetItemCount(void);
108
109 private:
110         /**
111          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
112          */
113         CustomIconListProvider(const CustomIconListProvider&);
114
115         /**
116          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
117          */
118         CustomIconListProvider& operator =(const CustomIconListProvider&);
119
120 private:
121         bool __editMode;        // keeps the value of editmode
122         bool __isProjectedItemInvalid;    // Is the projection item to be egnored
123         int __index;        // keeps track of index
124         int __iconsPerPage;     // number of icons per page
125         int __currentIndex;     // the index of current projected item
126         IPageControlItemProvider* __pPageItemProvider;      // item provider instance
127         Tizen::Ui::Controls::IconListViewItem* __pMovementItem;       //The item pointer to be projected in expected position
128         Tizen::Graphics::Bitmap* __pOverayBitmap;       //The close button bitmap
129
130
131 };
132
133 #endif //_HM_CUSTOM_ICON_LIST_ITEM_PROVIDER_H_