Merge "support evas engine type" into tizen_2.1
[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 Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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.@n
50          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
51          *
52          * @since       2.0
53          */
54         virtual ~IGalleryItemProvider(void) {}
55
56         /**
57          * Gets the total number of items.
58          *
59          * @since       2.0
60          *
61          * @return              The total number of the Gallery control items
62          * @remarks             An application that uses the Gallery control must implement this method.
63          */
64         virtual int GetItemCount(void) = 0;
65
66         /**
67          * Gets the item at the specified index from the item provider.
68          *
69          * @since       2.0
70          *
71          * @return              An item of the Gallery control
72          * @param[in]   index                   The index of the item
73          * @see                 DeleteItem()
74          * @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
75          *                              heap memory. The returned item can be of type GalleryItem. Note that when the item is not required, the Gallery control calls the
76          *                              IGalleryItemProvider::DeleteItem() method.
77          *                              The returned item should not be a null pointer.
78          */
79         virtual Tizen::Ui::Controls::GalleryItem* CreateItem(int index) = 0;
80
81         /**
82          * Deletes the specified item.
83          *
84          * @since       2.0
85          *
86          * @return              @c true if the item is deallocated by this method, @n
87          *                              else @c false
88          * @param[in]   index           The index of the item
89          * @param[in]   pItem           The pointer to GalleryItem to delete
90          * @see                 CreateItem()
91          * @remarks             An application that uses the Gallery control must implement this method. Using this method, an application can deallocate the item. If an
92          *                              application deallocates the item, this method returns @c true. This notifies the Gallery control to not release the item.
93          *                              Otherwise, the item is deallocated by the Gallery control.
94          */
95         virtual bool DeleteItem(int index, Tizen::Ui::Controls::GalleryItem* pItem) = 0;
96
97 protected:
98         //
99         //This method is for internal use only. Using this method can cause behavioral, security-related,
100         //and consistency-related issues in the application.
101         //
102         virtual void GalleryItemProvider_Reserved1(void) {}
103
104         //
105         //This method is for internal use only. Using this method can cause behavioral, security-related,
106         //and consistency-related issues in the application.
107         //
108         virtual void GalleryItemProvider_Reserved2(void) {}
109
110         //
111         //This method is for internal use only. Using this method can cause behavioral, security-related,
112         //and consistency-related issues in the application.
113         //
114         virtual void GalleryItemProvider_Reserved3(void) {}
115 }; // IGalleryItemProvider
116
117 }}} // Tizen::Ui::Controls
118
119 #endif // _FUI_CTRL_IGALLERY_ITEM_PROVIDER_H_