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 FUiCtrlSectionTableView.h
20 * @brief This is the header file for the %SectionTableView class.
22 * This header file contains the declarations of the %SectionTableView class and its helper classes.
25 #ifndef _FUI_CTRL_SECTION_TABLE_VIEW_H_
26 #define _FUI_CTRL_SECTION_TABLE_VIEW_H_
28 #include <FGrpRectangle.h>
29 #include <FGrpColor.h>
30 #include <FUiContainer.h>
31 #include <FUiCtrlControlsTypes.h>
32 #include <FUiCtrlTableViewTypes.h>
33 #include <FUiCtrlScrollPanelTypes.h>
35 namespace Tizen { namespace Ui { namespace Controls
37 class ISectionTableViewItemProvider;
38 class ISectionTableViewItemProviderF;
39 class ISectionTableViewItemEventListener;
40 class IFastScrollListener;
41 class IScrollEventListener;
42 class IScrollEventListenerF;
45 * @class SectionTableView
46 * @brief This class defines common behavior for a %SectionTableView control.
50 * The %SectionTableView class defines common behavior for a %SectionTableView control.
52 //Sample code for SectionTableViewSample.h
55 class SectionTableViewSample
56 : public Tizen::Ui::Controls::Form
57 , public Tizen::Ui::Controls::ISectionTableViewItemProvider
58 , public Tizen::Ui::Controls::ISectionTableViewItemEventListener
61 SectionTableViewSample(void)
62 : __pSectionTableView(null)
63 , __pContextItem(null){}
65 bool Initialize(void);
66 virtual result OnInitializing(void);
67 virtual result OnTerminating(void);
69 // ISectionTableViewItemEventListener
70 virtual void OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
71 virtual void OnSectionTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::SectionTableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated);
73 // ISectionTableViewItemProvider
74 virtual int GetSectionCount(void);
75 virtual int GetItemCount(int sectionIndex);
76 virtual bool HasSectionHeader(int sectionIndex);
77 virtual bool HasSectionFooter(int sectionIndex);
78 virtual Tizen::Base::String GetSectionHeader(int sectionIndex);
79 virtual Tizen::Base::String GetSectionFooter(int sectionIndex);
80 virtual int GetDefaultItemHeight(void);
81 virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int sectionIndex, int itemIndex, int itemWidth);
82 virtual bool DeleteItem(int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
83 virtual void UpdateItem(int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
86 Tizen::Ui::Controls::SectionTableView* __pSectionTableView;
92 //Sample code for SectionTableViewSample.cpp
94 #include <FGraphics.h>
96 #include "SectionTableViewSample.h"
98 using namespace Tizen::App;
99 using namespace Tizen::Base;
100 using namespace Tizen::Graphics;
101 using namespace Tizen::Media;
102 using namespace Tizen::Ui::Controls;
105 SectionTableViewSample::Initialize(void)
107 Construct(FORM_STYLE_NORMAL);
112 SectionTableViewSample::OnInitializing(void)
114 result r = E_SUCCESS;
116 // Creates an instance of TableView
117 __pSectionTableView = new TableView();
118 __pSectionTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
119 __pSectionTableView->SetItemProvider(*this);
120 __pSectionTableView->AddTableViewItemEventListener(*this);
122 // Adds the TableView to the form
123 AddControl(*__pSectionTableView);
128 SectionTableViewSample::OnTerminating(void)
133 // ISectionTableViewItemEventListener implementation
135 SectionTableViewSample::OnSectionTableViewItemStateChanged(SectionTableView& tableView, int sectionIndex, int itemIndex, TableViewItem* pItem, TableViewItemStatus status)
141 SectionTableViewSample::OnSectionTableViewContextItemActivationStateChanged(SectionTableView& tableView, int sectionIndex, int itemIndex, TableViewContextItem* pContextItem, bool activated)
146 // ISectionTableViewItemProvider implementation
148 SectionTableViewSample::GetSectionCount(void)
154 SectionTableViewSample::GetItemCount(int sectionIndex)
160 SectionTableViewSample::HasSectionHeader(int sectionIndex)
166 SectionTableViewSample::HasSectionFooter(int sectionIndex)
172 SectionTableViewSample::GetSectionHeader(int sectionIndex)
175 text.Format(30, L"Section header %d", sectionIndex);
181 SectionTableViewSample::GetSectionFooter(int sectionIndex)
184 text.Format(30, L"Section footer %d", sectionIndex);
190 SectionTableViewSample::GetDefaultItemHeight(void)
196 SectionTableViewSample::CreateItem(int sectionIndex, int itemIndex, int itemWidth)
198 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
199 TableViewItem* pItem = new TableViewItem();
201 switch (itemIndex % 6)
204 style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
207 style = TABLE_VIEW_ANNEX_STYLE_MARK;
210 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
213 style = TABLE_VIEW_ANNEX_STYLE_DETAILED;
216 style = TABLE_VIEW_ANNEX_STYLE_RADIO;
219 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER;
225 pItem->Construct(Dimension(itemWidth, GetDefaultItemHeight()), style);
228 text.Format(30, L"TableViewItem %d", itemIndex);
230 Label* pLabel = new Label();
231 pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultItemHeight(), text);
233 pItem->AddControl(*pLabel);
240 SectionTableViewSample::DeleteItem(int sectionIndex, int itemIndex, TableViewItem* pItem)
248 SectionTableViewSample::UpdateItem(int sectionIndex, int itemIndex, TableViewItem* pItem)
255 class _OSP_EXPORT_ SectionTableView
256 : public Tizen::Ui::Container
260 * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor.
264 SectionTableView(void);
267 * This destructor overrides Tizen::Base::Object::~Object().
271 virtual ~SectionTableView(void);
274 * Initializes this instance of %SectionTableView with the specified parameters.
278 * @return An error code
279 * @param[in] rect An instance of the Graphics::Rectangle class
280 * This instance represents the x and y coordinates of the left top corner of the created %SectionTableView along with the width and height.
281 * @param[in] itemDivider Set to @c true to display an item divider, @n
283 * @param[in] scrollStyle The style of %SectionTableView scroll bar style
284 * @exception E_SUCCESS The method is successful.
285 * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value.
288 result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle);
291 * Initializes this instance of %SectionTableView with the specified parameters.
295 * @return An error code
296 * @param[in] rect An instance of the Graphics::FloatRectangle class
297 * This instance represents the x and y coordinates of the left top corner of the created %SectionTableView along with the width and height.
298 * @param[in] itemDivider Set to @c true to display an item divider, @n
300 * @param[in] scrollStyle The style of %SectionTableView scroll bar style
301 * @exception E_SUCCESS The method is successful.
302 * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value.
305 result Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle);
308 * Sets the item provider that creates and deletes items for the section style table view.
312 * @param[in] pProvider The item provider to create and delete items
313 * @remarks If an item provider is not set for the table view, the table view does not work.
314 * The specified provider should be allocated in heap memory.
316 void SetItemProvider(ISectionTableViewItemProvider* pProvider);
319 * Sets the item provider that creates and deletes items for the section style table view.
323 * @param[in] pProvider The item provider to create and delete items
324 * @remarks If an item provider is not set for the table view, the table view does not work.
325 * The specified provider should be allocated in heap memory.
327 void SetItemProviderF(ISectionTableViewItemProviderF* pProvider);
330 * Sets the color of a section.
334 * @param[in] color The section color
335 * @remarks This method works only when the style of the %SectionTableView control is TABLE_VIEW_STYLE_SECTION.
337 void SetSectionColor(const Tizen::Graphics::Color& color);
340 * Gets the color of a section.
344 * @return The section color
346 Tizen::Graphics::Color GetSectionColor(void) const;
349 * Sets the grouped look is enabled.
353 * @param[in] enable The enabled/disabled status
355 void SetGroupedLookEnabled(bool enable);
358 * Returns whether the grouped look is enabled or not.
362 * @return @c true if the grouped look is enabled, else @c false
364 bool IsGroupedLookEnabled(void) const;
367 * Adds a listener instance that listens to state changes of table view items. @n
368 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
372 * @return An error code
373 * @param[in] listener The event listener to add
374 * @exception E_SUCCESS The method is successful.
375 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
376 * @remarks The specified listener should be allocated in heap memory.
378 result AddSectionTableViewItemEventListener(ISectionTableViewItemEventListener& listener);
381 * Removes a listener instance that listens to state changes of table view items. @n
382 * The removed listener cannot listen to events when they are fired.
386 * @return An error code
387 * @param[in] listener The event listener to remove
388 * @exception E_SUCCESS The method is successful.
389 * @exception E_OBJ_NOT_FOUND The listener is not found.
391 result RemoveSectionTableViewItemEventListener(ISectionTableViewItemEventListener& listener);
394 * Adds a listener instance that listens to state changes of a fast scroll. @n
395 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
399 * @return An error code
400 * @param[in] listener The event listener to add
401 * @exception E_SUCCESS The method is successful.
402 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
403 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
404 * @remarks The specified listener should be allocated in heap memory.
406 result AddFastScrollListener(IFastScrollListener& listener);
409 * Removes a listener instance that listens to state changes of a fast scroll. @n
410 * The removed listener cannot listen to events when they are fired.
414 * @return An error code
415 * @param[in] listener The event listener to remove
416 * @exception E_SUCCESS The method is successful.
417 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
418 * @exception E_OBJ_NOT_FOUND The listener is not found.
420 result RemoveFastScrollListener(IFastScrollListener& listener);
423 * Adds a listener instance that listens to state changes of a scroll event. @n
424 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
428 * @return An error code
429 * @param[in] listener The event listener to add
430 * @see IScrollEventListener::OnScrollEndReached()
431 * @see RemoveScrollEventListener()
432 * @exception E_SUCCESS The method is successful.
433 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
434 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
435 * @remarks The specified listener should be allocated in heap memory.
437 result AddScrollEventListener(IScrollEventListener& listener);
440 * Removes a listener instance that listens to state changes of a scroll event. @n
441 * The removed listener cannot listen to events when they are fired.
445 * @return An error code
446 * @param[in] listener The event listener to remove
447 * @see IScrollEventListener::OnScrollEndReached()
448 * @see AddScrollEventListener()
449 * @exception E_SUCCESS The method is successful.
450 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
451 * @exception E_OBJ_NOT_FOUND The listener is not found.
453 result RemoveScrollEventListener(IScrollEventListener& listener);
456 * Adds a listener instance that listens to state changes of a scroll event. @n
457 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
461 * @return An error code
462 * @param[in] listener The event listener to add
463 * @see IScrollEventListenerF::OnScrollEndReached()
464 * @see RemoveScrollEventListener()
465 * @exception E_SUCCESS The method is successful.
466 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
467 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
468 * @remarks The specified listener should be allocated in heap memory.
470 result AddScrollEventListener(IScrollEventListenerF& listener);
473 * Removes a listener instance that listens to state changes of a scroll event. @n
474 * The removed listener cannot listen to events when they are fired.
478 * @return An error code
479 * @param[in] listener The event listener to remove
480 * @see IScrollEventListenerF::OnScrollEndReached()
481 * @see AddScrollEventListener()
482 * @exception E_SUCCESS The method is successful.
483 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
484 * @exception E_OBJ_NOT_FOUND The listener is not found.
486 result RemoveScrollEventListener(IScrollEventListenerF& listener);
489 * Sets the text index of the fast scroll.
493 * @return An error code
494 * @param[in] text The text of the index
495 * @param[in] useSearchIcon Set to @c true to show the magnifying icon, @n
497 * @exception E_SUCCESS The method is successful.
498 * @exception E_INVALID_ARG A specified input parameter is invalid.
499 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
501 result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon);
504 * Gets the section and item indexes of the top item.
508 * @return An error code
509 * @param[out] sectionIndex The section index
510 * @param[out] itemIndex The item index
511 * @exception E_SUCCESS The method is successful.
512 * @exception E_OBJ_NOT_FOUND Top drawn item is not found.
514 result GetTopDrawnItemIndex(int& sectionIndex, int& itemIndex) const;
517 * Gets the section and item indexes of the bottom item.
521 * @return An error code
522 * @param[out] sectionIndex The section index
523 * @param[out] itemIndex The item index
524 * @exception E_SUCCESS The method is successful.
525 * @exception E_OBJ_NOT_FOUND Bottom drawn item is not found.
527 result GetBottomDrawnItemIndex(int& sectionIndex, int& itemIndex) const;
530 * Scrolls to the item at the specified index.
531 * The specified item is drawn at the position specified by the item alignment.
535 * @return An error code
536 * @param[in] sectionIndex The section index
537 * @param[in] itemIndex The item index
538 * @param[in] itemAlignment The item alignment
539 * @exception E_SUCCESS The method is successful.
540 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
541 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @b Since: @b 2.1.
542 * @remarks This method does not work during the ITableViewItemProvider call-back procedure.
543 * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()).
545 result ScrollToItem(int sectionIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment = TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
548 * Checks or unchecks the item at the specified index.
552 * @return An error code
553 * @param[in] sectionIndex The section index
554 * @param[in] itemIndex The item index
555 * @param[in] check Set to @c true to select the item, @n
557 * @exception E_SUCCESS The method is successful.
558 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
559 * @exception E_INVALID_OPERATION The item is disabled or the current state of the instance prohibits the execution of the specified operation.
560 * @remarks This method works only when the annex style of the item allows selection. @n
561 * This method does not work during the ITableViewItemProvider call-back procedure.
562 * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()).
564 result SetItemChecked(int sectionIndex, int itemIndex, bool check);
567 * Returns whether the item at the specified index is selected or not.
571 * @return @c true if the item is selected, @n
573 * @param[in] sectionIndex The section index
574 * @param[in] itemIndex The item index
575 * @exception E_SUCCESS The method is successful.
576 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
577 * @remarks This method returns @c false, if the annex style of the item does not allow selection.
578 * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()).
580 bool IsItemChecked(int sectionIndex, int itemIndex) const;
583 * Enables or disables the item at the specified index.
587 * @return An error code
588 * @param[in] sectionIndex The section index
589 * @param[in] itemIndex The item index
590 * @param[in] enable Set to @c true to enable the specified item, @n
592 * @exception E_SUCCESS The method is successful.
593 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
594 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @b Since: @b 2.1.
595 * @remarks This method does not work during the ITableViewItemProvider call-back procedure.
596 * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()).
598 result SetItemEnabled(int sectionIndex, int itemIndex, bool enable);
601 * Returns whether the item at the specified index is enabled or disabled.
605 * @return @c true if the item is enabled, @n
607 * @param[in] sectionIndex The section index
608 * @param[in] itemIndex The item index
609 * @exception E_SUCCESS The method is successful.
610 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
611 * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()).
613 bool IsItemEnabled(int sectionIndex, int itemIndex) const;
616 * Counts the total number of sections.
620 * @return The total number of sections
622 int GetSectionCount(void) const;
625 * Counts all the items of the specified section.
629 * @return The total number of items in the specified section
630 * @param[in] sectionIndex The section index
631 * @exception E_SUCCESS The method is successful.
632 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
634 int GetItemCountAt(int sectionIndex) const;
637 * Updates the specified item. @n
638 * For instance, @c TABLE_VIEW_REFRESH_TYPE_ITEM_ADD is used when a new item needs to be added and @c TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE is used when an item is deleted from the
639 * table view. Moreover, @c TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has changed and it needs to be updated.
640 * Note that calling this method with @c TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY invokes item provider's UpdateItem() for the given index in sequence.
644 * @return An error code
645 * @param[in] sectionIndex The section index
646 * @param[in] itemIndex The item index
647 * @param[in] type The item to add, remove, or modify
648 * @exception E_SUCCESS The method is successful.
649 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
650 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @b Since: @b 2.1.
651 * @remarks If the specified item. itemIndex is -1, then the method is applied to the section item with the given index.
652 * Note that if @c TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE option is used to a section item, all the items in the section (including the section item itself) are
653 * removed from the table view. @n
654 * This method does not work during the ITableViewItemProvider call-back procedure.
656 result RefreshItem(int sectionIndex, int itemIndex, TableViewRefreshType type);
659 * Updates all items of the table view. @n
660 * Note that calling this method invokes its item provider's UpdateItem() for all loaded items.
664 * @return An error code
665 * @exception E_SUCCESS The method is successful.
666 * @exception E_INVALID_OPERATION The %SectionTableView item provider is processing the other request.
668 result RefreshAllItems(void);
671 * Updates all the items of a table view.
675 * @exception E_SUCCESS The method is successful.
676 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @b Since: @b 2.1.
677 * @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. @n
678 * This method does not work during the ITableViewItemProvider call-back procedure.
679 * @remarks The specific error code can be accessed using the GetLastResult() method.
681 void UpdateTableView(void);
684 * Gets the index of the item at the specified position.
688 * @param[in] position The position of the item
689 * @param[out] sectionIndex The section index of the item on specified position
690 * @param[out] itemIndex The item index of the item on specified position
691 * @remarks This method sets both of sectionIndex and itemIndex to -1 if no item is found at the given position.
692 * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()).
694 result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& sectionIndex, int& itemIndex) const;
697 * Gets the index of the item at the specified position.
701 * @param[in] position The position of the item
702 * @param[out] sectionIndex The section index of the item on specified position
703 * @param[out] itemIndex The item index of the item on specified position
704 * @remarks This method sets both of sectionIndex and itemIndex to -1 if no item is found at the given position.
705 * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()).
707 result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& sectionIndex, int& itemIndex) const;
710 * Sets the color of a division line between items.
714 * @return An error code
715 * @param[in] color The division line color
717 void SetItemDividerColor(const Tizen::Graphics::Color& color);
720 * Gets the color of a division line between items.
724 * @return The color of a division line
726 Tizen::Graphics::Color GetItemDividerColor(void) const;
729 * Sets the background color of this control.
733 * @param[in] color The background color
734 * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified,
735 * only the bitmap image is displayed.
737 void SetBackgroundColor(const Tizen::Graphics::Color& color);
740 * Gets the background color of this control.
744 * @return The background color
746 Tizen::Graphics::Color GetBackgroundColor(void) const;
749 * Sets the scroll input handling mode.
753 * @param[in] mode The scroll input handling mode
754 * @see GetScrollInputMode()
756 void SetScrollInputMode(ScrollInputMode mode);
759 * Gets the scroll input handling mode.
763 * @return The scroll input handling mode
764 * @see SetScrollInputMode()
766 ScrollInputMode GetScrollInputMode(void) const;
769 * Scrolls the list contents by the specified number of pixels. When it is negative, it scrolls to opposite direction in current scroll style.
773 * @return An error code
774 * @param[in] pixel The amount of pixels to scroll
775 * @exception E_SUCCESS The method is successful.
776 * @exception E_OUT_OF_RANGE The specified @c pixel is out of range.
777 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation
778 * @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.
779 * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. @n
780 * This method does not work during the ITableViewItemProvider call-back procedure.
782 result ScrollByPixel(int pixel);
785 * Scrolls the list contents by the specified number of pixels. When it is negative, it scrolls to opposite direction in current scroll style.
789 * @return An error code
790 * @param[in] pixel The amount of pixels to scroll
791 * @exception E_SUCCESS The method is successful.
792 * @exception E_OUT_OF_RANGE The specified @c pixel is out of range.
793 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation
794 * @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.
795 * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. @n
796 * This method does not work during the ITableViewItemProvider call-back procedure.
798 result ScrollByPixel(float pixel);
801 * Gets the current scroll position
805 int GetCurrentScrollPosition(void) const;
808 * Gets the current scroll position
812 float GetCurrentScrollPositionF(void) const;
815 * Enables or disables the scroll of SectionTableView items.
819 void SetScrollEnabled(bool enable);
822 * Checks whether the scroll is enabled or disabled.
826 bool IsScrollEnabled(void) const;
829 * Opens the context item at the specified index.
833 * @return An error code
834 * @param[in] sectionIndex The section index
835 * @param[in] itemIndex The item index
836 * @exception E_SUCCESS The method is successful.
837 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
838 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
840 result OpenContextItem(int sectionIndex, int itemIndex);
843 * Closes the context item at the specified index.
847 * @return An error code
848 * @param[in] sectionIndex The section index
849 * @param[in] itemIndex The item index
850 * @exception E_SUCCESS The method is successful.
851 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
852 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
854 result CloseContextItem(int sectionIndex, int itemIndex);
857 * Returns whether the context item at the specified index is opened.
861 * @return @c true if the context item is opened, else @c false
862 * @param[in] sectionIndex The section index
863 * @param[in] itemIndex The item index
864 * @exception E_SUCCESS The method is successful.
865 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
867 bool IsContextItemOpened(int sectionIndex, int itemIndex) const;
870 * Sets the Horizontal alignment of the text of the %SectionTableView header.
874 * @return An error code
875 * @param[in] sectionIndex The index of the section
876 * @param[in] alignment The horizontal alignment of the section header text
877 * @exception E_SUCCESS The method is successful.
878 * @exception E_OUT_OF_RANGE The specified input parameter is invalid.
879 * @exception E_INVALID_OPERATION There is no header in the section.
880 * @remarks By default, the text of the section header is left aligned.
881 * @see GetSectionHeaderTextHorizontalAlignment()
883 result SetSectionHeaderTextHorizontalAlignment(int sectionIndex, HorizontalAlignment alignment);
886 * Gets the Horizontal alignment of the text of the %SectionTableView header.
890 * @return The horizontal alignment of the text
891 * @param[in] sectionIndex The index of the section
892 * @exception E_SUCCESS The method is successful
893 * @exception E_OUT_OF_RANGE The specified input parameter is invalid.
894 * @exception E_INVALID_OPERATION There is no header in the section.
895 * @remarks The specific error code can be accessed using the GetLastResult() method.
896 * @see SetSectionHeaderTextHorizontalAlignment()
898 HorizontalAlignment GetSectionHeaderTextHorizontalAlignment(int sectionIndex) const;
901 * Sets the Horizontal alignment of the text of the %SectionTableView footer.
905 * @return An error code
906 * @param[in] sectionIndex The index of the section
907 * @param[in] alignment The horizontal alignment of the section footer text
908 * @exception E_SUCCESS The method is successful.
909 * @exception E_OUT_OF_RANGE The specified input parameter is invalid.
910 * @exception E_INVALID_OPERATION There is no footer in the section.
911 * @remarks By default, the text of the section footer is right aligned.
912 * @see GetSectionFooterTextHorizontalAlignment()
914 result SetSectionFooterTextHorizontalAlignment(int sectionIndex, HorizontalAlignment alignment);
917 * Gets the Horizontal alignment of the text of the %SectionTableView footer.
921 * @return The horizontal alignment of the text
922 * @param[in] sectionIndex The index of the section
923 * @exception E_SUCCESS The method is successful
924 * @exception E_OUT_OF_RANGE The specified input parameter is invalid.
925 * @exception E_INVALID_OPERATION There is no footer in the section.
926 * @remarks The specific error code can be accessed using the GetLastResult() method.
927 * @see SetSectionFooterTextHorizontalAlignment()
929 HorizontalAlignment GetSectionFooterTextHorizontalAlignment(int sectionIndex) const;
932 friend class _TableViewImpl;
934 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
935 SectionTableView(const SectionTableView& rhs);
937 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
938 SectionTableView& operator =(const SectionTableView& rhs);
939 }; // SectionTableView
941 }}} // Tizen::Ui::Controls
943 #endif // _FUI_CTRL_SECTION_TABLE_VIEW_H_