Fix for klockwork minor issues.
[platform/framework/native/uifw.git] / inc / FUiCtrlIIconListViewItemProvider.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 /**
19  * @file        FUiCtrlIIconListViewItemProvider.h
20  * @brief       This is the header file for the %IIconListViewItemProvider interface.
21  *
22  * This header file contains the declarations of the %IIconListViewItemProvider interface. @n
23  * If an event is generated, a method of this interface is called. @n
24  * Applications that perform tasks related to the list events call methods of this interface.
25  */
26
27 #ifndef _FUI_CTRL_IICON_LIST_VIEW_ITEM_PROVIDER_H_
28 #define _FUI_CTRL_IICON_LIST_VIEW_ITEM_PROVIDER_H_
29
30 #include <FUiCtrlIconListViewItem.h>
31
32 namespace Tizen { namespace Ui { namespace Controls
33 {
34
35 class IconListView;
36
37 /**
38  * @interface   IIconListViewItemProvider
39  * @brief               This interface implements the provider for events on %IconListView.
40  *
41  * @since               2.0
42  *
43  * The %IIconListViewItemProvider interface is the interface for handling IconListView items.
44  * The class that handles list items implements this interface, and the instance created using the IconListView::Construct(const Tizen::Graphics::Rectangle&, const Tizen::Graphics::Dimension&, IconListViewStyle, IconListViewScrollDirection, IconListViewScrollStyle) method.
45  *
46  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
47  */
48 class _OSP_EXPORT_ IIconListViewItemProvider
49 {
50 // Operation
51 public:
52         /**
53          * 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.
54          *
55          * @since   2.0
56          */
57         virtual ~IIconListViewItemProvider(void) {}
58
59         /**
60          * Called when the IconListView is about to be drawn and requests the listener to set the number of total items.
61          *
62          * @since   2.0
63          *
64          * @return      The item count of the IconListView
65          * @remarks     Applications that use IconListView must implement this method. This method is expected to return the number of total items in the
66          *                      %IconListView.
67          */
68         virtual int GetItemCount(void) = 0;
69
70         /**
71          * Called when items need to be loaded.
72          *
73          * @since   2.0
74          *
75          * @return      The item of the IconListView
76          * @param[in] index                     The index of the item
77          * @remarks  Applications that use IconListView must implement this method. This method is expected to return an item that is allocated in a heap
78          *                      memory. The returned item can be IconListViewItem. Note that, when the item becomes unnecessary, the %IconListView calls
79          *                      DeleteItem() and applications are in charge of deallocating the item. @n
80          *                      The returned item should not be a null pointer.
81          *
82          */
83         virtual Tizen::Ui::Controls::IconListViewItem* CreateItem(int index) = 0;
84
85         /**
86          * Called when an item is no longer used by the IconListView.
87          *
88          * @since   2.0
89          *
90          * @return      @c true if the item is deallocated by this method, @n
91          *          else @c false
92          *
93          * @param[in] index                     The index of the item
94          * @param[in] pItem                     The pointer to the item to delete
95          *
96          * @remarks     Applications that use IconListView must implement this method. In this method, the applications have the chance of deallocating the
97          *                      item. If the application deallocates the item, this method must return @c true, notifying the %IconListView not to free the item.
98          *                      Otherwise, the item will be deallocated by the %IconListView.
99          *
100          * @see         CreateItem()
101          */
102         virtual bool DeleteItem(int index, Tizen::Ui::Controls::IconListViewItem* pItem) = 0;
103
104 protected:
105         // The following methods are reserved and may change its name at any time without prior notice.
106         virtual void IconListViewItemProvider_Reserved1(void) {}
107         virtual void IconListViewItemProvider_Reserved2(void) {}
108         virtual void IconListViewItemProvider_Reserved3(void) {}
109 }; // IIconListViewItemProvider
110
111 }}} // Tizen::Ui::Controls
112
113 #endif // _FUI_CTRL_IICON_LIST_VIEW_ITEM_PROVIDER_H_