Adjust the position of the partial Frame
[platform/framework/native/uifw.git] / inc / FUiCtrlCustomListItem.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        FUiCtrlCustomListItem.h
20  * @brief       This is the header file for the %CustomListItem class.
21  *
22  * This header file contains the declarations of the %CustomListItem class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_CUSTOM_LIST_ITEM_H_
26 #define _FUI_CTRL_CUSTOM_LIST_ITEM_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FUiCtrlICustomListElement.h>
31
32 namespace Tizen { namespace Ui { namespace Controls
33 {
34 class _CustomListItemImpl;
35 class CustomListItemFormat;
36 /**
37  * @if OSPDEPREC        
38  * @class         CustomListItem
39  * @brief   <i> [Deprecated] </i> This class defines the common behavior of an item of the CustomList control.
40  *
41  * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class.
42  * @since               2.0
43  *
44  * The %CustomListItem class represents a custom list item which is the unit of
45  * handling of a custom list. A custom list item is composed of one or more elements,
46  * which can be texts and bitmaps. Custom drawable elements are also supported via
47  * ICustomListElement. The value of the elements is set using %CustomListItem.
48  *
49  * Note that %CustomListItem needs to be created on a heap. CustomListItems will be deleted automatically
50  * when the CustomList is destroyed. If you want to remove certain list items, you must use RemoveItemAt().
51  *
52  * Refer to CustomListItemFormat.
53  *
54  * @endif
55  */
56 class _OSP_EXPORT_ CustomListItem
57         : public Tizen::Base::Object
58 {
59 public:
60         /**
61          * @if OSPDEPREC
62          * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
63          *
64          * @brief   <i> [Deprecated] </i>
65          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
66          *
67          * @since               2.0
68          * @endif
69          */
70         CustomListItem(void);
71
72         /**
73          * @if OSPDEPREC
74          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
75          *
76          * @brief   <i> [Deprecated] </i>
77          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
78          * @since               2.0
79          * @endif
80          */
81         virtual ~CustomListItem(void);
82
83 public:
84         /**
85          * @if OSPDEPREC
86          * Initializes this instance of %CustomListItem with the specified parameter.
87          *
88          * @brief   <i> [Deprecated] </i>
89          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
90          * @since                                       2.0
91          *
92          * @return      An error code
93          * @param[in]   itemHeight                      The height of %CustomListItem
94          * @exception   E_SUCCESS                       The method is successful.
95          * @exception   E_SYSTEM                        A system error has occurred.
96          * @endif
97          */
98         result Construct(int itemHeight);
99
100         /**
101          * @if OSPDEPREC
102          * Sets the format of %CustomListItem.
103          *
104          * @brief   <i> [Deprecated] </i>
105          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
106          * @since                       2.0
107          *
108          * @param[in]   itemFormat              An instance of %CustomListItemFormat
109          * @remarks Do not delete @c itemFormat before the associated %CustomListItem is removed from %CustomList, because %CustomListItemFormat is constantly
110          *                      used while %CustomListItem is added to CustomList.
111          * @endif
112          */
113         void SetItemFormat(const CustomListItemFormat& itemFormat);
114
115         /**
116          * Gets the format of %CustomListItem.
117          *
118          * @since                       2.0
119          *
120          * @return      A pointer to CustomListItemFormat, @n
121          *                      else @c null if a system error occurs
122          */
123         const CustomListItemFormat* GetItemFormat(void) const;
124
125         /**
126          * @if OSPDEPREC
127          * Sets the background bitmap image which is displayed when the item is focused.
128          *
129          * @brief   <i> [Deprecated] </i>
130          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
131          * @since                       2.0
132          *
133          * @param[in] bitmap            The background bitmap image
134          * @remarks  The specified bitmap is automatically scaled to the size of an associated item.
135          * @see SetNormalItemBackgroundBitmap()
136          * @endif
137          */
138         void SetFocusedItemBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
139
140         /**
141          * @if OSPDEPREC
142          * Sets the background image of the item which is displayed when the item is in normal state.
143          *
144          * @brief   <i> [Deprecated] </i>
145          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
146          * @since                       2.0
147          *
148          * @param[in] bitmap     The background bitmap image
149          * @remarks The specified bitmap is automatically scaled to the size of an+B6 associated item.
150          * @see SetFocusedItemBackgroudBitmap()
151          * @endif
152          */
153         void SetNormalItemBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
154
155         /**
156          * @if OSPDEPREC
157          * Sets the highlighted background image on the rectangle of each list item.
158          *
159          * @brief   <i> [Deprecated] </i>
160          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
161          * @since           2.0
162          *
163          * @param[in]   bitmap   The background image
164          * @remarks     When a user navigates the user interface using the directional keys, @n
165          *                  the selected UI control is highlighted and takes the focus.
166          * @endif
167          */
168
169         void SetHighlightedItemBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
170
171         /**
172          * @if OSPDEPREC
173          * Sets the text of the element for %CustomListItem.
174          *
175          * @brief   <i> [Deprecated] </i>
176          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
177          * @since                       2.0
178          *
179          * @return              An error code
180          * @param[in]   elementId       The ID of the element
181          * @param[in] text            The text string to add
182          * @exception   E_SUCCESS               The method is successful.
183          * @exception   E_SYSTEM        A system error has occurred.
184          * @remarks             To display text in multi-lines or to denote the end of line use '\\n'.
185          * @endif
186          */
187         result SetElement(int elementId, const Tizen::Base::String& text);
188
189         /**
190          * @if OSPDEPREC
191          * Sets the bitmap of the element for %CustomListItem.
192          *
193          * @brief   <i> [Deprecated] </i>
194          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
195          * @since                                       2.0
196          *
197          * @return              An error code
198          * @param[in]   elementId       The ID of the element
199          * @param[in]   normalBitmap        The bitmap displayed when the item is in the normal state
200          * @param[in]   pFocusedBitmap  The bitmap displayed when the item is focused
201          * @exception   E_SUCCESS                       The method is successful.
202          * @exception   E_SYSTEM            A system error has occurred.
203          * @endif
204          */
205         result SetElement(int elementId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pFocusedBitmap);
206
207
208         /**
209          * @if OSPDEPREC
210          * Sets the bitmap of the element for %CustomListItem.
211          *
212          * @brief   <i> [Deprecated] </i>
213          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
214          * @since        2.0
215          *
216          * @return     An error code
217          * @param[in]  elementId          The ID of the element
218          * @param[in]   normalBitmap        The bitmap displayed when the item is in the normal state
219          * @param[in]  pFocusedBitmap     The bitmap displayed when the item is selected
220          * @param[in]  pHighlightedBitmap The bitmap displayed when the item is highlighted
221          * @exception   E_SUCCESS           The method is successful.
222          * @exception   E_SYSTEM                        A system error has occurred.
223          * @endif
224          */
225         result SetElement(int elementId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pFocusedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
226
227         /**
228          * @if OSPDEPREC
229          * Sets the custom element for %CustomListItem.
230          *
231          * @brief   <i> [Deprecated] </i>
232          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
233          * @since                                       2.0
234          *
235          * @return              An error code
236          * @param[in]   elementId        The ID of the element
237          * @param[in]   element                  The custom element
238          * @exception   E_SUCCESS               The method is successful.
239          * @exception   E_SYSTEM        A system error has occurred.
240          * @remarks     Do not delete @c element before the associated %CustomListItem is removed from CustomList, @n
241          *              as ICustomListElement is constantly used while %CustomListItem is added to %CustomList. @n
242          *            Call RefreshItem() to draw the custom element that has been set with this method.
243          * @endif
244          */
245         result SetElement(int elementId, const ICustomListElement& element);
246
247         /**
248          * @if OSPDEPREC
249          * Sets the element ID of the checkbox of %CustomListItem.
250          *
251          * @brief   <i> [Deprecated] </i>
252          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
253          * @since                       2.0
254          *
255          * @return              An error code
256          * @param[in]   elementId        The ID of the element
257          * @exception   E_SUCCESS               The method is successful.
258          * @exception   E_SYSTEM        A system error has occurred.
259          * @endif
260          */
261         result SetCheckBox(int elementId);
262
263         /**
264          * @if OSPDEPREC
265          * Gets the percentage value of %CustomListItem.
266          *
267          * @brief   <i> [Deprecated] </i>
268          * @deprecated   This class is deprecated. Instead of using this class, use CustomItem class
269          * @since                       2.0
270          *
271          * @return              The percentage value, @n
272          *              else @c -1 if a system error occurs
273          * @endif
274          */
275         int GetValue(void) const;
276
277 private:
278         //
279         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
280         //
281         CustomListItem(const CustomListItem& rhs);
282
283         //
284         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
285         //
286         CustomListItem& operator =(const CustomListItem& rhs);
287
288 private:
289
290         CustomListItemFormat* __pCustomListItemFormat;
291         _CustomListItemImpl* __pCustomListItemImpl;
292
293         friend class _CustomListImpl;
294         friend class _CustomListItemImpl;
295         friend class _ExpandableListImpl;
296         friend class _SlidableListImpl;
297         friend class _GroupedListImpl;
298         friend class _SlidableGroupedListImpl;
299         friend class _ListImpl;
300
301         friend class _CustomListItemDataProvider;
302         friend class _SlidableListItemProvider;
303         friend class _ListBaseImpl;
304         friend class _GroupedListItemDataProvider;
305         friend class _ExpandableListItemDataProvider;
306         friend class _SlidableGroupedListItemProvider;
307         friend class _ListItemDataProvider;
308 }; //CustomListItem
309
310 }}} // Tizen::Ui::Controls
311
312 #endif // _FUI_CTRL_CUSTOM_LIST_ITEM_H_