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 FUiCtrlHeaderItem.h
20 * @brief This is the header file for the %HeaderItem class.
22 * This header file contains the declarations of the %HeaderItem class.
24 #ifndef _FUI_CTRL_HEADER_ITEM_H_
25 #define _FUI_CTRL_HEADER_ITEM_H_
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FBaseTypes.h>
30 #include <FGrpBitmap.h>
32 namespace Tizen { namespace Ui { namespace Controls
35 * @enum HeaderItemStatus
37 * Defines the possible statuses of a %HeaderItem control.
43 HEADER_ITEM_STATUS_NORMAL, /**< The normal status */
44 HEADER_ITEM_STATUS_PRESSED, /**< The pressed status */
45 HEADER_ITEM_STATUS_SELECTED, /**< The selected status */
46 HEADER_ITEM_STATUS_HIGHLIGHTED, /**< The highlighted status */
47 HEADER_ITEM_STATUS_DISABLED /**< The disabled status */
52 * @brief This class is an implementation of a %HeaderItem control.
56 * The %HeaderItem class is a helper class that specifies the properties of the Header item.
58 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_header.htm">Header</a>.
60 class _OSP_EXPORT_ HeaderItem
61 : public Tizen::Base::Object
66 * This is the default constructor for this class.
74 * This is the destructor for this class.
78 virtual ~HeaderItem(void);
82 * Initializes this instance of %HeaderItem with the specified parameters.
86 * @return An error code
87 * @param[in] actionId The action ID of this item
88 * @exception E_SUCCESS The method is successful.
89 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
90 * The action ID of the specified item must be a positive integer.
92 result Construct(int actionId);
96 * Gets the action ID of the %HeaderItem control.
100 * @return The action ID, @n
101 * else @c -1 if an error occurs
102 * @exception E_SUCCESS The method is successful.
103 * @remarks The specific error code can be accessed using the GetLastResult() method.
105 int GetActionId(void) const;
109 * Gets the text of the %HeaderItem control.
113 * @return The item text, @n
114 * else an empty string if an error occurs
115 * @exception E_SUCCESS The method is successful.
116 * @remarks The specific error code can be accessed using the GetLastResult() method.
118 Tizen::Base::String GetText(void) const;
122 * Sets the action ID of the %HeaderItem control.
126 * @return An error code
127 * @param[in] actionId The specified action ID for this item
128 * @exception E_SUCCESS The method is successful.
129 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
130 * The action ID of the specified item must be a positive integer.
132 result SetActionId(int actionId);
136 * Sets the background bitmap of the %HeaderItem control.
140 * @return An error code
141 * @param[in] status The item status
142 * @param[in] pBitmap The background bitmap to set, @n
143 * else @c null if no bitmap is displayed
144 * @exception E_SUCCESS The method is successful.
145 * @remarks If the size of the bitmap is greater than the size of the item, the bitmap is scaled down.
147 result SetBackgroundBitmap(HeaderItemStatus status, const Tizen::Graphics::Bitmap* pBitmap);
151 * Sets the icon of the header item.
155 * @return An error code
156 * @param[in] status The status of the header item
157 * @param[in] pIcon The icon to set, @n
158 * else @c null if no icon is set
159 * @exception E_SUCCESS The method is successful.
161 * - If the size of the bitmap is greater than the default size, the bitmap is scaled down.
162 * - The bitmap specified for the @c HEADER_ITEM_STATUS_NORMAL will be applied for all other statuses unless different bitmaps
163 * are explicitly set for those by using this method.
164 * - Note that the specified bitmaps are ignored if the style of the Header control is not ::HEADER_STYLE_TITLE_BUTTON. @n
165 * Furthermore, the title button does not support @c HEADER_ITEM_STATUS_SELECTED status and the bitmap for the status is also ignored.
167 result SetIcon(HeaderItemStatus status, const Tizen::Graphics::Bitmap* pIcon);
171 * Sets the text of the %HeaderItem control.
175 * @return An error code
176 * @param[in] text The text to set
177 * @exception E_SUCCESS The method is successful.
179 * - If the text cannot be displayed in a line, then the text is automatically displayed in two lines and the ellipsis is applied if the text
180 * is longer than two lines.
181 * - Use @htmlonly '\n' @endhtmlonly to denote the end of the line.
183 result SetText(const Tizen::Base::String& text);
187 HeaderItem(const HeaderItem& headerItem);
188 HeaderItem& operator =(const HeaderItem& headerItem);
192 friend class _HeaderImpl;
193 friend class _HeaderItemImpl;
195 class _HeaderItemImpl * __pImpl;
199 }}} // Tizen::Ui::Controls
201 #endif // _FUI_CTRL_HEADER_ITEM_H_