2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 * The following example demonstrates how to use the %SectionTableView class.
55 //Sample code for SectionTableViewSample.h
58 class SectionTableViewSample
59 : public Tizen::Ui::Controls::Form
60 , public Tizen::Ui::Controls::ISectionTableViewItemProvider
61 , public Tizen::Ui::Controls::ISectionTableViewItemEventListener
64 SectionTableViewSample(void)
65 : __pSectionTableView(null){}
67 bool Initialize(void);
68 virtual result OnInitializing(void);
69 virtual result OnTerminating(void);
71 // ISectionTableViewItemEventListener
72 virtual void OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
73 virtual void OnSectionTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::SectionTableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated);
75 // ISectionTableViewItemProvider
76 virtual int GetSectionCount(void);
77 virtual int GetItemCount(int sectionIndex);
78 virtual bool HasSectionHeader(int sectionIndex);
79 virtual bool HasSectionFooter(int sectionIndex);
80 virtual Tizen::Base::String GetSectionHeader(int sectionIndex);
81 virtual Tizen::Base::String GetSectionFooter(int sectionIndex);
82 virtual int GetDefaultItemHeight(void);
83 virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int sectionIndex, int itemIndex, int itemWidth);
84 virtual bool DeleteItem(int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
85 virtual void UpdateItem(int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
88 Tizen::Ui::Controls::SectionTableView* __pSectionTableView;
94 //Sample code for SectionTableViewSample.cpp
96 #include <FGraphics.h>
98 #include "SectionTableViewSample.h"
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;
107 SectionTableViewSample::Initialize(void)
109 Construct(FORM_STYLE_NORMAL);
114 SectionTableViewSample::OnInitializing(void)
116 result r = E_SUCCESS;
118 // Creates an instance of TableView
119 __pSectionTableView = new SectionTableView();
120 __pSectionTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
121 __pSectionTableView->SetItemProvider(this);
122 __pSectionTableView->AddSectionTableViewItemEventListener(*this);
124 // Adds the Section TableView to the form
125 AddControl(__pSectionTableView);
130 SectionTableViewSample::OnTerminating(void)
135 // ISectionTableViewItemEventListener implementation
137 SectionTableViewSample::OnSectionTableViewItemStateChanged(SectionTableView& tableView, int sectionIndex, int itemIndex, TableViewItem* pItem, TableViewItemStatus status)
143 SectionTableViewSample::OnSectionTableViewContextItemActivationStateChanged(SectionTableView& tableView, int sectionIndex, int itemIndex, TableViewContextItem* pContextItem, bool activated)
148 // ISectionTableViewItemProvider implementation
150 SectionTableViewSample::GetSectionCount(void)
156 SectionTableViewSample::GetItemCount(int sectionIndex)
162 SectionTableViewSample::HasSectionHeader(int sectionIndex)
168 SectionTableViewSample::HasSectionFooter(int sectionIndex)
174 SectionTableViewSample::GetSectionHeader(int sectionIndex)
177 text.Format(30, L"Section header %d", sectionIndex);
183 SectionTableViewSample::GetSectionFooter(int sectionIndex)
186 text.Format(30, L"Section footer %d", sectionIndex);
192 SectionTableViewSample::GetDefaultItemHeight(void)
198 SectionTableViewSample::CreateItem(int sectionIndex, int itemIndex, int itemWidth)
200 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
201 TableViewItem* pItem = new TableViewItem();
203 switch (itemIndex % 6)
206 style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
209 style = TABLE_VIEW_ANNEX_STYLE_MARK;
212 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
215 style = TABLE_VIEW_ANNEX_STYLE_DETAILED;
218 style = TABLE_VIEW_ANNEX_STYLE_RADIO;
221 style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER;
227 pItem->Construct(Dimension(itemWidth, GetDefaultItemHeight()), style);
230 text.Format(30, L"TableViewItem %d", itemIndex);
232 Label* pLabel = new Label();
233 pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultItemHeight()), text);
235 pItem->AddControl(pLabel);
242 SectionTableViewSample::DeleteItem(int sectionIndex, int itemIndex, TableViewItem* pItem)
250 SectionTableViewSample::UpdateItem(int sectionIndex, int itemIndex, TableViewItem* pItem)
257 class _OSP_EXPORT_ SectionTableView
258 : public Tizen::Ui::Container
262 * The object is not fully constructed after this constructor is called. @n
263 * For full construction, the %Construct() method must be called right after calling this constructor.
267 SectionTableView(void);
270 * This destructor overrides Tizen::Base::Object::~Object().
274 virtual ~SectionTableView(void);
277 * Initializes this instance of %SectionTableView with the specified parameters.
281 * @return An error code
282 * @param[in] rect An instance of the Graphics::Rectangle class
283 * This instance represents the x and y coordinates of the left top corner of the created %SectionTableView along with the width and height.
284 * @param[in] itemDivider Set to @c true to display an item divider, @n
286 * @param[in] scrollStyle The style of %SectionTableView scroll bar style
287 * @exception E_SUCCESS The method is successful.
288 * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value.
291 result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle);
294 * Initializes this instance of %SectionTableView with the specified parameters.
298 * @return An error code
299 * @param[in] rect An instance of the Tizen::Graphics::FloatRectangle class @n
300 * This instance represents the x and y coordinates of the left top corner of the created %SectionTableView along with the width and height.
301 * @param[in] itemDivider Set to @c true to display an item divider, @n
303 * @param[in] scrollStyle The style of %SectionTableView scroll bar style
304 * @exception E_SUCCESS The method is successful.
305 * @exception E_INVALID_ARG A specified input parameter is invalid, or either the @c rect.width or @c rect.height parameter has a negative value.
308 result Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle);
311 * Sets the item provider that creates and deletes items for the section style table view.
315 * @param[in] pProvider The item provider to create and delete items
316 * @remarks If an item provider is not set for the table view, the table view does not work.
317 * The specified provider should be allocated in heap memory.
319 void SetItemProvider(ISectionTableViewItemProvider* pProvider);
322 * Sets the item provider that creates and deletes items for the section style table view.
326 * @param[in] pProvider The item provider to create and delete items
327 * @remarks If an item provider is not set for the table view, the table view does not work.
328 * The specified provider should be allocated in heap memory.
330 void SetItemProviderF(ISectionTableViewItemProviderF* pProvider);
333 * Sets the color of a section.
337 * @param[in] color The section color
339 void SetSectionColor(const Tizen::Graphics::Color& color);
342 * Gets the color of a section.
346 * @return The section color
348 Tizen::Graphics::Color GetSectionColor(void) const;
351 * Sets the grouped look is enabled.
355 * @param[in] enable The enabled/disabled status
357 void SetGroupedLookEnabled(bool enable);
360 * Returns whether the grouped look is enabled or not.
364 * @return @c true if the grouped look is enabled, @n
367 bool IsGroupedLookEnabled(void) const;
370 * Adds a listener instance that listens to state changes of table view items. @n
371 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
375 * @return An error code
376 * @param[in] listener The event listener to add
377 * @exception E_SUCCESS The method is successful.
378 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
379 * @remarks The specified listener should be allocated in heap memory.
381 result AddSectionTableViewItemEventListener(ISectionTableViewItemEventListener& listener);
384 * Removes a listener instance that listens to state changes of table view items. @n
385 * The removed listener cannot listen to events when they are fired.
389 * @return An error code
390 * @param[in] listener The event listener to remove
391 * @exception E_SUCCESS The method is successful.
392 * @exception E_OBJ_NOT_FOUND The listener is not found.
394 result RemoveSectionTableViewItemEventListener(ISectionTableViewItemEventListener& listener);
397 * Adds a listener instance that listens to state changes of a fast scroll. @n
398 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
402 * @return An error code
403 * @param[in] listener The event listener to add
404 * @exception E_SUCCESS The method is successful.
405 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
406 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
407 * @remarks The specified listener should be allocated in heap memory.
409 result AddFastScrollListener(IFastScrollListener& listener);
412 * Removes a listener instance that listens to state changes of a fast scroll. @n
413 * The removed listener cannot listen to events when they are fired.
417 * @return An error code
418 * @param[in] listener The event listener to remove
419 * @exception E_SUCCESS The method is successful.
420 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
421 * @exception E_OBJ_NOT_FOUND The listener is not found.
423 result RemoveFastScrollListener(IFastScrollListener& listener);
426 * Adds a listener instance that listens to state changes of a scroll event. @n
427 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
431 * @return An error code
432 * @param[in] listener The event listener to add
433 * @exception E_SUCCESS The method is successful.
434 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
435 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
436 * @remarks The specified listener should be allocated in heap memory.
437 * @see IScrollEventListener::OnScrollEndReached()
438 * @see RemoveScrollEventListener()
440 result AddScrollEventListener(IScrollEventListener& listener);
443 * Removes a listener instance that listens to state changes of a scroll event. @n
444 * The removed listener cannot listen to events when they are fired.
448 * @return An error code
449 * @param[in] listener The event listener to remove
450 * @exception E_SUCCESS The method is successful.
451 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
452 * @exception E_OBJ_NOT_FOUND The listener is not found.
453 * @see IScrollEventListener::OnScrollEndReached()
454 * @see AddScrollEventListener()
456 result RemoveScrollEventListener(IScrollEventListener& listener);
459 * Adds a listener instance that listens to state changes of a scroll event. @n
460 * The added listener can listen to events on the specified event dispatcher's context when they are fired.
464 * @return An error code
465 * @param[in] listener The event listener to add
466 * @exception E_SUCCESS The method is successful.
467 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
468 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
469 * @remarks The specified listener should be allocated in heap memory.
470 * @see IScrollEventListenerF::OnScrollEndReached()
471 * @see RemoveScrollEventListener()
473 result AddScrollEventListener(IScrollEventListenerF& listener);
476 * Removes a listener instance that listens to state changes of a scroll event. @n
477 * The removed listener cannot listen to events when they are fired.
481 * @return An error code
482 * @param[in] listener The event listener to remove
483 * @exception E_SUCCESS The method is successful.
484 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
485 * @exception E_OBJ_NOT_FOUND The listener is not found.
486 * @see IScrollEventListenerF::OnScrollEndReached()
487 * @see AddScrollEventListener()
489 result RemoveScrollEventListener(IScrollEventListenerF& listener);
492 * Sets the text index of the fast scroll.
496 * @return An error code
497 * @param[in] text The text of the index
498 * @param[in] useSearchIcon Set to @c true to show the magnifying icon, @n
500 * @exception E_SUCCESS The method is successful.
501 * @exception E_INVALID_ARG A specified input parameter is invalid.
502 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
504 result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon);
507 * Gets the section and item indexes of the top item.
511 * @return An error code
512 * @param[out] sectionIndex The section index
513 * @param[out] itemIndex The item index
514 * @exception E_SUCCESS The method is successful.
515 * @exception E_OBJ_NOT_FOUND Top drawn item is not found.
517 result GetTopDrawnItemIndex(int& sectionIndex, int& itemIndex) const;
520 * Gets the section and item indexes of the bottom item.
524 * @return An error code
525 * @param[out] sectionIndex The section index
526 * @param[out] itemIndex The item index
527 * @exception E_SUCCESS The method is successful.
528 * @exception E_OBJ_NOT_FOUND Bottom drawn item is not found.
530 result GetBottomDrawnItemIndex(int& sectionIndex, int& itemIndex) const;
533 * Scrolls to the item at the specified index.
534 * The specified item is drawn at the position specified by the item alignment.
538 * @return An error code
539 * @param[in] sectionIndex The section index
540 * @param[in] itemIndex The item index
541 * @param[in] itemAlignment The item alignment
542 * @exception E_SUCCESS The method is successful.
543 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
544 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @b Since: @b 2.1
546 * - This method does not work during the ITableViewItemProvider call-back procedure.
547 * - This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle
548 * of the TableView, then UpdateTableView() method should be called explicitly (for example, during Tizen::Ui::Control::OnInitializing()).
550 result ScrollToItem(int sectionIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment = TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
553 * Checks or unchecks the item at the specified index.
557 * @return An error code
558 * @param[in] sectionIndex The section index
559 * @param[in] itemIndex The item index
560 * @param[in] check Set to @c true to select the item, @n
562 * @exception E_SUCCESS The method is successful.
563 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
564 * @exception E_INVALID_OPERATION The item is disabled or the current state of the instance prohibits the execution of the specified operation.
566 * - This method works only when the annex style of the item allows selection.
567 * This method does not work during the ITableViewItemProvider call-back procedure.
568 * - This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle
569 * of the TableView, then UpdateTableView() method should be called explicitly (for example, during Tizen::Ui::Control::OnInitializing()).
571 result SetItemChecked(int sectionIndex, int itemIndex, bool check);
574 * Returns whether the item at the specified index is selected or not.
578 * @return @c true if the item is selected, @n
580 * @param[in] sectionIndex The section index
581 * @param[in] itemIndex The item index
582 * @exception E_SUCCESS The method is successful.
583 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
585 * - This method returns @c false, if the annex style of the item does not allow selection.
586 * - This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the
587 * TableView, then UpdateTableView() method should be called explicitly (for example, during Tizen::Ui::Control::OnInitializing()).
589 bool IsItemChecked(int sectionIndex, int itemIndex) const;
592 * Enables or disables the item at the specified index.
596 * @return An error code
597 * @param[in] sectionIndex The section index
598 * @param[in] itemIndex The item index
599 * @param[in] enable Set to @c true to enable the specified item, @n
601 * @exception E_SUCCESS The method is successful.
602 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
603 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @b Since: @b 2.1
605 * - This method does not work during the ITableViewItemProvider call-back procedure.
606 * - This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the
607 * TableView, then UpdateTableView() method should be called explicitly (for example, during Tizen::Ui::Control::OnInitializing()).
609 result SetItemEnabled(int sectionIndex, int itemIndex, bool enable);
612 * Checks whether the item at the specified index is enabled or disabled.
616 * @return @c true if the item is enabled, @n
618 * @param[in] sectionIndex The section index
619 * @param[in] itemIndex The item index
620 * @exception E_SUCCESS The method is successful.
621 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
622 * @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
623 * TableView, then UpdateTableView() method should be called explicitly (for example, during Tizen::Ui::Control::OnInitializing()).
625 bool IsItemEnabled(int sectionIndex, int itemIndex) const;
628 * Counts the total number of sections.
632 * @return The total number of sections
634 int GetSectionCount(void) const;
637 * Counts all the items of the specified section.
641 * @return The total number of items in the specified section
642 * @param[in] sectionIndex The section index
643 * @exception E_SUCCESS The method is successful.
644 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
646 int GetItemCountAt(int sectionIndex) const;
649 * Updates the specified item. @n
650 * 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
651 * used when an item is deleted from the table view. Moreover, @c TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has
652 * changed and it needs to be updated. @n Note that calling the %RefreshAllItems() method with @c TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY
653 * invokes ISectionTableViewItemProvider::UpdateItem() or ISectionTableViewItemProviderF::UpdateItem() for the given index in sequence.
657 * @return An error code
658 * @param[in] sectionIndex The section index
659 * @param[in] itemIndex The item index
660 * @param[in] type The item to add, remove, or modify
661 * @exception E_SUCCESS The method is successful.
662 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
663 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @b Since: @b 2.1
665 * - If the specified item.itemIndex is @c -1, then the method is applied to the section item with the given index.
666 * - Note that if @c TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE option is used to a section item, all the items in the section
667 * (including the section item itself) are removed from the table view.
668 * - This method does not work during the ITableViewItemProvider call-back procedure.
670 result RefreshItem(int sectionIndex, int itemIndex, TableViewRefreshType type);
673 * Updates all items of the table view. @n
674 * Note that calling the %RefreshAllItems() method invokes ISectionTableViewItemProvider::UpdateItem() or ISectionTableViewItemProviderF::UpdateItem() for
679 * @return An error code
680 * @exception E_SUCCESS The method is successful.
681 * @exception E_INVALID_OPERATION The %SectionTableView item provider is processing the other request.
683 result RefreshAllItems(void);
686 * Updates all the items of a table view. @n
687 * This method deletes all the items in the table view and invokes the methods of the item provider again to update the table view.
691 * @exception E_SUCCESS The method is successful.
692 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @b Since: @b 2.1.
694 * - This method will delete all the items and recreate them, so it should not be called from the inside of
695 * OnSectionTableViewItemStateChanged() call-back as this leads to self deletion. If you need to update an Item, you should use RefreshItem() method.
696 * - This method should not be called from ISectionTableViewItemProvider implementation because of recursion.
697 * - The specific error code can be accessed using the GetLastResult() method.
699 void UpdateTableView(void);
702 * Gets the index of the item at the specified position.
706 * @param[in] position The position of the item
707 * @param[out] sectionIndex The section index of the item on specified position
708 * @param[out] itemIndex The item index of the item on specified position
710 * - This method sets both of sectionIndex and itemIndex to @c -1 if no item is found at the given position.
711 * - This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle
712 * of the TableView, then UpdateTableView() method should be called explicitly (for example, during Tizen::Ui::Control::OnInitializing()).
714 result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& sectionIndex, int& itemIndex) const;
717 * Gets the index of the item at the specified position.
721 * @param[in] position The position of the item
722 * @param[out] sectionIndex The section index of the item on specified position
723 * @param[out] itemIndex The item index of the item on specified position
725 * - This method sets both of sectionIndex and itemIndex to -1 if no item is found at the given position.
726 * - This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of
727 * the TableView, then UpdateTableView() method should be called explicitly (for example, during Tizen::Ui::Control::OnInitializing()).
729 result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& sectionIndex, int& itemIndex) const;
732 * Sets the color of a division line between items.
736 * @return An error code
737 * @param[in] color The division line color
739 void SetItemDividerColor(const Tizen::Graphics::Color& color);
742 * Gets the color of a division line between items.
746 * @return The color of a division line
748 Tizen::Graphics::Color GetItemDividerColor(void) const;
751 * Sets the background color of this control.
755 * @param[in] color The background color
756 * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified,
757 * only the bitmap image is displayed.
759 void SetBackgroundColor(const Tizen::Graphics::Color& color);
762 * Gets the background color of this control.
766 * @return The background color
768 Tizen::Graphics::Color GetBackgroundColor(void) const;
771 * Sets the scroll input handling mode.
775 * @param[in] mode The scroll input handling mode
776 * @see GetScrollInputMode()
778 void SetScrollInputMode(ScrollInputMode mode);
781 * Gets the scroll input handling mode.
785 * @return The scroll input handling mode
786 * @see SetScrollInputMode()
788 ScrollInputMode GetScrollInputMode(void) const;
791 * Scrolls the list contents by a specified number of pixels. @n When it is negative, it scrolls to opposite direction in current scroll style.
795 * @return An error code
796 * @param[in] pixel The amount of pixels to scroll
797 * @exception E_SUCCESS The method is successful.
798 * @exception E_OUT_OF_RANGE The specified @c pixel is out of range.
799 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
801 * - If you call this method with negative @c pixel when position of scroll is already top of contents then it will return
802 * @c E_OUT_OF_RANGE. @n
803 * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return @c E_OUT_OF_RANGE.
804 * - This method does not work during the ITableViewItemProvider call-back procedure.
806 result ScrollByPixel(int pixel);
809 * Scrolls the list contents by a specified number of pixels. @n When it is negative, it scrolls to opposite direction in current scroll style.
813 * @return An error code
814 * @param[in] pixel The amount of pixels to scroll
815 * @exception E_SUCCESS The method is successful.
816 * @exception E_OUT_OF_RANGE The specified @c pixel is out of range.
817 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation
819 * - If you call this method with negative @c pixel when position of scroll is already top of contents then it will @c
820 * return E_OUT_OF_RANGE. @n
821 * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return @c E_OUT_OF_RANGE.
822 * - This method does not work during the ITableViewItemProvider call-back procedure.
824 result ScrollByPixel(float pixel);
827 * Gets the current scroll position
831 int GetCurrentScrollPosition(void) const;
834 * Gets the current scroll position
838 float GetCurrentScrollPositionF(void) const;
841 * Enables or disables the scroll of %SectionTableView items.
845 void SetScrollEnabled(bool enable);
848 * Checks whether the scroll is enabled or disabled.
852 bool IsScrollEnabled(void) const;
855 * Opens the context item at a specified index.
859 * @return An error code
860 * @param[in] sectionIndex The section index
861 * @param[in] itemIndex The item index
862 * @exception E_SUCCESS The method is successful.
863 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
864 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
866 result OpenContextItem(int sectionIndex, int itemIndex);
869 * Closes the context item at a specified index.
873 * @return An error code
874 * @param[in] sectionIndex The section index
875 * @param[in] itemIndex The item index
876 * @exception E_SUCCESS The method is successful.
877 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
878 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
880 result CloseContextItem(int sectionIndex, int itemIndex);
883 * Checks whether the context item at a specified index is opened.
887 * @return @c true if the context item is opened, @n
889 * @param[in] sectionIndex The section index
890 * @param[in] itemIndex The item index
891 * @exception E_SUCCESS The method is successful.
892 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
894 bool IsContextItemOpened(int sectionIndex, int itemIndex) const;
897 * Sets the horizontal alignment of the text of the %SectionTableView header.
901 * @return An error code
902 * @param[in] sectionIndex The index of the section
903 * @param[in] alignment The horizontal alignment of the section header text
904 * @exception E_SUCCESS The method is successful.
905 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
906 * @exception E_INVALID_OPERATION There is no header in the section.
907 * @remarks By default, the text of the section header is left aligned.
908 * @see GetSectionHeaderTextHorizontalAlignment()
910 result SetSectionHeaderTextHorizontalAlignment(int sectionIndex, HorizontalAlignment alignment);
913 * Gets the horizontal alignment of the text of the %SectionTableView header.
917 * @return The horizontal alignment of the text
918 * @param[in] sectionIndex The index of the section
919 * @exception E_SUCCESS The method is successful
920 * @exception E_OUT_OF_RANGE The specified input parameter is invalid.
921 * @exception E_INVALID_OPERATION There is no header in the section.
922 * @remarks The specific error code can be accessed using the GetLastResult() method.
923 * @see SetSectionHeaderTextHorizontalAlignment()
925 HorizontalAlignment GetSectionHeaderTextHorizontalAlignment(int sectionIndex) const;
928 * Sets the horizontal alignment of the text of the %SectionTableView footer.
932 * @return An error code
933 * @param[in] sectionIndex The index of the section
934 * @param[in] alignment The horizontal alignment of the section footer text
935 * @exception E_SUCCESS The method is successful.
936 * @exception E_OUT_OF_RANGE A specified input parameter is invalid.
937 * @exception E_INVALID_OPERATION There is no footer in the section.
938 * @remarks By default, the text of the section footer is right aligned.
939 * @see GetSectionFooterTextHorizontalAlignment()
941 result SetSectionFooterTextHorizontalAlignment(int sectionIndex, HorizontalAlignment alignment);
944 * Gets the horizontal alignment of the text of the %SectionTableView footer.
948 * @return The horizontal alignment of the text
949 * @param[in] sectionIndex The index of the section
950 * @exception E_SUCCESS The method is successful
951 * @exception E_OUT_OF_RANGE The specified input parameter is invalid.
952 * @exception E_INVALID_OPERATION There is no footer in the section.
953 * @remarks The specific error code can be accessed using the GetLastResult() method.
954 * @see SetSectionFooterTextHorizontalAlignment()
956 HorizontalAlignment GetSectionFooterTextHorizontalAlignment(int sectionIndex) const;
959 friend class _TableViewImpl;
961 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
962 SectionTableView(const SectionTableView& rhs);
964 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
965 SectionTableView& operator =(const SectionTableView& rhs);
966 }; // SectionTableView
968 }}} // Tizen::Ui::Controls
970 #endif // _FUI_CTRL_SECTION_TABLE_VIEW_H_