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 FUiCtrlIListViewItemEventListener.h
20 * @brief This is the header file for the %IListViewItemEventListener interface.
22 * This header file contains the declarations of the %IListViewItemEventListener interface. @n
23 * If an item event is generated, a method of this interface is called. @n
24 * So, if an application does some jobs related to the item event, use the methods of this interface.
27 #ifndef _FUI_CTRL_ILIST_VIEW_ITEM_EVENT_LISTENER_H_
28 #define _FUI_CTRL_ILIST_VIEW_ITEM_EVENT_LISTENER_H_
30 #include <FBaseRtIEventListener.h>
31 #include <FUiCtrlListViewTypes.h>
33 namespace Tizen { namespace Ui { namespace Controls
39 * @interface IListViewItemEventListener
40 * @brief This interface implements the listener for item event.
44 * The %IListViewItemEventListener interface is the listener interface for receiving ListView item events.
45 * The class that processes a list item event implements this interface, and the instance created with that class is registered
46 * with a UI control, using the control's AddListViewItemEventListener() method. When the list item event occurs, a method of that
47 * instance is invoked.
49 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
51 class _OSP_EXPORT_ IListViewItemEventListener
52 : virtual public Tizen::Base::Runtime::IEventListener
57 * This polymorphic destructor should be overridden if required.
58 * This way, the destructors of the derived classes are called
59 * when the destructor of this interface is called.
63 virtual ~IListViewItemEventListener(void) {}
66 * Called when the state of an element in the ListViewItem in the ListView or GroupedListView is changed.
70 * @param[in] listView The source of the event
71 * @param[in] index The index of the list
72 * @param[in] elementId The element ID
73 * @param[in] status The status of the element
75 * @remarks This method is called when an element of the ListViewItem in the ListView is checked, unchecked, or selected. @n
76 * When the event comes from the annex or the whole item, @c elementId is always @c -1.
78 virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) = 0;
81 * Called when the ListItem is swept.
85 * @param[in] listView The source of the event
86 * @param[in] index The index of the list
87 * @param[in] direction The sweep direction
89 virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) = 0;
92 * Called when the state of an element in the %ListContextItem is changed.
96 * @param[in] listView The source of the event
97 * @param[in] index The index of the list
98 * @param[in] elementId The element ID
99 * @param[in] status The status of the element
101 virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status) = 0;
104 * Called when the item or the element is long pressed.
108 * @param[in] listView The source of the event
109 * @param[in] index The index of the list
110 * @param[in] elementId The element ID
111 * @param[in,out] invokeListViewItemCallback Indicates whether to invoke ListView 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 @c -1.
114 * Setting @c invokeListViewItemCallback to @c true invokes %ListView item callbacks after this method returns.
115 * Set @c invokeListViewItemCallback to @c false to not invoke %ListView item callbacks. The default value of
116 * @c invokeListViewItemCallback is @c true.
117 * Note that other %ListView item callbacks are not called even though @c invokeListViewItemCallback is @c true, in case that ListView
118 * loses the focus, for example, due to invoking a Popup or a ContextMenu in this method.
120 virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
123 * Called when the item is reordered.
127 * @param[in] listView The source of the event
128 * @param[in] indexFrom The start index of the item
129 * @param[in] indexTo The final index of the item
131 virtual void OnListViewItemReordered(Tizen::Ui::Controls::ListView& listView, int indexFrom, int indexTo);
135 // Following methods are reserved and may change its name at any time without prior notice.
137 virtual void IListViewItemEventListener_Reserved1(void) {}
138 virtual void IListViewItemEventListener_Reserved2(void) {}
139 virtual void IListViewItemEventListener_Reserved3(void) {}
140 }; // IListViewItemEventListener
142 }}} // Tizen::Ui::Controls
144 #endif // _FUI_CTRL_ILIST_VIEW_ITEM_EVENT_LISTENER_H_