LibreOffice Module canvas (master) 1
canvasfont.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#pragma once
21
24
25#include <com/sun/star/lang/XServiceInfo.hpp>
26#include <com/sun/star/geometry/Matrix2D.hpp>
27#include <com/sun/star/rendering/FontRequest.hpp>
28#include <com/sun/star/rendering/XCanvasFont.hpp>
29#include <com/sun/star/rendering/XGraphicDevice.hpp>
30
31#include <vcl/font.hxx>
32
33#include <vclwrapper.hxx>
34
35#include "outdevprovider.hxx"
36
37
38/* Definition of CanvasFont class */
39
40namespace vclcanvas
41{
42 typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont,
43 css::lang::XServiceInfo > CanvasFont_Base;
44
46 public CanvasFont_Base
47 {
48 public:
50
52 CanvasFont(const CanvasFont&) = delete;
53 const CanvasFont& operator=(const CanvasFont&) = delete;
54
55 CanvasFont( const css::rendering::FontRequest& fontRequest,
56 const css::uno::Sequence< css::beans::PropertyValue >& extraFontProperties,
57 const css::geometry::Matrix2D& rFontMatrix,
58 css::rendering::XGraphicDevice& rDevice,
59 const OutDevProviderSharedPtr& rOutDevProvider );
60
62 virtual void SAL_CALL disposing() override;
63
64 // XCanvasFont
65 virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout( const css::rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) override;
66 virtual css::rendering::FontRequest SAL_CALL getFontRequest( ) override;
67 virtual css::rendering::FontMetrics SAL_CALL getFontMetrics( ) override;
68 virtual css::uno::Sequence< double > SAL_CALL getAvailableSizes( ) override;
69 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getExtraFontProperties( ) override;
70
71 // XServiceInfo
72 virtual OUString SAL_CALL getImplementationName() override;
73 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
74 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
75
76 vcl::Font const & getVCLFont() const;
77
78 const css::geometry::Matrix2D& getFontMatrix() const;
79
80 private:
82 css::rendering::FontRequest maFontRequest;
83 css::uno::Reference< css::rendering::XGraphicDevice> mpRefDevice;
85 css::geometry::Matrix2D maFontMatrix;
86 };
87
88}
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::rendering::XGraphicDevice > mpRefDevice
Definition: canvasfont.hxx:83
vcl::Font const & getVCLFont() const
Definition: canvasfont.cxx:152
virtual css::rendering::FontMetrics SAL_CALL getFontMetrics() override
Definition: canvasfont.cxx:106
virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout(const css::rendering::StringContext &aText, sal_Int8 nDirection, sal_Int64 nRandomSeed) override
OutDevProviderSharedPtr mpOutDevProvider
Definition: canvasfont.hxx:84
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: canvasfont.cxx:147
CanvasFont(const CanvasFont &)=delete
make noncopyable
const CanvasFont & operator=(const CanvasFont &)=delete
CanvasFont(const css::rendering::FontRequest &fontRequest, const css::uno::Sequence< css::beans::PropertyValue > &extraFontProperties, const css::geometry::Matrix2D &rFontMatrix, css::rendering::XGraphicDevice &rDevice, const OutDevProviderSharedPtr &rOutDevProvider)
virtual void SAL_CALL disposing() override
Dispose all internal references.
Definition: canvasfont.cxx:77
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: canvasfont.cxx:142
css::geometry::Matrix2D maFontMatrix
Definition: canvasfont.hxx:85
const css::geometry::Matrix2D & getFontMatrix() const
Definition: canvasfont.cxx:157
virtual OUString SAL_CALL getImplementationName() override
Definition: canvasfont.cxx:137
rtl::Reference< CanvasFont > Reference
Definition: canvasfont.hxx:49
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getExtraFontProperties() override
Definition: canvasfont.cxx:131
::canvas::vcltools::VCLObject< vcl::Font > maFont
Definition: canvasfont.hxx:81
virtual css::uno::Sequence< double > SAL_CALL getAvailableSizes() override
Definition: canvasfont.cxx:125
css::rendering::FontRequest maFontRequest
Definition: canvasfont.hxx:82
virtual css::rendering::FontRequest SAL_CALL getFontRequest() override
Definition: canvasfont.cxx:99
std::shared_ptr< OutDevProvider > OutDevProviderSharedPtr
::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont, css::lang::XServiceInfo > CanvasFont_Base
Definition: canvasfont.hxx:43
unsigned char sal_Bool
signed char sal_Int8