LibreOffice Module toolkit (master) 1
vclxdevice.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_TOOLKIT_AWT_VCLXDEVICE_HXX
21#define INCLUDED_TOOLKIT_AWT_VCLXDEVICE_HXX
22
23#include <toolkit/dllapi.h>
24#include <com/sun/star/awt/XDevice.hpp>
27#include <vcl/virdev.hxx>
28#include <vcl/vclptr.hxx>
29
30#include <com/sun/star/awt/XUnitConversion.hpp>
31
34 public cppu::WeakImplHelper<
35 css::awt::XDevice,
36 css::awt::XUnitConversion>
37{
38 friend class VCLXGraphics;
39 friend class VCLXVirtualDevice;
40
41private:
43
44public:
45 VCLXDevice();
46 virtual ~VCLXDevice() override;
47
48 void SetOutputDevice( const VclPtr<OutputDevice> &pOutDev ) { mpOutputDevice = pOutDev; }
50
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;
59
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;
65
66
67};
68
69
70
71
72class VCLXVirtualDevice final : public VCLXDevice
73{
74public:
75 virtual ~VCLXVirtualDevice() override;
76
77 void SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( pVDev ); }
78};
79
80
81#endif // INCLUDED_TOOLKIT_AWT_VCLXDEVICE_HXX
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A UNO wrapper for the VCL OutputDevice.
Definition: vclxdevice.hxx:37
css::uno::Reference< css::awt::XGraphics > SAL_CALL createGraphics() override
Definition: vclxdevice.cxx:49
css::uno::Reference< css::awt::XFont > SAL_CALL getFont(const css::awt::FontDescriptor &aDescriptor) override
Definition: vclxdevice.cxx:108
css::awt::Point SAL_CALL convertPointToLogic(const css::awt::Point &aPoint, ::sal_Int16 TargetUnit) override
Definition: vclxdevice.cxx:157
VclPtr< OutputDevice > mpOutputDevice
Definition: vclxdevice.hxx:42
css::awt::Size SAL_CALL convertSizeToLogic(const css::awt::Size &aSize, ::sal_Int16 TargetUnit) override
Definition: vclxdevice.cxx:204
virtual ~VCLXDevice() override
Definition: vclxdevice.cxx:41
css::uno::Reference< css::awt::XDevice > SAL_CALL createDevice(sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: vclxdevice.cxx:61
css::awt::Point SAL_CALL convertPointToPixel(const css::awt::Point &aPoint, ::sal_Int16 SourceUnit) override
Definition: vclxdevice.cxx:181
css::uno::Reference< css::awt::XDisplayBitmap > SAL_CALL createDisplayBitmap(const css::uno::Reference< css::awt::XBitmap > &Bitmap) override
Definition: vclxdevice.cxx:138
css::awt::DeviceInfo SAL_CALL getInfo() override
Definition: vclxdevice.cxx:77
css::awt::Size SAL_CALL convertSizeToPixel(const css::awt::Size &aSize, ::sal_Int16 SourceUnit) override
Definition: vclxdevice.cxx:228
css::uno::Reference< css::awt::XBitmap > SAL_CALL createBitmap(sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight) override
Definition: vclxdevice.cxx:122
void SetOutputDevice(const VclPtr< OutputDevice > &pOutDev)
Definition: vclxdevice.hxx:48
const VclPtr< OutputDevice > & GetOutputDevice() const
Definition: vclxdevice.hxx:49
css::uno::Sequence< css::awt::FontDescriptor > SAL_CALL getFontDescriptors() override
Definition: vclxdevice.cxx:89
virtual ~VCLXVirtualDevice() override
Definition: vclxdevice.cxx:148
void SetVirtualDevice(VirtualDevice *pVDev)
Definition: vclxdevice.hxx:77
#define TOOLKIT_DLLPUBLIC
Definition: dllapi.h:29