2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
19 * @file FUiCtrlIGroupedListViewItemEventListener.h
20 * @brief This is the header file for the %IGroupedListViewItemEventListener interface.
22 * This header file contains the declarations of the %IGroupedListViewItemEventListener interface.
25 #ifndef _FUI_CTRL_IGROUPED_LIST_VIEW_ITEM_EVENT_LISTENER_H_
26 #define _FUI_CTRL_IGROUPED_LIST_VIEW_ITEM_EVENT_LISTENER_H_
28 #include <FBaseRtIEventListener.h>
29 #include <FUiCtrlListViewTypes.h>
31 namespace Tizen { namespace Ui { namespace Controls
34 class GroupedListView;
37 * @interface IGroupedListViewItemEventListener
38 * @brief This interface implements the listener for the events generated by the items of the GroupedListView control.
42 * The %IGroupedListViewItemEventListener interface is the listener interface for receiving GroupedListView item events.
43 * The class that processes a list item event implements this interface, and the instance created with that class is registered
44 * with a UI control, using the control's AddGroupedListViewItemEventListener() method. When the list item event occurs, a
45 * method of that instance is invoked.
47 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
49 class _OSP_EXPORT_ IGroupedListViewItemEventListener
50 : virtual public Tizen::Base::Runtime::IEventListener
54 * This polymorphic destructor should be overridden if required.
55 * This way, the destructors of the derived classes are called
56 * when the destructor of this interface is called.
60 virtual ~IGroupedListViewItemEventListener(void) {};
63 * Called when the state of an element of a GroupedListView item is changed.
67 * @param[in] listView The source of the event
68 * @param[in] groupIndex The index of the group item
69 * @param[in] itemIndex The index of the item in the group
70 * @param[in] elementId The element ID
71 * @param[in] status The status of the element
73 * @remarks This method is called when an element of the %CustomItem control in the %GroupedListView control is checked, unchecked, or selected. @n
74 * If the method is called to notify the state change of an item's annex or the item itself, the specified elementId is set to @c -1.
76 virtual void OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus status) = 0;
79 * Called when ListItem is swept.
82 * @param[in] listView The source of the event
83 * @param[in] groupIndex The index of the group item
84 * @param[in] itemIndex The index of the item in the group
85 * @param[in] direction The sweep direction
87 virtual void OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction) = 0;
90 * Called when the state of an element in the ListContextItem control is changed.
94 * @param[in] listView The source of the event
95 * @param[in] groupIndex The index of the group item
96 * @param[in] itemIndex The index of the item in the group
97 * @param[in] elementId The element ID
98 * @param[in] status The status of the element
100 virtual void OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status) = 0;
103 * Called when the item or the element is long pressed.
107 * @param[in] listView The source of the event
108 * @param[in] groupIndex The index of the group
109 * @param[in] itemIndex The index of the item in the group
110 * @param[in] elementId The element ID
111 * @param[in,out] invokeListViewItemCallback Indicates whether to invoke %GroupedListView item callback after this method returns
112 * @remarks This method is invoked when an item or an element is long pressed. @n
113 * When the event comes from the annex or the whole item, @c elementId is always -1. @n
114 * Setting @c invokeListViewItemCallback to @c true invokes GroupedListView item callbacks after this method returns. @n
115 * Set @c invokeListViewItemCallback to @c false to not invoke %GroupedListView item callbacks. The default value of
116 * @c invokeListViewItemCallback is @c true. @n
117 * Note that other %GroupedListView item callbacks are not called even though @c invokeListViewItemCallback is @c true, if
118 * %GroupedListView loses focus, for example, due to invoking a Popup or a ContextMenu in this method.
120 virtual void OnGroupedListViewItemLongPressed(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, bool& invokeListViewItemCallback);
123 * Called when GroupItem is selected.
127 * @param[in] listView The source of the event
128 * @param[in] groupIndex The index of the group item
130 virtual void OnGroupedListViewGroupItemSelected(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex);
133 * Called when the item is reordered.
137 * @param[in] listView The source of the event
138 * @param[in] groupIndexFrom The source group index of the item
139 * @param[in] itemIndexFrom The source item index of the item
140 * @param[in] groupIndexTo The target group index of the item
141 * @param[in] itemIndexTo The target item index of the item
143 virtual void OnGroupedListViewItemReordered(Tizen::Ui::Controls::GroupedListView& listView, int groupIndexFrom, int itemIndexFrom, int groupIndexTo, int itemIndexTo);
147 // Following methods are reserved and may change its name at any time without prior notice.
149 virtual void IGroupedListViewItemEventListener_Reserved1(void) {}
150 virtual void IGroupedListViewItemEventListener_Reserved2(void) {}
151 virtual void IGroupedListViewItemEventListener_Reserved3(void) {}
152 }; // IGroupedListViewItemEventListener
154 }}} // Tizen::Ui::Controls
156 #endif // _FUI_CTRL_IGROUPED_LIST_VIEW_ITEM_EVENT_LISTENER_H_