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 FUiCtrlFooterItem.h
20 * @brief This is the header file for the %FooterItem class.
22 * This header file contains the declarations of the %FooterItem class.
24 #ifndef _FUI_CTRL_FOOTER_ITEM_H_
25 #define _FUI_CTRL_FOOTER_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 FooterItemStatus
37 * Defines the possible status of %FooterItem.
43 FOOTER_ITEM_STATUS_NORMAL, /**< The normal state */
44 FOOTER_ITEM_STATUS_PRESSED, /**< The pressed state */
45 FOOTER_ITEM_STATUS_SELECTED, /**< The selected state */
46 FOOTER_ITEM_STATUS_HIGHLIGHTED, /**< The highlighted state */
47 FOOTER_ITEM_STATUS_DISABLED /**< The disabled state */
52 * @brief This class is an implementation of %FooterItem.
56 * The %FooterItem class is a helper class that specifies the contents of the footer item.
58 *For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_footer.htm">Footer</a>.
60 class _OSP_EXPORT_ FooterItem
61 : public Tizen::Base::Object
65 * This is the default constructor for this class.
73 * This is the destructor for this class.
77 virtual ~FooterItem(void);
81 * Initializes this instance of %FooterItem with the specified parameter.
85 * @return An error code
86 * @param[in] actionId The action ID of this item
87 * @exception E_SUCCESS The method is successful.
88 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
89 * The specified @c actionId of the specified item must be a positive integer.
91 result Construct(int actionId);
95 * Gets the action ID of the item.
99 * @return The action ID, @n
100 * else @c -1 if an error occurs
101 * @exception E_SUCCESS The method is successful.
102 * @remarks The specific error code can be accessed using the GetLastResult() method.
104 int GetActionId(void) const;
108 * Gets the text of the footer item.
112 * @return The item text, @n
113 * else an empty string if an error occurs
114 * @exception E_SUCCESS The method is successful.
115 * @remarks The specific error code can be accessed using the GetLastResult() method.
117 Tizen::Base::String GetText(void) const;
121 * Sets the action ID of the footer item.
125 * @return An error code
126 * @param[in] actionId The specified action ID of the footer item
127 * @exception E_SUCCESS The method is successful.
128 * @exception E_INVALID_ARG The specified input parameter is invalid. @n
129 * The specified @c actionId of the specified item must be a positive integer.
131 result SetActionId(int actionId);
135 * Sets the background bitmap of the footer item.
139 * @return An error code
140 * @param[in] status The status of the footer item
141 * @param[in] pBitmap The background bitmap to set, @n
142 * else @c null if no bitmap is displayed.
143 * @exception E_SUCCESS The method is successful.
144 * @remarks If the size of the bitmap is greater than the size of the item, the bitmap is scaled down.
146 result SetBackgroundBitmap(FooterItemStatus status, const Tizen::Graphics::Bitmap* pBitmap);
150 * Sets the icon of the footer item.
154 * @return An error code
155 * @param[in] status The status of the footer item
156 * @param[in] pIcon The icon to set, @n
157 * else @c null if no bitmap is displayed
158 * @exception E_SUCCESS The method is successful.
159 * @remarks If the size of the bitmap is greater than the default icon size, the bitmap is scaled down. @n
160 * The bitmap specified for the @c FOOTER_ITEM_STATUS_NORMAL will be applied for all other statues unless different bitmaps are explicitly
161 * set for those by using this method. @n
162 * Furthermore, the icon button does not support @c FOOTER_ITEM_STATUS_SELECTED status and the bitmap for the status is also ignored.
164 result SetIcon(FooterItemStatus status, const Tizen::Graphics::Bitmap* pIcon);
168 * Sets the text of the footer item.
172 * @return An error code
173 * @param[in] text The text to set
174 * @exception E_SUCCESS The method is successful.
175 * @remarks 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
176 * is longer than two lines. @n
177 * Use @htmlonly '\n' @endhtmlonly to denote the end of the first line.
179 result SetText(const Tizen::Base::String& text);
183 FooterItem(const FooterItem& footerItem);
184 FooterItem& operator =(const FooterItem& footerItem);
187 friend class _FooterImpl;
188 friend class _FooterItemImpl;
190 class _FooterItemImpl* __pImpl;
193 }}} // Tizen::Ui::Controls
195 #endif // _FUI_CTRL_FOOTER_ITEM_H_