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 FUiCtrl_ITableViewItemEventListener.h
20 * @brief This is the header file for the _ITableViewItemEventListener class.
22 * This header file contains the declarations of the _ITableViewItemEventListener
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.
30 #ifndef _FUI_CTRL_INTERNAL_ITABLEVIEWITEM_EVENT_LISTENER_H_
31 #define _FUI_CTRL_INTERNAL_ITABLEVIEWITEM_EVENT_LISTENER_H_
34 #include <FBaseRtIEventListener.h>
35 #include <FUiCtrlTableViewTypes.h>
37 namespace Tizen { namespace Ui { namespace Controls
40 class TableViewContextItem;
41 class TableViewGroupItem;
46 * @interface _ITableViewItemEventListener
47 * @brief This interface implements the listener for
48 * internal item event.
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.
59 class _ITableViewItemEventListener
60 : virtual public Tizen::Base::Runtime::IEventListener
65 * This is the destructor for this class.
69 virtual ~_ITableViewItemEventListener(void) {}
72 * Called when the state of a TableViewItem in the TableView is changed.
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.
83 virtual void OnTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0;
86 * Called when the TableViewContextItem is opened or closed.
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
96 virtual void OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::_TableView& tableView, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pContextItem, bool activated) = 0;
99 * Called when the item is reordered.
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
107 virtual void OnTableViewItemReordered(Tizen::Ui::Controls::_TableView& tableView, int itemIndexFrom, int itemIndexTo) = 0;
111 * Called when the state of a TableViewGroupItem is changed.
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.
121 virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0;
124 * Called when the state of a TableViewItem in the GroupedTableView is changed.
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.
135 virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0;
138 * Called when the TableViewContextItem is opened or closed.
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
149 virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pContextItem, bool activated) = 0;
152 * Called when the item is reordered.
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
162 virtual void OnGroupedTableViewItemReordered(Tizen::Ui::Controls::_TableView& tableView, int groupIndexFrom, int itemIndexFrom, int groupIndexTo, int itemIndexTo) = 0;
166 * Called when the state of a TableViewItem in the SectionTableView is changed.
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.
177 virtual void OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0;
180 * Called when the TableViewContextItem is opened or closed.
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
191 virtual void OnSectionTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::_TableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pContextItem, bool activated) = 0;
195 * Called when the TableViewItem is swept.
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
204 virtual void OnTableViewItemSwept(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewSweepDirection direction) = 0;
207 // reserved virtual methods for later extension
209 // Following methods are reserved and may change its name at any time without prior notice.
211 virtual void _ITableViewItemEventListener_Reserved1(void) {}
212 virtual void _ITableViewItemEventListener_Reserved2(void) {}
213 virtual void _ITableViewItemEventListener_Reserved3(void) {}
214 }; // _ITableViewItemEventListener
216 }}} // Tizen::Ui::Controls
218 #endif // _FUI_CTRL_INTERNAL_ITABLEVIEWITEM_EVENT_LISTENER_H_