Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrlExpandableList.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                 FUiCtrlExpandableList.cpp
20 * @brief                This is the implementation file for FUiCtrlExpandableList class.
21 *
22 */
23
24 #include <FUiCtrlExpandableList.h>
25 #include <FBaseSysLog.h>
26 #include "FUiCtrl_CustomListImpl.h"
27 #include "FUiCtrl_ExpandableListImpl.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Graphics;
32
33
34 namespace Tizen { namespace Ui { namespace Controls
35 {
36
37 ExpandableList::ExpandableList(void)
38 {
39 }
40
41 ExpandableList::~ExpandableList(void)
42 {
43 }
44
45 result
46 ExpandableList::Construct(const Rectangle& rect, CustomListStyle style, bool itemDivider)
47 {
48         result r = E_SUCCESS;
49
50         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
51         SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class");
52
53         pImpl = _ExpandableListImpl::CreateExpandableListImplN(this, rect, itemDivider);
54         r = GetLastResult();
55         SysTryReturn(NID_UI_CTRL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
56
57         _pControlImpl = pImpl;
58
59         r = pImpl->UpdateBounds(rect);
60         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
61
62         r = pImpl->SetListStyle(style);
63         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[E_SYSTEM] A system error occurred.");
64
65         r = pImpl->Initialize();
66         SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
67
68         r = pImpl->LoadDefaultBitmap();
69         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[E_SYSTEM] A system error occurred.");
70
71         ClearLastResult();
72
73         return E_SUCCESS;
74
75 CATCH:
76         Dispose();
77         return E_SYSTEM;
78 }
79
80 void
81 ExpandableList::AddExpandableItemEventListener(IExpandableItemEventListener& listener)
82 {
83         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
84         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
85
86         result r = pImpl->AddExpandableItemEventListener(listener);
87
88         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
89         SetLastResult(E_SUCCESS);
90
91         return;
92 }
93
94 void
95 ExpandableList::RemoveExpandableItemEventListener(IExpandableItemEventListener& listener)
96 {
97         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
98         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
99
100         result r = pImpl->RemoveExpandableItemEventListener(listener);
101
102         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
103         SetLastResult(E_SUCCESS);
104
105         return;
106 }
107
108 result
109 ExpandableList::AddItem(const CustomListItem& item, int itemId)
110 {
111         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
112         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
113
114         return pImpl->AddItem(item, itemId);
115 }
116
117 result
118 ExpandableList::InsertItemAt(int index, const CustomListItem& item, int itemId)
119 {
120         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
121         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
122
123         result r = pImpl->InsertItemAt(index, item, itemId);
124         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
125
126         return E_SUCCESS;
127 }
128
129 result
130 ExpandableList::SetItemAt(int index, const CustomListItem& item, int itemId)
131 {
132         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
133         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
134         SetLastResult(E_SUCCESS);
135
136         result r = pImpl->SetItemAt(index, item, itemId);
137         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
138
139         return E_SUCCESS;
140 }
141
142 result
143 ExpandableList::RemoveItemAt(int mainIndex)
144 {
145         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
146         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
147
148         result r = pImpl->RemoveItemAt(mainIndex);
149         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
150
151         return E_SUCCESS;
152 }
153
154 result
155 ExpandableList::RemoveAllItems(void)
156 {
157         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
158         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
159
160         result r = pImpl->RemoveAllItems();
161         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
162
163         return E_SUCCESS;
164 }
165
166 const CustomListItem*
167 ExpandableList::GetItemAt(int index) const
168 {
169         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
170         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
171
172         const CustomListItem* pItem = pImpl->GetCustomListItemAt(index, -1);
173         return pItem;
174 }
175
176 result
177 ExpandableList::AddSubItem(int mainIndex, const CustomListItem& item, int itemId)
178 {
179         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
180         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
181
182         result r = pImpl->AddSubItem(mainIndex, item, itemId);
183         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
184
185         return E_SUCCESS;
186 }
187
188 result
189 ExpandableList::InsertSubItemAt(int mainIndex, int subIndex, const CustomListItem& item, int itemId)
190 {
191         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
192         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
193
194         result r = pImpl->InsertSubItemAt(mainIndex, subIndex, item, itemId);
195         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
196
197         return E_SUCCESS;
198 }
199
200 result
201 ExpandableList::SetSubItemAt(int mainIndex, int subIndex, const CustomListItem& item, int itemId)
202 {
203         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
204         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
205
206         result r = pImpl->SetSubItemAt(mainIndex, subIndex, item, itemId);
207         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
208
209         return E_SUCCESS;
210 }
211
212 result
213 ExpandableList::RemoveSubItemAt(int mainIndex, int subIndex)
214 {
215         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
216         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
217
218         result r = pImpl->RemoveSubItemAt(mainIndex, subIndex);
219         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
220
221         return E_SUCCESS;
222 }
223
224 result
225 ExpandableList::RemoveAllSubItemsAt(int mainIndex)
226 {
227         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
228         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
229
230         result r = pImpl->RemoveAllSubItemsAt(mainIndex);
231         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
232
233         return E_SUCCESS;
234 }
235
236 int
237 ExpandableList::GetItemCount(void) const
238 {
239         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
240         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
241         SetLastResult(E_SUCCESS);
242
243         return pImpl->GetItemCount();
244 }
245
246 int
247 ExpandableList::GetSubItemCount(int mainIndex) const
248 {
249         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
250         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
251         SetLastResult(E_SUCCESS);
252
253         return pImpl->GetSubItemCount(mainIndex);
254 }
255
256 const CustomListItem*
257 ExpandableList::GetSubItemAt(int mainIndex, int subIndex) const
258 {
259         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
260         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
261
262         SysTryReturn(NID_UI_CTRL, (mainIndex >= 0 && subIndex >= 0), null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument used. mainIndex = %d subIndex = %d", mainIndex, subIndex);
263
264         const CustomListItem* pItem = pImpl->GetCustomListItemAt(mainIndex, subIndex);
265         return pItem;
266 }
267
268 int
269 ExpandableList::GetFirstCheckedItemIndex(void) const
270 {
271         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
272         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
273         SetLastResult(E_SUCCESS);
274
275         return pImpl->GetFirstCheckedItemIndex();
276 }
277
278 int
279 ExpandableList::GetItemIdAt(int mainIndex) const
280 {
281         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
282         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
283         SetLastResult(E_SUCCESS);
284
285         return pImpl->GetItemIdAt(mainIndex);
286 }
287
288 int
289 ExpandableList::GetItemIndexFromItemId(int itemId) const
290 {
291         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
292         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
293         SetLastResult(E_SUCCESS);
294
295         return pImpl->GetItemIndexFromItemId(itemId);
296 }
297
298 int
299 ExpandableList::GetSubItemIdAt(int mainIndex, int subIndex) const
300 {
301         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
302         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
303         SetLastResult(E_SUCCESS);
304
305         return pImpl->GetSubItemIdAt(mainIndex, subIndex);
306 }
307
308 result
309 ExpandableList::SetItemExpanded(int mainIndex, bool expand)
310 {
311         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
312         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
313
314         return pImpl->SetItemExpanded(mainIndex, expand);
315 }
316
317 bool
318 ExpandableList::IsItemExpanded(int mainIndex) const
319 {
320         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
321         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
322         SetLastResult(E_SUCCESS);
323
324         return pImpl->IsItemExpanded(mainIndex);
325 }
326
327 result
328 ExpandableList::SetItemEnabled(int mainIndex, bool enable)
329 {
330         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
331         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
332
333         result r = pImpl->SetItemEnabled(mainIndex, enable);
334         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
335
336         return E_SUCCESS;
337 }
338
339 bool
340 ExpandableList::IsItemEnabled(int index) const
341 {
342         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
343         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
344         SetLastResult(E_SUCCESS);
345
346         return pImpl->IsItemEnabled(index);
347 }
348
349 result
350 ExpandableList::SetSubItemEnabled(int mainIndex, int subIndex, bool enable)
351 {
352         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
353         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
354
355         result r = pImpl->SetSubItemEnabled(mainIndex, subIndex, enable);
356         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
357
358         return E_SUCCESS;
359 }
360
361 bool
362 ExpandableList::IsSubItemEnabled(int mainIndex, int subIndex) const
363 {
364         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
365         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
366         SetLastResult(E_SUCCESS);
367
368         return pImpl->IsSubItemEnabled(mainIndex, subIndex);
369 }
370
371 result
372 ExpandableList::SetItemChecked(int mainIndex, bool check)
373 {
374         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
375         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
376
377         result r = pImpl->SetItemChecked(mainIndex, check);
378         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
379
380         return E_SUCCESS;
381 }
382
383 bool
384 ExpandableList::IsItemChecked(int mainIndex) const
385 {
386         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
387         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
388
389         return pImpl->IsItemChecked(mainIndex);
390 }
391
392 result
393 ExpandableList::SetSubItemChecked(int mainIndex, int subIndex, bool check)
394 {
395         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
396         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
397
398         result r = pImpl->SetSubItemChecked(mainIndex, subIndex, check);
399         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
400
401         return E_SUCCESS;
402 }
403
404 bool
405 ExpandableList::IsSubItemChecked(int mainIndex, int subIndex) const
406 {
407         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
408         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
409         SetLastResult(E_SUCCESS);
410
411         return pImpl->IsSubItemChecked(mainIndex, subIndex);
412 }
413
414 result
415 ExpandableList::SetAllSubItemsChecked(int mainIndex, bool check)
416 {
417         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
418         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
419
420         result r = pImpl->SetAllSubItemsChecked(mainIndex, check);
421         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
422
423         return E_SUCCESS;
424 }
425
426 result
427 ExpandableList::RemoveAllCheckedSubItemsAt(int mainIndex)
428 {
429         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
430         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
431
432         result r = pImpl->RemoveAllCheckedSubItemsAt(mainIndex);
433         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
434
435         return E_SUCCESS;
436 }
437
438 int
439 ExpandableList::GetFirstCheckedSubItemIndex(int mainIndex) const
440 {
441         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
442         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
443         SetLastResult(E_SUCCESS);
444
445         return pImpl->GetFirstCheckedSubItemIndex(mainIndex);
446 }
447
448 int
449 ExpandableList::GetLastCheckedItemIndex(void) const
450 {
451         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
452         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
453         SetLastResult(E_SUCCESS);
454
455         return pImpl->GetLastCheckedItemIndex();
456 }
457
458 int
459 ExpandableList::GetLastCheckedSubItemIndex(int mainIndex) const
460 {
461         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
462         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
463         SetLastResult(E_SUCCESS);
464
465         return pImpl->GetLastCheckedSubItemIndex(mainIndex);
466 }
467
468 int
469 ExpandableList::GetNextCheckedItemIndexAfter(int index) const
470 {
471         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
472         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
473         SetLastResult(E_SUCCESS);
474
475         return pImpl->GetNextCheckedItemIndexAfter(index);
476 }
477
478 int
479 ExpandableList::GetNextCheckedSubItemIndexAfter(int mainIndex, int subIndex) const
480 {
481         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
482         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
483         SetLastResult(E_SUCCESS);
484
485         return pImpl->GetNextCheckedSubItemIndexAfter(mainIndex, subIndex);
486 }
487
488 result
489 ExpandableList::GetSubItemIndexFromItemId(int itemId, int& mainIndex, int& subIndex) const
490 {
491         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
492         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
493
494         return pImpl->GetSubItemIndexFromItemId(itemId, mainIndex, subIndex);
495 }
496
497 result
498 ExpandableList::GetItemIndexFromPosition(int x, int y, int& mainIndex, int& subIndex) const
499 {
500         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
501         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
502
503         return pImpl->GetItemIndexFromPosition(Point(x, y), mainIndex, subIndex);
504 }
505
506 result
507 ExpandableList::GetItemIndexFromPosition(const Point& position, int& mainIndex, int& subIndex) const
508 {
509         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
510         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
511
512         return pImpl->GetItemIndexFromPosition(position, mainIndex, subIndex);
513 }
514
515 result
516 ExpandableList::GetTopDrawnItemIndex(int& mainIndex, int& subIndex) const
517 {
518         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
519         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
520
521         return pImpl->GetTopDrawnItemIndex(mainIndex, subIndex);
522 }
523
524 result
525 ExpandableList::GetBottomDrawnItemIndex(int& mainIndex, int& subIndex) const
526 {
527         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
528         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
529
530         return pImpl->GetBottomDrawnItemIndex(mainIndex, subIndex);
531 }
532
533 void
534 ExpandableList::SetBackgroundColor(const Color& color)
535 {
536         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
537         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
538         SetLastResult(E_SUCCESS);
539
540         pImpl->SetBgColor(color);
541         return;
542 }
543
544 void
545 ExpandableList::SetTextOfEmptyList(const String& text)
546 {
547         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
548         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
549         SetLastResult(E_SUCCESS);
550
551         pImpl->SetTextOfEmptyList(text);
552         return;
553 }
554
555 void
556 ExpandableList::SetTextColorOfEmptyList(const Color& color)
557 {
558         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
559         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
560
561         pImpl->SetTextColorOfEmptyList(color);
562         SetLastResult(E_SUCCESS);
563
564         return;
565 }
566
567 Color
568 ExpandableList::GetTextColorOfEmptyList(void) const
569 {
570         const _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
571         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
572         SetLastResult(E_SUCCESS);
573
574         return pImpl->GetTextColorOfEmptyList();
575 }
576
577 void
578 ExpandableList::ScrollToBottom(void)
579 {
580         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
581         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
582
583         result r = pImpl->ScrollToBottom();
584         SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
585         SetLastResult(E_SUCCESS);
586
587         return;
588 }
589
590 void
591 ExpandableList::ScrollToTop(void)
592 {
593         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
594         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
595         SetLastResult(E_SUCCESS);
596
597         result r = pImpl->ScrollToTop();
598         SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
599
600         return;
601 }
602
603 result
604 ExpandableList::ScrollToTop(int mainIndex, int subIndex)
605 {
606         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
607         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
608
609         result r = pImpl->ScrollToTop(mainIndex, subIndex);
610         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
611
612         return E_SUCCESS;
613 }
614
615 result
616 ExpandableList::ScrollToTop(int mainIndex)
617 {
618         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
619         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
620
621         result r = pImpl->ScrollToTop(mainIndex);
622         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
623
624         return E_SUCCESS;
625 }
626
627 result
628 ExpandableList::RefreshSubItem(int mainIndex, int subIndex)
629 {
630         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
631         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
632
633         result r = pImpl->RefreshSubItem(mainIndex, subIndex);
634         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
635
636         return E_SUCCESS;
637 }
638
639 result
640 ExpandableList::RefreshItem(int mainIndex)
641 {
642         _ExpandableListImpl* pImpl = _ExpandableListImpl::GetInstance(*this);
643         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
644
645         result r = pImpl->RefreshItem(mainIndex);
646         SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
647
648         return E_SUCCESS;
649 }
650
651 }}} //Tizen::Ui::Controls