2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0/
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.
18 * @file FUiCtrlIGalleryItemProvider.h
19 * @brief This is the header file for the %IGalleryItemProvider interface.
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.
26 #ifndef _FUI_CTRL_IGALLERY_ITEM_PROVIDER_H_
27 #define _FUI_CTRL_IGALLERY_ITEM_PROVIDER_H_
29 #include <FUiCtrlGalleryItem.h>
31 namespace Tizen { namespace Ui { namespace Controls
35 * @interface IGalleryItemProvider
36 * @brief This interface implements the provider for events on Gallery.
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.
43 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_gallery.htm">Gallery</a>.
45 class _OSP_EXPORT_ IGalleryItemProvider
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.
53 virtual ~IGalleryItemProvider(void) {}
56 * Gets the total number of items.
60 * @return The total number of the Gallery control items
61 * @remarks An application that uses the Gallery control must implement this method.
63 virtual int GetItemCount(void) = 0;
66 * Gets the item at the specified index from the item provider.
70 * @return An item of the Gallery control
71 * @param[in] index The index of the item
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.
77 virtual Tizen::Ui::Controls::GalleryItem* CreateItem(int index) = 0;
80 * Deletes the specified item.
84 * @return @c true if the item is deallocated by this method, @n
86 * @param[in] index The index of the item
87 * @param[in] pItem The pointer to GalleryItem to delete
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.
93 virtual bool DeleteItem(int index, Tizen::Ui::Controls::GalleryItem* pItem) = 0;
97 //This method is for internal use only. Using this method can cause behavioral, security-related,
98 //and consistency-related issues in the application.
100 virtual void GalleryItemProvider_Reserved1(void) {}
103 //This method is for internal use only. Using this method can cause behavioral, security-related,
104 //and consistency-related issues in the application.
106 virtual void GalleryItemProvider_Reserved2(void) {}
109 //This method is for internal use only. Using this method can cause behavioral, security-related,
110 //and consistency-related issues in the application.
112 virtual void GalleryItemProvider_Reserved3(void) {}
113 }; // IGalleryItemProvider
115 }}} // Tizen::Ui::Controls
117 #endif // _FUI_CTRL_IGALLERY_ITEM_PROVIDER_H_