xref: /trunk/main/canvas/source/vcl/devicehelper.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _VCLCANVAS_DEVICEHELPER_HXX
29 #define _VCLCANVAS_DEVICEHELPER_HXX
30 
31 #include <com/sun/star/awt/Rectangle.hpp>
32 #include <com/sun/star/awt/XWindow2.hpp>
33 #include <com/sun/star/rendering/XGraphicDevice.hpp>
34 #include <com/sun/star/rendering/XBufferController.hpp>
35 
36 #include <vcl/outdev.hxx>
37 #include <vcl/window.hxx>
38 
39 #include "outdevprovider.hxx"
40 
41 #include <boost/utility.hpp>
42 
43 
44 /* Definition of DeviceHelper class */
45 
46 namespace vclcanvas
47 {
48     class Canvas;
49 
50     class DeviceHelper : private ::boost::noncopyable
51     {
52     public:
53         DeviceHelper();
54 
55         void init( const OutDevProviderSharedPtr& rOutDev );
56 
57         /// Dispose all internal references
58         void disposing();
59 
60         // XWindowGraphicDevice
61         ::com::sun::star::geometry::RealSize2D getPhysicalResolution();
62         ::com::sun::star::geometry::RealSize2D getPhysicalSize();
63         ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon(
64             const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& 								 rDevice,
65             const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& points );
66         ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon(
67             const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& 								 		 rDevice,
68             const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points );
69         ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap(
70             const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& 	rDevice,
71             const ::com::sun::star::geometry::IntegerSize2D& 										size );
72         ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap(
73             const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& 	rDevice,
74             const ::com::sun::star::geometry::IntegerSize2D& 										size );
75         ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap(
76             const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& 	rDevice,
77             const ::com::sun::star::geometry::IntegerSize2D& 										size );
78         ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
79             const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& 	rDevice,
80             const ::com::sun::star::geometry::IntegerSize2D& 										size );
81         sal_Bool hasFullScreenMode(  );
82         sal_Bool enterFullScreenMode( sal_Bool bEnter );
83 
84         ::com::sun::star::uno::Any isAccelerated() const;
85         ::com::sun::star::uno::Any getDeviceHandle() const;
86         ::com::sun::star::uno::Any getSurfaceHandle() const;
87         ::com::sun::star::uno::Reference<
88             ::com::sun::star::rendering::XColorSpace > getColorSpace() const;
89 
90         OutDevProviderSharedPtr getOutDev() const { return mpOutDev; }
91 
92         /** called when DumpScreenContent property is enabled on
93             XGraphicDevice, and writes out bitmaps of current screen.
94          */
95         void dumpScreenContent() const;
96 
97     private:
98         /// For retrieving device info
99         OutDevProviderSharedPtr mpOutDev;
100     };
101 }
102 
103 #endif /* _VCLCANVAS_DEVICEHELPER_HXX */
104