Tizen 2.1 base
[platform/framework/native/uifw.git] / inc / FUiCtrlIGalleryItemProvider.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  * @file                FUiCtrlIGalleryItemProvider.h
19  * @brief               This is the header file for the %IGalleryItemProvider interface.
20  *
21  * This header file contains the declarations of the %IGalleryItemProvider interface. @n
22  * If an event is generated, a method of this interface is called. @n
23  * Therefore, if applications perform jobs related to the list events, use the methods of this interface.
24  *
25  */
26 #ifndef _FUI_CTRL_IGALLERY_ITEM_PROVIDER_H_
27 #define _FUI_CTRL_IGALLERY_ITEM_PROVIDER_H_
28
29 #include <FUiCtrlGalleryItem.h>
30
31 namespace Tizen { namespace Ui { namespace Controls
32 {
33
34 /**
35  * @interface   IGalleryItemProvider
36  * @brief               This interface implements the provider for events on Gallery.
37  *
38  * @since               2.0
39  *
40  * The %IGalleryItemProvider interface is the interface for handling Gallery items. The class that handles gallery items implements this
41  * interface, and the instance created using the Gallery's SetItemProvider() method.
42  *
43  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_gallery.htm">Gallery</a>.
44  */
45 class _OSP_EXPORT_ IGalleryItemProvider
46 {
47 public:
48         /**
49          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
50          *
51          * @since       2.0
52          */
53         virtual ~IGalleryItemProvider(void) {}
54
55         /**
56          * Gets the total number of items.
57          *
58          * @since       2.0
59          *
60          * @return              The total number of the Gallery control items
61          * @remarks             An application that uses the Gallery control must implement this method.
62          */
63         virtual int GetItemCount(void) = 0;
64
65         /**
66          * Gets the item at the specified index from the item provider.
67          *
68          * @since       2.0
69          *
70          * @return              An item of the Gallery control
71          * @param[in]   index                   The index of the item
72          * @see                 DeleteItem()
73          * @remarks             An application that uses the Gallery control must implement this method. This method is expected to return an item that is allocated on a
74          *                              heap memory. The returned item can be of type GalleryItem. Note that when the item is not required, the Gallery control calls the
75          *                              IGalleryItemProvider::DeleteItem() method.
76          */
77         virtual Tizen::Ui::Controls::GalleryItem* CreateItem(int index) = 0;
78
79         /**
80          * Deletes the specified item.
81          *
82          * @since       2.0
83          *
84          * @return              @c true if the item is deallocated by this method, @n
85          *                              else @c false
86          * @param[in]   index           The index of the item
87          * @param[in]   pItem           The pointer to GalleryItem that is to be deleted
88          * @see                 CreateItem()
89          * @remarks             An application that uses the Gallery control must implement this method. Using this method, an application can deallocate the item. If an
90          *                              application deallocates the item, this method returns @c true. This notifies the Gallery control to not release the item.
91          *                              Otherwise, the item is deallocated by the Gallery control.
92          */
93         virtual bool DeleteItem(int index, Tizen::Ui::Controls::GalleryItem* pItem) = 0;
94
95 protected:
96         //
97         //This method is for internal use only. Using this method can cause behavioral, security-related,
98         //and consistency-related issues in the application.
99         //
100         virtual void GalleryItemProvider_Reserved1(void) {}
101
102         //
103         //This method is for internal use only. Using this method can cause behavioral, security-related,
104         //and consistency-related issues in the application.
105         //
106         virtual void GalleryItemProvider_Reserved2(void) {}
107
108         //
109         //This method is for internal use only. Using this method can cause behavioral, security-related,
110         //and consistency-related issues in the application.
111         //
112         virtual void GalleryItemProvider_Reserved3(void) {}
113 }; // IGalleryItemProvider
114
115 }}} // Tizen::Ui::Controls
116
117 #endif // _FUI_CTRL_IGALLERY_ITEM_PROVIDER_H_