Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_FastScrollIndex.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_FastScrollIndex.cpp
20  * @brief               This is the implementation file for the _FastScrollIndex class.
21  */
22
23 #include <wchar.h>
24 #include <FBaseSysLog.h>
25 #include <FGrp_BitmapImpl.h>
26 #include "FUiCtrl_FastScrollIndex.h"
27
28 using namespace Tizen::Base::Collection;
29
30 namespace
31 {
32         const char* _DELIMITER = "\n";
33 }
34
35 namespace Tizen { namespace Ui { namespace Controls
36 {
37
38 _FastScrollIndex::_FastScrollIndex(void)
39         : __pImage(null)
40         , __pText(null)
41         , __pParentIndex(null)
42         , __pChildIndexList(null)
43         , __pChildNextIndexList(null)
44         , __pChildPreviousIndexList(null)
45         , __pIndexObserver(null)
46         , __omitted(false)
47         , __indexType(FAST_SCROLL_INDEX_TYPE_NORMAL)
48 {
49 }
50
51 _FastScrollIndex::~_FastScrollIndex(void)
52 {
53         if (__pIndexObserver)
54         {
55                 __pIndexObserver->OnIndexDeleted(*this);
56         }
57
58         if (__pParentIndex)
59         {
60                 __pParentIndex->RemoveChildIndex(this, false);
61                 __pParentIndex = null;
62         }
63
64         RemoveChildren(true);
65
66         delete __pImage;
67         __pImage = null;
68
69         delete __pText;
70         __pText = null;
71 }
72
73
74 _FastScrollIndex*
75 _FastScrollIndex::CreateFastScrollIndexN(void)
76 {
77         _FastScrollIndex* pIndex = new (std::nothrow) _FastScrollIndex();
78         SysTryReturn(NID_UI_CTRL, pIndex, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
79
80         result r = pIndex->Construct();
81         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
82
83         SetLastResult(E_SUCCESS);
84         return pIndex;
85
86 CATCH:
87         delete pIndex;
88
89         return null;
90 }
91
92 result
93 _FastScrollIndex::SetIndexText(Tizen::Base::String* pText)
94 {
95         delete __pText;
96         __pText = null;
97
98         if (pText)
99         {
100                 __pText = new (std::nothrow) Tizen::Base::String(*pText);
101                 SysTryReturnResult(NID_UI_CTRL, __pText, E_OUT_OF_MEMORY, "Memory allocation failed.");
102         }
103
104         // send the action to _IFastScrollIndexObserver
105         if (__pIndexObserver)
106         {
107                 __pIndexObserver->OnIndexDataUpdated(*this);
108         }
109
110         return E_SUCCESS;
111 }
112
113 Tizen::Base::String*
114 _FastScrollIndex::GetIndexText(void) const
115 {
116         return __pText;
117 }
118
119 result
120 _FastScrollIndex::SetIndexImage(Tizen::Graphics::Bitmap* pImage)
121 {
122         delete __pImage;
123         __pImage = null;
124
125         if (pImage)
126         {
127                 __pImage = Tizen::Graphics::_BitmapImpl::CloneN(*pImage);
128         }
129
130         // send the action to _IFastScrollIndexObserver
131         if (__pIndexObserver)
132         {
133                 __pIndexObserver->OnIndexDataUpdated(*this);
134         }
135
136         return E_SUCCESS;
137 }
138
139 Tizen::Graphics::Bitmap*
140 _FastScrollIndex::GetIndexImage(void) const
141 {
142         return __pImage;
143 }
144
145 void
146 _FastScrollIndex::SetIndexObserver(_IFastScrollIndexObserver* pIndexListener)
147 {
148         __pIndexObserver = pIndexListener;
149 }
150
151 _IFastScrollIndexObserver*
152 _FastScrollIndex::GetIndexObserver(void) const
153 {
154         return __pIndexObserver;
155 }
156
157 result
158 _FastScrollIndex::SetOmissionIndex(int indexCountMax)
159 {
160         int childCount = GetChildCount();
161         _FastScrollIndex* pIndex = null;
162
163         int maxOmissionSlot = (indexCountMax - 1) / 2;
164         if (maxOmissionSlot < 0)
165         {
166                 maxOmissionSlot = 0;
167         }
168         else if (maxOmissionSlot == 0)
169         {
170                 maxOmissionSlot = 1;
171         }
172
173         int omissionCount = childCount - indexCountMax;
174         int omittedNum = childCount - indexCountMax;
175         int additionalOmittedNum = 0;
176         int additionalOmissionStartIndex = 0;
177         int indexCountMin = 3;
178
179         if (maxOmissionSlot > 0)
180         {
181                 omittedNum = (omissionCount / maxOmissionSlot) + 1;
182                 additionalOmittedNum = (omissionCount % maxOmissionSlot);
183                 additionalOmissionStartIndex = ((maxOmissionSlot - additionalOmittedNum) / 2);
184         }
185
186         int i = 0;
187         int j = 0;
188         result r = E_SUCCESS;
189         Tizen::Base::String omissionText(L".");
190
191         if ((indexCountMax > indexCountMin) && (indexCountMax % 2) == 0)
192         {
193                 pIndex = AddChildIndex(GetChildIndex(i), &__childOmittedIndexList);
194                 SysTryReturnResult(NID_UI_CTRL, pIndex, GetLastResult(), "Failed to add child index.");
195                 i++;
196                 j++;
197         }
198
199         while (i < childCount)
200         {
201                 if (j < indexCountMax)
202                 {
203                         pIndex = AddChildIndex(GetChildIndex(i), &__childOmittedIndexList);
204                         SysTryReturnResult(NID_UI_CTRL, pIndex, GetLastResult(), "Failed to add child index.");
205
206                         i++;
207                         j++;
208                 }
209
210                 if (i >= childCount)
211                 {
212                         break;
213                 }
214
215                 int omittedCount = omittedNum;
216                 if ((additionalOmissionStartIndex < 0) && (additionalOmittedNum > 0))
217                 {
218                         omittedCount += 1;
219                         additionalOmittedNum--;
220                 }
221
222                 if (omittedCount < 2)
223                 {
224                         if ((i % 2) > 0)
225                         {
226                                 additionalOmissionStartIndex--;
227                         }
228                         continue;
229                 }
230
231                 pIndex = AddChildIndex(&omissionText, null, &__childOmittedIndexList);
232                 SysTryReturnResult(NID_UI_CTRL, pIndex, GetLastResult(), "Failed to add child index.");
233
234                 pIndex->SetOmitted(true);
235                 ArrayList* pList = new (std::nothrow) ArrayList();
236                 SysTryReturnResult(NID_UI_CTRL, pList, E_OUT_OF_MEMORY, "Memory allocation failed.");
237                 pIndex->SetCurrentIndexList(pList);
238
239                 j++;
240                 additionalOmissionStartIndex--;
241
242                 for (int k = 0; k < omittedCount; k++)
243                 {
244                         pIndex->AddOmissionChildIndex(GetChildIndex(i + k));
245                 }
246                 i += omittedCount;
247         }
248         SetIndexType(FAST_SCROLL_INDEX_TYPE_OMISSION);
249
250         return r;
251 }
252
253 _FastScrollIndex*
254 _FastScrollIndex::AddChildIndex(Tizen::Base::String* pText, Tizen::Graphics::Bitmap* pImage, ArrayList* pIndexList)
255 {
256         _FastScrollIndex* pNewIndex = _FastScrollIndex::CreateFastScrollIndexN();
257         SysTryReturn(NID_UI_CTRL, pNewIndex, null, GetLastResult(),
258                         "[%s] Failed to create _FastScrollIndex.", GetErrorMessage(GetLastResult()));
259
260         result r = pNewIndex->SetIndexText(pText);
261         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set text.", GetErrorMessage(r));
262
263         pNewIndex->SetIndexImage(pImage);
264
265         return AddChildIndex(pNewIndex, pIndexList);
266
267 CATCH:
268         delete pNewIndex;
269
270         return null;
271 }
272
273 _FastScrollIndex*
274 _FastScrollIndex::AddChildIndex(_FastScrollIndex* pChildIndex, ArrayList* pIndexList)
275 {
276         return AddChildIndex(GetChildCount(pIndexList), pChildIndex, pIndexList);
277 }
278
279 _FastScrollIndex*
280 _FastScrollIndex::AddChildIndex(int childOrder, Tizen::Base::String* pText, Tizen::Graphics::Bitmap* pImage, ArrayList* pIndexList)
281 {
282         _FastScrollIndex* pNewIndex = _FastScrollIndex::CreateFastScrollIndexN();
283         SysTryReturn(NID_UI_CTRL, pNewIndex, null, GetLastResult(),
284                         "[%s] Failed to create _FastScrollIndex.", GetErrorMessage(GetLastResult()));
285
286         result r = pNewIndex->SetIndexText(pText);
287         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set text.", GetErrorMessage(r));
288
289         pNewIndex->SetIndexImage(pImage);
290
291         return AddChildIndex(childOrder, pNewIndex, pIndexList);
292
293 CATCH:
294         delete pNewIndex;
295
296         return null;
297 }
298
299 _FastScrollIndex*
300 _FastScrollIndex::AddChildIndex(int childOrder, _FastScrollIndex* pChildIndex, ArrayList* pIndexList)
301 {
302         SysTryReturn(NID_UI_CTRL, pChildIndex, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. pChildIndex is null.");
303
304         ArrayList* pList = null;
305         if (pIndexList)
306         {
307                 pList = pIndexList;
308         }
309         else
310         {
311                 if (__pChildIndexList == null)
312                 {
313                         __pChildIndexList = new (std::nothrow) ArrayList();
314                         SysTryReturn(NID_UI_CTRL, __pChildIndexList, null, E_OUT_OF_MEMORY, "Memory allocation failed.");
315                 }
316
317                 pList = __pChildIndexList;
318         }
319
320         if (pList->GetCount() <= childOrder)
321         {
322                 childOrder = GetChildCount(pList);
323         }
324
325         pList->InsertAt(*pChildIndex, childOrder);
326         pChildIndex->SetParentIndex(this);
327
328         if (__pIndexObserver)
329         {
330                 __pIndexObserver->OnChildIndexAttached(*this, childOrder, *pChildIndex);
331         }
332
333         return pChildIndex;
334 }
335
336 void
337 _FastScrollIndex::AddOmissionChildIndex(_FastScrollIndex* pChildIndex)
338 {
339         if (GetOmitted() == false)
340         {
341                 return;
342         }
343
344         SysTryReturnVoidResult(NID_UI_CTRL, pChildIndex, E_INVALID_ARG,
345                         "[E_INVALID_ARG] Invalid argument is used. pChildIndex is null.");
346         SysTryReturnVoidResult(NID_UI_CTRL, __pChildIndexList, E_INVALID_ARG,
347                         "[E_INVALID_ARG] Invalid argument is used. pChildIndexList is null.");
348
349         __pChildIndexList->InsertAt(*pChildIndex, GetChildCount());
350 }
351
352 result
353 _FastScrollIndex::AddChildTextIndexArray(int childOrder, const wchar_t* pTextIndexArray, int textLenth, int indexCount)
354 {
355         result r = E_SUCCESS;
356
357         Tizen::Base::String* indexText = null;
358
359         wchar_t* pTempChar = new (std::nothrow) wchar_t[textLenth+1];
360         SysTryReturnResult(NID_UI_CTRL, pTempChar, E_OUT_OF_MEMORY, "Memory allocation failed.");
361
362         int i = 0;
363         int j = 0;
364         int k = childOrder;
365
366         _FastScrollIndex* pIndex = null;
367         ArrayList* pChildIndexList = null;
368         ArrayList* pFormerList = null;
369         ArrayList* pFirstIndexList = GetCurrentIndexList();
370         if (pFirstIndexList == null)
371         {
372                 pFirstIndexList = new (std::nothrow) ArrayList();
373                 SysTryCatch(NID_UI_CTRL, pFirstIndexList, , E_OUT_OF_MEMORY, "Memory allocation failed.");
374                 SetCurrentIndexList(pFirstIndexList);
375         }
376         pChildIndexList = pFirstIndexList;
377
378         for (i = 0; i < indexCount; i++)
379         {
380                 for (j = 0; j < textLenth; j++)
381                 {
382                         pTempChar[j] = pTextIndexArray[(i*textLenth)+j];
383                 }
384                 pTempChar[j] = 0;
385
386                 indexText = new (std::nothrow) Tizen::Base::String(pTempChar);
387                 SysTryCatch(NID_UI_CTRL, indexText, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
388                 if (indexText->Equals(Tizen::Base::String(_DELIMITER)))
389                 {
390                         delete indexText;
391                         indexText = null;
392
393                         pFormerList = pChildIndexList;
394                         _FastScrollIndex* pFormerIndex = null;
395
396                         pChildIndexList = new (std::nothrow) ArrayList();
397                         SysTryCatchLabel(NID_UI_CTRL, pChildIndexList, , CATCH1, E_OUT_OF_MEMORY, "Memory allocation failed.");
398                         k = 0;
399
400                         pFormerIndex = GetChildIndex(GetChildCount(pFormerList) - 1, pFormerList);
401                         SysTryCatchLabel(NID_UI_CTRL, pFormerIndex, , CATCH1, GetLastResult(), "[%s] Failed to get the child index.", GetErrorMessage(GetLastResult()));
402                         pFormerIndex->SetNextIndexList(pChildIndexList);
403                         continue;
404                 }
405
406                 pIndex = AddChildIndex(k, indexText, null, pChildIndexList);
407                 SysTryCatch(NID_UI_CTRL, pIndex, , GetLastResult(), "[%s] Failed to add child index.", GetErrorMessage(GetLastResult()));
408
409                 if (k == 0 && pFormerList)
410                 {
411                         pIndex->SetPreviousIndexList(pFormerList);
412                         pFormerList = null;
413                 }
414                 k++;
415
416                 delete indexText;
417                 indexText = null;
418         }
419
420         if (pChildIndexList)
421         {
422                 pChildIndexList = pFirstIndexList;
423                 int childCount = GetChildCount(pChildIndexList);
424                 pIndex = GetChildIndex(childCount - 1, pChildIndexList);
425                 SysTryCatch(NID_UI_CTRL, pIndex, , GetLastResult(),
426                                 "[%s] Failed to get the child index.", GetErrorMessage(GetLastResult()));
427                 ArrayList* pNextIndexList = pIndex->GetNextIndexList();
428                 int i = 0;
429                 while(pNextIndexList)
430                 {
431                         //next last index to previous last index
432                         pIndex->SetNextIndexList(null);
433                         pIndex = GetChildIndex(GetChildCount(pNextIndexList) - 1, pNextIndexList);
434                         SysTryCatch(NID_UI_CTRL, pIndex, , GetLastResult(),
435                                         "[%s] Failed to get the child index.", GetErrorMessage(GetLastResult()));
436                         pIndex = AddChildIndex(childCount, pIndex->GetIndexText(), null, pChildIndexList);
437                         SysTryCatch(NID_UI_CTRL, pIndex, , GetLastResult(), "[%s] Failed to add child index.", GetErrorMessage(GetLastResult()));
438                         pIndex->SetNextIndexList(pNextIndexList);
439
440                         //next first index to previous first index
441                         pIndex = GetChildIndex(0, pNextIndexList);
442                         SysTryCatch(NID_UI_CTRL, pIndex, , GetLastResult(),
443                                         "[%s] Failed to get the child index.", GetErrorMessage(GetLastResult()));
444                         pIndex->SetPreviousIndexList(null);
445
446                         pIndex = GetChildIndex(i, pChildIndexList);
447                         SysTryCatch(NID_UI_CTRL, pIndex, , GetLastResult(),
448                                         "[%s] Failed to get the child index.", GetErrorMessage(GetLastResult()));
449                         pIndex = AddChildIndex(0, pIndex->GetIndexText(), null, pNextIndexList);
450                         SysTryCatch(NID_UI_CTRL, pIndex, , GetLastResult(), "[%s] Failed to add child index.", GetErrorMessage(GetLastResult()));
451                         pIndex->SetPreviousIndexList(pChildIndexList);
452                         if (i == 0)
453                         {
454                                 i++;
455                         }
456
457                         //NEXT language set
458                         pChildIndexList = pNextIndexList;
459                         childCount = GetChildCount(pChildIndexList);
460                         pIndex = GetChildIndex(childCount - 1, pChildIndexList);
461                         SysTryCatch(NID_UI_CTRL, pIndex, , GetLastResult(),
462                                         "[%s] Failed to get the child index.", GetErrorMessage(GetLastResult()));
463                         pNextIndexList = pIndex->GetNextIndexList();
464                 }
465         }
466
467         delete[] pTempChar;
468         return E_SUCCESS;
469
470 CATCH1:
471         delete pChildIndexList;
472         pChildIndexList = null;
473
474 CATCH:
475         delete indexText;
476         indexText = null;
477         delete[] pTempChar;
478
479         return r;
480 }
481
482 result
483 _FastScrollIndex::RemoveChildIndex(int childOrder, bool destroy, ArrayList* pIndexList)
484 {
485         _FastScrollIndex* pIndex = GetChildIndex(childOrder, pIndexList);
486         SysTryReturnResult(NID_UI_CTRL, pIndex, GetLastResult(), "Failed to get the child index.");
487
488         return RemoveChildIndex(pIndex, destroy, pIndexList);
489 }
490
491 result
492 _FastScrollIndex::RemoveChildIndex(_FastScrollIndex* pChildIndex, bool destroy, ArrayList* pIndexList)
493 {
494         int detachedOrder = 0;
495         ArrayList* pList = __pChildIndexList;
496
497         if (pIndexList)
498         {
499                 pList = pIndexList;
500         }
501
502         if (pList == null)
503         {
504                 return E_SUCCESS;
505         }
506
507         pList->IndexOf(*pChildIndex, detachedOrder);
508
509         if (destroy == true)
510         {
511                 pList->Remove(*pChildIndex, true);
512         }
513         else
514         {
515                 pList->Remove(*pChildIndex, false);
516                 pChildIndex->SetParentIndex(null);
517         }
518
519         if (__pIndexObserver)
520         {
521                 __pIndexObserver->OnChildIndexDetached(*this, detachedOrder, *pChildIndex);
522         }
523
524         return E_SUCCESS;
525 }
526
527 void
528 _FastScrollIndex::RemoveChildren(bool destroy, ArrayList* pIndexList)
529 {
530         RemoveOmissionChildren(destroy);
531         ArrayList* pList = __pChildIndexList;
532
533         if (pIndexList)
534         {
535                 pList = pIndexList;
536         }
537
538         if (pList == null)
539         {
540                 return;
541         }
542
543         int childrenCount = pList->GetCount();
544         _FastScrollIndex* pIndex = (GetChildIndex(childrenCount - 1));
545         if (pIndex)
546         {
547                 ArrayList* nextIndexList = pIndex->GetNextIndexList();
548                 if (GetOmitted() == false && nextIndexList)
549                 {
550                         RemoveChildren(destroy, nextIndexList);
551                         pIndex->SetNextIndexList(null);
552                 }
553         }
554
555         for (int i = childrenCount-1; i >= 0; i--)
556         {
557                 pList->RemoveAt(i, destroy);
558         }
559
560         delete pList;
561         if (pIndexList)
562         {
563                 pIndexList = null;
564         }
565         else
566         {
567                 __pChildIndexList = null;
568         }
569 }
570
571 result
572 _FastScrollIndex::RemoveOmissionChildren(bool destroy)
573 {
574         int childrenCount = __childOmittedIndexList.GetCount();
575
576         if (childrenCount <= 0)
577         {
578                 return E_SUCCESS;
579         }
580
581         for (int i = childrenCount-1; i >= 0; i--)
582         {
583                 _FastScrollIndex* pIndex = GetChildIndex(i, &__childOmittedIndexList);
584                 SysTryReturnResult(NID_UI_CTRL, pIndex, GetLastResult(), "Failed to get the child index.");
585
586                 if (pIndex->GetOmitted())
587                 {
588                         pIndex->RemoveChildren(false);
589
590                         __childOmittedIndexList.RemoveAt(i, true);
591                 }
592                 else
593                 {
594                         __childOmittedIndexList.RemoveAt(i, false);
595                 }
596         }
597         SetIndexType(FAST_SCROLL_INDEX_TYPE_NORMAL);
598
599         return E_SUCCESS;
600 }
601
602 void
603 _FastScrollIndex::SetParentIndex(_FastScrollIndex* pParent)
604 {
605         __pParentIndex = pParent;
606 }
607
608 _FastScrollIndex*
609 _FastScrollIndex::GetParentIndex(void) const
610 {
611         return __pParentIndex;
612 }
613
614 _FastScrollIndex*
615 _FastScrollIndex::GetChildIndex(int childOrder, bool omitted) const
616 {
617         ArrayList* pIndexList = __pChildIndexList;
618         if (omitted && __childOmittedIndexList.GetCount() > 0)
619         {
620                 pIndexList = const_cast <ArrayList*>(&__childOmittedIndexList);
621         }
622
623         return GetChildIndex(childOrder, pIndexList);
624 }
625
626 _FastScrollIndex*
627 _FastScrollIndex::GetChildIndex(int childOrder, ArrayList* pIndexList) const
628 {
629         if (pIndexList == null)
630         {
631                 return null;
632         }
633
634         Object* pChildIndex = const_cast <Object*>(pIndexList->GetAt(childOrder));
635         SysTryReturn(NID_UI_CTRL, pChildIndex, null, GetLastResult(), "[%s] Failed to get the child index.",
636                         GetErrorMessage(GetLastResult()));
637
638         return dynamic_cast <_FastScrollIndex*>(pChildIndex);
639 }
640
641 int
642 _FastScrollIndex::GetChildOrder(const _FastScrollIndex* pChildIndex, bool omitted) const
643 {
644         ArrayList* pIndexList = __pChildIndexList;
645         if (omitted && __childOmittedIndexList.GetCount() > 0)
646         {
647                 pIndexList = const_cast <ArrayList*>(&__childOmittedIndexList);
648         }
649
650         return GetChildOrder(pChildIndex, pIndexList);
651 }
652
653 int
654 _FastScrollIndex::GetChildOrder(const _FastScrollIndex* pChildIndex, ArrayList* pIndexList) const
655 {
656         if (pIndexList == null)
657         {
658                 return 0;
659         }
660
661         int childIndex = -1;
662         pIndexList->IndexOf(*pChildIndex, childIndex);
663
664         return childIndex;
665 }
666
667 int
668 _FastScrollIndex::GetChildCount(bool omitted) const
669 {
670         ArrayList* pIndexList = __pChildIndexList;
671         if (omitted)
672         {
673                 pIndexList = const_cast <ArrayList*>(&__childOmittedIndexList);
674         }
675
676         return GetChildCount(pIndexList);
677 }
678
679 int
680 _FastScrollIndex::GetChildCount(ArrayList* pIndexList) const
681 {
682         if (pIndexList == null)
683         {
684                 return 0;
685         }
686
687         return pIndexList->GetCount();
688 }
689
690 int
691 _FastScrollIndex::GetIndexOrder(bool omitted) const
692 {
693         if (__pParentIndex)
694         {
695                 return __pParentIndex->GetChildOrder(this, omitted);
696         }
697         else
698         {
699                 return -1;
700         }
701 }
702
703 int
704 _FastScrollIndex::GetIndexOrder(ArrayList* pIndexList) const
705 {
706         if (__pParentIndex)
707         {
708                 return __pParentIndex->GetChildOrder(this, pIndexList);
709         }
710         else
711         {
712                 return -1;
713         }
714 }
715
716 void
717 _FastScrollIndex::SetIndexType(_FastScrollIndexType type)
718 {
719         __indexType = type;
720 }
721
722 _FastScrollIndexType
723 _FastScrollIndex::GetIndexType(void) const
724 {
725         return __indexType;
726 }
727
728 void
729 _FastScrollIndex::SetCurrentIndexList(ArrayList* pList)
730 {
731         __pChildIndexList = pList;
732 }
733
734 ArrayList*
735 _FastScrollIndex::GetCurrentIndexList(void) const
736 {
737         return __pChildIndexList;
738 }
739
740 void
741 _FastScrollIndex::SetNextIndexList(ArrayList* pList)
742 {
743         __pChildNextIndexList = pList;
744 }
745
746 ArrayList*
747 _FastScrollIndex::GetNextIndexList(void) const
748 {
749         return __pChildNextIndexList;
750 }
751
752 void
753 _FastScrollIndex::SetPreviousIndexList(ArrayList* pList)
754 {
755         __pChildPreviousIndexList = pList;
756 }
757
758 ArrayList*
759 _FastScrollIndex::GetPreviousIndexList(void) const
760 {
761         return __pChildPreviousIndexList;
762 }
763
764 void
765 _FastScrollIndex::SetOmitted(bool omitted)
766 {
767         __omitted = omitted;
768 }
769
770 bool
771 _FastScrollIndex::GetOmitted(void) const
772 {
773         return __omitted;
774 }
775
776 result
777 _FastScrollIndex::Construct(void)
778 {
779         return E_SUCCESS;
780 }
781
782 } } } // Tizen::Ui::Controls