1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: devicehelper.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _VCLCANVAS_DEVICEHELPER_HXX
32 #define _VCLCANVAS_DEVICEHELPER_HXX
34 #include <com/sun/star/awt/Rectangle.hpp>
35 #include <com/sun/star/awt/XWindow2.hpp>
36 #include <com/sun/star/rendering/XGraphicDevice.hpp>
37 #include <com/sun/star/rendering/XBufferController.hpp>
39 #include <vcl/outdev.hxx>
40 #include <vcl/window.hxx>
42 #include "outdevprovider.hxx"
44 #include <boost/utility.hpp>
47 /* Definition of DeviceHelper class */
53 class DeviceHelper
: private ::boost::noncopyable
58 void init( const OutDevProviderSharedPtr
& rOutDev
);
60 /// Dispose all internal references
63 // XWindowGraphicDevice
64 ::com::sun::star::geometry::RealSize2D
getPhysicalResolution();
65 ::com::sun::star::geometry::RealSize2D
getPhysicalSize();
66 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XLinePolyPolygon2D
> createCompatibleLinePolyPolygon(
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::RealPoint2D
> >& points
);
69 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBezierPolyPolygon2D
> createCompatibleBezierPolyPolygon(
70 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
71 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::geometry::RealBezierSegment2D
> >& points
);
72 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBitmap
> createCompatibleBitmap(
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::XVolatileBitmap
> createVolatileBitmap(
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::XBitmap
> createCompatibleAlphaBitmap(
79 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
80 const ::com::sun::star::geometry::IntegerSize2D
& size
);
81 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XVolatileBitmap
> createVolatileAlphaBitmap(
82 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
83 const ::com::sun::star::geometry::IntegerSize2D
& size
);
84 sal_Bool
hasFullScreenMode( );
85 sal_Bool
enterFullScreenMode( sal_Bool bEnter
);
87 ::com::sun::star::uno::Any
isAccelerated() const;
88 ::com::sun::star::uno::Any
getDeviceHandle() const;
89 ::com::sun::star::uno::Any
getSurfaceHandle() const;
90 ::com::sun::star::uno::Reference
<
91 ::com::sun::star::rendering::XColorSpace
> getColorSpace() const;
93 OutDevProviderSharedPtr
getOutDev() const { return mpOutDev
; }
95 /** called when DumpScreenContent property is enabled on
96 XGraphicDevice, and writes out bitmaps of current screen.
98 void dumpScreenContent() const;
101 /// For retrieving device info
102 OutDevProviderSharedPtr mpOutDev
;
106 #endif /* _VCLCANVAS_DEVICEHELPER_HXX */