Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / layout / FUi_LayoutLayoutItemProxy.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_LayoutLayoutItemProxy.h
19  * @brief       This is the header file for LayoutItemProxy class.
20  *
21  * This header file contains the declaration of LayoutItemProxy class.
22  */
23
24 #pragma once
25
26 #ifndef _FUI_INTERNAL_LAYOUT_LAYOUT_ITEM_PROXY_H_
27 #define _FUI_INTERNAL_LAYOUT_LAYOUT_ITEM_PROXY_H_
28
29 #include "FUi_LayoutLayoutItem.h"
30
31 namespace Tizen { namespace Ui { namespace _Layout
32 {
33
34 class Layout;
35
36 class LayoutItemProxy
37 {
38 public:
39         int GetIndex(void) const;
40
41         LayoutItem* GetItem(void) const;
42
43         void SetItemAlignment(const ItemAlign align);
44         ItemAlign GetItemAlignment(void) const;
45
46         void SetItemMargin(const ItemMargin margin);
47         ItemMargin GetItemMargin(void) const;
48
49         void SetItemWidthMatchMode(const LayoutMatchMode matchmode);
50         LayoutMatchMode GetItemWidthMatchMode(void) const;
51         void SetItemHeightMatchMode(const LayoutMatchMode matchmode);
52         LayoutMatchMode GetItemHeightMatchMode(void) const;
53
54         void SetItemBaseRect(const LayoutRect rect);
55         LayoutRect GetItemBaseRect(void) const;
56
57         void SetMeasuredSize(int width, int height);
58         void GetMeasuredSize(int& width, int& height) const;
59
60         result SetItemWindowRect(const LayoutRect itemRect, bool calculating = true);
61         void GetItemWindowRect(LayoutRect& itemRect) const;
62
63         void ConvertWindowToClientBounds(const LayoutRect windowRect, LayoutRect& clientRect);
64
65         result Measure(int width, int height);
66         void Visible(const bool visible);
67
68         void SetParentLayout(Layout* pLayout);
69         Layout* GetParentLayout(void) const;
70
71         void GetMinSize(LayoutSize& minSize) const;
72         void GetMaxSize(LayoutSize& maxSize) const;
73
74         void SetParentContainer(LayoutContainer* pParentContainer);
75         LayoutContainer* GetParentContainer(void) const;
76
77 private:
78         LayoutItemProxy(LayoutItem& pRealItem);
79         LayoutItemProxy(const LayoutItemProxy&);
80         LayoutItemProxy& operator =(const LayoutItemProxy&);
81
82         virtual ~LayoutItemProxy(void);
83
84         void SetIndex(int index);
85         static LayoutItemProxy* Create(Layout& pLayout, LayoutItem& pRealItem);
86         void Destroy(void);
87
88 // property
89 private:
90         int __index;
91         LayoutItem* __pItem;
92
93         ItemAlign __itemAlign;
94         ItemMargin __itemMargin;
95
96         LayoutMatchMode __widthMatchmode;
97         LayoutMatchMode __heightMatchmode;
98
99         LayoutRect __baseRect;
100         LayoutRect __calculatedRect;
101
102         Layout* __pParentLayout;
103
104         friend class Layout;
105         friend class ProxyList;
106 }; // LayoutItemProxy
107
108 }}} //Tizen::Ui::_Layout
109
110 #endif // _FUI_INTERNAL_LAYOUT_LAYOUT_ITEM_PROXY_H_