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.@n
50 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
54 virtual ~IGalleryItemProvider(void) {}
57 * Gets the total number of items.
61 * @return The total number of the Gallery control items
62 * @remarks An application that uses the Gallery control must implement this method.
64 virtual int GetItemCount(void) = 0;
67 * Gets the item at the specified index from the item provider.
71 * @return An item of the Gallery control
72 * @param[in] index The index of the item
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.
79 virtual Tizen::Ui::Controls::GalleryItem* CreateItem(int index) = 0;
82 * Deletes the specified item.
86 * @return @c true if the item is deallocated by this method, @n
88 * @param[in] index The index of the item
89 * @param[in] pItem The pointer to GalleryItem to delete
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.
95 virtual bool DeleteItem(int index, Tizen::Ui::Controls::GalleryItem* pItem) = 0;
99 //This method is for internal use only. Using this method can cause behavioral, security-related,
100 //and consistency-related issues in the application.
102 virtual void GalleryItemProvider_Reserved1(void) {}
105 //This method is for internal use only. Using this method can cause behavioral, security-related,
106 //and consistency-related issues in the application.
108 virtual void GalleryItemProvider_Reserved2(void) {}
111 //This method is for internal use only. Using this method can cause behavioral, security-related,
112 //and consistency-related issues in the application.
114 virtual void GalleryItemProvider_Reserved3(void) {}
115 }; // IGalleryItemProvider
117 }}} // Tizen::Ui::Controls
119 #endif // _FUI_CTRL_IGALLERY_ITEM_PROVIDER_H_