Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiCtrlCustomListItemFormat.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  * @if OSPDEPREC
20  * @file        FUiCtrlCustomListItemFormat.h
21  * @brief       This is the header file for the %CustomListItemFormat class.
22  *
23  * This header file contains the declarations of the %CustomListItemFormat class and its helper classes.
24  * @endif
25  */
26
27 #ifndef _FUI_CTRL_CUSTOM_LIST_ITEM_FORMAT_H_
28 #define _FUI_CTRL_CUSTOM_LIST_ITEM_FORMAT_H_
29
30 #include <FBaseObject.h>
31 #include <FBaseTypes.h>
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35 /**
36  * @if OSPDEPREC
37  * @class       CustomListItemFormat
38  * @brief               <i> [Deprecated] </i> This class defines the common behavior of an item format of a CustomList control.
39  *
40  * @deprecated  This class is deprecated. There is no need to use this class.
41  * @since               2.0
42  *
43  * The %CustomListItemFormat class defines the common behavior of an item format of a CustomList control.
44  * A custom list item is composed of elements, which can be texts and bitmaps.
45  * A custom list item format determines the configuration of elements of a list item
46  * and the position and the size of a custom list item.
47  *
48  * Note that %CustomListItemFormat needs to be created on a heap and it must be
49  * deleted explicitly after use. However, CustomListItem must
50  * be manually deleted because items are removed from memory by the List when
51  * it is destroyed.
52  *
53  * Refer to CustomListItem.
54  * @endif
55  */
56 class _OSP_EXPORT_ CustomListItemFormat
57         : public Tizen::Base::Object
58 {
59 public:
60         /**
61          * @if OSPDEPREC
62          * The object is not fully constructed after this constructor is called. @n
63          * For full construction, the CustomListItemFormat::Construct() method must be called right after calling this constructor.
64          *
65          * @brief               <i> [Deprecated] </i>
66          * @deprecated  This class is deprecated. There is no need to use this class.
67          * @since               2.0
68          * @endif
69          */
70         CustomListItemFormat(void);
71
72         /**
73          * @if OSPDEPREC
74          * This polymorphic destructor should be overridden if required. @n
75          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
76          *
77          * @brief               <i> [Deprecated] </i>
78          * @deprecated  This class is deprecated. There is no need to use this class.
79          * @since               2.0
80          * @endif
81          */
82         virtual ~CustomListItemFormat(void);
83
84 public:
85         /**
86          * @if OSPDEPREC
87          * Initializes this instance of %CustomListItemFormat.
88          *
89          * @brief               <i> [Deprecated] </i>
90          * @deprecated  This class is deprecated. There is no need to use this class.
91          * @since                       2.0
92          *
93          * @return              An error code
94          * @exception   E_SUCCESS                       The method is successful.
95          * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
96          * @endif
97          */
98         result Construct(void);
99
100         /**
101          * @if OSPDEPREC
102          * Adds the %CustomListElement with bounds equal to @c rect.
103          *
104          * @brief               <i> [Deprecated] </i>
105          * @deprecated  This class is deprecated. There is no need to use this class.
106          * @since                       2.0
107          *
108          * @return              An error code
109          * @param[in]   elementId        The ID of the element
110          * @param[in]   rect    The bounds of the element
111          * @exception   E_SUCCESS               The method is successful.
112          * @exception   E_SYSTEM        A system error has occurred.
113          * @endif
114          */
115         result AddElement(int elementId, const Tizen::Graphics::Rectangle& rect);
116
117         /**
118          * @if OSPDEPREC
119          * Adds the %CustomListElement with bounds equal to @c rect and size of the text @c textSize.
120          *
121          * @brief               <i> [Deprecated] </i>
122          * @deprecated  This class is deprecated. There is no need to use this class.
123          * @since                       2.0
124          *
125          * @return              An error code
126          * @param[in]   elementId               The ID of the element
127          * @param[in]   rect                    The bounds of the element
128          * @param[in]   textSize                The size of the text
129          * @exception   E_SUCCESS               The method is successful.
130          * @exception   E_SYSTEM        A system error has occurred.
131          * @endif
132          */
133         result AddElement(int elementId, const Tizen::Graphics::Rectangle& rect, int textSize);
134
135         /**
136          * @if OSPDEPREC
137          * Adds the %CustomListElement with bounds equal to @c rect, specifying the size of text and the color of text.
138          *
139          * @brief               <i> [Deprecated] </i>
140          * @deprecated  This class is deprecated. There is no need to use this class.
141          * @since     2.0
142          *
143          * @return    An error code
144          * @param[in] elementId          The ID of the element
145          * @param[in] rect               The bounds of the element
146          * @param[in] textSize           The size of the text
147          * @param[in] normalTextColor    The color of the text in the normal status
148          * @param[in] focusedTextColor   The color of the text in the focused status
149          * @exception   E_SUCCESS          The method is successful.
150          * @exception   E_SYSTEM           A system error has occurred.
151          * @endif
152          */
153         result AddElement(int elementId, const Tizen::Graphics::Rectangle& rect, int textSize, const Tizen::Graphics::Color& normalTextColor, const Tizen::Graphics::Color& focusedTextColor);
154
155         /**
156          * @if OSPDEPREC
157          * Adds the %CustomListElement with bounds equal to @c rect, specifying the size of text and the color of text.
158          *
159          * @brief               <i> [Deprecated] </i>
160          * @deprecated  This class is deprecated. There is no need to use this class.
161          * @since     2.0
162          *
163          * @return    An error code
164          * @param[in] elementId              The ID of the element
165          * @param[in] rect                   The bounds of the element
166          * @param[in] textSize               The size of the text
167          * @param[in] normalTextColor        The color of the text in the normal status
168          * @param[in] focusedTextColor       The color of the text in the focused status
169          * @param[in] highlightedTextColor   The color of the text in the highlighted status
170          * @exception   E_SUCCESS              The method is successful.
171          * @exception   E_SYSTEM               A system error has occurred.
172          * @endif
173          */
174         result AddElement(int elementId, const Tizen::Graphics::Rectangle& rect, int textSize, const Tizen::Graphics::Color& normalTextColor, const Tizen::Graphics::Color& focusedTextColor, const Tizen::Graphics::Color& highlightedTextColor);
175
176         /**
177          * @if OSPDEPREC
178          * Gets the position and size of the element.
179          *
180          * @brief               <i> [Deprecated] </i>
181          * @deprecated  This class is deprecated. There is no need to use this class.
182          * @since                       2.0
183          *
184          * @return              The bounds of the element, @n
185          *                              else a rectangle of (0, 0, -1, -1) if there is no element matching the specified ID
186          * @param[in]   elementId        The ID of the element
187          * @endif
188          */
189         Tizen::Graphics::Rectangle GetElement(int elementId) const;
190
191         /**
192          * @if OSPDEPREC
193          * Gets the ID of the first element.
194          *
195          * @brief               <i> [Deprecated] </i>
196          * @deprecated  This class is deprecated. There is no need to use this class.
197          * @since               2.0
198          *
199          * @return      The ID of the first element, @n
200          *              else @c -1 if a system error occurs
201          * @endif
202          */
203         int GetFirstElementId(void) const;
204
205         /**
206          * @if OSPDEPREC
207          * Gets the ID of the next element of the specified element.
208          *
209          * @brief               <i> [Deprecated] </i>
210          * @deprecated  This class is deprecated. There is no need to use this class.
211          * @since               2.0
212          *
213          * @return      The ID of the next element of the specified element, @n
214          *              else @c -1 if there is no element next to the element specified by @c elementId
215          * @param[in] elementId         The ID of the element
216          * @endif
217          */
218         int GetNextElementId(int elementId) const;
219
220         /**
221          * @if OSPDEPREC
222          * Gets the ID of the first element of all enabled items.
223          *
224          * @brief               <i> [Deprecated] </i>
225          * @deprecated  This class is deprecated. There is no need to use this class.
226          * @since               2.0
227          *
228          * @return              The ID of the first enabled element, @n
229          *                              else @c -1 if no element is enabled
230          * @endif
231          */
232         int GetFirstEnabledElementId(void) const;
233
234         /**
235          * @if OSPDEPREC
236          * Gets the ID of the next enabled element after the specified element.
237          *
238          * @brief               <i> [Deprecated] </i>
239          * @deprecated  This class is deprecated. There is no need to use this class.
240          * @since               2.0
241          *
242          * @return              The ID of the next enabled element, @n
243          *                              else @c -1 if no element after the specified element is enabled
244          * @param[in] elementId         The ID of the element
245          * @endif
246          */
247         int GetNextEnabledElementId(int elementId) const;
248
249         /**
250          * @if OSPDEPREC
251          * Gets the ID of the previous enabled element ID of the specified element.
252          *
253          * @brief               <i> [Deprecated] </i>
254          * @deprecated  This class is deprecated. There is no need to use this class.
255          * @since               2.0
256          *
257          * @return              The ID of the previous enabled element, @n
258          *                              else @c -1 if no element before the specified element is enabled
259          * @param[in] elementId         The ID of the element
260          * @endif
261          */
262         int GetPreviousEnabledElementId(int elementId) const;
263
264         /**
265          * @if OSPDEPREC
266          * Sets the event status for the specified element.
267          *
268          * @brief               <i> [Deprecated] </i>
269          * @deprecated  This class is deprecated. There is no need to use this class.
270          * @since                       2.0
271          *
272          * @param[in] elementId         The ID of the element
273          * @param[in]   enable          Set to @c true to allow the specified element to handle the events, @n
274          *                              else @c false
275          * @endif
276          */
277         void SetElementEventEnabled(int elementId, bool enable);
278
279         /**
280          * @if OSPDEPREC
281          * Checks whether the event status is enabled for the specified element.
282          *
283          * @brief               <i> [Deprecated] </i>
284          * @deprecated  This class is deprecated. There is no need to use this class.
285          * @since                       2.0
286          *
287          * @return              @c true if the event status is enabled, @n
288          *                              else @c false
289          * @param[in] elementId         The ID of the element
290          * @endif
291          */
292         bool IsElementEventEnabled(int elementId);
293
294 private:
295         //
296         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
297         //
298         CustomListItemFormat(const CustomListItemFormat& rhs);
299
300         //
301         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
302         //
303         CustomListItemFormat& operator =(const CustomListItemFormat& rhs);
304
305 private:
306
307         class _CustomListItemFormatImpl* __pCustomListItemFormatImpl;
308
309         friend class _CustomListItemImpl;
310         friend class _CustomListImpl;
311         friend class _ExpandableListImpl;
312         friend class _SlidableListImpl;
313         friend class _GroupedListImpl;
314         friend class _SlidableGroupedListImpl;
315 }; //CustomListItemFormat
316
317 }}} //Tizen::Ui::Controls
318
319 #endif // _FUI_CTRL_CUSTOM_LIST_ITEM_FORMAT_H_