Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / toolkit / awt / vclxdevice.hxx
blob08a12a65353e1e9dd0eb3eb0f541e4614c65ba06
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 <comphelper/servicehelper.hxx>
26 #include <cppuhelper/implbase.hxx>
27 #include <vcl/virdev.hxx>
28 #include <vcl/vclptr.hxx>
30 #include <com/sun/star/awt/XUnitConversion.hpp>
32 /// A UNO wrapper for the VCL OutputDevice
33 class TOOLKIT_DLLPUBLIC VCLXDevice :
34 public cppu::WeakImplHelper<
35 css::awt::XDevice,
36 css::awt::XUnitConversion>
38 friend class VCLXGraphics;
39 friend class VCLXVirtualDevice;
41 private:
42 VclPtr<OutputDevice> mpOutputDevice;
44 public:
45 VCLXDevice();
46 virtual ~VCLXDevice() override;
48 void SetOutputDevice( const VclPtr<OutputDevice> &pOutDev ) { mpOutputDevice = pOutDev; }
49 const VclPtr<OutputDevice>& GetOutputDevice() const { return mpOutputDevice; }
51 // css::awt::XDevice,
52 css::uno::Reference< css::awt::XGraphics > SAL_CALL createGraphics( ) override;
53 css::uno::Reference< css::awt::XDevice > SAL_CALL createDevice( sal_Int32 nWidth, sal_Int32 nHeight ) override;
54 css::awt::DeviceInfo SAL_CALL getInfo() override;
55 css::uno::Sequence< css::awt::FontDescriptor > SAL_CALL getFontDescriptors( ) override;
56 css::uno::Reference< css::awt::XFont > SAL_CALL getFont( const css::awt::FontDescriptor& aDescriptor ) override;
57 css::uno::Reference< css::awt::XBitmap > SAL_CALL createBitmap( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight ) override;
58 css::uno::Reference< css::awt::XDisplayBitmap > SAL_CALL createDisplayBitmap( const css::uno::Reference< css::awt::XBitmap >& Bitmap ) override;
60 // css::awt::XUnitConversion
61 css::awt::Point SAL_CALL convertPointToLogic( const css::awt::Point& aPoint, ::sal_Int16 TargetUnit ) override;
62 css::awt::Point SAL_CALL convertPointToPixel( const css::awt::Point& aPoint, ::sal_Int16 SourceUnit ) override;
63 css::awt::Size SAL_CALL convertSizeToLogic( const css::awt::Size& aSize, ::sal_Int16 TargetUnit ) override;
64 css::awt::Size SAL_CALL convertSizeToPixel( const css::awt::Size& aSize, ::sal_Int16 SourceUnit ) override;
72 class VCLXVirtualDevice final : public VCLXDevice
74 public:
75 virtual ~VCLXVirtualDevice() override;
77 void SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( pVDev ); }
81 #endif // INCLUDED_TOOLKIT_AWT_VCLXDEVICE_HXX
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */