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 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
181 * the number of elements or less than @c 0.
182 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
183 * The specified @c item is not constructed.
184 * @exception E_SYSTEM A system error has occurred.
185 * @remarks The %Header control does not throw any exception even though the same action ID is assigned to multiple items. @n
186 * However, the content of the specified item is copied to the %Header control.
188 result InsertItemAt(int itemIndex, const HeaderItem& item);
192 * Checks whether a button item is set at the specified position.
196 * @return @c true if the button item is set at the specified position, @n
198 * @param[in] position The position of the button item
199 * @exception E_SUCCESS The method is successful.
200 * @remarks The specific error code can be accessed using the GetLastResult() method.
202 bool IsButtonSet(ButtonPosition position) const;
206 * Gets the state of the specified button item.
210 * @return The state of the button item at the specified position, @n
211 * else @c BUTTON_ITEM_STATUS_NORMAL if an error occurs
212 * @param[in] position The position of the button item
213 * @exception E_SUCCESS The method is successful.
214 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
215 * There is no button set at the specified position.
216 * @remarks The specific error code can be accessed using the GetLastResult() method.
218 ButtonItemStatus GetButtonStatus(ButtonPosition position) const;
222 * Gets the color of the button item for the specified state.
226 * @return The color of the button item, @n
227 * else RGBA (0,0,0,0) if an error occurs
228 * @param[in] status The status of the button item
229 * @exception E_SUCCESS The method is successful.
230 * @remarks The specific error code can be accessed using the GetLastResult() method.
231 * @see SetButtonColor()
233 Tizen::Graphics::Color GetButtonColor(ButtonItemStatus status) const;
237 * Gets the text color of the button item for the specified state.
241 * @return The text color of the button item, @n
242 * else RGBA (0,0,0,0) if an error occurs
243 * @param[in] status The status of the button item
244 * @exception E_SUCCESS The method is successful.
245 * @remarks The specific error code can be accessed using the GetLastResult() method.
247 Tizen::Graphics::Color GetButtonTextColor(ButtonItemStatus status) const;
251 * Gets the description text of the %Header control that has the title style.
255 * @return The description text, @n
256 * else an empty string if an error occurs
257 * @exception E_SUCCESS The method is successful.
258 * @remarks The specific error code can be accessed using the GetLastResult() method.
260 Tizen::Base::String GetDescriptionText(void) const;
264 * Gets the description text color of the %Header control that has the title style.
268 * @return The description text color, @n
269 * else RGBA (0,0,0,0) if an error occurs
270 * @exception E_SUCCESS The method is successful.
271 * @remarks The specific error code can be accessed using the GetLastResult() method.
273 Tizen::Graphics::Color GetDescriptionTextColor(void) const;
277 * Gets the color of the header item for the specified item state.
281 * @return The color of the item, @n
282 * else RGBA (0,0,0,0) if an error occurs
283 * @param[in] status The item status
284 * @exception E_SUCCESS The method is successful.
285 * @remarks The specific error code can be accessed using the GetLastResult() method.
286 * @see SetItemColor()
288 Tizen::Graphics::Color GetItemColor(HeaderItemStatus status) const;
292 * Gets the total number of header items.
296 * @return The total number of header items, @n
297 * else @c -1 if an error occurs
298 * @exception E_SUCCESS The method is successful.
299 * @remarks The specific error code can be accessed using the GetLastResult() method.
301 int GetItemCount(void) const;
305 * Gets the state of the specified header item.
309 * @return The item status
310 * @param[in] itemIndex The index of the item
311 * @param[out] status The item status
312 * @exception E_SUCCESS The method is successful.
313 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
314 * The index is greater than or equal to the number of elements or less than @c 0.
316 result GetItemStatus(int itemIndex, HeaderItemStatus& status) const;
320 * Gets the text color of the header item for the specified item state.
324 * @return The item's text color, @n
325 * else RGBA (0,0,0,0) if an error occurs
326 * @param[in] status The item status
327 * @exception E_SUCCESS The method is successful.
328 * @remarks The specific error code can be accessed using the GetLastResult() method.
330 Tizen::Graphics::Color GetItemTextColor(HeaderItemStatus status) const;
334 * Gets the style of the %Header control.
338 * @return The %Header control style, @n
339 * else @c HEADER_STYLE_TITLE if an error occurs
340 * @exception E_SUCCESS The method is successful.
341 * @remarks The specific error code can be accessed using the GetLastResult() method.
343 HeaderStyle GetStyle(void) const;
347 * Gets the index of the currently selected item.
351 * @return The selected item index, @n
352 * else @c -1 if an error occurs
353 * @exception E_SUCCESS The method is successful.
354 * @exception E_UNSUPPORTED_OPERATION This operation is supported when the style of the %Header control is
355 * ::HEADER_STYLE_SEGMENTED, @n ::HEADER_STYLE_SEGMENTED_WITH_TITLE,
356 ::HEADER_STYLE_TAB or ::HEADER_STYLE_TAB_WITH_TITLE.
357 * @remarks The specific error code can be accessed using the GetLastResult() method.
359 int GetSelectedItemIndex(void) const;
363 * Gets the title text of the %Header control that has the title style.
367 * @return The title text, @n
368 * else an empty string if an error occurs
369 * @exception E_SUCCESS The method is successful.
370 * @remarks The specific error code can be accessed using the GetLastResult() method.
372 Tizen::Base::String GetTitleText(void) const;
376 * Gets the title text color of the %Header control that has the title style.
380 * @return The title text color, @n
381 * else RGBA (0,0,0,0) if an error occurs
382 * @exception E_SUCCESS The method is successful.
383 * @remarks The specific error code can be accessed using the GetLastResult() method.
385 Tizen::Graphics::Color GetTitleTextColor(void) const;
389 * Gets the color of the %Header control.
393 * @return The header color, @n
394 * else RGBA (0,0,0,0) if an error occurs
395 * @exception E_SUCCESS The method is successful.
396 * @remarks The specific error code can be accessed using the GetLastResult() method.
398 Tizen::Graphics::Color GetColor(void) const;
402 * Gets the status of the waiting animation at the specified position.
406 * @return The animation status
407 * @param[in] animationPos The waiting animation position
408 * @exception E_SUCCESS The method is successful.
409 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
410 * This method returns @c ANIMATION_STOPPED, if no animation is in progress at the specified position.
411 * @see PauseWaitingAnimation()
412 * @see PlayWaitingAnimation()
413 * @see StopWaitingAnimation()
415 AnimationStatus GetWaitingAnimationStatus(HeaderAnimationPosition animationPos) const;
419 * Pauses the waiting animation at the specified position.
423 * @return An error code
424 * @param[in] animationPos The waiting animation position
425 * @exception E_SUCCESS The method is successful.
426 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
427 * No waiting animation is in progress at the specified position.
428 * @exception E_SYSTEM A system error has occurred.
429 * @see PlayWaitingAnimation()
430 * @see StopWaitingAnimation()
432 result PauseWaitingAnimation(HeaderAnimationPosition animationPos);
436 * Starts the waiting animation at the specified position.
440 * @return An error code
441 * @param[in] animationPos The waiting animation position
442 * @exception E_SUCCESS The method is successful.
443 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
444 * There is no button set at the specified position (except for @c HEADER_ANIMATION_POSITION_TITLE).
445 * @exception E_SYSTEM A system error has occurred.
448 * @see GetWaitingAnimationStatus()
449 * @see PauseWaitingAnimation()
450 * @see StopWaitingAnimation()
452 result PlayWaitingAnimation(HeaderAnimationPosition animationPos);
456 * Removes all the button items.
460 * @return An error code
461 * @exception E_SUCCESS The method is successful.
462 * @exception E_SYSTEM A system error has occurred.
464 result RemoveAllButtons(void);
468 * Removes all the %Header control items.
472 * @return An error code
473 * @exception E_SUCCESS The method is successful.
474 * @exception E_SYSTEM A system error has occurred.
475 * @remarks The left button, right button, and back button items are not removed.
477 result RemoveAllItems(void);
481 * Removes the item at the specified index.
485 * @return An error code
486 * @param[in] itemIndex The index of the item to remove
487 * @exception E_SUCCESS The method is successful.
488 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
489 * The index is greater than or equal to the number of elements or less than @c 0.
490 * @exception E_SYSTEM A system error has occurred.
492 result RemoveItemAt(int itemIndex);
496 * Removes the button item at the specified position.
500 * @return An error code
501 * @param[in] position The position of the button item to remove
502 * @exception E_SUCCESS The method is successful.
503 * @exception E_SYSTEM A system error has occurred.
504 * @remarks If no button item is set at the specified position, the method returns @c E_SUCCESS.
506 result RemoveButtonAt(ButtonPosition position);
510 * Sets the background bitmap image.
514 * @return An error code
515 * @param[in] pBitmap The background image
516 * @exception E_SUCCESS The method is successful.
517 * @exception E_SYSTEM A system error has occurred.
519 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
523 * Sets the button item at the specified position.
527 * @return An error code
528 * @param[in] position The position at which to set the specified button item
529 * @param[in] button The button item to set
530 * @exception E_SUCCESS The method is successful.
531 * @exception E_INVALID_ARG A specified input parameter is invalid. @n
532 * The specified item is not constructed.
533 * @exception E_SYSTEM A system error has occurred.
534 * @remarks If there is an existing button item at the specified position, it is replaced with a new item. @n
535 * The contents of the specified item are copied.
537 result SetButton(ButtonPosition position, const ButtonItem& button);
541 * Sets the button item color for the specified state.
545 * @return An error code
546 * @param[in] status The status of the button item
547 * @param[in] color The button item color to set
548 * @exception E_SUCCESS The method is successful.
549 * @exception E_SYSTEM A system error has occurred.
550 * @see GetButtonColor()
552 result SetButtonColor(ButtonItemStatus status, const Tizen::Graphics::Color& color);
556 * Enables or disables the button item at the specified position.
560 * @return An error code
561 * @param[in] position The button item position
562 * @param[in] enable Set to @c true to enable the specified button item, @n
563 * else @c false to disable
564 * @exception E_SUCCESS The method is successful.
565 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
566 * There is no button set at the specified position.
567 * @exception E_SYSTEM A system error has occurred.
569 result SetButtonEnabled(ButtonPosition position, bool enable);
573 * Sets the text color of the button item for the specified state.
577 * @return An error code
578 * @param[in] status The status of the button item
579 * @param[in] color The button item text color to set
580 * @exception E_SUCCESS The method is successful.
581 * @exception E_SYSTEM A system error has occurred.
583 result SetButtonTextColor(ButtonItemStatus status, const Tizen::Graphics::Color& color);
587 * Sets the badge icon of the specified ButtonItem.
591 * @return An error code
592 * @param[in] position The button item position
593 * @param[in] pBadgeIcon The bitmap for the icon
594 * @exception E_SUCCESS The method is successful.
595 * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n
596 * The operation is not supported when the style of the %Header control is ::HEADER_STYLE_TAB or ::HEADER_STYLE_TAB_WITH_TITLE.
598 result SetButtonBadgeIcon(ButtonPosition position, const Tizen::Graphics::Bitmap* pBadgeIcon);
602 * Sets the numbered badge icon of the specified ButtonItem.
606 * @return An error code
607 * @param[in] position The button item position
608 * @param[in] number The number value that should be displayed as the badge icon
609 * @exception E_SUCCESS The method is successful.
610 * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999.
611 * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n
612 * The operation is not supported when the style of the %Header control is ::HEADER_STYLE_TAB or ::HEADER_STYLE_TAB_WITH_TITLE.
613 * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number.
615 result SetButtonNumberedBadgeIcon(ButtonPosition position, int number);
619 * Sets the contents of the %Header control item at the specified index.
623 * @return An error code
624 * @param[in] itemIndex The index at which to set the specified item
625 * @param[in] item The item to set
626 * @exception E_SUCCESS The method is successful.
627 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
628 * The index is greater than or equal to the number of elements or less than @c 0.
629 * @exception E_INVALID_ARG A specified input parameter is invalid.
630 * @exception E_SYSTEM A system error has occurred.
631 * @remarks The contents of the specified item are copied.
633 result SetItemAt(int itemIndex, const HeaderItem& item);
637 * Sets the badge icon of the specified segmented style header item.
641 * @return An error code
642 * @param[in] itemIndex The item index
643 * @param[in] pBadgeIcon The bitmap for the icon
644 * @exception E_SUCCESS The method is successful.
645 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
646 * The index is greater than or equal to the number of elements or less than @c 0.
647 * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the style of the %Header control is ::HEADER_STYLE_TITLE.
648 * @exception E_SYSTEM A system error has occurred.
650 result SetItemBadgeIcon(int itemIndex, const Tizen::Graphics::Bitmap* pBadgeIcon);
654 * Sets the numbered badge icon of the specified segmented style header item.
658 * @return An error code
659 * @param[in] itemIndex The item index
660 * @param[in] number The number value that should be displayed as the badge icon
661 * @exception E_SUCCESS The method is successful.
662 * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999.
663 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
664 * The index is greater than or equal to the number of elements or less than @c 0.
665 * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the style of the %Header control is ::HEADER_STYLE_TITLE.
666 * @exception E_SYSTEM A system error has occurred.
667 * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number.
669 result SetItemNumberedBadgeIcon(int itemIndex, int number);
673 * Sets the item color for the specified state.
677 * @return An error code
678 * @param[in] status The item status
679 * @param[in] color The item color to set
680 * @exception E_SUCCESS The method is successful.
681 * @exception E_SYSTEM A system error has occurred.
682 * @see GetItemColor()
684 result SetItemColor(HeaderItemStatus status, const Tizen::Graphics::Color& color);
688 * Sets the item state at the specified index in the %Header control.
692 * @return An error code
693 * @param[in] itemIndex The index of the item to set
694 * @param[in] enable Set to @c true to enable the item state, @n
696 * @exception E_SUCCESS The method is successful.
697 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
698 * The index is greater than or equal to the number of elements or less than @c 0.
699 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
700 * The specified item is currently selected.
701 * @exception E_SYSTEM A system error has occurred.
703 result SetItemEnabled(int itemIndex, bool enable);
707 * Sets the item text color for the specified state.
711 * @return An error code
712 * @param[in] status The item status
713 * @param[in] color The item text color to set
714 * @exception E_SUCCESS The method is successful.
715 * @exception E_SYSTEM A system error has occurred.
717 result SetItemTextColor(HeaderItemStatus status, const Tizen::Graphics::Color& color);
721 * Sets the selected item at the specified index.
725 * @return An error code
726 * @param[in] itemIndex The index of the item to select
727 * @exception E_SUCCESS The method is successful.
728 * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n
729 * The index is greater than or equal to the number of elements or less than @c 0.
730 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
731 * The item at the specified index is disabled.
732 * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the %Header control style is ::HEADER_STYLE_TITLE, @n
733 * ::HEADER_STYLE_TITLE_BUTTON or ::HEADER_STYLE_BUTTON.
734 * @exception E_SYSTEM A system error has occurred.
736 result SetItemSelected(int itemIndex);
740 * Sets the color of the %Header control.
744 * @return An error code
745 * @param[in] color The header color
746 * @exception E_SUCCESS The method is successful.
748 result SetColor(const Tizen::Graphics::Color& color);
752 * Sets the style of the %Header control.
756 * @return An error code
757 * @param[in] style The header style to set
758 * @exception E_SUCCESS The method is successful.
759 * @exception E_SYSTEM A system error has occurred.
760 * @remarks All items and buttons will be removed if the style is changed.
762 result SetStyle(HeaderStyle style);
766 * Sets the title icon of the %Header control that has the title style.
770 * @return An error code
771 * @param[in] pIcon The title icon to set @n
772 * Set to @c null to remove the title icon.
773 * @exception E_SUCCESS The method is successful.
774 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style is ::HEADER_STYLE_TITLE, @n
775 * ::HEADER_STYLE_SEGMENTED_WITH_TITLE or ::HEADER_STYLE_TAB_WITH_TITLE.
776 * @exception E_SYSTEM A system error has occurred.
778 result SetTitleIcon(const Tizen::Graphics::Bitmap* pIcon);
782 * Sets the title text of the %Header control.
786 * @return An error code
787 * @param[in] text The text to set
788 * @exception E_SUCCESS The method is successful.
789 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style is ::HEADER_STYLE_TITLE, @n
790 * ::HEADER_STYLE_SEGMENTED_WITH_TITLE or ::HEADER_STYLE_TAB_WITH_TITLE.
791 * @exception E_SYSTEM A system error has occurred.
792 * @remarks If the text cannot be displayed in a line, then the ellipsis is applied at the end. @n
793 * When the title icon is set along with the title text, the title retains the left alignment.
795 result SetTitleText(const Tizen::Base::String& text);
799 * Sets the title text color.
803 * @return An error code
804 * @param[in] color The title text color to set
805 * @exception E_SUCCESS The method is successful.
806 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style is ::HEADER_STYLE_TITLE, @n
807 * ::HEADER_STYLE_SEGMENTED_WITH_TITLE or ::HEADER_STYLE_TAB_WITH_TITLE.
808 * @exception E_SYSTEM A system error has occurred.
810 result SetTitleTextColor(const Tizen::Graphics::Color& color);
814 * Sets the description text.
818 * @return An error code
819 * @param[in] text The text to set
820 * @exception E_SUCCESS The method is successful.
821 * @exception E_UNSUPPORTED_OPERATION The current state of the instance does not support the execution of the specified operation. @n
822 * The style of the %Header control is not ::HEADER_STYLE_TITLE.
823 * @exception E_SYSTEM A system error has occurred.
824 * @remarks If the text cannot be displayed in a line, then the ellipsis is applied at the end. @n
825 * When the title icon is set along with the title text, the title retains the left alignment.
827 result SetDescriptionText(const Tizen::Base::String& text);
831 * Sets the description text color.
835 * @return An error code
836 * @param[in] color The description text color to set
837 * @exception E_SUCCESS The method is successful.
838 * @exception E_UNSUPPORTED_OPERATION The current state of the instance does not support the execution of the specified operation. @n
839 * The style of the %Header control is not ::HEADER_STYLE_TITLE.
840 * @exception E_SYSTEM A system error has occurred.
842 result SetDescriptionTextColor(const Tizen::Graphics::Color& color);
846 * Stops the waiting animation in progress at the specified position.
850 * @return An error code
851 * @param[in] animationPos The waiting animation position
852 * @exception E_SUCCESS The method is successful.
853 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
854 * @exception E_SYSTEM A system error has occurred.
855 * @remarks This method returns @c E_INVALID_OPERATION if no waiting animation is in progress at the specified position.
856 * @see GetWaitingAnimationStatus()
857 * @see PauseWaitingAnimation()
858 * @see PlayWaitingAnimation()
860 result StopWaitingAnimation(HeaderAnimationPosition animationPos);
864 * Adds an IActionEventListener instance. @n
865 * OnActionPerformed() of the added listener is called when the user selects an item.
869 * @param[in] listener The event listener to add
871 void AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
875 * Removes an IActionEventListener instance. @n
876 * The removed listener cannot listen to events when they are fired.
880 * @param[in] listener The event listener to remove
882 void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
886 * Checks whether the tab edit mode is enabled.
890 * @return @c true if the tab edit mode is set, @n
893 bool IsTabEditModeEnabled(void) const;
897 * Enables or disables the tab edit mode.
901 * @return An error code
902 * @param[in] enable Set to @c true to enable the edit mode, @n
904 * @exception E_SUCCESS The method is successful.
905 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the style of the %Header control style is ::HEADER_STYLE_TAB @n
906 * or ::HEADER_STYLE_TAB_WITH_TITLE.
908 result SetTabEditModeEnabled(bool enable);
912 * Sets the back button.
916 * @return An error code
917 * @exception E_SUCCESS The method is successful.
918 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
919 * There are more than 2 header items.
920 * @exception E_UNSUPPORTED_OPERATION The operation is supported when the style of the %Header control is ::HEADER_STYLE_BUTTON. @n
921 * This device does not support the software back button.
922 * @remarks When the back button is pressed, OnFormBackRequested() of IFormBackEventListener is called. @n
923 * If the right button is already set, then the button is replaced with the back button.
925 result SetBackButton(void);
929 * Checks whether the back button item is set.
933 * @return @c true if the back button item is set, @n
936 bool IsBackButtonSet(void) const;
940 * Removes the back button item.
945 void RemoveBackButton(void);
949 * Enables or disables the back button.
953 * @return An error code
954 * @param[in] enable Set to @c true to enable the back button, @n
956 * @exception E_SUCCESS The method is successful.
957 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
958 * The back button item is not set.
960 result SetBackButtonEnabled(bool enable);
964 * Gets the state of the back button.
968 * @return The state of the back button, @n
969 * else @c BUTTON_ITEM_STATUS_NORMAL if an error occurs.
970 * @exception E_SUCCESS The method is successful.
971 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
972 * The back button is not set.
973 * @remarks The specific error code can be accessed using the GetLastResult() method.
975 ButtonItemStatus GetBackButtonStatus(void) const;
979 * Gets the position and size of the specified button item.
983 * @return The position and size of the button item at the specified position.
984 * @param[in] position The position of the button item
985 * @exception E_SUCCESS The method is successful.
986 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
987 * There is no button set at the specified position.
988 * @remarks The specific error code can be accessed using the GetLastResult() method.
990 Tizen::Graphics::Rectangle GetButtonBounds(ButtonPosition position) const;
993 * Gets the position and size of the specified button item.
997 * @return The position and size of the button item at the specified position.
998 * @param[in] position The position of the button item
999 * @exception E_SUCCESS The method is successful.
1000 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1001 * There is no button set at the specified position.
1002 * @remarks The specific error code can be accessed using the GetLastResult() method.
1004 Tizen::Graphics::FloatRectangle GetButtonBoundsF(ButtonPosition position) const;
1007 * Sets the badge icon.
1011 * @return An error code
1012 * @param[in] pBadgeIcon The bitmap for the badge icon
1013 * @exception E_SUCCESS The method is successful.
1014 * @exception E_INVALID_OPERATION This operation is invalid. @n
1015 * The operation is invalid when the style of the %Header control is not ::HEADER_STYLE_TITLE
1016 * or ::HEADER_STYLE_SEGMENTED_WITH_TITLE or ::HEADER_STYLE_TAB_WITH_TITLE.
1017 * @remarks For icon size details, see <a href="../org.tizen.native.appprogramming/html/guide/ui/control_iconsize.htm">here</a>.
1019 result SetTitleBadgeIcon(const Tizen::Graphics::Bitmap* pBadgeIcon);
1022 * Sets the numbered badge icon.
1026 * @return An error code
1027 * @param[in] number The number value that should be displayed as the badge icon
1028 * @exception E_SUCCESS The method is successful.
1029 * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999.
1030 * @exception E_INVALID_OPERATION This operation is invalid. @n
1031 * The operation is invalid when the style of the %Header control is not ::HEADER_STYLE_TITLE
1032 * or ::HEADER_STYLE_SEGMENTED_WITH_TITLE TITLE or ::HEADER_STYLE_TAB_WITH_TITLE.
1033 * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number.
1035 result SetTitleNumberedBadgeIcon(int number);
1040 //This method is for internal use only. Using this method can cause behavioral, security-related,
1041 //and consistency-related issues in the application.
1043 // This is the default constructor for this class.
1051 //This method is for internal use only. Using this method can cause behavioral, security-related,
1052 //and consistency-related issues in the application.
1054 // This is the destructor for this class.
1058 virtual ~Header(void);
1063 //This method is for internal use only. Using this method can cause behavioral, security-related,
1064 //and consistency-related issues in the application.
1066 // Initializes this instance of %Header with the specified parameter.
1069 // @return An error code
1070 // @exception E_SUCCESS The method is successful.
1071 // @exception E_SYSTEM A system error has occurred.
1073 result Construct(void);
1075 Header(const Header& rhs);
1076 Header& operator =(const Header& rhs);
1079 friend class _FormImpl;
1080 friend class _HeaderImpl;
1084 }}} // Tizen::Ui::Controls
1086 #endif // _FUI_CTRL_HEADER_H_