Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/toolkit/awt/vclxdevice.hxx
Line
Count
Source
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
#pragma once
21
22
#include <toolkit/dllapi.h>
23
#include <com/sun/star/awt/XDevice.hpp>
24
#include <cppuhelper/implbase.hxx>
25
#include <vcl/virdev.hxx>
26
#include <vcl/vclptr.hxx>
27
28
#include <com/sun/star/awt/XUnitConversion.hpp>
29
30
/// A UNO wrapper for the VCL OutputDevice
31
class TOOLKIT_DLLPUBLIC VCLXDevice :
32
                    public cppu::WeakImplHelper<
33
                        css::awt::XDevice,
34
                        css::awt::XUnitConversion>
35
{
36
    friend class VCLXGraphics;
37
    friend class VCLXVirtualDevice;
38
39
private:
40
    VclPtr<OutputDevice>    mpOutputDevice;
41
42
public:
43
                            VCLXDevice();
44
                            virtual ~VCLXDevice() override;
45
46
183k
    void                    SetOutputDevice( const VclPtr<OutputDevice> &pOutDev ) { mpOutputDevice = pOutDev; }
47
1.24M
    const VclPtr<OutputDevice>& GetOutputDevice() const { return mpOutputDevice; }
48
49
    // css::awt::XDevice,
50
    css::uno::Reference< css::awt::XGraphics >    SAL_CALL createGraphics(  ) override;
51
    css::uno::Reference< css::awt::XDevice >      SAL_CALL createDevice( sal_Int32 nWidth, sal_Int32 nHeight ) override;
52
    css::awt::DeviceInfo                                       SAL_CALL getInfo() override;
53
    css::uno::Sequence< css::awt::FontDescriptor > SAL_CALL getFontDescriptors(  ) override;
54
    css::uno::Reference< css::awt::XFont >        SAL_CALL getFont( const css::awt::FontDescriptor& aDescriptor ) override;
55
    css::uno::Reference< css::awt::XBitmap >      SAL_CALL createBitmap( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight ) override;
56
    css::uno::Reference< css::awt::XDisplayBitmap > SAL_CALL createDisplayBitmap( const css::uno::Reference< css::awt::XBitmap >& Bitmap ) override;
57
58
    // css::awt::XUnitConversion
59
    css::awt::Point SAL_CALL convertPointToLogic( const css::awt::Point& aPoint, ::sal_Int16 TargetUnit ) override;
60
    css::awt::Point SAL_CALL convertPointToPixel( const css::awt::Point& aPoint, ::sal_Int16 SourceUnit ) override;
61
    css::awt::Size SAL_CALL convertSizeToLogic( const css::awt::Size& aSize, ::sal_Int16 TargetUnit ) override;
62
    css::awt::Size SAL_CALL convertSizeToPixel( const css::awt::Size& aSize, ::sal_Int16 SourceUnit ) override;
63
64
65
};
66
67
68
69
70
class VCLXVirtualDevice final : public VCLXDevice
71
{
72
public:
73
                    virtual ~VCLXVirtualDevice() override;
74
75
0
    void            SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( pVDev ); }
76
};
77
78
79
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */