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 FUiCtrlHeader.h
20 * @brief This is the header file for the %Header class.
22 * This header file contains the declarations of the %Header class.
24 #ifndef _FUI_CTRL_HEADER_H_
25 #define _FUI_CTRL_HEADER_H_
27 #include <FBaseObject.h>
28 #include <FBaseTypes.h>
29 #include <FBaseString.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpColor.h>
32 #include <FGrpRectangle.h>
33 #include <FUiControl.h>
34 #include <FUiIActionEventListener.h>
35 #include <FUiCtrlAnimation.h>
36 #include <FUiCtrlButtonItem.h>
37 #include <FUiCtrlHeaderItem.h>
38 #include <FUiCtrlForm.h>
40 namespace Tizen { namespace Ui { namespace Controls
47 * Defines the possible styles of a %Header control.
53 HEADER_STYLE_TITLE, /**< The title style */
54 HEADER_STYLE_TITLE_BUTTON, /**< The title button style */
55 HEADER_STYLE_SEGMENTED, /**< The segmented style */
56 HEADER_STYLE_SEGMENTED_WITH_TITLE, /**< The segmented style with title */
57 HEADER_STYLE_TAB, /**< The tab style */
58 HEADER_STYLE_TAB_WITH_TITLE, /**< The tab with title style */
59 HEADER_STYLE_BUTTON /**< The button style */
63 * @enum HeaderAnimationPosition
65 * Defines the possible positions of the waiting animation of a header.
69 enum HeaderAnimationPosition
71 HEADER_ANIMATION_POSITION_TITLE, /**< The title animation */
72 HEADER_ANIMATION_POSITION_BUTTON_LEFT, /**< The left button animation */
73 HEADER_ANIMATION_POSITION_BUTTON_RIGHT /**< The right button animation */
78 * @brief This class is an implementation of a %Header control.
82 * The %Header class displays a multi-purpose area at the top of the screen that usually acts as a placeholder for descriptive
83 * contents, such as a title of the current screen. It can also contain buttons for performing various user-defined tasks.
85 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_header.htm">Header</a>.
87 * The following examples demonstrate how to use the %Header class.
89 * - Constructing a header: @n
90 * When creating a Form, specify the FORM_STYLE_HEADER parameter in the Form::Construct() method.
95 * TestForm::Initialize(void)
97 * Construct(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER );
101 * - Using the header: @n
102 * Gets the header with the GetHeader() method, and sets the header style.
106 * TestForm::Initialize(void)
108 * Header* pHeader = GetHeader();
109 * pHeader->SetStyle(HEADER_STYLE_SEGMENTED);
113 * - Adding items to the header: @n
114 * Adds HeaderItems or ButtonItems according to the header style. The action ID registered in the Construct() method is notified
115 * when items are touched.
119 * TestForm::Initialize(void)
121 * HeaderItem headerItem;
122 * headerItem.Construct(ID_HEADER_ITEM);
123 * headerItem.SetText("HeaderItem");
125 * pHeader->AddItem(headerItem);
127 * ButtonItem buttonItem;
128 * buttonItem.Construct(BUTTON_ITEM_STYLE_ICON, ID_HEADER_BUTTON);
129 * buttonItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, __pBitmap);
131 * pHeader->SetButton(BUTTON_POSITION_LEFT, buttonItem);
136 * - Setting the header title and description:
140 * TestForm::Initialize(void)
142 * pHeader->SetTitleText(L"Header Title");
143 * pHeader->SetDescriptionText(L"Description Text");
147 class _OSP_EXPORT_ Header
148 : public Tizen::Ui::Control
153 * Adds the specified header item.
157 * @return An error code
158 * @param[in] item The HeaderItem object to add
159 * @exception E_SUCCESS The method is successful.
160 * @exception E_MAX_EXCEEDED The number of items has exceeded the maximum limit.
161 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
162 * The specified item is not constructed.
163 * @exception E_SYSTEM A system error has occurred.
164 * @remarks The %Header control does not throw any exception even though the same action ID is assigned to multiple items. @n
165 * However, the content of the specified item is copied to the %Header control.
167 result AddItem(const HeaderItem& item);
171 * Inserts the header item at the specified index.
175 * @return An error code
176 * @param[in] itemIndex The index where the item should be inserted
177 * @param[in] item The HeaderItem object to insert
178 * @exception E_SUCCESS The method is successful.
179 * @exception E_MAX_EXCEEDED The number of items has exceeded the maximum limit.
180 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or the index is greater than or equal to the number of elements or less than @c 0.
181 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
182 * The specified @c item is not constructed.
183 * @exception E_SYSTEM A system error has occurred.
184 * @remarks The %Header control does not throw any exception even though the same action ID is assigned to multiple items. @n
185 * However, the content of the specified item is copied to the %Header control.
187 result InsertItemAt(int itemIndex, const HeaderItem& item);
191 * Checks whether a button item is set at the specified position.
195 * @return @c true if the button item is set at the specified position, @n
197 * @param[in] position The position of the button item
198 * @exception E_SUCCESS The method is successful.
199 * @remarks The specific error code can be accessed using the GetLastResult() method.
201 bool IsButtonSet(ButtonPosition position) const;
205 * Gets the state of the specified button item.
209 * @return The state of the button item at the specified position, @n
210 * else @c BUTTON_ITEM_STATUS_NORMAL if an error occurs
211 * @param[in] position The position of the button item
212 * @exception E_SUCCESS The method is successful.
213 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
214 * There is no button set at the specified position.
215 * @remarks The specific error code can be accessed using the GetLastResult() method.
217 ButtonItemStatus GetButtonStatus(ButtonPosition position) const;
221 * Gets the color of the button item for the specified state.
225 * @return The color of the button item, @n
226 * else RGBA (0,0,0,0) if an error occurs
227 * @param[in] status The status of the button item
228 * @exception E_SUCCESS The method is successful.
229 * @remarks The specific error code can be accessed using the GetLastResult() method.
230 * @see SetButtonColor()
232 Tizen::Graphics::Color GetButtonColor(ButtonItemStatus status) const;
236 * Gets the text color of the button item for the specified state.
240 * @return The text color of the button item, @n
241 * else RGBA (0,0,0,0) if an error occurs
242 * @param[in] status The status of the button item
243 * @exception E_SUCCESS The method is successful.
244 * @remarks The specific error code can be accessed using the GetLastResult() method.
246 Tizen::Graphics::Color GetButtonTextColor(ButtonItemStatus status) const;
250 * Gets the description text of the %Header control that has the title style.
254 * @return The description text, @n
255 * else an empty string if an error occurs
256 * @exception E_SUCCESS The method is successful.
257 * @remarks The specific error code can be accessed using the GetLastResult() method.
259 Tizen::Base::String GetDescriptionText(void) const;
263 * Gets the description text color of the %Header control that has the title style.
267 * @return The description text color, @n
268 * else RGBA (0,0,0,0) if an error occurs
269 * @exception E_SUCCESS The method is successful.
270 * @remarks The specific error code can be accessed using the GetLastResult() method.
272 Tizen::Graphics::Color GetDescriptionTextColor(void) const;
276 * Gets the color of the header item for the specified item state.
280 * @return The color of the item, @n
281 * else RGBA (0,0,0,0) if an error occurs
282 * @param[in] status The item status
283 * @exception E_SUCCESS The method is successful.
284 * @remarks The specific error code can be accessed using the GetLastResult() method.
285 * @see SetItemColor()
287 Tizen::Graphics::Color GetItemColor(HeaderItemStatus status) const;
291 * Gets the total number of header items.
295 * @return The total number of header items, @n
296 * else @c -1 if an error occurs
297 * @exception E_SUCCESS The method is successful.
298 * @remarks The specific error code can be accessed using the GetLastResult() method.
300 int GetItemCount(void) const;
304 * Gets the state of the specified header item.
308 * @return The item status
309 * @param[in] itemIndex The index of the item
310 * @param[out] status The item status
311 * @exception E_SUCCESS The method is successful.
312 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
313 * The index is greater than or equal to the number of elements or less than @c 0.
315 result GetItemStatus(int itemIndex, HeaderItemStatus& status) const;
319 * Gets the text color of the header item for the specified item state.
323 * @return The item's text color, @n
324 * else RGBA (0,0,0,0) if an error occurs
325 * @param[in] status The item status
326 * @exception E_SUCCESS The method is successful.
327 * @remarks The specific error code can be accessed using the GetLastResult() method.
329 Tizen::Graphics::Color GetItemTextColor(HeaderItemStatus status) const;
333 * Gets the style of the %Header control.
337 * @return The %Header control style, @n
338 * else @c HEADER_STYLE_TITLE if an error occurs
339 * @exception E_SUCCESS The method is successful.
340 * @remarks The specific error code can be accessed using the GetLastResult() method.
342 HeaderStyle GetStyle(void) const;
346 * Gets the index of the currently selected item.
350 * @return The selected item index, @n
351 * else @c -1 if an error occurs
352 * @exception E_SUCCESS The method is successful.
353 * @exception E_UNSUPPORTED_OPERATION This operation is supported when the style of the %Header control is @c HEADER_STYLE_SEGMENTED, @n
354 * @c HEADER_STYLE_SEGMENTED_WITH_TITLE, @c HEADER_STYLE_TAB or @c HEADER_STYLE_TAB_WITH_TITLE.
355 * @remarks The specific error code can be accessed using the GetLastResult() method.
357 int GetSelectedItemIndex(void) const;
361 * Gets the title text of the %Header control that has the title style.
365 * @return The title text, @n
366 * else an empty string if an error occurs
367 * @exception E_SUCCESS The method is successful.
368 * @remarks The specific error code can be accessed using the GetLastResult() method.
370 Tizen::Base::String GetTitleText(void) const;
374 * Gets the title text color of the %Header control that has the title style.
378 * @return The title text color, @n
379 * else RGBA (0,0,0,0) if an error occurs
380 * @exception E_SUCCESS The method is successful.
381 * @remarks The specific error code can be accessed using the GetLastResult() method.
383 Tizen::Graphics::Color GetTitleTextColor(void) const;
387 * Gets the color of the %Header control.
391 * @return The header color, @n
392 * else RGBA (0,0,0,0) if an error occurs
393 * @exception E_SUCCESS The method is successful.
394 * @remarks The specific error code can be accessed using the GetLastResult() method.
396 Tizen::Graphics::Color GetColor(void) const;
400 * Gets the status of the waiting animation at the specified position.
404 * @return The animation status
405 * @param[in] animationPos The waiting animation position
406 * @exception E_SUCCESS The method is successful.
407 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
408 * This method returns @c ANIMATION_STOPPED, if no animation is in progress at the specified position.
409 * @see PauseWaitingAnimation()
410 * @see PlayWaitingAnimation()
411 * @see StopWaitingAnimation()
413 AnimationStatus GetWaitingAnimationStatus(HeaderAnimationPosition animationPos) const;
417 * Pauses the waiting animation at the specified position.
421 * @return An error code
422 * @param[in] animationPos The waiting animation position
423 * @exception E_SUCCESS The method is successful.
424 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
425 * No waiting animation is in progress at the specified position.
426 * @exception E_SYSTEM A system error has occurred.
427 * @see PlayWaitingAnimation()
428 * @see StopWaitingAnimation()
430 result PauseWaitingAnimation(HeaderAnimationPosition animationPos);
434 * Starts the waiting animation at the specified position.
438 * @return An error code
439 * @param[in] animationPos The waiting animation position
440 * @exception E_SUCCESS The method is successful.
441 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
442 * There is no button set at the specified position (except for @c HEADER_ANIMATION_POSITION_TITLE).
443 * @exception E_SYSTEM A system error has occurred.
446 * @see GetWaitingAnimationStatus()
447 * @see PauseWaitingAnimation()
448 * @see StopWaitingAnimation()
450 result PlayWaitingAnimation(HeaderAnimationPosition animationPos);
454 * Removes all the button items.
458 * @return An error code
459 * @exception E_SUCCESS The method is successful.
460 * @exception E_SYSTEM A system error has occurred.
462 result RemoveAllButtons(void);
466 * Removes all the %Header control items.
470 * @return An error code
471 * @exception E_SUCCESS The method is successful.
472 * @exception E_SYSTEM A system error has occurred.
473 * @remarks The left button, right button, and back button items are not removed.
475 result RemoveAllItems(void);
479 * Removes the item at the specified index.
483 * @return An error code
484 * @param[in] itemIndex The index of the item to remove
485 * @exception E_SUCCESS The method is successful.
486 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
487 * The index is greater than or equal to the number of elements or less than @c 0.
488 * @exception E_SYSTEM A system error has occurred.
490 result RemoveItemAt(int itemIndex);
494 * Removes the button item at the specified position.
498 * @return An error code
499 * @param[in] position The position of the button item to remove
500 * @exception E_SUCCESS The method is successful.
501 * @exception E_SYSTEM A system error has occurred.
502 * @remarks If no button item is set at the specified position, the method returns @c E_SUCCESS.
504 result RemoveButtonAt(ButtonPosition position);
508 * Sets the background bitmap image.
512 * @return An error code
513 * @param[in] pBitmap The background image
514 * @exception E_SUCCESS The method is successful.
515 * @exception E_SYSTEM A system error has occurred.
517 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
521 * Sets the button item at the specified position.
525 * @return An error code
526 * @param[in] position The position at which to set the specified button item
527 * @param[in] button The button item to set
528 * @exception E_SUCCESS The method is successful.
529 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
530 * The specified item is not constructed.
531 * @exception E_SYSTEM A system error has occurred.
532 * @remarks If there is an existing button item at the specified position, it is replaced with a new item. @n
533 * The contents of the specified item are copied.
535 result SetButton(ButtonPosition position, const ButtonItem& button);
539 * Sets the button item color for the specified state.
543 * @return An error code
544 * @param[in] status The status of the button item
545 * @param[in] color The button item color to set
546 * @exception E_SUCCESS The method is successful.
547 * @exception E_SYSTEM A system error has occurred.
548 * @see GetButtonColor()
550 result SetButtonColor(ButtonItemStatus status, const Tizen::Graphics::Color& color);
554 * Enables or disables the button item at the specified position.
558 * @return An error code
559 * @param[in] position The button item position
560 * @param[in] enable Set to @c true to enable the specified button item, @n
561 * else @c false to disable
562 * @exception E_SUCCESS The method is successful.
563 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
564 * There is no button set at the specified position.
565 * @exception E_SYSTEM A system error has occurred.
567 result SetButtonEnabled(ButtonPosition position, bool enable);
571 * Sets the text color of the button item for the specified state.
575 * @return An error code
576 * @param[in] status The status of the button item
577 * @param[in] color The button item text color to set
578 * @exception E_SUCCESS The method is successful.
579 * @exception E_SYSTEM A system error has occurred.
581 result SetButtonTextColor(ButtonItemStatus status, const Tizen::Graphics::Color& color);
585 * Sets the badge icon of the specified ButtonItem.
589 * @return An error code
590 * @param[in] position The button item position
591 * @param[in] pBadgeIcon The bitmap for the icon
592 * @exception E_SUCCESS The method is successful.
593 * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n
594 * The operation is not supported when the style of the %Header control is @c HEADER_STYLE_TAB or @c HEADER_STYLE_TAB_WITH_TITLE.
596 result SetButtonBadgeIcon(ButtonPosition position, const Tizen::Graphics::Bitmap* pBadgeIcon);
600 * Sets the numbered badge icon of the specified ButtonItem.
604 * @return An error code
605 * @param[in] position The button item position
606 * @param[in] number The number value that should be displayed as the badge icon
607 * @exception E_SUCCESS The method is successful.
608 * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999.
609 * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n
610 * The operation is not supported when the style of the %Header control is @c HEADER_STYLE_TAB or @c HEADER_STYLE_TAB_WITH_TITLE.
611 * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number.
613 result SetButtonNumberedBadgeIcon(ButtonPosition position, int number);
617 * Sets the contents of the %Header control item at the specified index.
621 * @return An error code
622 * @param[in] itemIndex The index at which to set the specified item
623 * @param[in] item The item to set
624 * @exception E_SUCCESS The method is successful.
625 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
626 * The index is greater than or equal to the number of elements or less than @c 0.
627 * @exception E_INVALID_ARG A specified input parameter is invalid.
628 * @exception E_SYSTEM A system error has occurred.
629 * @remarks The contents of the specified item are copied.
631 result SetItemAt(int itemIndex, const HeaderItem& item);
635 * Sets the badge icon of the specified segmented style header item.
639 * @return An error code
640 * @param[in] itemIndex The item index
641 * @param[in] pBadgeIcon The bitmap for the icon
642 * @exception E_SUCCESS The method is successful.
643 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
644 * The index is greater than or equal to the number of elements or less than @c 0.
645 * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the style of the %Header control is @c HEADER_STYLE_TITLE.
646 * @exception E_SYSTEM A system error has occurred.
648 result SetItemBadgeIcon(int itemIndex, const Tizen::Graphics::Bitmap* pBadgeIcon);
652 * Sets the numbered badge icon of the specified segmented style header item.
656 * @return An error code
657 * @param[in] itemIndex The item index
658 * @param[in] number The number value that should be displayed as the badge icon
659 * @exception E_SUCCESS The method is successful.
660 * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999.
661 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
662 * The index is greater than or equal to the number of elements or less than @c 0.
663 * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the style of the %Header control is @c HEADER_STYLE_TITLE.
664 * @exception E_SYSTEM A system error has occurred.
665 * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number.
667 result SetItemNumberedBadgeIcon(int itemIndex, int number);
671 * Sets the item color for the specified state.
675 * @return An error code
676 * @param[in] status The item status
677 * @param[in] color The item color to set
678 * @exception E_SUCCESS The method is successful.
679 * @exception E_SYSTEM A system error has occurred.
680 * @see GetItemColor()
682 result SetItemColor(HeaderItemStatus status, const Tizen::Graphics::Color& color);
686 * Sets the item state at the specified index in the %Header control.
690 * @return An error code
691 * @param[in] itemIndex The index of the item to set
692 * @param[in] enable Set to @c true to enable the item state, @n
694 * @exception E_SUCCESS The method is successful.
695 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
696 * The index is greater than or equal to the number of elements or less than @c 0.
697 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
698 * The specified item is currently selected.
699 * @exception E_SYSTEM A system error has occurred.
701 result SetItemEnabled(int itemIndex, bool enable);
705 * Sets the item text color for the specified state.
709 * @return An error code
710 * @param[in] status The item status
711 * @param[in] color The item text color to set
712 * @exception E_SUCCESS The method is successful.
713 * @exception E_SYSTEM A system error has occurred.
715 result SetItemTextColor(HeaderItemStatus status, const Tizen::Graphics::Color& color);
719 * Sets the selected item at the specified index.
723 * @return An error code
724 * @param[in] itemIndex The index of the item to select
725 * @exception E_SUCCESS The method is successful.
726 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
727 * The index is greater than or equal to the number of elements or less than @c 0.
728 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
729 * The item at the specified index is disabled.
730 * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the %Header control style is @c HEADER_STYLE_TITLE, @n
731 * @c HEADER_STYLE_TITLE_BUTTON or @c HEADER_STYLE_BUTTON.
732 * @exception E_SYSTEM A system error has occurred.
734 result SetItemSelected(int itemIndex);
738 * Sets the color of the %Header control.
742 * @return An error code
743 * @param[in] color The header color
744 * @exception E_SUCCESS The method is successful.
746 result SetColor(const Tizen::Graphics::Color& color);
750 * Sets the style of the %Header control.
754 * @return An error code
755 * @param[in] style The header style to set
756 * @exception E_SUCCESS The method is successful.
757 * @exception E_SYSTEM A system error has occurred.
758 * @remarks All items and buttons will be removed if the style is changed.
760 result SetStyle(HeaderStyle style);
764 * Sets the title icon of the %Header control that has the title style.
768 * @return An error code
769 * @param[in] pIcon The title icon to set @n
770 * Set to @c null to remove the title icon.
771 * @exception E_SUCCESS The method is successful.
772 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style is @c HEADER_STYLE_TITLE, @n
773 * @c HEADER_STYLE_SEGMENTED_WITH_TITLE or @c HEADER_STYLE_TAB_WITH_TITLE.
774 * @exception E_SYSTEM A system error has occurred.
776 result SetTitleIcon(const Tizen::Graphics::Bitmap* pIcon);
780 * Sets the title text of the %Header control.
784 * @return An error code
785 * @param[in] text The text to set
786 * @exception E_SUCCESS The method is successful.
787 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style is @c HEADER_STYLE_TITLE, @n
788 * @c HEADER_STYLE_SEGMENTED_WITH_TITLE or @c HEADER_STYLE_TAB_WITH_TITLE.
789 * @exception E_SYSTEM A system error has occurred.
790 * @remarks If the text cannot be displayed in a line, then the ellipsis is applied at the end. @n
791 * When the title icon is set along with the title text, the title retains the left alignment.
793 result SetTitleText(const Tizen::Base::String& text);
797 * Sets the title text color.
801 * @return An error code
802 * @param[in] color The title text color to set
803 * @exception E_SUCCESS The method is successful.
804 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style is @c HEADER_STYLE_TITLE, @n
805 * @c HEADER_STYLE_SEGMENTED_WITH_TITLE or @c HEADER_STYLE_TAB_WITH_TITLE.
806 * @exception E_SYSTEM A system error has occurred.
808 result SetTitleTextColor(const Tizen::Graphics::Color& color);
812 * Sets the description text.
816 * @return An error code
817 * @param[in] text The text to set
818 * @exception E_SUCCESS The method is successful.
819 * @exception E_UNSUPPORTED_OPERATION The current state of the instance does not support the execution of the specified operation. @n
820 * The style of the %Header control is not @c HEADER_STYLE_TITLE.
821 * @exception E_SYSTEM A system error has occurred.
822 * @remarks If the text cannot be displayed in a line, then the ellipsis is applied at the end. @n
823 * When the title icon is set along with the title text, the title retains the left alignment.
825 result SetDescriptionText(const Tizen::Base::String& text);
829 * Sets the description text color.
833 * @return An error code
834 * @param[in] color The description text color to set
835 * @exception E_SUCCESS The method is successful.
836 * @exception E_UNSUPPORTED_OPERATION The current state of the instance does not support the execution of the specified operation. @n
837 * The style of the %Header control is not @c HEADER_STYLE_TITLE.
838 * @exception E_SYSTEM A system error has occurred.
840 result SetDescriptionTextColor(const Tizen::Graphics::Color& color);
844 * Stops the waiting animation in progress at the specified position.
848 * @return An error code
849 * @param[in] animationPos The waiting animation position
850 * @exception E_SUCCESS The method is successful.
851 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
852 * @exception E_SYSTEM A system error has occurred.
853 * @remarks This method returns @c E_INVALID_OPERATION if no waiting animation is in progress at the specified position.
854 * @see GetWaitingAnimationStatus()
855 * @see PauseWaitingAnimation()
856 * @see PlayWaitingAnimation()
858 result StopWaitingAnimation(HeaderAnimationPosition animationPos);
862 * Adds an IActionEventListener instance. @n
863 * OnActionPerformed() of the added listener is called when the user selects an item.
867 * @param[in] listener The event listener to add
869 void AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
873 * Removes an IActionEventListener instance. @n
874 * The removed listener cannot listen to events when they are fired.
878 * @param[in] listener The event listener to remove
880 void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
884 * Checks whether the tab edit mode is enabled.
888 * @return @c true if the tab edit mode is set, @n
891 bool IsTabEditModeEnabled(void) const;
895 * Enables or disables the tab edit mode.
899 * @return An error code
900 * @param[in] enable Set to @c true to enable the edit mode, @n
902 * @exception E_SUCCESS The method is successful.
903 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the style of the %Header control style is @c HEADER_STYLE_TAB @n
904 * or @c HEADER_STYLE_TAB_WITH_TITLE.
906 result SetTabEditModeEnabled(bool enable);
910 * Sets the back button.
914 * @return An error code
915 * @exception E_SUCCESS The method is successful.
916 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
917 * There are more than 2 header items.
918 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the style of the %Header control is @c HEADER_STYLE_BUTTON. @n
919 * This device does not support the software back button.
920 * @remarks When the back button is pressed, OnFormBackRequested() of IFormBackEventListener is called. @n
921 * If the right button is already set, then the button is replaced with the back button.
923 result SetBackButton(void);
927 * Checks whether the back button item is set.
931 * @return @c true if the back button item is set, @n
934 bool IsBackButtonSet(void) const;
938 * Removes the back button item.
943 void RemoveBackButton(void);
947 * Enables or disables the back button.
951 * @return An error code
952 * @param[in] enable Set to @c true to enable the back button, @n
954 * @exception E_SUCCESS The method is successful.
955 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
956 * The back button item is not set.
958 result SetBackButtonEnabled(bool enable);
962 * Gets the state of the back button.
966 * @return The state of the back button, @n
967 * else @c BUTTON_ITEM_STATUS_NORMAL if an error occurs.
968 * @exception E_SUCCESS The method is successful.
969 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
970 * The back button is not set.
971 * @remarks The specific error code can be accessed using the GetLastResult() method.
973 ButtonItemStatus GetBackButtonStatus(void) const;
977 * Gets the position and size of the specified button item.
981 * @return The position and size of the button item at the specified position.
982 * @param[in] position The position of the button item
983 * @exception E_SUCCESS The method is successful.
984 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
985 * There is no button set at the specified position.
986 * @remarks The specific error code can be accessed using the GetLastResult() method.
988 Tizen::Graphics::Rectangle GetButtonBounds(ButtonPosition position) const;
991 * Gets the position and size of the specified button item.
995 * @return The position and size of the button item at the specified position.
996 * @param[in] position The position of the button item
997 * @exception E_SUCCESS The method is successful.
998 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
999 * There is no button set at the specified position.
1000 * @remarks The specific error code can be accessed using the GetLastResult() method.
1002 Tizen::Graphics::FloatRectangle GetButtonBoundsF(ButtonPosition position) const;
1005 * Sets the badge icon.
1009 * @return An error code
1010 * @param[in] pBadgeIcon The bitmap for the badge icon
1011 * @exception E_SUCCESS The method is successful.
1012 * @exception E_INVALID_OPERATION This operation is invalid. @n
1013 * The operation is invalid when the style of the %Header control is not @c HEADER_STYLE_TITLE or @c HEADER_STYLE_SEGMENTED_WITH_TITLE or @c HEADER_STYLE_TAB_WITH_TITLE.
1014 * @remarks For icon size details, see <a href="../org.tizen.native.appprogramming/html/guide/ui/control_icon_size.htm">here</a>.
1016 result SetTitleBadgeIcon(const Tizen::Graphics::Bitmap* pBadgeIcon);
1019 * Sets the numbered badge icon.
1023 * @return An error code
1024 * @param[in] number The number value that should be displayed as the badge icon
1025 * @exception E_SUCCESS The method is successful.
1026 * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999.
1027 * @exception E_INVALID_OPERATION This operation is invalid. @n
1028 * The operation is invalid when the style of the %Header control is not @c HEADER_STYLE_TITLE or @c HEADER_STYLE_SEGMENTED_WITH_TITLE TITLE or @c HEADER_STYLE_TAB_WITH_TITLE.
1029 * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number.
1031 result SetTitleNumberedBadgeIcon(int number);
1036 //This method is for internal use only. Using this method can cause behavioral, security-related,
1037 //and consistency-related issues in the application.
1039 // This is the default constructor for this class.
1047 //This method is for internal use only. Using this method can cause behavioral, security-related,
1048 //and consistency-related issues in the application.
1050 // This is the destructor for this class.
1054 virtual ~Header(void);
1059 //This method is for internal use only. Using this method can cause behavioral, security-related,
1060 //and consistency-related issues in the application.
1062 // Initializes this instance of %Header with the specified parameter.
1065 // @return An error code
1066 // @exception E_SUCCESS The method is successful.
1067 // @exception E_SYSTEM A system error has occurred.
1069 result Construct(void);
1071 Header(const Header& rhs);
1072 Header& operator =(const Header& rhs);
1075 friend class _FormImpl;
1076 friend class _HeaderImpl;
1080 }}} // Tizen::Ui::Controls
1082 #endif // _FUI_CTRL_HEADER_H_