Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_OverlayRegionImpl.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_OverlayRegionImpl.h
20  * @brief       This is the header file for the _OverlayRegionImpl class.
21  *
22  * This header file contains the declarations of the _OverlayRegionImpl class.
23  *
24  */
25
26 #ifndef _FUI_CTRL_INTERNAL_OVERLAY_REGION_IMPL_H_
27 #define _FUI_CTRL_INTERNAL_OVERLAY_REGION_IMPL_H_
28
29 #include <Ecore_Evas.h>
30
31 #include <FOspConfig.h>
32
33 namespace Tizen { namespace Graphics
34 {
35 class Canvas;
36 class Rectangle;
37 class Dimension;
38 } }
39
40 namespace Tizen { namespace Ui { namespace Controls
41 {
42 class _Form;
43 class OverlayRegion;
44 class _OverlayAgent;
45 } } }
46
47 namespace Tizen { namespace Ui
48 {
49 class _Control;
50 } }
51
52 namespace Tizen { namespace Ui { namespace Controls
53 {
54
55 enum OverlayRegionRotate
56 {
57         OVERLAYREGION_ROTATE_0 = 0,
58         OVERLAYREGION_ROTATE_90,
59         OVERLAYREGION_ROTATE_180,
60         OVERLAYREGION_ROTATE_270,
61         OVERLAYREGION_ROTATE_NONE
62 };
63
64 class _OverlayRegionImpl
65         : public Tizen::Base::Object
66 {
67 public:
68         virtual ~_OverlayRegionImpl(void);
69
70         Tizen::Graphics::Rectangle GetBounds(void) const;
71         void GetBounds(int& x, int& y, int& width, int& height) const;
72         result SetInputBuffer(const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, OverlayRegionBufferPixelFormat srcFormat, bool isUserInput);
73         result GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& info) const;
74         result Show(void) const;
75
76         result Construct(_Form* pParentForm, OverlayRegionType overlayRegionType, const Tizen::Graphics::Point& leftTopPos, const Tizen::Graphics::Rectangle& userDestRect, const Tizen::Graphics::Rectangle& finalPhyRect);
77
78         OverlayRegion* CreateOverlayRegionN(void);
79         void SetFormArrayIndex(int index);
80         Tizen::Ui::Controls::OverlayRegion* GetOverlayRegion(void) const;
81
82         void GoForeground(void);
83         void GoBackground(void);
84
85         static result IsValidOverlayRect(Tizen::Graphics::Rectangle& userRect, Tizen::Graphics::Rectangle& overlayPhysicalRect, const Tizen::Graphics::Rectangle& basePhysicalRect, bool& modified);
86         static result SetPixelFormatList(void);
87         static int GetWidthUnit(void);
88         static int GetHeightUnit(void);
89         static int GetMaxCount(void);
90
91         static _OverlayRegionImpl* GetInstance(OverlayRegion& overlayRegion);
92         static const _OverlayRegionImpl* GetInstance(const OverlayRegion& overlayRegion);
93
94 public:
95         static int overlayRegionWidthUnit;
96         static int overlayRegionHeightUnit;
97         static int overlayRegionMaxCount;
98         static bool overlayRegionPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_MAX];
99
100 private:
101         _OverlayRegionImpl(void);
102         _OverlayRegionImpl(const _OverlayRegionImpl& rhs);
103
104         _OverlayRegionImpl& operator =(const _OverlayRegionImpl& rhs);
105
106 private:
107         Tizen::Ui::Controls::_Form* __pParentForm;
108         Tizen::Ui::Controls::OverlayRegion* __pOverlayRegion;
109         Tizen::Graphics::Rectangle __destRect;
110         Tizen::Ui::Controls::OverlayRegionType __overlayRegionType;
111         bool __showState;
112         int __myIdx;
113
114         int __cameraDirection;
115         int __cameraRotation;
116
117         // Evas version
118         _OverlayAgent* __pOverlayAgent;
119
120         friend class _Form;
121
122 }; // OverlayRegionImpl
123
124 } } } //Tizen::Ui::Controls
125
126 #endif // _FUI_CTRL_INTERNAL_OVERLAY_REGION_IMPL_H_