Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_FastScrollIndex.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FUiCtrl_FastScrollIndex.h
20  * @brief               This is the header file for the _FastScrollIndex class.
21  *
22  * This header file contains the declarations of the %_FastScrollIndex class.
23  */
24
25 #ifndef _FUICTRL_INTERNAL_FASTSCROLL_INDEX_H_
26 #define _FUICTRL_INTERNAL_FASTSCROLL_INDEX_H_
27
28 #include "FBaseObject.h"
29 #include "FBaseString.h"
30 #include "FBaseColArrayList.h"
31 #include "FGrpBitmap.h"
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35 class _FastScrollIndex;
36
37 enum _FastScrollIndexType
38 {
39         FAST_SCROLL_INDEX_TYPE_NORMAL = 0,
40         FAST_SCROLL_INDEX_TYPE_OMISSION,
41 };
42
43 class _IFastScrollIndexObserver
44         : public Tizen::Base::Object
45 {
46 public:
47         virtual ~_IFastScrollIndexObserver(void){}
48
49         virtual void OnIndexDataUpdated(_FastScrollIndex& updatedIndex) = 0;
50         virtual void OnIndexDeleted(_FastScrollIndex& deletedIndex) = 0;
51         virtual void OnChildIndexAttached(_FastScrollIndex& parentIndex, int attachedOrder, _FastScrollIndex& attachedIndex) = 0;
52         virtual void OnChildIndexDetached(_FastScrollIndex& parentIndex, int detachedOrder, _FastScrollIndex& detachedIndex) = 0;
53 };
54
55 class _FastScrollIndex
56         : public Tizen::Base::Object
57 {
58 public:
59         virtual ~_FastScrollIndex(void);
60
61         static _FastScrollIndex* CreateFastScrollIndexN(void);
62
63         result SetIndexText(Tizen::Base::String* pText);
64         Tizen::Base::String* GetIndexText(void) const;
65
66         result SetIndexImage(Tizen::Graphics::Bitmap* pImage);
67         Tizen::Graphics::Bitmap* GetIndexImage(void) const;
68
69         void SetIndexObserver(_IFastScrollIndexObserver* pIndexListener);
70         _IFastScrollIndexObserver* GetIndexObserver(void) const;
71
72         result SetOmissionIndex(int indexCountMax);
73
74         result AddChildIndex(Tizen::Base::String* pText, Tizen::Graphics::Bitmap* pImage, bool omitted = false);
75         result AddChildIndex(_FastScrollIndex* pChildIndex, bool omitted = false);
76         result AddChildIndex(int childOrder, Tizen::Base::String* pText, Tizen::Graphics::Bitmap* pImage, bool omitted = false);
77         result AddChildIndex(int childOrder, _FastScrollIndex* pChildIndex, bool omitted = false);
78         void AddOmissionChildIndex(_FastScrollIndex* pChildIndex);
79         result AddChildTextIndexArray(int childOrder, const wchar_t* pTextIndexArray, int textLenth, int indexCount);
80
81         result RemoveChildIndex(int childOrder, bool destroy);
82         result RemoveChildIndex(_FastScrollIndex* pChildIndex, bool destroy);
83         void RemoveChildren(bool destroy);
84         result RemoveOmissionChildren(bool destroy);
85
86         void SetParentIndex(_FastScrollIndex* pParent);
87         _FastScrollIndex* GetParentIndex(void) const;
88
89         _FastScrollIndex* GetChildIndex(int childOrder, bool omitted = false) const;
90         int GetChildOrder(const _FastScrollIndex* pChildIndex, bool omitted = false) const;
91         int GetChildCount(bool omitted = false) const;
92         int GetIndexOrder(bool omitted = false) const;
93
94         void SetIndexType(_FastScrollIndexType type);
95         _FastScrollIndexType GetIndexType(void) const;
96
97         void SetOmitted(bool omitted);
98         bool GetOmitted(void) const;
99
100 private:
101         _FastScrollIndex(const _FastScrollIndex& rhs);
102         _FastScrollIndex& operator =(const _FastScrollIndex& rhs);
103
104         _FastScrollIndex(void);
105         result Construct(void);
106
107 private:
108         Tizen::Graphics::Bitmap* __pImage;
109         Tizen::Base::String* __pText;
110
111         _FastScrollIndex* __pParentIndex;
112         Tizen::Base::Collection::ArrayList __childIndexList;
113         Tizen::Base::Collection::ArrayList __childOmittedIndexList;
114
115         _IFastScrollIndexObserver* __pIndexObserver;
116
117         bool __omitted;
118         _FastScrollIndexType __indexType;
119
120 };
121
122 } } }   // Tizen::Ui::Controls
123
124 #endif //_FUICTRL_INTERNAL_FASTSCROLL_INDEX_H_