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 FUiCtrlGroupItem.h
20 * @brief This is the header file for the %GroupItem class.
22 * This header file contains the declarations of the %GroupItem class and its helper classes.
25 #ifndef _FUI_CTRL_GROUP_ITEM_H_
26 #define _FUI_CTRL_GROUP_ITEM_H_
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpFloatRectangle.h>
32 #include <FGrpRectangle.h>
33 #include <FUiCtrlListItemBase.h>
35 namespace Tizen { namespace Ui { namespace Controls
42 * @brief This class defines common behavior of %GroupItem.
46 * The %GroupItem class displays a group item. The basic layout of the %GroupItem instance is text and a bitmap arranged horizontally in one line. The bitmap can be omitted while text must be given.
48 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
51 class _OSP_EXPORT_ GroupItem
52 : public Tizen::Base::Object
56 * The object is not fully constructed after this constructor is
57 * called. For full construction, the Construct() method must be
58 * called right after calling this constructor.
65 * This destructor overrides Tizen::Base::Object::~Object().
69 virtual ~GroupItem(void);
72 * Initializes this instance of %GroupItem with the specified parameter.
76 * @return An error code
77 * @param[in] itemSize The size of the item
78 * @exception E_SUCCESS The method is successful.
79 * @exception E_SYSTEM A system error has occurred.
81 result Construct(const Tizen::Graphics::Dimension& itemSize);
84 * Initializes this instance of %GroupItem with the specified parameter.
88 * @return An error code
89 * @param[in] itemSize The size of the item
90 * @exception E_SUCCESS The method is successful.
91 * @exception E_SYSTEM A system error has occurred.
93 result Construct(const Tizen::Graphics::FloatDimension& itemSize);
96 * Sets the background image of the item.
100 * @return An error code
101 * @param[in] pBitmap The background bitmap image
102 * @exception E_SUCCESS The method is successful.
103 * @exception E_SYSTEM A system error has occurred.
104 * @remarks The background bitmap has priority over the background color. When both the background bitmap and background color are specified, only
105 * the bitmap is displayed.
107 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
110 * Sets the background color of the item.
114 * @return An error code
115 * @param[in] color The background color
116 * @exception E_SUCCESS The method is successful.
117 * @exception E_SYSTEM A system error has occurred.
118 * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only the bitmap is displayed. @n
119 * The background color of the item is not applied when the item is inserted into the GroupedListView of section style.
121 result SetBackgroundColor(const Tizen::Graphics::Color& color);
124 * Gets the background color of the item.
128 * @return The background color of the item, @n
129 * else RGBA(0, 0, 0, 0) if an error occurs
130 * @see SetBackgroundColor()
132 Tizen::Graphics::Color GetBackgroundColor(void) const;
135 * Sets the color of the text.
139 * @return An error code
140 * @param[in] color The text color
141 * @exception E_SUCCESS The method is successful.
142 * @exception E_SYSTEM A system error has occurred.
143 * @see GetTextColor()
145 result SetTextColor(const Tizen::Graphics::Color& color);
148 * Gets the color of the text.
152 * @return The text color, @n
153 * else RGBA(0, 0, 0, 0) if an error occurs
154 * @see SetTextColor()
156 Tizen::Graphics::Color GetTextColor(void) const;
159 * Sets the size of the text.
163 * @return An error code
164 * @param[in] size The size of the text
165 * @exception E_SUCCESS The method is successful.
166 * @exception E_INVALID_ARG The specified input parameter is invalid.
167 * @exception E_SYSTEM A system error has occurred.
170 result SetTextSize(int size);
173 * Sets the size of the text.
177 * @return An error code
178 * @param[in] size The size of the text
179 * @exception E_SUCCESS The method is successful.
180 * @exception E_INVALID_ARG The specified input parameter is invalid.
181 * @exception E_SYSTEM A system error has occurred.
184 result SetTextSize(float size);
187 * Gets the size of the text.
191 * @return The size of the text,
192 * else @c -1 if an error occurs
196 int GetTextSize(void) const;
199 * Gets the size of the text.
203 * @return The size of the text,
204 * else @c -1.0f if an error occurs
208 float GetTextSizeF(void) const;
211 * Sets the text and bitmap of the element for %GroupItem.
215 * @return An error code
216 * @param[in] text The text string to be added
217 * @param[in] pBitmap The bitmap to be displayed
219 * @exception E_SUCCESS The method is successful.
220 * @exception E_SYSTEM A system error has occurred.
221 * @remarks The behavior of %GroupItem is different according to the style of GroupedListView. @n
222 * When the style is GROUPED_LIST_VIEW_INDEXED, the text and bitmap of %GroupItem are displayed, if they are given. However, when the style
223 * is GROUPED_LIST_VIEW_STYLE_SECTION, the bitmap is not displayed in any case and setting an empty text to %GroupItem does not show
226 result SetElement(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null);
229 friend class _GroupItemImpl;
233 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
235 GroupItem(const GroupItem& rhs);
238 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
240 GroupItem& operator =(const GroupItem& rhs);
243 _GroupItemImpl* _pImpl;
246 }}} // Tizen::Ui::Controls
248 #endif // _FUI_CTRL_GROUP_ITEM_H_