Adjust the position of the partial Frame
[platform/framework/native/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 <FGrpFloatRectangle.h>
32 #include <FGrpRectangle.h>
33 #include <FUiCtrlListItemBase.h>
34
35 namespace Tizen { namespace Ui { namespace Controls
36 {
37
38 class _GroupItemImpl;
39
40 /**
41  * @class       GroupItem
42  * @brief    This class defines common behavior of %GroupItem.
43  *
44  * @since       2.0
45  *
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.
47  * @n
48  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
49  */
50
51 class _OSP_EXPORT_ GroupItem
52         : public Tizen::Base::Object
53 {
54 public:
55         /**
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.
59          *
60          * @since       2.0
61          */
62         GroupItem(void);
63
64         /**
65          * This destructor overrides Tizen::Base::Object::~Object().
66          *
67          * @since       2.0
68          */
69         virtual ~GroupItem(void);
70
71         /**
72          * Initializes this instance of %GroupItem with the specified parameter.
73          *
74          * @since       2.0
75          *
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.
80          */
81         result Construct(const Tizen::Graphics::Dimension& itemSize);
82
83         /**
84          * Initializes this instance of %GroupItem with the specified parameter.
85          *
86          * @since       2.1
87          *
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.
92          */
93         result Construct(const Tizen::Graphics::FloatDimension& itemSize);
94
95         /**
96          * Sets the background image of the item.
97          *
98          * @since       2.0
99          *
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.
106          */
107         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
108
109         /**
110          * Sets the background color of the item.
111          *
112          * @since       2.0
113          *
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.
120          */
121         result SetBackgroundColor(const Tizen::Graphics::Color& color);
122
123         /**
124          * Gets the background color of the item.
125          *
126          * @since       2.0
127          *
128          * @return      The background color of the item, @n
129          *                      else RGBA(0, 0, 0, 0) if an error occurs
130          * @see     SetBackgroundColor()
131          */
132         Tizen::Graphics::Color GetBackgroundColor(void) const;
133
134         /**
135          * Sets the color of the text.
136          *
137          * @since       2.0
138          *
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()
144          */
145         result SetTextColor(const Tizen::Graphics::Color& color);
146
147         /**
148          * Gets the color of the text.
149          *
150          * @since       2.0
151          *
152          * @return      The text color, @n
153          *                      else RGBA(0, 0, 0, 0) if an error occurs
154          * @see         SetTextColor()
155          */
156         Tizen::Graphics::Color GetTextColor(void) const;
157
158         /**
159          * Sets the size of the text.
160          *
161          * @since       2.0
162          *
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.
168          * @see     GetTextSize()
169          */
170         result SetTextSize(int size);
171
172         /**
173          * Sets the size of the text.
174          *
175          * @since       2.1
176          *
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.
182          * @see     GetTextSize()
183          */
184         result SetTextSize(float size);
185
186         /**
187          * Gets the size of the text.
188          *
189          * @since       2.0
190          *
191          * @return  The size of the text,
192          *                      else @c -1 if an error occurs
193          *
194          * @see     SetTextSize()
195          */
196         int GetTextSize(void) const;
197
198         /**
199          * Gets the size of the text.
200          *
201          * @since       2.1
202          *
203          * @return  The size of the text,
204          *                      else @c -1.0f if an error occurs
205          *
206          * @see     SetTextSize()
207          */
208         float GetTextSizeF(void) const;
209
210         /**
211          * Sets the text and bitmap of the element for %GroupItem.
212          *
213          * @since   2.0
214          *
215          * @return      An error code
216          * @param[in]   text                            The text string to be added
217          * @param[in]   pBitmap             The bitmap to be displayed
218          *
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
224          *                      %GroupItem.
225          */
226         result SetElement(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null);
227
228 protected:
229         friend class _GroupItemImpl;
230
231 private:
232         //
233         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
234         //
235         GroupItem(const GroupItem& rhs);
236
237         //
238         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
239         //
240         GroupItem& operator =(const GroupItem& rhs);
241
242 protected:
243         _GroupItemImpl* _pImpl;
244 }; // GroupItem
245
246 }}} // Tizen::Ui::Controls
247
248 #endif  // _FUI_CTRL_GROUP_ITEM_H_