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 <FGrpRectangle.h>
32 #include <FUiCtrlListItemBase.h>
34 namespace Tizen { namespace Ui { namespace Controls
41 * @brief This class defines common behavior of %GroupItem.
45 * 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.
47 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
50 class _OSP_EXPORT_ GroupItem
51 : public Tizen::Base::Object
55 * The object is not fully constructed after this constructor is
56 * called. For full construction, the Construct() method must be
57 * called right after calling this constructor.
64 * This destructor overrides Tizen::Base::Object::~Object().
68 virtual ~GroupItem(void);
71 * Initializes this instance of %GroupItem with the specified parameter.
75 * @return An error code
76 * @param[in] itemSize The size of the item
77 * @exception E_SUCCESS The method is successful.
78 * @exception E_SYSTEM A system error has occurred.
80 result Construct(const Tizen::Graphics::Dimension& itemSize);
83 * Sets the background image of the item.
87 * @return An error code
88 * @param[in] pBitmap The background bitmap image
89 * @exception E_SUCCESS The method is successful.
90 * @exception E_SYSTEM A system error has occurred.
91 * @remarks The background bitmap has priority over the background color. When both the background bitmap and background color are specified, only
92 * the bitmap is displayed.
94 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
97 * Sets the background color of the item.
101 * @return An error code
102 * @param[in] color The background color
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 the background color are specified, only the bitmap is displayed. @n
106 * The background color of the item is not applied when the item is inserted into the GroupedListView of section style.
108 result SetBackgroundColor(const Tizen::Graphics::Color& color);
111 * Gets the background color of the item.
115 * @return The background color of the item, @n
116 * else RGBA(0, 0, 0, 0) if an error occurs
117 * @see SetBackgroundColor()
119 Tizen::Graphics::Color GetBackgroundColor(void) const;
122 * Sets the color of the text.
126 * @return An error code
127 * @param[in] color The text color
128 * @exception E_SUCCESS The method is successful.
129 * @exception E_SYSTEM A system error has occurred.
130 * @see GetTextColor()
132 result SetTextColor(const Tizen::Graphics::Color& color);
135 * Gets the color of the text.
139 * @return The text color, @n
140 * else RGBA(0, 0, 0, 0) if an error occurs
141 * @see SetTextColor()
143 Tizen::Graphics::Color GetTextColor(void) const;
146 * Sets the size of the text.
150 * @return An error code
151 * @param[in] size The size of the text
152 * @exception E_SUCCESS The method is successful.
153 * @exception E_INVALID_ARG The specified input parameter is invalid.
154 * @exception E_SYSTEM A system error has occurred.
157 result SetTextSize(int size);
160 * Gets the size of the text.
164 * @return The size of the text,
165 * else @c -1 if an error occurs
169 int GetTextSize(void) const;
172 * Sets the text and bitmap of the element for %GroupItem.
176 * @return An error code
177 * @param[in] text The text string to be added
178 * @param[in] pBitmap The bitmap to be displayed
180 * @exception E_SUCCESS The method is successful.
181 * @exception E_SYSTEM A system error has occurred.
182 * @remarks The behavior of %GroupItem is different according to the style of GroupedListView. @n
183 * When the style is GROUPED_LIST_VIEW_INDEXED, the text and bitmap of %GroupItem are displayed, if they are given. However, when the style
184 * is GROUPED_LIST_VIEW_STYLE_SECTION, the bitmap is not displayed in any case and setting an empty text to %GroupItem does not show
187 result SetElement(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null);
190 friend class _GroupItemImpl;
194 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
196 GroupItem(const GroupItem& rhs);
199 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
201 GroupItem& operator =(const GroupItem& rhs);
204 _GroupItemImpl* _pImpl;
207 }}} // Tizen::Ui::Controls
209 #endif // _FUI_CTRL_GROUP_ITEM_H_