Bump version to 21.06.18.1
[LibreOffice.git] / include / toolkit / awt / vclxdevice.hxx
blob6db587343f150d86469c732e4533bc6effb774b0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_TOOLKIT_AWT_VCLXDEVICE_HXX
21 #define INCLUDED_TOOLKIT_AWT_VCLXDEVICE_HXX
23 #include <toolkit/dllapi.h>
24 #include <com/sun/star/awt/XDevice.hpp>
25 #include <com/sun/star/lang/XUnoTunnel.hpp>
26 #include <comphelper/servicehelper.hxx>
27 #include <cppuhelper/implbase.hxx>
28 #include <vcl/virdev.hxx>
29 #include <vcl/vclptr.hxx>
31 #include <com/sun/star/awt/XUnitConversion.hpp>
33 /// A UNO wrapper for the VCL OutputDevice
34 class TOOLKIT_DLLPUBLIC VCLXDevice :
35 public cppu::WeakImplHelper<
36 css::awt::XDevice,
37 css::lang::XUnoTunnel,
38 css::awt::XUnitConversion>
40 friend class VCLXGraphics;
41 friend class VCLXVirtualDevice;
43 private:
44 VclPtr<OutputDevice> mpOutputDevice;
46 public:
47 VCLXDevice();
48 virtual ~VCLXDevice() override;
50 void SetOutputDevice( const VclPtr<OutputDevice> &pOutDev ) { mpOutputDevice = pOutDev; }
51 const VclPtr<OutputDevice>& GetOutputDevice() const { return mpOutputDevice; }
53 // css::lang::XUnoTunnel
54 UNO3_GETIMPLEMENTATION_DECL(VCLXDevice)
56 // css::awt::XDevice,
57 css::uno::Reference< css::awt::XGraphics > SAL_CALL createGraphics( ) override;
58 css::uno::Reference< css::awt::XDevice > SAL_CALL createDevice( sal_Int32 nWidth, sal_Int32 nHeight ) override;
59 css::awt::DeviceInfo SAL_CALL getInfo() override;
60 css::uno::Sequence< css::awt::FontDescriptor > SAL_CALL getFontDescriptors( ) override;
61 css::uno::Reference< css::awt::XFont > SAL_CALL getFont( const css::awt::FontDescriptor& aDescriptor ) override;
62 css::uno::Reference< css::awt::XBitmap > SAL_CALL createBitmap( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight ) override;
63 css::uno::Reference< css::awt::XDisplayBitmap > SAL_CALL createDisplayBitmap( const css::uno::Reference< css::awt::XBitmap >& Bitmap ) override;
65 // css::awt::XUnitConversion
66 css::awt::Point SAL_CALL convertPointToLogic( const css::awt::Point& aPoint, ::sal_Int16 TargetUnit ) override;
67 css::awt::Point SAL_CALL convertPointToPixel( const css::awt::Point& aPoint, ::sal_Int16 SourceUnit ) override;
68 css::awt::Size SAL_CALL convertSizeToLogic( const css::awt::Size& aSize, ::sal_Int16 TargetUnit ) override;
69 css::awt::Size SAL_CALL convertSizeToPixel( const css::awt::Size& aSize, ::sal_Int16 SourceUnit ) override;
77 class VCLXVirtualDevice : public VCLXDevice
79 public:
80 virtual ~VCLXVirtualDevice() override;
82 void SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( pVDev ); }
86 #endif // INCLUDED_TOOLKIT_AWT_VCLXDEVICE_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */