Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiCtrlOverlayPanel.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                FUiCtrlOverlayPanel.h
20  * @brief       This is the header file for the %OverlayPanel class.
21  *
22  * This header file contains the declarations of the %OverlayPanel class.
23  */
24 #ifndef _FUI_CTRL_OVERLAY_PANEL_H_
25 #define _FUI_CTRL_OVERLAY_PANEL_H_
26
27 #include <FBaseTypes.h>
28 #include <FGrpCanvas.h>
29 #include <FUiCtrlPanel.h>
30
31 namespace Tizen { namespace Ui { namespace Controls
32 {
33 /**
34  * @if OSPDEPREC
35  * @class       OverlayPanel
36  * @brief        <i> [Deprecated] </i> This class is an implementation of %OverlayPanel.
37  *
38  * @deprecated  This class is deprecated. Instead of using this class, use the OverlayRegion class, that supports video playback and camera preview.
39  * @since               2.0
40  *
41  * @remarks     The %OverlayPanel control can only be attached to a %Form control by using Tizen::Ui::Container::AddControl method, because of its native
42  *                      characteristics. Since %OverlayPanel inherits a Panel control, it can be used as a container if needed.
43  *
44  * The %OverlayPanel class is an implementation of the %OverlayPanel control.
45  * The %OverlayPanel is a special type of panel which is used to specify a region where the developer
46  * can playback video or camera preview. It is called an overlay because it is possible to overlay
47  * other graphics and controls on top of the panel.
48  * The %OverlayPanel consists of two layers, the foreground panel and background buffer which supports
49  * H/W accelerated rendering. Due to the hardware accelerated nature, there is a limitation with an
50  * %OverlayPanel. The Form that houses an %OverlayPanel can only have a black, opaque background.
51  * The overlay panel can manipulate the rotation, the aspect ratio and the size of input buffer.
52  *
53  * Example: Please refer to the camera preview example of Tizen::Media::Camera
54  *
55  * @endif
56  */
57 class _OSP_EXPORT_ OverlayPanel
58         : public Tizen::Ui::Controls::Panel
59 {
60 public:
61         /**
62          * @if OSPDEPREC
63          * @enum   Rotation
64          *
65          * Defines the various rotation options.
66          *
67          * @brief <i> [Deprecated]  </i>
68          * @deprecated  This enumerator is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera
69          *                              preview.
70          * @since       2.0
71          * @endif
72          */
73         enum Rotation
74         {
75                 ROTATION_NONE,      /**< @if OSPDEPREC No rotation @endif */
76                 ROTATION_90,        /**< @if OSPDEPREC The 90 degree rotation @endif */
77                 ROTATION_180,       /**< @if OSPDEPREC The 180 degree rotation @endif */
78                 ROTATION_270,       /**< @if OSPDEPREC The 270 degree rotation @endif */
79                 ROTATION_NONE_LR,   /**< @if OSPDEPREC The horizontal mirroring @endif */
80                 ROTATION_NONE_UD,   /**< @if OSPDEPREC The vertical mirroring @endif */
81                 ROTATION_90_LR,     /**< @if OSPDEPREC The 90 degree rotation with horizontal mirroring @endif */
82                 ROTATION_90_UD,     /**< @if OSPDEPREC The 90 degree rotation with vertical mirroring @endif */
83                 ROTATION_180_LR,    /**< @if OSPDEPREC The 180 degree rotation with horizontal mirroring @endif */
84                 ROTATION_180_UD,    /**< @if OSPDEPREC The 180 degree rotation with vertical mirroring @endif */
85                 ROTATION_270_LR,    /**< @if OSPDEPREC The 270 degree rotation with horizontal mirroring @endif */
86                 ROTATION_270_UD,    /**< @if OSPDEPREC The 270 degree rotation with vertical mirroring @endif */
87                 ROTATION_MAX
88         };
89
90         /**
91          * @if OSPDEPREC
92          * @enum  BufferPixelFormat
93          *
94          * Defines the pixel formats.
95          *
96          * @brief <i> [Deprecated]  </i>
97          * @deprecated  This enumerator is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
98          * @since       2.0
99          * @endif
100          */
101         enum BufferPixelFormat
102         {
103                 /**
104                  * @if OSPDEPREC 
105                  * The ARGB8888 pixel format
106                  *
107                  * @since       2.0
108                  * @endif
109                  */
110                 BUFFER_PIXEL_FORMAT_ARGB8888,
111
112                 /**
113                  * @if OSPDEPREC 
114                  * The RGB565 pixel format
115                  *
116                  * @since       2.0
117                  * @endif 
118                  */
119                 BUFFER_PIXEL_FORMAT_RGB565,
120
121                 /**
122                  * @if OSPDEPREC 
123                  * The 8 bit Y plane followed by 8 bit 2 X 2 subsampled U and V planes
124                  *
125                  * @since       2.0
126                  * @endif 
127                  */
128                 BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR
129         };
130
131         /**
132          * @if OSPDEPREC
133          * This is the default constructor for this class.
134          * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
135          *
136          * @brief <i> [Deprecated]  </i>
137          * @deprecated  This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
138          * @since       2.0
139          * @endif
140          */
141         OverlayPanel(void);
142
143         /**
144          * @if OSPDEPREC
145          * This is the destructor for this class.
146          *
147          * @brief <i> [Deprecated]  </i>
148          * @deprecated  This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
149          * @since       2.0
150          * @endif
151          */
152         virtual ~OverlayPanel(void);
153
154         /**
155          * @if OSPDEPREC
156          * Initializes this instance of %OverlayPanel at the specified rectangle.
157          *
158          * @brief <i> [Deprecated]  </i>
159          * @deprecated  This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
160          * @since                       2.0
161          *
162          * @return                                                      An error code
163          * @param[in]   rect                            The location and size of the %OverlayPanel control @n
164          *                                                                      The maximum size is 480 x 800 on a WVGA screen, or 240 x 400 on a WQVGA screen. @n
165          *                                                                      The minimum size of this control is 32 x 32 on a WVGA screen.
166          * @exception   E_SUCCESS                       The method is successful.
167          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
168          * @exception   E_SYSTEM                        A system error has occurred.
169          * @remarks     The size of the control must be within the range defined by the minimum size and the maximum size.
170          * @remarks     Do not use %OverlayPanel in combination with %OverlayRegion. If used, %OverlayPanel may not work as expected.
171          * @see         Tizen::Ui::Container
172          * @endif
173          */
174         result Construct(const Tizen::Graphics::Rectangle& rect);
175
176         /**
177          * @if OSPDEPREC
178          * Sets the rotation of the input buffer. @n
179          * All the rotations are clock-wise.
180          *
181          * @brief <i> [Deprecated]  </i>
182          * @deprecated  This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
183          * @since                       2.0
184          *
185          * @param[in]   rotation        The rotation
186          *
187          * @endif
188          */
189         void SetRendererRotation(OverlayPanel::Rotation rotation);
190
191         /**
192          * @if OSPDEPREC
193          * Changes the size of the displayed renderer.
194          *
195          * @brief <i> [Deprecated]  </i>
196          * @deprecated  This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
197          * @since                       2.0
198          *
199          * @param[in]   dim             The dimension of the window to draw
200          *
201          * @endif
202          */
203         void SetRendererSize(Tizen::Graphics::Dimension& dim);
204
205         /**
206          * @if OSPDEPREC
207          * Sets the aspect ratio of the renderer.
208          *
209          * @brief <i> [Deprecated]  </i>
210          * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
211          * @since                       2.0
212          *
213          * @param[in]   fix             Set to @c true if the renderer will display the aspect ratio of the input buffer even if the renderer and input data have
214          *                                              different aspect ratios, @n
215          *                                              else @c false
216          * @endif
217          */
218         void SetRendererAspectRatio(bool fix);
219
220         /**
221          * @if OSPDEPREC
222          * Sets the input buffer.
223          *
224          * @brief <i> [Deprecated]  </i>
225          * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
226          * @since               2.0
227          *
228          * @param[in]   destDim                           The dimension of the window to be drawn
229          * @param[in]   srcBuffer             The source buffer
230          * @param[in]   srcDim                The source dimension
231          * @param[in]   srcFormat             The pixel format of buffer data
232          * @exception   E_SUCCESS                         The method is successful.
233          * @exception   E_INVALID_ARG             A specified input parameter is invalid.
234          * @exception   E_SYSTEM                          A system error has occurred.
235          * @exception   E_UNSUPPORTED_FORMAT  The specified pixel format is not supported.
236          * @remarks     BUFFER_PIXEL_FORMAT_ARGB8888, and BUFFER_PIXEL_FORMAT_RGB565 are not supported. @n
237          *                      Control::Invalidate() methods must be called to properly display the input buffer.
238          *
239          * @endif
240          */
241         result SetInputBuffer(const Tizen::Graphics::Dimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, BufferPixelFormat srcFormat);
242
243         /**
244          * @if OSPDEPREC
245          * Gets the information of the background buffer.
246          *
247          * @brief <i> [Deprecated]  </i>
248          * @deprecated  This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
249          * @since                        2.0
250          *
251          * @return              An error code
252          * @param[out]  info                            The information of the background buffer
253          * @exception   E_SUCCESS                       The method is successful.
254          * @exception   E_OPERATION_FAILED      The operation has failed.
255          * @remarks             Currently, this function provides buffer information except the pointer of the RGB color buffer. @n
256          *                              Therefore, info.pPixels is always assigned @c null.
257          * @endif
258          */
259         result GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& info) const;
260
261         /**
262          * @if OSPDEPREC
263          * Gets the masking color of this control.
264          *
265          * @brief <i> [Deprecated]  </i>
266          * @deprecated  This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview.
267          * @since                        2.0
268          *
269          * @return     The pixel color format
270          * @endif
271          */
272         Tizen::Graphics::Color GetMaskingColor(void) const;
273
274 private:
275         friend class _OverlayPanelImpl;
276
277 private:
278         //
279         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
280         //
281         OverlayPanel(const OverlayPanel& rhs);
282
283         //
284         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
285         //
286         OverlayPanel& operator =(const OverlayPanel& rhs);
287
288 }; // OverlayPanel
289
290 }}} // Tizen::Ui::Controls
291
292 #endif // _FUI_CTRL_OVERLAY_PANEL_H_