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