Fix to adjust the position of the partial Frame
[platform/framework/native/uifw.git] / inc / FUiCtrlIListViewItemEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
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        FUiCtrlIListViewItemEventListener.h
20  * @brief       This is the header file for the %IListViewItemEventListener interface.
21  *
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.
25  *
26  */
27 #ifndef _FUI_CTRL_ILIST_VIEW_ITEM_EVENT_LISTENER_H_
28 #define _FUI_CTRL_ILIST_VIEW_ITEM_EVENT_LISTENER_H_
29
30 #include <FBaseRtIEventListener.h>
31 #include <FUiCtrlListViewTypes.h>
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35
36 class ListView;
37
38 /**
39  * @interface   IListViewItemEventListener
40  * @brief               This interface implements the listener for item event.
41  *
42  * @since               2.0
43  *
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.
48  *
49  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
50  */
51 class _OSP_EXPORT_ IListViewItemEventListener
52         : virtual public Tizen::Base::Runtime::IEventListener
53 {
54 // Operation
55 public:
56         /**
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.
60          *
61          * @since       2.0
62          */
63         virtual ~IListViewItemEventListener(void) {}
64
65         /**
66          * Called when the state of an element in the ListViewItem in the ListView or GroupedListView is changed.
67          *
68          * @since       2.0
69          *
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
74          *
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.
77          */
78         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) = 0;
79
80         /**
81          * Called when the ListItem is swept.
82          *
83          * @since       2.0
84          *
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
88          */
89         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) = 0;
90
91         /**
92          * Called when the state of an element in the %ListContextItem is changed.
93          *
94          * @since       2.0
95          *
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
100          */
101         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status) = 0;
102
103         /**
104          * Called when the item or the element is long pressed.
105          *
106          * @since       2.0
107          *
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.
119          */
120         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
121
122         /**
123          * Called when the item is reordered.
124          *
125          * @since 2.0
126          *
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
130          */
131         virtual void OnListViewItemReordered(Tizen::Ui::Controls::ListView& listView, int indexFrom, int indexTo);
132
133 protected:
134         //
135         // Following methods are reserved and may change its name at any time without prior notice.
136         //
137         virtual void IListViewItemEventListener_Reserved1(void) {}
138         virtual void IListViewItemEventListener_Reserved2(void) {}
139         virtual void IListViewItemEventListener_Reserved3(void) {}
140 }; // IListViewItemEventListener
141
142 }}} // Tizen::Ui::Controls
143
144 #endif // _FUI_CTRL_ILIST_VIEW_ITEM_EVENT_LISTENER_H_