LibreOffice Module canvas (master) 1
cairo_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
23
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/geometry/Matrix2D.hpp>
26#include <com/sun/star/rendering/FontRequest.hpp>
27#include <com/sun/star/rendering/XCanvasFont.hpp>
28
29#include <vcl/font.hxx>
30
31#include <vclwrapper.hxx>
32
34
35
36/* Definition of CanvasFont class */
37
38namespace cairocanvas
39{
40 typedef ::comphelper::WeakComponentImplHelper< css::rendering::XCanvasFont,
41 css::lang::XServiceInfo > CanvasFont_Base;
42
44 {
45 public:
48 CanvasFont(const CanvasFont&) = delete;
49 const CanvasFont& operator=(const CanvasFont&) = delete;
50
51 CanvasFont( const css::rendering::FontRequest& fontRequest,
52 const css::uno::Sequence< css::beans::PropertyValue >& extraFontProperties,
53 const css::geometry::Matrix2D& rFontMatrix,
54 SurfaceProviderRef rDevice );
55
57 virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
58
59 // XCanvasFont
60 virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout( const css::rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) override;
61 virtual css::rendering::FontRequest SAL_CALL getFontRequest( ) override;
62 virtual css::rendering::FontMetrics SAL_CALL getFontMetrics( ) override;
63 virtual css::uno::Sequence< double > SAL_CALL getAvailableSizes( ) override;
64 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getExtraFontProperties( ) override;
65
66 // XServiceInfo
67 virtual OUString SAL_CALL getImplementationName() override;
68 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
69 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
70
71 vcl::Font const & getVCLFont() const;
72
73 sal_uInt32 getEmphasisMark() const { return mnEmphasisMark; }
74
75 private:
77 css::rendering::FontRequest maFontRequest;
79 sal_uInt32 mnEmphasisMark;
80 };
81
82}
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl::Reference< CanvasFont > Reference
virtual css::rendering::FontMetrics SAL_CALL getFontMetrics() override
CanvasFont(const CanvasFont &)=delete
make noncopyable
virtual void disposing(std::unique_lock< std::mutex > &rGuard) override
Dispose all internal references.
virtual css::uno::Sequence< double > SAL_CALL getAvailableSizes() override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getExtraFontProperties() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
const CanvasFont & operator=(const CanvasFont &)=delete
sal_uInt32 getEmphasisMark() const
SurfaceProviderRef mpRefDevice
vcl::Font const & getVCLFont() const
::canvas::vcltools::VCLObject< vcl::Font > maFont
virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout(const css::rendering::StringContext &aText, sal_Int8 nDirection, sal_Int64 nRandomSeed) override
css::rendering::FontRequest maFontRequest
virtual OUString SAL_CALL getImplementationName() override
virtual css::rendering::FontRequest SAL_CALL getFontRequest() override
CanvasFont(const css::rendering::FontRequest &fontRequest, const css::uno::Sequence< css::beans::PropertyValue > &extraFontProperties, const css::geometry::Matrix2D &rFontMatrix, SurfaceProviderRef rDevice)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
::comphelper::WeakComponentImplHelper< css::rendering::XCanvasFont, css::lang::XServiceInfo > CanvasFont_Base
class SAL_LOPLUGIN_ANNOTATE("crosscast") SurfaceProvider typedef ::rtl::Reference< SurfaceProvider > SurfaceProviderRef
Target interface for XCachedPrimitive implementations.
unsigned char sal_Bool
signed char sal_Int8