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.
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. @n
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
74 * - This method is called when an element of the %CustomItem control in the %GroupedListView control is checked, unchecked,
76 * - 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.
78 virtual void OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus status) = 0;
81 * Called when ListItem is swept.
84 * @param[in] listView The source of the event
85 * @param[in] groupIndex The index of the group item
86 * @param[in] itemIndex The index of the item in the group
87 * @param[in] direction The sweep direction
89 virtual void OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction) = 0;
92 * Called when the state of an element in the ListContextItem control is changed.
96 * @param[in] listView The source of the event
97 * @param[in] groupIndex The index of the group item
98 * @param[in] itemIndex The index of the item in the group
99 * @param[in] elementId The element ID
100 * @param[in] status The status of the element
102 virtual void OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status) = 0;
105 * Called when the item or the element is long pressed.
109 * @param[in] listView The source of the event
110 * @param[in] groupIndex The index of the group
111 * @param[in] itemIndex The index of the item in the group
112 * @param[in] elementId The element ID
113 * @param[in,out] invokeListViewItemCallback Indicates whether to invoke %GroupedListView item callback after this method returns
115 * - This method is invoked when an item or an element is long pressed. @n
116 * When the event comes from the annex or the whole item, @c elementId is always -1.
117 * - Setting @c invokeListViewItemCallback to @c true invokes GroupedListView item callbacks after this method returns.
118 * - Set @c invokeListViewItemCallback to @c false to not invoke %GroupedListView item callbacks. The default value of
119 * @c invokeListViewItemCallback is @c true.
120 * - Note that other %GroupedListView item callbacks are not called even though @c invokeListViewItemCallback is @c true, if
121 * %GroupedListView loses focus, for example, due to invoking a Popup or a ContextMenu in this method.
123 virtual void OnGroupedListViewItemLongPressed(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, bool& invokeListViewItemCallback);
126 * Called when GroupItem is selected.
130 * @param[in] listView The source of the event
131 * @param[in] groupIndex The index of the group item
133 virtual void OnGroupedListViewGroupItemSelected(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex);
136 * Called when the item is reordered.
140 * @param[in] listView The source of the event
141 * @param[in] groupIndexFrom The source group index of the item
142 * @param[in] itemIndexFrom The source item index of the item
143 * @param[in] groupIndexTo The target group index of the item
144 * @param[in] itemIndexTo The target item index of the item
146 virtual void OnGroupedListViewItemReordered(Tizen::Ui::Controls::GroupedListView& listView, int groupIndexFrom, int itemIndexFrom, int groupIndexTo, int itemIndexTo);
150 // The following methods are reserved and may change its name at any time without prior notice.
152 virtual void IGroupedListViewItemEventListener_Reserved1(void) {}
153 virtual void IGroupedListViewItemEventListener_Reserved2(void) {}
154 virtual void IGroupedListViewItemEventListener_Reserved3(void) {}
155 }; // IGroupedListViewItemEventListener
157 }}} // Tizen::Ui::Controls
159 #endif // _FUI_CTRL_IGROUPED_LIST_VIEW_ITEM_EVENT_LISTENER_H_