Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiCtrlGroupedTableView.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 FUiCtrlGroupedTableView.h
20  * @brief This is the header file for the %GroupedTableView class.
21  *
22  * This header file contains the declarations of the %GroupedTableView class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_GROUPED_TABLE_VIEW_H_
26 #define _FUI_CTRL_GROUPED_TABLE_VIEW_H_
27
28 #include <FGrpRectangle.h>
29 #include <FGrpColor.h>
30 #include <FUiContainer.h>
31 #include <FUiCtrlTableViewTypes.h>
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35 class IGroupedTableViewItemProvider;
36 class IGroupedTableViewItemEventListener;
37 class IFastScrollListener;
38 class IScrollEventListener;
39
40 /**
41  * @class GroupedTableView
42  * @brief   This class defines common behavior for a %GroupedTableView control.
43  *
44  * @since 2.0
45  *
46  * The %GroupedTableView class defines common behavior for a %GroupedTableView control.
47  * @code
48 //Sample code for GroupedTableViewSample.h
49 #include <FUi.h>
50
51 class GroupedTableViewSample
52         : public Tizen::Ui::Controls::Form
53         , public Tizen::Ui::Controls::IGroupedTableViewItemProvider
54         , public Tizen::Ui::Controls::IGroupedTableViewItemEventListener
55         , public Tizen::Ui::Controls::IFastScrollListener
56 {
57 public:
58         GroupedTableViewSample(void)
59         : __pGroupedTableView(null)
60         , __pContextItem(null){}
61
62         bool Initialize(void);
63         virtual result OnInitializing(void);
64         virtual result OnTerminating(void);
65
66         // IGroupedTableViewItemEventListener
67         virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
68         virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
69         virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated);
70
71         // IGroupedTableViewItemProvider
72         virtual int GetGroupCount(void);
73         virtual int GetItemCount(int groupIndex);
74         virtual Tizen::Ui::Controls::TableViewGroupItem* CreateGroupItem(int groupIndex, int itemWidth);
75         virtual bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
76         virtual void UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem);
77         virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int groupIndex, int itemIndex, int itemWidth);
78         virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
79         virtual void UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
80         virtual int GetDefaultItemHeight(void);
81         virtual int GetDefaultGroupItemHeight(void);
82
83         // IFastScrollListener
84         virtual void OnFastScrollIndexSelected(Tizen::Ui::Control& source, Tizen::Base::String& index);
85
86 private:
87         Tizen::Ui::Controls::GroupedTableView* __pGroupedTableView;
88         Tizen::Ui::Controls::TableViewContextItem* __pContextItem;
89 };
90  *  @endcode
91  *
92  *  @code
93
94 //Sample code for GroupedTableViewSample.cpp
95 #include <FApp.h>
96 #include <FGraphics.h>
97
98 #include "GroupedTableViewSample.h"
99
100 using namespace Tizen::App;
101 using namespace Tizen::Base;
102 using namespace Tizen::Graphics;
103 using namespace Tizen::Media;
104 using namespace Tizen::Ui::Controls;
105
106 bool
107 GroupedTableViewSample::Initialize(void)
108 {
109         Construct(FORM_STYLE_NORMAL);
110         return true;
111 }
112
113 result
114 GroupedTableViewSample::OnInitializing(void)
115 {
116         result r = E_SUCCESS;
117
118         // Creates an instance of TableView
119         __pGroupedTableView = new GroupedTableView();
120         __pGroupedTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL);
121         __pGroupedTableView->SetItemProvider(*this);
122         __pGroupedTableView->AddTableViewItemEventListener(*this);
123
124         __pGroupedTableView->AddFastScrollListener(*this);
125         __pGroupedTableView->SetFastScrollIndex(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ", true);
126
127         // Adds the TableView to the form
128         AddControl(*__pGroupedTableView);
129
130         // Creates an instance of TableViewContextItem
131         __pContextItem = new TableViewContextItem();
132         __pContextItem->Construct(Dimension(720, 100));
133
134         Button* pButton = new Button();
135         pButton->Construct(Rectangle(10, 10, 200, 80), L"Context1");
136
137         Button* pButton2 = new Button();
138         pButton2->Construct(Rectangle(250, 10, 200, 80), L"Context2");
139
140         __pContextItem->AddControl(*pButton);
141         __pContextItem->AddControl(*pButton2);
142
143         return r;
144 }
145
146 result
147 GroupedTableViewSample::OnTerminating(void)
148 {
149         result r = E_SUCCESS;
150
151         // Deallocates the item context
152         delete __pItemContext;
153         __pItemContext = null;
154
155         return r;
156 }
157
158 // IGroupedTableViewItemEventListener implementation
159 void
160 GroupedTableViewSample::OnGroupedTableViewGroupItemStateChanged(GroupedTableView& tableView, int groupIndex, TableViewGroupItem* pItem, TableViewItemStatus status)
161 {
162         if (tableView.IsGroupExpanded(groupIndex))
163         {
164                 tableView.CollapseGroup(groupIndex);
165         }
166         else
167         {
168                 tableView.ExpandGroup(groupIndex);
169         }
170 }
171
172 void
173 GroupedTableViewSample::OnGroupedTableViewItemStateChanged(GroupedTableView& tableView, int groupIndex, int itemIndex, TableViewItem* pItem, TableViewItemStatus status)
174 {
175         // ....
176 }
177
178 void
179 GroupedTableViewSample::OnGroupedTableViewContextItemActivationStateChanged(GroupedTableView& tableView, int groupIndex, int itemIndex, TableViewContextItem* pContextItem, bool activated)
180 {
181         // ....
182 }
183
184 // IFastScrollListener implementation
185 void
186 GroupedTableViewSample::OnFastScrollIndexSelected(Tizen::Ui::Control& source, Tizen::Base::String& index)
187 {
188         // ....
189 }
190
191 // IGroupedTableViewItemProvider implementation
192 int
193 GroupedTableViewSample::GetGroupCount(void)
194 {
195         return 26;
196 }
197
198 int
199 GroupedTableViewSample::GetItemCount(int groupIndex)
200 {
201         return 10;
202 }
203
204 int
205 GroupedTableViewSample::GetDefaultItemHeight(void)
206 {
207         return 100;
208 }
209
210 int
211 GroupedTableViewSample::GetDefaultGroupItemHeight(void)
212 {
213         return 80;
214 }
215
216 TableViewGroupItem*
217 GroupedTableViewSample::CreateGroupItem(int groupIndex, int itemWidth)
218 {
219         TableViewGroupItem* pItem = new TableViewGroupItem();
220         pItem->Construct(Dimension(itemWidth, GetDefaultGroupItemHeight()));
221
222         String text;
223         text.Format(30, L"Group title %d", itemIndex);
224
225         Label* pLabel = new Label();
226         pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultGroupItemHeight(), text);
227
228         pItem->AddControl(*pLable);
229
230         return pItem;
231 }
232
233 bool
234 GroupedTableViewSample::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
235 {
236         delete pItem;
237
238         return true;
239 }
240
241 void
242 GroupedTableViewSample::UpdateGroupItem(int groupIndex, TableViewGroupItem* pItem)
243 {
244         // ....
245 }
246
247 TableViewItem*
248 GroupedTableViewSample::CreateItem(int groupIndex, int itemIndex, int itemWidth)
249 {
250         TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
251         TableViewItem* pItem = new TableViewItem();
252
253         switch (itemIndex % 5)
254         {
255         case 0:
256                 style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
257                 break;
258         case 1:
259                 style = TABLE_VIEW_ANNEX_STYLE_MARK;
260                 break;
261         case 2:
262                 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
263                 break;
264         case 3:
265                 style = TABLE_VIEW_ANNEX_STYLE_DETAILED;
266                 break;
267         case 4:
268                 style = TABLE_VIEW_ANNEX_STYLE_RADIO;
269                 break;
270         default:
271                 break;
272         }
273
274         pItem->Construct(Dimension(itemWidth, GetDefaultItemHeight()), style);
275
276         String text;
277         text.Format(30, L"TableViewItem %d", itemIndex);
278
279         Label* pLabel = new Label();
280         pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultItemHeight(), text);
281
282         pItem->AddControl(*pLabel);
283         pItem->SetContextItem(__pContextItem);
284
285         return pItem;
286 }
287
288 bool
289 GroupedTableViewSample::DeleteItem(int groupIndex, int itemIndex, Controls::TableViewItem* pItem)
290 {
291         delete pItem;
292
293         return true;
294 }
295
296 void
297 GroupedTableViewSample::UpdateItem(int groupIndex, int itemIndex, Controls::TableViewItem* pItem)
298 {
299         // ....
300 }
301  * @endcode
302  *
303  */
304
305 class _OSP_EXPORT_ GroupedTableView
306         : public Tizen::Ui::Container
307 {
308 public:
309         /**
310          * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor.
311          *
312          * @since 2.0
313          */
314         GroupedTableView(void);
315
316         /**
317          * This destructor overrides Tizen::Base::Object::~Object().
318          *
319          * @since 2.0
320          */
321         virtual ~GroupedTableView(void);
322
323         /**
324          * Initializes this instance of %GroupedTableView with the specified parameters.
325          *
326          * @since 2.0
327          *
328          * @return  An error code
329          * @param[in] rect    An instance of the Graphics::Rectangle class
330          *                              This instance represents the x and y coordinates of the left top corner of the created %GroupedTableView along with the width and height.
331          * @param[in] itemDivider       Set to @c true to display an item divider, @n
332          *                              else @c false
333          * @param[in] scrollStyle       The style of %GroupedTableView scroll bar style
334          * @exception E_SUCCESS         The method is successful.
335          * @exception E_INVALID_ARG     A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value.
336          *
337          */
338         result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle);
339
340         /**
341          * Sets the item provider that creates and deletes items for the grouped style table view.
342          *
343          * @since 2.0
344          *
345          * @param[in] pProvider                                 The item provider to create and delete items
346          * @remarks If an item provider is not set for the table view, the table view does not work. The specified provider should be allocated in heap memory.
347          *          To reset the item provider, pass @c null to @c pProvider.
348          */
349         void SetItemProvider(IGroupedTableViewItemProvider* pProvider);
350
351         /**
352          * Expands the group's items.
353          *
354          * @since 2.0
355          *
356          * @return An error code
357          * @param[in] groupIndex The index of the group
358          * @exception E_SUCCESS             The method is successful.
359          * @exception E_OUT_OF_RANGE        A specified input parameter is invalid.
360          */
361         result ExpandGroup(int groupIndex);
362
363         /**
364          * Collapses the group's items.
365          *
366          * @since 2.0
367          *
368          * @return An error code
369          * @param[in] groupIndex The index of the group
370          * @exception E_SUCCESS         The method is successful.
371          * @exception E_OUT_OF_RANGE           A specified input parameter is invalid.
372          */
373         result CollapseGroup(int groupIndex);
374
375         /**
376          * Expands all groups of table view.
377          *
378          * @since 2.0
379          *
380          */
381         void ExpandAllGroup(void);
382
383         /**
384          * Collapses all groups of table view.
385          *
386          * @since 2.0
387          *
388          */
389         void CollapseAllGroup(void);
390
391         /**
392          * Returns whether the group is expanded or not.
393          *
394          * @since 2.0
395          *
396          * @return @c true if the group is expanded, else @c false
397          * @param[in] groupIndex The index of the group
398          * @exception E_SUCCESS  The method is successful.
399          * @exception E_OUT_OF_RANGE           A specified input parameter is invalid.
400          */
401         bool IsGroupExpanded(int groupIndex) const;
402
403         /**
404          * Sets the grouped look is enabled.
405          *
406          * @since 2.0
407          *
408          * @param[in] enable   The enabled/disabled status
409          */
410         void SetGroupedLookEnabled(bool enable);
411
412         /**
413          * Returns whether the grouped look is enabled or not.
414          *
415          * @since 2.0
416          *
417          * @return @c true if the grouped look is enabled, else @c false
418          */
419         bool IsGroupedLookEnabled(void) const;
420
421         /**
422          * Adds a listener instance that listens to state changes of table view items. @n
423          * The added listener can listen to events on the specified event dispatcher's context when they are fired.
424          *
425          * @since 2.0
426          *
427          * @return  An error code
428          * @param[in] listener      The event listener to add
429          * @exception E_SUCCESS                                          The method is successful.
430          * @exception E_OBJ_ALREADY_EXIST      The listener is already added.
431          * @remarks   The specified listener should be allocated in heap memory.
432          */
433         result AddGroupedTableViewItemEventListener(IGroupedTableViewItemEventListener& listener);
434
435         /**
436          * Removes a listener instance that listens to state changes of table view items. @n
437          * The removed listener cannot listen to events when they are fired.
438          *
439          * @since 2.0
440          *
441          * @return  An error code
442          * @param[in] listener   The event listener to remove
443          * @exception   E_SUCCESS                             The method is successful.
444          * @exception   E_OBJ_NOT_FOUND                  The listener is not found.
445          */
446         result RemoveGroupedTableViewItemEventListener(IGroupedTableViewItemEventListener& listener);
447
448         /**
449          * Adds a listener instance that listens to state changes of a fast scroll. @n
450          * The added listener can listen to events on the specified event dispatcher's context when they are fired.
451          *
452          * @since 2.0
453          *
454          * @return  An error code
455          * @param[in] listener   The event listener to add
456          * @exception   E_SUCCESS                             The method is successful.
457          * @exception   E_INVALID_OPERATION  The current state of the instance prohibits the execution of the specified operation.
458          * @exception   E_OBJ_ALREADY_EXIST   The listener is already added.
459          * @remarks   The specified listener should be allocated in heap memory.
460          */
461         result AddFastScrollListener(IFastScrollListener& listener);
462
463         /**
464          * Removes a listener instance that listens to state changes of a fast scroll. @n
465          * The removed listener cannot listen to events when they are fired.
466          *
467          * @since 2.0
468          *
469          * @return  An error code
470          * @param[in] listener   The event listener to remove
471          * @exception   E_SUCCESS                             The method is successful.
472          * @exception   E_INVALID_OPERATION  The current state of the instance prohibits the execution of the specified operation.
473          * @exception   E_OBJ_NOT_FOUND                  The listener is not found.
474          */
475         result RemoveFastScrollListener(IFastScrollListener& listener);
476
477         /**
478          * Adds a listener instance that listens to state changes of a scroll event. @n
479          * The added listener can listen to events on the specified event dispatcher's context when they are fired.
480          *
481          * @since 2.0
482          *
483          * @return  An error code
484          * @param[in] listener          The event listener to add
485          * @see     IScrollEventListener::OnScrollEndReached()
486          * @see     RemoveScrollEventListener()
487          * @exception   E_SUCCESS                             The method is successful.
488          * @exception   E_INVALID_OPERATION  The current state of the instance prohibits the execution of the specified operation.
489          * @exception   E_OBJ_ALREADY_EXIST   The listener is already added.
490          * @remarks   The specified listener should be allocated in heap memory.
491          */
492         result AddScrollEventListener(IScrollEventListener& listener);
493
494         /**
495          * Removes a listener instance that listens to state changes of a scroll event. @n
496          * The removed listener cannot listen to events when they are fired.
497          *
498          * @since 2.0
499          *
500          * @return  An error code
501          * @param[in] listener   The event listener to remove
502          * @see  IScrollEventListener::OnScrollEndReached()
503          * @see     AddScrollEventListener()
504          * @exception   E_SUCCESS                             The method is successful.
505          * @exception   E_INVALID_OPERATION  The current state of the instance prohibits the execution of the specified operation.
506          * @exception   E_OBJ_NOT_FOUND                  The listener is not found.
507          */
508         result RemoveScrollEventListener(IScrollEventListener& listener);
509
510         /**
511          * Enables or disables the collapse by pinch gesture.
512          *
513          * @since 2.0
514          *
515          * @param[in] enable   Set to @c true to enable the collapse by pinch gesture, else @c false
516          */
517         void SetCollapseByPinchGestureEnabled(bool enable);
518
519         /**
520          * Returns whether the collapse by pinch gesture is enabled or not.
521          *
522          * @since 2.0
523          *
524          * @return @c true if the collapse by pinch gesture is enabled, else @c false
525          */
526         bool IsCollapseByPinchGestureEnabled(void) const;
527
528         /**
529          * Sets the text index of the fast scroll.
530          *
531          * @since 2.0
532          *
533          * @return  An error code
534          * @param[in] text                    The text of the index
535          * @param[in] useSearchIcon           Set to @c true to show the magnifying icon, @n
536          *                                    else @c false
537          * @exception E_SUCCESS               The method is successful.
538          * @exception E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation.
539          */
540         result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon);
541
542         /**
543          * Gets the group and item indexes of the top item.
544          *
545          * @since 2.0
546          *
547          * @return        An error code
548          * @param[out]  groupIndex                 The group index
549          * @param[out]  itemIndex                  The item index
550          * @exception   E_SUCCESS                  The method is successful.
551          * @exception   E_OBJ_NOT_FOUND            Top drawn item is not found.
552          */
553         result GetTopDrawnItemIndex(int& groupIndex, int& itemIndex) const;
554
555         /**
556          * Gets the group and item indexes of the bottom item.
557          *
558          * @since 2.0
559          *
560          * @return        An error code
561          * @param[out]  groupIndex                 The group index
562          * @param[out]  itemIndex                  The item index
563          * @exception   E_SUCCESS                  The method is successful.
564          * @exception   E_OBJ_NOT_FOUND            Bottom drawn item is not found.
565          */
566         result GetBottomDrawnItemIndex(int& groupIndex, int& itemIndex) const;
567
568         /**
569          * Scrolls to the item at the specified index.
570          * The specified item is drawn at the position specified by the item alignment.
571          *
572          * @since 2.0
573          *
574          * @return  An error code
575          * @param[in] groupIndex            The group index
576          * @param[in] itemIndex             The item index
577          * @param[in] itemAlignment         The item alignment
578          * @exception E_SUCCESS             The method is successful.
579          * @exception E_OUT_OF_RANGE        A specified input parameter is invalid.
580          * @remarks If the specified item. itemIndex is -1, then the method is applied to the group item with the given index.
581          */
582         result ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment = TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
583
584         /**
585          * Checks or unchecks the item at the specified index.
586          *
587          * @since 2.0
588          *
589          * @return  An error code
590          * @param[in] groupIndex            The group index
591          * @param[in] itemIndex             The item index
592          * @param[in] check    Set to @c true to select the item, @n
593          *         else @c false
594          * @exception E_SUCCESS   The method is successful.
595          * @exception E_OUT_OF_RANGE           A specified input parameter is invalid.
596          * @exception E_INVALID_OPERATION     The item is disabled.
597          * @remarks This method works only when the annex style of the item allows selection.
598          */
599         result SetItemChecked(int groupIndex, int itemIndex, bool check);
600
601         /**
602          * Returns whether the item at the specified index is selected or not.
603          *
604          * @since 2.0
605          *
606          * @return @c true if the item is selected, @n
607          *   else @c false
608          * @param[in] groupIndex            The group index
609          * @param[in] itemIndex             The item index
610          * @exception E_SUCCESS                               The method is successful.
611          * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
612          * @remarks This method returns @c false, if the annex style of the item does not allow selection.
613         */
614         bool IsItemChecked(int groupIndex, int itemIndex) const;
615
616         /**
617          * Enables or disables the item at the specified index.
618          *
619          * @since 2.0
620          *
621          * @return An error code
622          * @param[in] groupIndex            The group index
623          * @param[in] itemIndex             The item index
624          * @param[in] enable    Set to @c true to enable the specified item, @n
625          *         else @c false
626          * @exception E_SUCCESS   The method is successful.
627          * @exception E_OUT_OF_RANGE  A specified input parameter is invalid.
628          */
629         result SetItemEnabled(int groupIndex, int itemIndex, bool enable);
630
631         /**
632          * Returns whether the item at the specified index is enabled or disabled.
633          *
634          * @since 2.0
635          *
636          * @return @c true if the item is enabled, @n
637          *   else @c false
638          * @param[in] groupIndex            The group index
639          * @param[in] itemIndex             The item index
640          * @exception E_SUCCESS                               The method is successful.
641          * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
642          */
643         bool IsItemEnabled(int groupIndex, int itemIndex) const;
644
645         /**
646          * Counts the total number of groups.
647          *
648          * @since 2.0
649          *
650          * @return The total number of groups
651          */
652         int GetGroupCount(void) const;
653
654         /**
655          * Counts all the items of the specified group.
656          *
657          * @since 2.0
658          *
659          * @return The total number of items in the specified group
660          * @param[in] groupIndex   The group index
661          * @exception E_SUCCESS                               The method is successful.
662          * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
663          */
664         int GetItemCountAt(int groupIndex) const;
665
666         /**
667          * Updates the specified item. @n
668          * For instance, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD is used when a new item needs to be added and TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE is used when an item is deleted from the
669          * table view. Moreover, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has changed and it needs to be updated.
670          * Note that calling this method with TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY invokes item provider's UpdateItem() for the given index in sequence.
671          *
672          * @since 2.0
673          *
674          * @return An error code
675          * @param[in] groupIndex                    The group index
676          * @param[in] itemIndex           The item index
677          * @param[in] type                             The item to be added, removed, or modified
678          * @exception E_SUCCESS   The method is successful.
679          * @exception E_OUT_OF_RANGE  A specified input parameter is invalid.
680          * @remarks If the specified item. itemIndex is -1, then the method is applied to the group item with the given index.
681          *   Note that if TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE option is used to a group item, all the items in the group (including the group item itself) are
682          *   removed from the table view.
683          */
684         result RefreshItem(int groupIndex, int itemIndex, TableViewRefreshType type);
685
686         /**
687          * Updates all the items of a table view.
688          *
689          * @since 2.0
690          *
691          * @remarks This method clears all the items in the table view and invokes the methods of the item provider again to update the table view.
692          */
693         void UpdateTableView(void);
694
695         /**
696          * Gets the index of the item at the specified position.
697          *
698          * @since 2.0
699          *
700          * @param[in] position    The position of the item
701          * @param[out] groupIndex The group index of the item on specified position
702          * @param[out] itemIndex  The item index of the item on specified position
703          * @remarks This method sets both of groupIndex and itemIndex to -1 if no item is found at the given position.
704          */
705         void GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const;
706
707         /**
708          * Sets the color of a division line between items.
709          *
710          * @since 2.0
711          *
712          * @return An error code
713          * @param[in] color    The division line color
714          */
715         void SetItemDividerColor(const Tizen::Graphics::Color& color);
716
717         /**
718          * Gets the color of a division line between items.
719          *
720          * @since 2.0
721          *
722          * @return  The color of a division line
723          */
724         Tizen::Graphics::Color GetItemDividerColor(void) const;
725
726         /**
727          * Sets the background color of this control.
728          *
729          * @since 2.0
730          *
731          * @param[in] color       The background color
732          * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified,
733          *   only the bitmap image is displayed.
734          */
735         void SetBackgroundColor(const Tizen::Graphics::Color& color);
736
737         /**
738          * Sets the scroll input handling mode.
739          *
740          * @since 2.0
741          *
742          * @param[in] mode  The scroll input handling mode
743          * @see         GetScrollInputMode()
744          */
745         void SetScrollInputMode(ScrollInputMode mode);
746
747         /**
748          * Gets the scroll input handling mode.
749          *
750          * @since 2.0
751          *
752          * @return     The scroll input handling mode
753          * @see         SetScrollInputMode()
754          */
755         ScrollInputMode GetScrollInputMode(void) const;
756
757         /**
758          * Gets the background color of this control.
759          *
760          * @since 2.0
761          *
762          * @return The background color
763          */
764         Tizen::Graphics::Color GetBackgroundColor(void) const;
765
766         /*
767          * Scrolls the list contents with the amount of pixels.
768          *
769          * @since 2.0
770          *
771          * @return  An error code
772          * @param[in]   pixel                                    The amount of pixels to scroll
773          * @exception   E_SUCCESS                        The method is successful.
774          * @exception   E_OUT_OF_RANGE   The specified @c pixel is out of range.
775          * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE.
776          *                         Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE.
777          */
778         result ScrollByPixel(int pixel);
779
780         /*
781          * Gets the current scroll position
782          *
783          * @since 2.0
784          */
785         int GetCurrentScrollPosition(void) const;
786
787         /*
788          * Enables or disables the scroll of GroupedTableView items.
789          *
790          * @since 2.0
791          */
792         void SetScrollEnabled(bool enable);
793
794         /*
795          * Checks whether the scroll is enabled or disabled.
796          *
797          * @since 2.0
798          */
799         bool IsScrollEnabled(void) const;
800
801 private:
802         friend class _TableViewImpl;
803
804         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
805         GroupedTableView(const GroupedTableView& rhs);
806
807         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
808         GroupedTableView& operator =(const GroupedTableView& rhs);
809 }; // GroupedTableView
810
811 }}} // Tizen::Ui::Controls
812
813 #endif  // _FUI_CTRL_GROUPED_TABLE_VIEW_H_