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 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.
47 * The bitmap can be omitted while text must be given.
49 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
52 class _OSP_EXPORT_ GroupItem
53 : public Tizen::Base::Object
57 * The object is not fully constructed after this constructor is
58 * called. @n For full construction, the %Construct() method must be
59 * called right after calling this constructor.
66 * This destructor overrides Tizen::Base::Object::~Object().
70 virtual ~GroupItem(void);
73 * Initializes this instance of %GroupItem with the specified parameter.
77 * @return An error code
78 * @param[in] itemSize The size of the item
79 * @exception E_SUCCESS The method is successful.
80 * @exception E_SYSTEM A system error has occurred.
82 result Construct(const Tizen::Graphics::Dimension& itemSize);
85 * Initializes this instance of %GroupItem with the specified parameter.
89 * @return An error code
90 * @param[in] itemSize The size of the item
91 * @exception E_SUCCESS The method is successful.
92 * @exception E_SYSTEM A system error has occurred.
94 result Construct(const Tizen::Graphics::FloatDimension& itemSize);
97 * Sets the background image of the item.
101 * @return An error code
102 * @param[in] pBitmap The background bitmap image
103 * @exception E_SUCCESS The method is successful.
104 * @exception E_SYSTEM A system error has occurred.
105 * @remarks The background bitmap has priority over the background color. When both the background bitmap and background color are
106 * specified, only the bitmap is displayed.
108 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
111 * Sets the background color of the item.
115 * @return An error code
116 * @param[in] color The background color
117 * @exception E_SUCCESS The method is successful.
118 * @exception E_SYSTEM A system error has occurred.
120 * - The background bitmap has priority over the background color. When both the background bitmap and the
121 * background color are specified, only the bitmap is displayed.
122 * - The background color of the item is not applied when the item is inserted into the GroupedListView of section style.
124 result SetBackgroundColor(const Tizen::Graphics::Color& color);
127 * Gets the background color of the item.
131 * @return The background color of the item, @n
132 * else RGBA(0, 0, 0, 0) if an error occurs
133 * @see SetBackgroundColor()
135 Tizen::Graphics::Color GetBackgroundColor(void) const;
138 * Sets the color of the text.
142 * @return An error code
143 * @param[in] color The text color
144 * @exception E_SUCCESS The method is successful.
145 * @exception E_SYSTEM A system error has occurred.
146 * @see GetTextColor()
148 result SetTextColor(const Tizen::Graphics::Color& color);
151 * Gets the color of the text.
155 * @return The text color, @n
156 * else RGBA(0, 0, 0, 0) if an error occurs
157 * @see SetTextColor()
159 Tizen::Graphics::Color GetTextColor(void) const;
162 * Sets the size of the text.
166 * @return An error code
167 * @param[in] size The size of the text
168 * @exception E_SUCCESS The method is successful.
169 * @exception E_INVALID_ARG The specified input parameter is invalid.
170 * @exception E_SYSTEM A system error has occurred.
173 result SetTextSize(int size);
176 * Sets the size of a text.
180 * @return An error code
181 * @param[in] size The size of the text to set
182 * @exception E_SUCCESS The method is successful.
183 * @exception E_INVALID_ARG The specified input parameter is invalid.
184 * @exception E_SYSTEM A system error has occurred.
187 result SetTextSize(float size);
190 * Gets the size of the text.
194 * @return The size of the text,
195 * else @c -1 if an error occurs
199 int GetTextSize(void) const;
202 * Gets the size of a text.
206 * @return The size of a text,
207 * else @c -1.0f if an error occurs
211 float GetTextSizeF(void) const;
214 * Sets the text and bitmap of the element for %GroupItem.
218 * @return An error code
219 * @param[in] text The text string to add
220 * @param[in] pBitmap The bitmap to display
222 * @exception E_SUCCESS The method is successful.
223 * @exception E_SYSTEM A system error has occurred.
225 * - The behavior of %GroupItem is different according to the style of GroupedListView.
226 * - When the style is ::GROUPED_LIST_VIEW_STYLE_INDEXED, the text and bitmap of %GroupItem are displayed,
227 * if they are given. However, when the style is ::GROUPED_LIST_VIEW_STYLE_SECTION, the bitmap is not displayed in any
228 * case and setting an empty text to %GroupItem does not show %GroupItem.
230 result SetElement(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null);
233 friend class _GroupItemImpl;
237 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
239 GroupItem(const GroupItem& rhs);
242 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
244 GroupItem& operator =(const GroupItem& rhs);
247 _GroupItemImpl* _pImpl;
250 }}} // Tizen::Ui::Controls
252 #endif // _FUI_CTRL_GROUP_ITEM_H_