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 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. @n
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
76 * - This method is called when an element of the ListViewItem in the ListView is checked, unchecked, or selected.
77 * - When the event comes from the annex or the whole item, @c elementId is always @c -1.
79 virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) = 0;
82 * Called when the ListItem is swept.
86 * @param[in] listView The source of the event
87 * @param[in] index The index of the list
88 * @param[in] direction The sweep direction
90 virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) = 0;
93 * Called when the state of an element in the %ListContextItem is changed.
97 * @param[in] listView The source of the event
98 * @param[in] index The index of the list
99 * @param[in] elementId The element ID
100 * @param[in] status The status of the element
102 virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, 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] index The index of the list
111 * @param[in] elementId The element ID
112 * @param[in,out] invokeListViewItemCallback Indicates whether to invoke ListView item callback after this method returns
114 * - This method is invoked when an item or an element is long pressed.
115 * - When the event comes from the annex or the whole item, @c elementId is always @c -1.
116 * - Setting @c invokeListViewItemCallback to @c true invokes %ListView item callbacks after this method returns.
117 * - Set @c invokeListViewItemCallback to @c false to not invoke %ListView item callbacks. The default value of
118 * @c invokeListViewItemCallback is @c true.
119 * - Note that other %ListView item callbacks are not called even though @c invokeListViewItemCallback is @c true, in case that ListView
120 * loses the focus, for example, due to invoking a Popup or a ContextMenu in this method.
122 virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
125 * Called when the item is reordered.
129 * @param[in] listView The source of the event
130 * @param[in] indexFrom The start index of the item
131 * @param[in] indexTo The final index of the item
133 virtual void OnListViewItemReordered(Tizen::Ui::Controls::ListView& listView, int indexFrom, int indexTo);
137 // The following methods are reserved and may change its name at any time without prior notice.
139 virtual void IListViewItemEventListener_Reserved1(void) {}
140 virtual void IListViewItemEventListener_Reserved2(void) {}
141 virtual void IListViewItemEventListener_Reserved3(void) {}
142 }; // IListViewItemEventListener
144 }}} // Tizen::Ui::Controls
146 #endif // _FUI_CTRL_ILIST_VIEW_ITEM_EVENT_LISTENER_H_