Tizen 2.1 base
[framework/osp/uifw.git] / src / graphics / inc / FGrp_BufferInfoImpl.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        FGrp_BufferInfoImpl.h
20  * @brief       This is the header file for the _BufferInfoImpl class.
21  *
22  * This header file contains the declarations of the %_BufferInfoImpl class.
23  *
24  */
25
26 #ifndef _FGRP_INTERNAL_BUFFERINFO_IMPL_H_
27 #define _FGRP_INTERNAL_BUFFERINFO_IMPL_H_
28
29
30 #include <FBaseTypes.h>
31 #include <FGrpRectangle.h>
32
33
34 namespace Tizen { namespace Graphics
35 {
36 class BufferInfo;
37
38 class _OSP_EXPORT_ _BufferInfoImpl
39 {
40 public:
41         enum
42         {
43                 INVALID_BUFFER_HANDLE = 0
44         };
45
46         enum Orientation
47         {
48                 ORIENTATION_PORTRAIT,
49                 ORIENTATION_LANDSCAPE,
50                 ORIENTATION_PORTRAIT_REVERSE,
51                 ORIENTATION_LANDSCAPE_REVERSE
52         };
53
54         enum HandleType
55         {
56                 HANDLE_TYPE_NONE,
57                 HANDLE_TYPE_OVERLAY_REGION,
58                 HANDLE_TYPE_VE_SURFACE,
59                 HANDLE_TYPE_CANVAS_TEXTURE
60         };
61
62         enum Rotation
63         {
64                 ROTATION_0,
65                 ROTATION_90,
66                 ROTATION_180,
67                 ROTATION_270
68         };
69
70         /**
71          * This is the default constructor for this class.
72          */
73         _BufferInfoImpl();
74
75         /**
76          * This is the destructor for this class.
77          */
78         virtual ~_BufferInfoImpl();
79
80         /*
81          * Gets the handle of the current instance of _BufferInfoImpl.
82          *
83          * @return      The runtime handle
84          *
85          */
86         int GetHandle(HandleType handleType) const;
87
88         /*
89          * Sets the handle of the current instance of _BufferInfoImpl.
90          *
91          */
92         void SetHandle(HandleType handleType, int handle);
93
94         /*
95          * Gets the orientation of the current instance of _BufferInfoImpl.
96          *
97          */
98         Orientation GetOrientation(void) const;
99
100         /*
101          * Sets the orientation of the current instance of _BufferInfoImpl.
102          *
103          */
104         void SetOrientation(Orientation orientation);
105
106         /*
107          * Gets the bounds of the current instance of _BufferInfoImpl.
108          *
109          */
110         Rectangle GetBounds(void) const;
111
112         /*
113          * Sets the bounds of the current instance of _BufferInfoImpl.
114          *
115          */
116         void SetBounds(const Rectangle& rect);
117
118         /*
119          * Gets the rotation of the current instance of _BufferInfoImpl.
120          *
121          */
122         Rotation GetRotation(void) const;
123
124         /*
125          * Sets the rotation of the current instance of _BufferInfoImpl.
126          *
127          */
128         void SetRotation(Rotation rotation);
129
130         static _BufferInfoImpl* GetInstance(BufferInfo& bufferInfo);
131         static const _BufferInfoImpl* GetInstance(const BufferInfo& bufferInfo);
132
133 private:
134         /**
135          * This is the default copy constructor for this class.
136          */
137         _BufferInfoImpl(const _BufferInfoImpl& src);
138
139         /**
140          * This is the default assignment operator for this class.
141          */
142         _BufferInfoImpl& operator =(const _BufferInfoImpl& rhs);
143
144         friend class BufferInfo;
145
146         HandleType __handleType;
147         int __handle;
148         Orientation __orientation;
149         Rectangle __bounds;
150         Rotation __rotation;
151
152 }; // _BufferInfoImpl
153
154 }} // Tizen::Graphics
155
156 #endif // _FGRP_INTERNAL_BUFFERINFO_IMPL_H_