Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_ListBaseImpl.cpp
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         FUiCtrl_ListBaseImpl.cpp
20 * @brief        This file contains implementation of common classes used by 1.x Lists
21 */
22
23 #include <FGrpBitmap.h>
24 #include <FBaseSysLog.h>
25 #include <FGrp_TextTextSimple.h>
26 #include "FUiCtrl_ListBaseImpl.h"
27 #include "FUiCtrl_CustomListElements.h"
28 #include "FUiCtrl_CustomListItemImpl.h"
29 #include "FUiCtrl_Label.h"
30 #include "FUi_CoordinateSystemUtils.h"
31 #include "FGrp_BitmapImpl.h"
32
33 using namespace Tizen::Base::Collection;
34 using namespace Tizen::Base;
35 using namespace Tizen::Graphics;
36 using namespace Tizen::Graphics::_Text;
37
38 namespace Tizen { namespace Ui { namespace Controls
39 {
40
41 _ListBaseImpl::_ListBaseImpl(Control* pList, _TableView* pCore)
42         : _ControlImpl(pList, pCore)
43         , _annexStyle(TABLE_VIEW_ANNEX_STYLE_NORMAL)
44         , _currentRadioIndex(-1)
45         , _currentRadioGroupIndex(-1)
46         , _isDividerEnabled(false)
47         , _itemsList(_CustomListItemImpl::DeleteCustomListItem)
48         , __pEmptyText(null)
49 {
50         GET_SHAPE_CONFIG(LIST::LIST_DEFAULT_ITEM_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, _defaultItemHeight);
51         GET_COLOR_CONFIG(TABLEVIEW::EMPTY_CONTENTS_TEXT_NORMAL, __emptyTextColor);
52
53         for (int i = 0; i < CHECK_BOX_MAX; i++)
54         {
55                 _pCheckBitmaps[i] = null;
56         }
57
58 }
59
60 _ListBaseImpl::~_ListBaseImpl(void)
61 {
62         for (int i = 0; i < CHECK_BOX_MAX; i++)
63         {
64                 delete _pCheckBitmaps[i];
65         }
66
67         _TableView* pCore = static_cast<_TableView*>(&GetCore());
68         SysTryReturnVoidResult(NID_UI_CTRL, (pCore != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get _TableView core object.");
69
70         pCore->DetachAllChildren();
71 }
72
73 Bitmap*
74 _ListBaseImpl::CreateMergedBitmapN(Bitmap& pNormalBitmap, Bitmap* pSelectedBitmap)
75 {
76         Bitmap* pMergeBitmap = null;
77         Canvas* pCanvas = null;
78
79         Rectangle bitmapBounds;
80         result r = E_SUCCESS;
81
82         bitmapBounds =  Rectangle(0, 0, pNormalBitmap.GetWidth(), pNormalBitmap.GetHeight());
83
84         pCanvas = new (std::nothrow) Canvas();
85         SysTryReturn(NID_UI_CTRL, pCanvas != null, null, E_OUT_OF_MEMORY, "Memory allocation failed.");
86
87         pCanvas->Construct(bitmapBounds);
88         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
89         pCanvas->Clear();
90
91         if (_BitmapImpl::CheckNinePatchedBitmapStrictly(pNormalBitmap))
92         {
93                 pCanvas->DrawNinePatchedBitmap(bitmapBounds, pNormalBitmap);
94         }
95         else
96         {
97                 pCanvas->DrawBitmap(bitmapBounds, pNormalBitmap);
98         }
99
100         if (pSelectedBitmap != null)
101         {
102                 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pSelectedBitmap))
103                 {
104                         pCanvas->DrawNinePatchedBitmap(bitmapBounds, *pSelectedBitmap);
105                 }
106                 else
107                 {
108                         pCanvas->DrawBitmap(bitmapBounds, *pSelectedBitmap);
109                 }
110         }
111
112         pMergeBitmap = new (std::nothrow) Bitmap();
113         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "Memory allocation failed.");
114
115         r = pMergeBitmap->Construct(*pCanvas, bitmapBounds);
116         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "A system error has occurred. Failed to construct an item.");
117
118
119         delete pCanvas;
120         return pMergeBitmap;
121
122 CATCH:
123         delete pCanvas;
124         delete pMergeBitmap;
125
126         return null;
127 }
128
129
130 Bitmap*
131 _ListBaseImpl::CreateOnOffMergedBitmapN(Bitmap& pNormalBitmap, Bitmap& pSelectedBitmap, _CheckBoxBitmapType status)
132 {
133         Bitmap* pMergeBitmap = null;
134         Canvas* pCanvas = null;
135
136         Rectangle bitmapBounds;
137         Rectangle handlerBounds;
138         result r = E_SUCCESS;
139
140         bitmapBounds =  Rectangle(0, 0, pNormalBitmap.GetWidth(), pNormalBitmap.GetHeight());
141
142         if (status == CHECK_BOX_UNCHECKED)
143         {
144                 handlerBounds = Rectangle(0, 0, pSelectedBitmap.GetWidth(), pSelectedBitmap.GetHeight());
145         }
146         else
147         {
148                 handlerBounds.x = pNormalBitmap.GetWidth() - pSelectedBitmap.GetWidth();
149                 handlerBounds.y = 0;
150                 handlerBounds.width = pSelectedBitmap.GetWidth();
151                 handlerBounds.height = pSelectedBitmap.GetHeight();
152         }
153
154         pCanvas = new (std::nothrow) Canvas();
155         SysTryReturn(NID_UI_CTRL, pCanvas != null, null, E_OUT_OF_MEMORY, "Memory allocation failed.");
156
157         pCanvas->Construct(bitmapBounds);
158         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
159         pCanvas->Clear();
160
161         if (_BitmapImpl::CheckNinePatchedBitmapStrictly(pNormalBitmap))
162         {
163                 pCanvas->DrawNinePatchedBitmap(bitmapBounds, pNormalBitmap);
164         }
165         else
166         {
167                 pCanvas->DrawBitmap(bitmapBounds, pNormalBitmap);
168         }
169
170         if(_BitmapImpl::CheckNinePatchedBitmapStrictly(pSelectedBitmap))
171         {
172                 pCanvas->DrawNinePatchedBitmap(handlerBounds, pSelectedBitmap);
173         }
174         else
175         {
176                 pCanvas->DrawBitmap(handlerBounds, pSelectedBitmap);
177         }
178
179         pMergeBitmap = new (std::nothrow) Bitmap();
180         SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "Memory allocation failed.");
181
182         r = pMergeBitmap->Construct(*pCanvas, bitmapBounds);
183         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "A system error has occurred. Failed to construct an item.");
184
185         delete pCanvas;
186         return pMergeBitmap;
187
188 CATCH:
189         delete pCanvas;
190         delete pMergeBitmap;
191
192         return null;
193 }
194
195 result
196 _ListBaseImpl::LoadDefaultBitmap(void)
197 {
198         Bitmap* pNormalBitmap = null;
199         Bitmap* pSelectedBitmap = null;
200         Bitmap* pHandlerBitmap = null;
201         Bitmap* pDisabledNormalBitmap = null;
202         Bitmap* pDisabledSelectedBitmap = null;
203         Bitmap* pDisabledHandlerBitmap = null;
204         Bitmap* pPressedBitmap = null;
205
206         result r = E_SUCCESS;
207
208         if (_annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
209         {
210                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBitmap);
211                 SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, GetErrorMessage(r), "[%s] Propagating.", GetErrorMessage(r));
212
213                 _pCheckBitmaps[BITMAP_UNCHECKED] = CreateMergedBitmapN(*pNormalBitmap, pSelectedBitmap);
214
215                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBitmap);
216                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
217
218                 _pCheckBitmaps[BITMAP_UNCHECKED_PRESSED] = CreateMergedBitmapN(*pPressedBitmap, pSelectedBitmap);
219
220                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_BUTTON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap);
221                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
222
223                 _pCheckBitmaps[BITMAP_CHECKED] = CreateMergedBitmapN(*pNormalBitmap, pSelectedBitmap);
224
225                 _pCheckBitmaps[BITMAP_CHECKED_PRESSED] = CreateMergedBitmapN(*pPressedBitmap, pSelectedBitmap);
226
227                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_NORMAL_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledNormalBitmap);
228                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
229
230                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::RADIOBUTTON_BUTTON_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap);
231                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
232
233                 _pCheckBitmaps[BITMAP_CHECKED_DISABLED] = CreateMergedBitmapN(*pDisabledNormalBitmap, pSelectedBitmap);
234         }
235         else if (_annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || _annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
236         {
237                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pHandlerBitmap);
238                 SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, GetErrorMessage(r), "[%s] Propagating.", GetErrorMessage(r));
239
240                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_BG, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBitmap);
241                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
242
243                 _pCheckBitmaps[BITMAP_UNCHECKED] = CreateOnOffMergedBitmapN(*pNormalBitmap, *pHandlerBitmap, CHECK_BOX_UNCHECKED);
244
245                 delete pHandlerBitmap;
246                 pHandlerBitmap = null;
247
248                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_ON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pHandlerBitmap);
249                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
250
251
252                 _pCheckBitmaps[BITMAP_CHECKED] = CreateOnOffMergedBitmapN(*pNormalBitmap, *pHandlerBitmap, CHECK_BOX_CHECKED);
253
254                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledNormalBitmap);
255                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
256
257                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_ON_HANDLER_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledHandlerBitmap);
258                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
259
260                 _pCheckBitmaps[BITMAP_CHECKED_DISABLED] = CreateOnOffMergedBitmapN(*pDisabledNormalBitmap, *pDisabledHandlerBitmap, CHECK_BOX_CHECKED);
261
262                 delete pDisabledHandlerBitmap;
263                 pDisabledHandlerBitmap = null;
264
265                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF_HANDLER_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledHandlerBitmap);
266                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
267
268                 _pCheckBitmaps[BITMAP_UNCHECKED_DISABLED] = CreateOnOffMergedBitmapN(*pDisabledNormalBitmap, *pDisabledHandlerBitmap, CHECK_BOX_UNCHECKED);
269         }
270         else
271         {
272                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBitmap);
273                 SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, GetErrorMessage(r), "[%s] Propagating.", GetErrorMessage(r));
274
275                 _pCheckBitmaps[BITMAP_UNCHECKED] = CreateMergedBitmapN(*pNormalBitmap, pSelectedBitmap);
276
277                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBitmap);
278                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
279
280                 _pCheckBitmaps[BITMAP_UNCHECKED_PRESSED] = CreateMergedBitmapN(*pPressedBitmap, pSelectedBitmap);
281
282                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_CHECK_MARK_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap);
283                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
284
285                 _pCheckBitmaps[BITMAP_CHECKED] = CreateMergedBitmapN(*pNormalBitmap, pSelectedBitmap);
286
287                 delete pSelectedBitmap;
288                 pSelectedBitmap = null;
289
290                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_CHECK_MARK_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap);
291                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
292
293                 _pCheckBitmaps[BITMAP_CHECKED_PRESSED] = CreateMergedBitmapN(*pPressedBitmap, pSelectedBitmap);
294
295                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledNormalBitmap);
296                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
297
298                 r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_CHECK_MARK_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledSelectedBitmap);
299                 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
300
301                 _pCheckBitmaps[BITMAP_CHECKED_DISABLED] = CreateMergedBitmapN(*pDisabledNormalBitmap, pDisabledSelectedBitmap);
302         }
303
304         delete pNormalBitmap;
305         delete pSelectedBitmap;
306         delete pHandlerBitmap;
307         delete pDisabledNormalBitmap;
308         delete pDisabledSelectedBitmap;
309         delete pDisabledHandlerBitmap;
310         delete pPressedBitmap;
311
312         return r;
313
314 CATCH:
315         delete pNormalBitmap;
316         delete pSelectedBitmap;
317         delete pHandlerBitmap;
318         delete pDisabledNormalBitmap;
319         delete pDisabledSelectedBitmap;
320         delete pDisabledHandlerBitmap;
321         delete pPressedBitmap;
322
323         return r;
324
325 }
326
327 Tizen::Ui::Controls::TableViewAnnexStyle
328 _ListBaseImpl::GetAnnexStyle(void)
329 {
330     return _annexStyle;
331 }
332
333 Tizen::Graphics::Bitmap**
334 _ListBaseImpl::GetCheckBitmaps(void)
335 {
336         return _pCheckBitmaps;
337 }
338
339 result
340 _ListBaseImpl::SetItemChecked(int groupIndex, int itemIndex, bool check)
341 {
342         return E_SUCCESS;
343 }
344
345 bool
346 _ListBaseImpl::IsItemChecked(int groupIndex, int itemIndex) const
347 {
348         return false;
349 }
350
351 void
352 _ListBaseImpl::OnTouchDoublePressed(const Control &source, const Point &currentPosition, const TouchEventInfo &touchInfo)
353 {
354         return;
355 }
356
357 void
358 _ListBaseImpl::OnTouchFocusIn(const Control &source, const Point &currentPosition, const TouchEventInfo &touchInfo)
359 {
360         return;
361 }
362
363 void
364 _ListBaseImpl::OnTouchFocusOut(const Control &source, const Point &currentPosition, const TouchEventInfo &touchInfo)
365 {
366         OnTouchReleased(source, currentPosition, touchInfo);
367         return;
368 }
369
370 void
371 _ListBaseImpl::OnTouchLongPressed(const Control &source, const Point &currentPosition, const TouchEventInfo &touchInfo)
372 {
373         return;
374 }
375
376 void
377 _ListBaseImpl::OnTouchMoved(const Control &source, const Point &currentPosition, const TouchEventInfo &touchInfo)
378 {
379         return;
380 }
381
382 void
383 _ListBaseImpl::OnTouchPressed(const Control &source, const Point &currentPosition, const TouchEventInfo &touchInfo)
384 {
385         CustomListItem* pCustomListItem = GetItemFromControl(source);
386         SysTryReturnVoidResult(NID_UI_CTRL, pCustomListItem, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item");
387
388         pCustomListItem->__pCustomListItemImpl->StartSliding();
389
390     UpdateElements(source, CUSTOM_LIST_ITEM_STATUS_FOCUSED);
391     return;
392 }
393
394 void
395 _ListBaseImpl::OnTouchReleased(const Control &source, const Point &currentPosition, const TouchEventInfo &touchInfo)
396 {
397         CustomListItem* pCustomListItem = GetItemFromControl(source);
398         SysTryReturnVoidResult(NID_UI_CTRL, pCustomListItem, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item");
399
400         pCustomListItem->__pCustomListItemImpl->StopSliding();
401
402     UpdateElements(source, CUSTOM_LIST_ITEM_STATUS_NORMAL);
403     return;
404 }
405
406 CustomListItem*
407 _ListBaseImpl::GetItemFromControl(const Control &source)
408 {
409     _ITableViewBaseItemData* pBaseData = dynamic_cast<_ITableViewBaseItemData*>(const_cast<Control*>(&source));
410     SysTryReturn(NID_UI_CTRL, (pBaseData != null), null, E_SYSTEM, "[E_SYSTEM]  A system error has occurred. Failed to get item.");
411
412     int groupIndex = -1;
413     int itemIndex = -1;
414
415     pBaseData->GetIndex(groupIndex, itemIndex);
416
417     return GetCustomListItemAt(groupIndex, itemIndex- GetTopItemIndex(groupIndex));
418 }
419
420 void
421 _ListBaseImpl::UpdateElements(const Control &source, CustomListItemStatus itemStatus)
422 {
423         _ITableViewBaseItemData* pBaseData = dynamic_cast<_ITableViewBaseItemData*>(const_cast<Control*>(&source));
424         SysTryReturnVoidResult(NID_UI_CTRL, (pBaseData != null), E_SYSTEM, "[E_SYSTEM]  A system error has occurred. Failed to get item.");
425
426         int groupIndex = -1;
427         int itemIndex = -1;
428
429         pBaseData->GetIndex(groupIndex, itemIndex);
430
431         CustomListItem* pCustomListItem = GetCustomListItemAt(groupIndex, itemIndex - GetTopItemIndex(groupIndex));
432         SysTryReturnVoidResult(NID_UI_CTRL, pCustomListItem, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item");
433
434         LinkedList* pElements = &pCustomListItem->__pCustomListItemImpl->elements;
435
436         int elementCount = pElements->GetCount();
437         for (int i = 0; i < elementCount; i++)
438         {
439                 _ElementBaseModel* pElementBase = dynamic_cast<_ElementBaseModel*>(pElements->GetAt(i));
440                 SysTryReturnVoidResult(NID_UI_CTRL, (pElementBase != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get element.");
441
442                 if (pElementBase->_elementType != LIST_ITEM_ELEMENT_TYPE_CHECKBOX)
443                 {
444                         pElementBase->HandleElementEvent(itemStatus);
445                 }
446         }
447
448         DrawItem(groupIndex, itemIndex);
449 }
450
451 int
452 _ListBaseImpl::GetTopItemIndex(int groupIndex) const
453 {
454         return 0;
455 }
456
457 bool
458 _ListBaseImpl::IsItemNew(const CustomListItem& item) const
459 {
460         for (int itemCount = 0; itemCount < _itemsList.GetCount(); itemCount++)
461         {
462                 CustomListItem* pCustomListItem = dynamic_cast<CustomListItem*>(const_cast<Object*>(_itemsList.GetAt(itemCount)));
463                 SysTryReturnResult(NID_UI_CTRL, pCustomListItem, E_SYSTEM,
464                                    "A system error has occurred. Failed to get CustomList item at index %d.", itemCount);
465
466                 _CustomListItemImpl* pCustomListItemImpl = pCustomListItem->__pCustomListItemImpl;
467                 SysTryReturnResult(NID_UI_CTRL, pCustomListItemImpl, E_SYSTEM, "A system error has occurred. Failed to get an item at index(%d)", itemCount);
468
469                 if ((pCustomListItem == const_cast<CustomListItem*>(&item)) && (pCustomListItemImpl->itemId == item.__pCustomListItemImpl->itemId))
470                 {
471                         return false;
472                 }
473
474                 for (int subItemCount = 0; subItemCount < GetSubItemCountAt(itemCount); subItemCount++)
475                 {
476                         CustomListItem* pCustomListItem = dynamic_cast<CustomListItem*>(const_cast<Object*>(pCustomListItemImpl->__pSubItemsList->GetAt(subItemCount)));
477                         SysTryReturnResult(NID_UI_CTRL, pCustomListItem, E_SYSTEM,
478                                            "A system error has occurred. Failed to get CustomList item at index %d.", itemCount);
479
480                         if ((pCustomListItem == const_cast<CustomListItem*>(&item)) && (pCustomListItem->__pCustomListItemImpl->itemId == item.__pCustomListItemImpl->itemId))
481                         {
482                                 return false;
483                         }
484                 }
485         }
486
487         return true;
488 }
489
490 result
491 _ListBaseImpl::UpdateIndices(int groupIndex, int itemIndex, int updateBy)
492 {
493         int index = 0;
494         if (updateBy == -1)
495         {
496                 index = itemIndex;
497         }
498         else
499         {
500                 index = itemIndex + 1;
501         }
502
503         if (groupIndex == -1)
504         {
505                 for (; index < _itemsList.GetCount(); index++)
506                 {
507                         _TableViewItemData* pTableViewItemData = GetTableViewItemAt(-1, index);
508
509                         if (pTableViewItemData)
510                         {
511                                 pTableViewItemData->itemIndex += updateBy;
512                         }
513                 }
514
515                 if (_currentRadioIndex >= itemIndex)
516                 {
517                         _currentRadioIndex += updateBy;
518                 }
519         }
520         else if (itemIndex == -1)
521         {
522                 for (int index = groupIndex; index < _itemsList.GetCount(); index++)
523                 {
524                         _TableViewGroupItemData* pGroupItem = GetTableViewGroupItemAt(index);
525
526                         if (pGroupItem)
527                         {
528                                 pGroupItem->groupIndex += updateBy;
529                         }
530                 }
531
532                 if (_currentRadioGroupIndex >= groupIndex)
533                 {
534                         _currentRadioGroupIndex += updateBy;
535                 }
536         }
537         else
538         {
539                 int subItemCount = GetSubItemCountAt(groupIndex);
540
541                 for (; index < subItemCount; index++)
542                 {
543                         _TableViewItemData* pTableViewItemData = GetTableViewItemAt(groupIndex, index);
544
545                         if (pTableViewItemData)
546                         {
547                                 pTableViewItemData->itemIndex += updateBy;
548                         }
549                 }
550
551                 if (_currentRadioIndex >= itemIndex)
552                 {
553                         _currentRadioIndex += updateBy;
554                 }
555         }
556
557         return E_SUCCESS;
558 }
559
560 result
561 _ListBaseImpl::InsertIntoItemsList(const CustomListItem& item, int groupIndex, int itemIndex, bool updateIndices)
562 {
563         result r = E_SUCCESS;
564
565         if (GetCore().GetFirstDrawnFlag() == true)
566         {
567                 updateIndices = false;
568         }
569
570         if (groupIndex == -1)
571         {
572                 r = _itemsList.InsertAt(item, itemIndex);
573                 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
574         }
575         else if (itemIndex == -1)
576         {
577                 r = _itemsList.InsertAt(item, groupIndex);
578                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to insert an item.");
579         }
580         else
581         {
582                 CustomListItem* pCustomListItem = GetCustomListItemAt(groupIndex, -1);
583                 SysTryReturnResult(NID_UI_CTRL, pCustomListItem, E_SYSTEM, "A system error has occurred. Failed to get item at %d index.", groupIndex);
584
585                 if (pCustomListItem->__pCustomListItemImpl->__pSubItemsList == null)
586                 {
587                         pCustomListItem->__pCustomListItemImpl->__pSubItemsList = new (std::nothrow) ArrayList(_CustomListItemImpl::DeleteCustomListItem);
588                         SysTryReturnResult(NID_UI_CTRL, pCustomListItem->__pCustomListItemImpl->__pSubItemsList, E_OUT_OF_MEMORY, "Memory allocation failed.");
589
590                         pCustomListItem->__pCustomListItemImpl->__pSubItemsList->Construct(1);
591                 }
592
593                 pCustomListItem->__pCustomListItemImpl->__pSubItemsList->InsertAt(item, itemIndex);
594         }
595
596         if (updateIndices)
597         {
598                 return UpdateIndices(groupIndex, itemIndex, 1);
599         }
600         else
601         {
602                 return E_SUCCESS;
603         }
604 }
605
606 result
607 _ListBaseImpl::RemoveFromItemsList(int groupIndex, int itemIndex, bool updateIndices)
608 {
609         result r = E_SUCCESS;
610
611         if (GetCore().GetFirstDrawnFlag() == true)
612         {
613                 updateIndices = false;
614         }
615
616         if (groupIndex == -1)
617         {
618                 r = _itemsList.RemoveAt(itemIndex, true);
619                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "A system error has occurred. Failed to remove an item.");
620         }
621         else if (itemIndex == -1)
622         {
623                 r = _itemsList.RemoveAt(groupIndex, true);
624                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to remove an item.");
625         }
626         else
627         {
628                 CustomListItem* pCustomListGroupItem = dynamic_cast<CustomListItem*>(const_cast<Object*>(_itemsList.GetAt(groupIndex)));
629                 SysTryReturnResult(NID_UI_CTRL, pCustomListGroupItem, E_SYSTEM, "A system error has occurred. Failed to get an item at groupIndex(%d)", groupIndex);
630
631                 ArrayList* pList = pCustomListGroupItem->__pCustomListItemImpl->__pSubItemsList;
632                 SysTryReturnResult(NID_UI_CTRL, pList, E_SYSTEM, "A system error has occurred. Failed to get subItem at groupIndex(%d) itemIndex(%d)", groupIndex, itemIndex);
633
634                 r = pList->RemoveAt(itemIndex, true);
635                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "A system error has occurred. Failed to remove an item.");
636         }
637
638         if (updateIndices)
639         {
640                 return UpdateIndices(groupIndex, itemIndex, -1);
641         }
642         else
643         {
644                 return E_SUCCESS;
645         }
646
647 }
648
649 result
650 _ListBaseImpl::SetInItemsList(const CustomListItem& item, int groupIndex, int itemIndex)
651 {
652         result r = E_SUCCESS;
653
654         if (groupIndex == -1)
655         {
656                 r = _itemsList.SetAt(item, itemIndex, true);
657                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "A system error has occurred. Failed to remove an item.");
658         }
659         else if (itemIndex == -1)
660         {
661                 CustomListItem* pOldItem = GetCustomListItemAt(groupIndex, -1);
662                 SysTryReturnResult(NID_UI_CTRL, pOldItem, E_SYSTEM, "A system error has occurred. Failed to get current item.");
663
664                 item.__pCustomListItemImpl->__pTableViewGroupItemData = pOldItem->__pCustomListItemImpl->__pTableViewGroupItemData;
665                 item.__pCustomListItemImpl->__pSubItemsList = pOldItem->__pCustomListItemImpl->__pSubItemsList;
666
667                 r = _itemsList.SetAt(item, groupIndex, true);
668                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to remove an item.");
669         }
670         else
671         {
672                 CustomListItem* pCustomListGroupItem = GetCustomListItemAt(groupIndex, -1);
673                 SysTryReturnResult(NID_UI_CTRL, pCustomListGroupItem, E_SYSTEM, "A system error has occurred. Failed to get GroupItem at %d index.", groupIndex);
674
675                 ArrayList* pList = pCustomListGroupItem->__pCustomListItemImpl->__pSubItemsList;
676                 SysTryReturnResult(NID_UI_CTRL, pList, E_SYSTEM, "A system error has occurred. Failed to get subItem at groupIndex(%d) itemIndex(%d)", groupIndex, itemIndex);
677
678                 pList->SetAt(item, itemIndex, true);
679         }
680
681         return E_SUCCESS;
682 }
683
684 void
685 _ListBaseImpl::RemoveAllFromItemsList(void)
686 {
687         _itemsList.RemoveAll(true);
688 }
689
690 CustomListItem*
691 _ListBaseImpl::GetCustomListItemAt(int groupIndex, int itemIndex)
692 {
693         const CustomListItem* pItem = (static_cast<const _ListBaseImpl*>(this))->GetCustomListItemAt(groupIndex, itemIndex);
694         return const_cast<CustomListItem*>(pItem);
695 }
696
697 const CustomListItem*
698 _ListBaseImpl::GetCustomListItemAt(int groupIndex, int itemIndex) const
699 {
700         if (groupIndex == -1)
701         {
702                 CustomListItem* pCustomListItem = dynamic_cast<CustomListItem*>(const_cast<Object*>(_itemsList.GetAt(itemIndex)));
703                 SysTryReturn(NID_UI_CTRL, pCustomListItem, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument used. itemIndex = %d", itemIndex);
704
705                 return pCustomListItem;
706         }
707         else if (itemIndex == -1)
708         {
709                 CustomListItem* pCustomListItem = dynamic_cast<CustomListItem*>(const_cast<Object*>(_itemsList.GetAt(groupIndex)));
710                 SysTryReturn(NID_UI_CTRL, pCustomListItem, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument used. groupIndex = %d", groupIndex);
711
712                 return pCustomListItem;
713         }
714         else
715         {
716                 CustomListItem* pCustomListGroupItem = dynamic_cast<CustomListItem*>(const_cast<Object*>(_itemsList.GetAt(groupIndex)));
717                 SysTryReturn(NID_UI_CTRL, pCustomListGroupItem, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d)", groupIndex);
718
719                 ArrayList* pList = pCustomListGroupItem->__pCustomListItemImpl->__pSubItemsList;
720                 SysTryReturn(NID_UI_CTRL, pList, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get subItem at groupIndex(%d) itemIndex(%d)", groupIndex, itemIndex);
721
722                 CustomListItem* pCustomListItem = dynamic_cast<CustomListItem*>(const_cast<Object*>(pList->GetAt(itemIndex)));
723                 SysTryReturn(NID_UI_CTRL, pCustomListItem, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d) itemIndex(%d)", groupIndex, itemIndex);
724
725                 return pCustomListItem;
726         }
727 }
728
729 _TableViewItemData*
730 _ListBaseImpl::GetTableViewItemAt(int groupIndex, int itemIndex)
731 {
732         const _TableViewItemData* pTableViewItemData = (static_cast<const _ListBaseImpl*>(this))->GetTableViewItemAt(groupIndex, itemIndex);
733         return const_cast<_TableViewItemData*>(pTableViewItemData);
734 }
735
736 const _TableViewItemData*
737 _ListBaseImpl::GetTableViewItemAt(int groupIndex, int itemIndex) const
738 {
739         const CustomListItem* pCustomListGroupItem = (static_cast<const _ListBaseImpl*>(this))->GetCustomListItemAt(groupIndex, itemIndex);
740         SysTryReturn(NID_UI_CTRL, pCustomListGroupItem, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d) itemIndex(%d)", groupIndex, itemIndex);
741
742         SysTryReturn(NID_UI_CTRL, pCustomListGroupItem->__pCustomListItemImpl, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d) itemIndex(%d)", groupIndex, itemIndex);
743
744         return pCustomListGroupItem->__pCustomListItemImpl->__pTableViewItemData;
745 }
746
747 _TableViewGroupItemData*
748 _ListBaseImpl::GetTableViewGroupItemAt(int groupIndex)
749 {
750         const _TableViewGroupItemData* pTableViewGroupItemData = (static_cast<const _ListBaseImpl*>(this))->GetTableViewGroupItemAt(groupIndex);
751         return const_cast<_TableViewGroupItemData*>(pTableViewGroupItemData);
752 }
753
754 const _TableViewGroupItemData*
755 _ListBaseImpl::GetTableViewGroupItemAt(int groupIndex) const
756 {
757         const CustomListItem* pCustomListGroupItem = (static_cast<const _ListBaseImpl*>(this))->GetCustomListItemAt(groupIndex, -1);
758         SysTryReturn(NID_UI_CTRL, pCustomListGroupItem, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d)", groupIndex);
759
760         SysTryReturn(NID_UI_CTRL, pCustomListGroupItem->__pCustomListItemImpl, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d)", groupIndex);
761
762         return pCustomListGroupItem->__pCustomListItemImpl->__pTableViewGroupItemData;
763 }
764
765 _CheckElementModel*
766 _ListBaseImpl::GetCheckElementAt(int groupIndex, int itemIndex)
767 {
768         const _CheckElementModel* pCheckElementModel = (static_cast<const _ListBaseImpl*>(this))->GetCheckElementAt(groupIndex, itemIndex);
769         return const_cast<_CheckElementModel*>(pCheckElementModel);
770 }
771
772 const _CheckElementModel*
773 _ListBaseImpl::GetCheckElementAt(int groupIndex, int itemIndex) const
774 {
775         const CustomListItem* pCustomListItem = GetCustomListItemAt(groupIndex, itemIndex);
776         SysTryReturn(NID_UI_CTRL, pCustomListItem, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d), itemIndex(%d)", groupIndex, itemIndex);
777
778         SysTryReturn(NID_UI_CTRL, pCustomListItem->__pCustomListItemImpl, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d), itemIndex(%d)", groupIndex, itemIndex);
779
780         return pCustomListItem->__pCustomListItemImpl->GetCheckElement();
781 }
782
783 void
784 _ListBaseImpl::DrawItem(int groupIndex, int itemIndex)
785 {
786         if (itemIndex == -1)
787         {
788                 _TableViewGroupItemData* pTableViewGroupItemData = GetTableViewGroupItemAt(groupIndex);
789
790                 if (pTableViewGroupItemData)
791                 {
792                         pTableViewGroupItemData->Invalidate(true);
793                 }
794         }
795         else
796         {
797                 _TableViewItemData* pTableViewItemData = GetTableViewItemAt(groupIndex, itemIndex);
798
799                 if (pTableViewItemData)
800                 {
801                         pTableViewItemData->Invalidate(true);
802                 }
803         }
804 }
805
806 result
807 _ListBaseImpl::SetListStyle(CustomListStyle style)
808 {
809         result r = E_SUCCESS;
810
811         switch (style)
812         {
813         case CUSTOM_LIST_STYLE_NORMAL:
814                 _annexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
815                 break;
816
817         case CUSTOM_LIST_STYLE_RADIO:
818                 _annexStyle = TABLE_VIEW_ANNEX_STYLE_RADIO;
819                 break;
820
821         case CUSTOM_LIST_STYLE_RADIO_WITH_DIVIDER:
822                 _annexStyle = TABLE_VIEW_ANNEX_STYLE_RADIO;
823                 _isDividerEnabled = true;
824                 break;
825
826         case CUSTOM_LIST_STYLE_MARK:
827                 _annexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
828                 break;
829
830         case CUSTOM_LIST_STYLE_MARK_WITH_DIVIDER:
831                 _annexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
832                 _isDividerEnabled = true;
833                 break;
834
835         case CUSTOM_LIST_STYLE_ONOFF:
836                 _annexStyle = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
837                 break;
838
839         case CUSTOM_LIST_STYLE_ONOFF_WITH_DIVIDER:
840                 _annexStyle = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
841                 _isDividerEnabled = true;
842                 break;
843
844         default:
845                 SysLog(NID_UI_CTRL, "[E_INVALID_ARG] Invalid argument used. style is invalid.");
846                 r = E_INVALID_ARG;
847                 break;
848         }
849
850         return r;
851 }
852
853 _TableView&
854 _ListBaseImpl::GetCore(void)
855 {
856         return static_cast<_TableView&>(_ControlImpl::GetCore());
857 }
858
859 const _TableView&
860 _ListBaseImpl::GetCore(void) const
861 {
862         return static_cast<const _TableView&>(_ControlImpl::GetCore());
863 }
864
865 void
866 _ListBaseImpl::SetTextOfEmptyList(const String& text)
867 {
868         if (text.IsEmpty())
869         {
870                 if (__pEmptyText != null)
871                 {
872                         GetCore().DetachChild(*__pEmptyText);
873
874                         delete __pEmptyText;
875                         __pEmptyText = null;
876                 }
877         }
878         else
879         {
880                 if (__pEmptyText == null)
881                 {
882                         __pEmptyText = _Label::CreateLabelN();
883                         SysTryReturnVoidResult(NID_UI_CTRL, (__pEmptyText != null), E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
884
885                         __pEmptyText->SetVisibleState(false);
886                         __pEmptyText->SetMargin(0, 0);
887
888                         GetCore().AttachChild(*__pEmptyText);
889                 }
890
891                 TextObject* pText = new (std::nothrow) TextObject;
892                 SysTryReturnVoidResult(NID_UI_CTRL, (pText != null), E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
893
894                 pText->Construct();
895
896                 TextSimple* pSimpleText = new (std::nothrow) TextSimple(const_cast <wchar_t*>(text.GetPointer()), text.GetLength());
897                 SysTryReturnVoidResult(NID_UI_CTRL, (pSimpleText != null), E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
898
899                 pText->AppendElement(*pSimpleText);
900
901                 int textSize = 0;
902                 GET_SHAPE_CONFIG(LIST::EMPTY_LIST_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, textSize);
903
904                 Font font;
905                 font.Construct(GetFont(), FONT_STYLE_PLAIN, textSize);
906                 pText->SetFont(&font, 0, pText->GetTextLength());
907
908                 FloatDimension listDimension = GetCore().GetSizeF();
909
910                 pText->SetBounds(FloatRectangle(0.0f, 0.0f, listDimension.width, 1.0f));
911                 pText->Compose();
912
913                 FloatDimension labelDimension = pText->GetTextExtentF(0, pText->GetTextLength());
914                 labelDimension.height = pText->GetTotalHeightF();
915
916                 if (labelDimension.width > listDimension.width)
917                 {
918                         pText->SetBounds(FloatRectangle(0.0f, 0.0f, listDimension.width, 1.0f));
919                         pText->Compose();
920
921                         float labelHeight = pText->GetTotalHeightF();
922
923                         labelDimension.width = listDimension.width;
924                         labelDimension.height = ((listDimension.height < labelHeight) ? listDimension.height : labelHeight);
925                 }
926
927                 delete pText;
928
929                 FloatRectangle bounds = GetCore().GetBoundsF();
930
931                 __pEmptyText->SetBounds(FloatRectangle((bounds.width - labelDimension.width)/2.0f, (bounds.height - labelDimension.height)/2.0f, labelDimension.width, labelDimension.height));
932                 __pEmptyText->SetBackgroundColor(Color(0, 0, 0, 0));
933                 __pEmptyText->SetTextColor(__emptyTextColor);
934                 __pEmptyText->SetTextConfig(textSize, LABEL_TEXT_STYLE_NORMAL);
935                 __pEmptyText->SetText(text);
936         }
937
938         return;
939 }
940
941 void
942 _ListBaseImpl::SetTextColorOfEmptyList(const Color& color)
943 {
944         __emptyTextColor = color;
945
946         if (__pEmptyText != null)
947         {
948                 __pEmptyText->SetTextColor(color);
949         }
950
951         return;
952 }
953
954 Color
955 _ListBaseImpl::GetTextColorOfEmptyList(void) const
956 {
957         return __emptyTextColor;
958 }
959
960 result
961 _ListBaseImpl::GetTopDrawnItemIndex(int& groupIndex, int& itemIndex) const
962 {
963         result r = GetCore().GetTopDrawnItemIndex(groupIndex, itemIndex);
964         SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
965
966         return E_SUCCESS;
967 }
968
969 result
970 _ListBaseImpl::GetBottomDrawnItemIndex(int& groupIndex, int& itemIndex) const
971 {
972         result r = GetCore().GetBottomDrawnItemIndex(groupIndex, itemIndex);
973         SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
974
975         return E_SUCCESS;
976 }
977
978 result
979 _ListBaseImpl::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex) const
980 {
981         return GetCore().GetItemIndexFromPosition(position, groupIndex, itemIndex);
982 }
983
984 int
985 _ListBaseImpl::GetItemCount(void) const
986 {
987         return _itemsList.GetCount();
988 }
989
990 int
991 _ListBaseImpl::GetGroupCount(void) const
992 {
993         return _itemsList.GetCount();
994 }
995
996 int
997 _ListBaseImpl::GetSubItemCountAt(int groupIndex) const
998 {
999         result r = E_SUCCESS;
1000
1001         const CustomListItem* pCustomListItem = GetCustomListItemAt(groupIndex, -1);
1002         r = GetLastResult();
1003         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), -1, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
1004
1005         ArrayList* pList = pCustomListItem->__pCustomListItemImpl->__pSubItemsList;
1006         SysTryReturn(NID_UI_CTRL, pList, 0, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get subItemsList at groupIndex(%d)", groupIndex);
1007
1008         return pList->GetCount();
1009 }
1010
1011 result
1012 _ListBaseImpl::RemoveFromSubItemsList(int groupIndex)
1013 {
1014         result r = E_SUCCESS;
1015
1016         const CustomListItem* pCustomListItem = GetCustomListItemAt(groupIndex, -1);
1017         r = GetLastResult();
1018         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
1019
1020         ArrayList* pList = pCustomListItem->__pCustomListItemImpl->__pSubItemsList;
1021
1022         if (pList)
1023         {
1024                 pList->RemoveAll();
1025                 delete pList;
1026                 pCustomListItem->__pCustomListItemImpl->__pSubItemsList = null;
1027         }
1028
1029         return E_SUCCESS;
1030 }
1031
1032 void
1033 _ListBaseImpl::OnDraw(void)
1034 {
1035         _ControlImpl::OnDraw();
1036
1037         bool isEmpty = (GetItemCount() <= 0);
1038
1039         if (__pEmptyText != null)
1040         {
1041                 __pEmptyText->SetVisibleState(isEmpty);
1042         }
1043 }
1044
1045 void
1046 _ListBaseImpl::OnBoundsChanged(void)
1047 {
1048         GetCore().OnBoundsChanged();
1049 }
1050
1051 }}} //Tizen::Ui::Controls