Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_ITableViewItemEventListener.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                FUiCtrl_ITableViewItemEventListener.h
20  * @brief               This is the header file for the _ITableViewItemEventListener class.
21  *
22  * This header file contains the declarations of the _ITableViewItemEventListener
23  * class. @n
24  * If an item event is generated, a method of this class is called. @n
25  * So, if an application does some jobs related to the item event,
26  * use the methods of this class.
27  *
28  */
29
30 #ifndef _FUI_CTRL_INTERNAL_ITABLEVIEWITEM_EVENT_LISTENER_H_
31 #define _FUI_CTRL_INTERNAL_ITABLEVIEWITEM_EVENT_LISTENER_H_
32
33 // Includes
34 #include <FBaseRtIEventListener.h>
35 #include <FUiCtrlTableViewTypes.h>
36
37 namespace Tizen { namespace Ui { namespace Controls
38 {
39 class TableViewItem;
40 class TableViewContextItem;
41 class TableViewGroupItem;
42 class _TableView;
43 class _TableViewItem;
44
45 /**
46  * @interface   _ITableViewItemEventListener
47  * @brief               This interface implements the listener for
48  *              internal item event.
49  * @since 2.0
50  *
51  * _ITableViewItemEventListener is an interface which implements a listener for receiving
52  * item change events. The class that is interested in
53  * processing an item event implements this interface, and the
54  * instance created with that class is registered with a UI
55  * control, using the control's AddTableViewItemEventListener()
56  * method. When the item event occurs, the OnItemStateChanged()
57  * method of that object is invoked.
58  */
59 class _ITableViewItemEventListener
60         : virtual public Tizen::Base::Runtime::IEventListener
61 {
62 // Operation
63 public:
64         /**
65          * This is the destructor for this class.
66          *
67          * @since 2.0
68          */
69         virtual ~_ITableViewItemEventListener(void) {}
70
71         /**
72         * Called when the state of a TableViewItem in the TableView is changed.
73         *
74         * @since 2.0
75         *
76         * @param[in] tableView                          The source of the event
77         * @param[in] itemIndex                          The item index
78         * @param[in] pItem                                      The target item
79         * @param[in] status                                     The status of the item
80         * @remarks This method is called when a TableViewItem in the TableView is checked, unchecked, or selected.
81         *          The application can change @c pItem in this method, but should not keep @c pItem for later use.
82         */
83         virtual void OnTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0;
84
85         /**
86         * Called when the TableViewContextItem is opened or closed.
87         *
88         * @since 2.0
89         *
90         * @param[in] tableView                          The source of the event
91         * @param[in] itemIndex                          The item index
92         * @param[in] pContextItem                       The context item which is opened or closed
93         * @param[in] activated                          @c true if a context item is opened,@n
94         *                                   @c false, otherwise
95         */
96         virtual void OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::_TableView& tableView, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pContextItem, bool activated) = 0;
97
98         /**
99         * Called when the item is reordered.
100         *
101         * @since 2.0
102         *
103         * @param[in] tableView                          The source of the event
104         * @param[in] itemIndexFrom                      The start  item index of the item
105         * @param[in] itemIndexTo                        The final item index of the item
106         */
107         virtual void OnTableViewItemReordered(Tizen::Ui::Controls::_TableView& tableView, int itemIndexFrom, int itemIndexTo) = 0;
108
109
110         /**
111         * Called when the state of a TableViewGroupItem is changed.
112         *
113         * @since 2.0
114         *
115         * @param[in] tableView             The source of the event
116         * @param[in] groupIndex            The group index
117         * @param[in] pItem                 The target item
118         * @param[in] status                The status of the item
119         * @remarks  This method is called when the TableViewGroupItem in the GroupedTableView is checked, unchecked, or selected.
120         */
121         virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0;
122
123         /**
124         * Called when the state of a TableViewItem in the GroupedTableView is changed.
125         *
126         * @since 2.0
127         *
128         * @param[in] tableView             The source of the event
129         * @param[in] groupIndex            The group index
130         * @param[in] itemIndex             The item index
131         * @param[in] pItem                 The target item
132         * @param[in] status                The status of the item
133         * @remarks  This method is called when the TableViewItem in the GroupedTableView is checked, unchecked, or selected.
134         */
135         virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0;
136
137         /**
138         * Called when the TableViewContextItem is opened or closed.
139         *
140         * @since 2.0
141         *
142         * @param[in] tableView                          The source of the event
143         * @param[in] groupIndex                         The group index
144         * @param[in] itemIndex                          The item index
145         * @param[in] pContextItem                       The context item which is opened or closed
146         * @param[in] activated                          @c true if a context item is opened,@n
147         *                                   @c false, otherwise
148         */
149         virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pContextItem, bool activated) = 0;
150
151         /**
152         * Called when the item is reordered.
153         *
154         * @since 2.0
155         *
156         * @param[in] tableView   The source of the event
157         * @param[in] groupIndexFrom The source group index of the item
158         * @param[in] itemIndexFrom The source item index of the item
159         * @param[in] groupIndexTo The target group index of the item
160         * @param[in] itemIndexTo The target item index of the item
161         */
162         virtual void OnGroupedTableViewItemReordered(Tizen::Ui::Controls::_TableView& tableView, int groupIndexFrom, int itemIndexFrom, int groupIndexTo, int itemIndexTo) = 0;
163
164
165         /**
166         * Called when the state of a TableViewItem in the SectionTableView is changed.
167         *
168         * @since 2.0
169         *
170         * @param[in] tableView                          The source of the event
171         * @param[in] sectionIndex                       The section index
172         * @param[in] itemIndex                          The item index
173         * @param[in] pItem                                      The target item
174         * @param[in] status                                     The status of the item
175         * @remarks  This method is called when the TableViewItem in the SectionTableView is checked, unchecked, or selected.
176         */
177         virtual void OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0;
178
179         /**
180         * Called when the TableViewContextItem is opened or closed.
181         *
182         * @since 2.0
183         *
184         * @param[in] tableView                          The source of the event
185         * @param[in] sectionIndex                       The section index
186         * @param[in] itemIndex                          The item index
187         * @param[in] pContextItem                       The context item which is opened or closed
188         * @param[in] activated                          @c true if a context item is opened,@n
189         *                                   @c false, otherwise
190         */
191         virtual void OnSectionTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::_TableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pContextItem, bool activated) = 0;
192
193
194         /*
195         * Called when the TableViewItem is swept.
196         *
197         * @since 2.0
198         *
199         * @param[in] tableView                          The source of the event
200         * @param[in] groupIndex                 The item index
201         * @param[in] itemIndex                          The item index
202         * @param[in] direction                          The sweep direction
203         */
204         virtual void OnTableViewItemSwept(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewSweepDirection direction) = 0;
205
206 protected:
207         // reserved virtual methods for later extension
208         //
209         // Following methods are reserved and may change its name at any time without prior notice.
210         //
211         virtual void _ITableViewItemEventListener_Reserved1(void) {}
212         virtual void _ITableViewItemEventListener_Reserved2(void) {}
213         virtual void _ITableViewItemEventListener_Reserved3(void) {}
214 }; // _ITableViewItemEventListener
215
216 }}} // Tizen::Ui::Controls
217
218 #endif  // _FUI_CTRL_INTERNAL_ITABLEVIEWITEM_EVENT_LISTENER_H_