Tizen 2.1 base
[apps/osp/Home.git] / inc / HmIPageControlItemProvider.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        HmIPageControlItemProvider.h
19  * @brief       Keeps declaration of the IPageControlItemProvider
20  * The class keeps necessary methods which can be used for creating items for the Page data control.
21  */
22
23 #ifndef _HM_IPAGE_CONTROL_ITEM_PROVIDER_H_
24 #define _HM_IPAGE_CONTROL_ITEM_PROVIDER_H_
25
26 class HomeItemInfo;
27
28 /**
29  * @class       IPageControlItemProvider
30  * @brief       declares of the IPageControlItemProvider
31  * The class keeps necessary methods which can be used for creating items for the PageControl.
32  */
33 class IPageControlItemProvider
34 {
35 public:
36         /**
37          * This polymorphic destructor should be overridden if required.
38          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
39          */
40         virtual ~IPageControlItemProvider(void) {}
41
42         /**
43          * Returns the actual item pointer, at the mentioned position
44          *
45          * @return              HomeItemInfo*, The actual item's pointer
46          * @param[in]   pageNumber, page number in which the item to be located
47          * @param[in]   index, The index for which the item to be retrieved
48          */
49         virtual HomeItemInfo* GetItem(int pageNumber, int index) = 0;
50
51         /**
52          * Returns the number of items, which belongs to the mentioned page
53          *
54          * @return              int, The number of items in the page
55          * @param[in]   pageNumber,     Page number
56          */
57         virtual int GetItemCount(int pageNumber) = 0;
58
59         /**
60          * Returns the total number of pages
61          *
62          * @return int, the number of pages
63          */
64         virtual int GetPageCount(void) = 0;
65
66         /**
67          * Rearranges the items within a page, across page and moved icons.
68          *
69          * @param[in]   pMovedAppInfo, The HomeItemInfo's pointer, which has to be moved
70          * @param[in]   newPageNumber, New Page number, where the icon has to be placed
71          * @param[in]   newIndex, The index to which the mentioned application to be placed
72          */
73         virtual void RearrangeItems(HomeItemInfo* pMovedAppInfo, int newPageNumber, int newIndex) = 0;
74 };
75
76 #endif // _HM_IPAGE_CONTROL_ITEM_PROVIDER_H_