Fixed to add the AllWindowList
[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 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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
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.
47  * The bitmap can be omitted while text must be given.
48  *
49  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
50  */
51
52 class _OSP_EXPORT_ GroupItem
53         : public Tizen::Base::Object
54 {
55 public:
56         /**
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.
60          *
61          * @since       2.0
62          */
63         GroupItem(void);
64
65         /**
66          * This destructor overrides Tizen::Base::Object::~Object().
67          *
68          * @since       2.0
69          */
70         virtual ~GroupItem(void);
71
72         /**
73          * Initializes this instance of %GroupItem with the specified parameter.
74          *
75          * @since       2.0
76          *
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.
81          */
82         result Construct(const Tizen::Graphics::Dimension& itemSize);
83
84         /**
85          * Initializes this instance of %GroupItem with the specified parameter.
86          *
87          * @since       2.1
88          *
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.
93          */
94         result Construct(const Tizen::Graphics::FloatDimension& itemSize);
95
96         /**
97          * Sets the background image of the item.
98          *
99          * @since       2.0
100          *
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.
107          */
108         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
109
110         /**
111          * Sets the background color of the item.
112          *
113          * @since       2.0
114          *
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.
119          * @remarks
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.
123          */
124         result SetBackgroundColor(const Tizen::Graphics::Color& color);
125
126         /**
127          * Gets the background color of the item.
128          *
129          * @since       2.0
130          *
131          * @return      The background color of the item, @n
132          *                      else RGBA(0, 0, 0, 0) if an error occurs
133          * @see     SetBackgroundColor()
134          */
135         Tizen::Graphics::Color GetBackgroundColor(void) const;
136
137         /**
138          * Sets the color of the text.
139          *
140          * @since       2.0
141          *
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()
147          */
148         result SetTextColor(const Tizen::Graphics::Color& color);
149
150         /**
151          * Gets the color of the text.
152          *
153          * @since       2.0
154          *
155          * @return      The text color, @n
156          *                      else RGBA(0, 0, 0, 0) if an error occurs
157          * @see         SetTextColor()
158          */
159         Tizen::Graphics::Color GetTextColor(void) const;
160
161         /**
162          * Sets the size of the text.
163          *
164          * @since       2.0
165          *
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.
171          * @see     GetTextSize()
172          */
173         result SetTextSize(int size);
174
175         /**
176          * Sets the size of a text.
177          *
178          * @since       2.1
179          *
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.
185          * @see     GetTextSize()
186          */
187         result SetTextSize(float size);
188
189         /**
190          * Gets the size of the text.
191          *
192          * @since       2.0
193          *
194          * @return  The size of the text,
195          *                      else @c -1 if an error occurs
196          *
197          * @see     SetTextSize()
198          */
199         int GetTextSize(void) const;
200
201         /**
202          * Gets the size of a text.
203          *
204          * @since       2.1
205          *
206          * @return  The size of a text,
207          *                      else @c -1.0f if an error occurs
208          *
209          * @see     SetTextSize()
210          */
211         float GetTextSizeF(void) const;
212
213         /**
214          * Sets the text and bitmap of the element for %GroupItem.
215          *
216          * @since   2.0
217          *
218          * @return      An error code
219          * @param[in]   text                            The text string to add
220          * @param[in]   pBitmap             The bitmap to display
221          *
222          * @exception   E_SUCCESS                       The method is successful.
223          * @exception   E_SYSTEM                        A system error has occurred.
224          * @remarks
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.
229          */
230         result SetElement(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null);
231
232 protected:
233         friend class _GroupItemImpl;
234
235 private:
236         //
237         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
238         //
239         GroupItem(const GroupItem& rhs);
240
241         //
242         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
243         //
244         GroupItem& operator =(const GroupItem& rhs);
245
246 protected:
247         _GroupItemImpl* _pImpl;
248 }; // GroupItem
249
250 }}} // Tizen::Ui::Controls
251
252 #endif  // _FUI_CTRL_GROUP_ITEM_H_