Fork for IVI: mesa fixing
[profile/ivi/uifw.git] / inc / FUiCtrlGroupItem.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file        FUiCtrlGroupItem.h
20  * @brief       This is the header file for the %GroupItem class.
21  *
22  * This header file contains the declarations of the %GroupItem class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_GROUP_ITEM_H_
26 #define _FUI_CTRL_GROUP_ITEM_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpRectangle.h>
32 #include <FUiCtrlListItemBase.h>
33
34 namespace Tizen { namespace Ui { namespace Controls
35 {
36
37 class _GroupItemImpl;
38
39 /**
40  * @class       GroupItem
41  * @brief    This class defines common behavior of %GroupItem.
42  *
43  * @since       2.0
44  *
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.
46  * @n
47  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
48  */
49
50 class _OSP_EXPORT_ GroupItem
51         : public Tizen::Base::Object
52 {
53 public:
54         /**
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.
58          *
59          * @since       2.0
60          */
61         GroupItem(void);
62
63         /**
64          * This destructor overrides Tizen::Base::Object::~Object().
65          *
66          * @since       2.0
67          */
68         virtual ~GroupItem(void);
69
70         /**
71          * Initializes this instance of %GroupItem with the specified parameter.
72          *
73          * @since       2.0
74          *
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.
79          */
80         result Construct(const Tizen::Graphics::Dimension& itemSize);
81
82         /**
83          * Sets the background image of the item.
84          *
85          * @since       2.0
86          *
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.
93          */
94         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
95
96         /**
97          * Sets the background color of the item.
98          *
99          * @since       2.0
100          *
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.
107          */
108         result SetBackgroundColor(const Tizen::Graphics::Color& color);
109
110         /**
111          * Gets the background color of the item.
112          *
113          * @since       2.0
114          *
115          * @return      The background color of the item, @n
116          *                      else RGBA(0, 0, 0, 0) if an error occurs
117          * @see     SetBackgroundColor()
118          */
119         Tizen::Graphics::Color GetBackgroundColor(void) const;
120
121         /**
122          * Sets the color of the text.
123          *
124          * @since       2.0
125          *
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()
131          */
132         result SetTextColor(const Tizen::Graphics::Color& color);
133
134         /**
135          * Gets the color of the text.
136          *
137          * @since       2.0
138          *
139          * @return      The text color, @n
140          *                      else RGBA(0, 0, 0, 0) if an error occurs
141          * @see         SetTextColor()
142          */
143         Tizen::Graphics::Color GetTextColor(void) const;
144
145         /**
146          * Sets the size of the text.
147          *
148          * @since       2.0
149          *
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.
155          * @see     GetTextSize()
156          */
157         result SetTextSize(int size);
158
159         /**
160          * Gets the size of the text.
161          *
162          * @since       2.0
163          *
164          * @return  The size of the text,
165          *                      else @c -1 if an error occurs
166          *
167          * @see     SetTextSize()
168          */
169         int GetTextSize(void) const;
170
171         /**
172          * Sets the text and bitmap of the element for %GroupItem.
173          *
174          * @since   2.0
175          *
176          * @return      An error code
177          * @param[in]   text                            The text string to be added
178          * @param[in]   pBitmap             The bitmap to be displayed
179          *
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
185          *                      %GroupItem.
186          */
187         result SetElement(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null);
188
189 protected:
190         friend class _GroupItemImpl;
191
192 private:
193         //
194         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
195         //
196         GroupItem(const GroupItem& rhs);
197
198         //
199         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
200         //
201         GroupItem& operator =(const GroupItem& rhs);
202
203 protected:
204         _GroupItemImpl* _pImpl;
205 }; // GroupItem
206
207 }}} // Tizen::Ui::Controls
208
209 #endif  // _FUI_CTRL_GROUP_ITEM_H_