Revert " modify license, permission and remove ^M char"
[framework/osp/uifw.git] / src / ui / layout / FUi_LayoutProxyList.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  * @file        FUi_LayoutProxyList.h
19  * @brief       This is the header file for ProxyList class.
20  *
21  * This header file contains the declaration of ProxyList class.
22  */
23
24 #pragma once
25
26 #ifndef _FUI_INTERNAL_LAYOUT_PROXY_LIST_H_
27 #define _FUI_INTERNAL_LAYOUT_PROXY_LIST_H_
28
29 #include "FUi_LayoutLinkedList.h"
30 #include "FUi_LayoutProxyListNode.h"
31
32 namespace Tizen { namespace Ui { namespace _Layout
33 {
34
35 class LayoutItem;
36 class AbsoluteLayout;
37 class RelativeLayout;
38 class TableLayout;
39 class LinearLayout;
40
41 // Super class
42 class ProxyList
43         : public LinkedList
44 {
45 public:
46         virtual ~ProxyList(void);
47
48         ProxyListNode* GetFirstNode(void) const;
49         ProxyListNode* GetLastNode(void) const;
50
51         ProxyListNode* GetNextNode(const LinkedListNode& node) const;
52         ProxyListNode* GetPrevNode(const LinkedListNode& node) const;
53
54         int GetIndex(ProxyListNode& pnode) const;
55         ProxyListNode* GetNode(int index) const;
56         ProxyListNode* GetNode(const LayoutItem& item) const;
57
58         int GetNodeCount(void) const;
59
60         LayoutItemProxy* GetItemProxy(const LayoutItem& item) const;
61
62         void RefreshIndex(void);
63
64         ProxyListNode* AddNode(LayoutItemProxy& addProxy);
65         virtual result RemoveNode(LinkedListNode& removeNode);
66         result RemoveNode(LayoutItemProxy& removeItem);
67         result RemoveNode(int index);
68
69         virtual result OnAddNode(ProxyListNode& addNode);
70         virtual result OnRemoveNode(ProxyListNode& removeNode);
71
72         ProxyListNode* SearchNode(int index) const;
73         ProxyListNode* SearchNode(const LayoutItemProxy& item) const;
74
75 protected:
76         ProxyList(void);
77
78         void RemoveAllNode(void);
79
80 private:
81         ProxyList(const ProxyList&);
82         ProxyList& operator =(const ProxyList&);
83
84 private:
85         int __lastIndex;
86
87         friend class Layout;
88 }; // ProxyList
89
90 // Absolute layout
91 class AbsoluteProxyList
92         : public ProxyList
93 {
94 public:
95         virtual result OnAddNode(ProxyListNode& addNode);
96         virtual result OnRemoveNode(ProxyListNode& removeNode);
97
98 protected:
99         AbsoluteProxyList(void);
100         virtual ~AbsoluteProxyList(void);
101
102 private:
103         AbsoluteProxyList(const AbsoluteProxyList&);
104         AbsoluteProxyList& operator =(const AbsoluteProxyList&);
105
106         friend class AbsoluteLayout;
107 }; // AbsoluteProxyList
108
109 // Relative layout
110 class RelativeProxyList
111         : public ProxyList
112 {
113 public:
114         virtual result OnAddNode(ProxyListNode& pAddNode);
115         virtual result OnRemoveNode(ProxyListNode& pRemoveNode);
116         void SetRelativeLayout(RelativeLayout* pLayout);
117         int GetReferenceCount(ProxyListNode& pNode) const;
118
119 private:
120         RelativeProxyList(void);
121         virtual ~RelativeProxyList(void);
122
123 private:
124         RelativeLayout* __pRelativeLayout;
125
126         friend class RelativeLayout;
127 }; // RelativeProxyList
128
129 // Table layout
130 class TableProxyList
131         : public ProxyList
132 {
133 public:
134         virtual result OnAddNode(ProxyListNode& addNode);
135         virtual result OnRemoveNode(ProxyListNode& removeNode);
136
137 private:
138         TableProxyList(void);
139         virtual ~TableProxyList(void);
140
141         friend class TableLayout;
142 }; // TableProxyList
143
144 // Linear layout
145 class LinearProxyList
146         : public ProxyList
147 {
148 public:
149         virtual result OnAddNode(ProxyListNode& addNode);
150         virtual result OnRemoveNode(ProxyListNode& removeNode);
151
152 protected:
153         LinearProxyList(void);
154         virtual ~LinearProxyList(void);
155
156 private:
157         LinearProxyList(const LinearProxyList&);
158         LinearProxyList& operator =(const LinearProxyList&);
159
160         friend class LinearLayout;
161 }; // LinearProxyList
162
163 }}} //Tizen::Ui::_Layout
164
165 #endif // _FUI_INTERNAL_LAYOUT_PROXY_LIST_H_