LibreOffice Module canvas (master)  1
ogl_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 
10 #pragma once
11 
12 #include <cppuhelper/compbase.hxx>
13 #include <cppuhelper/basemutex.hxx>
14 
15 #include <com/sun/star/rendering/XCanvasFont.hpp>
16 #include <com/sun/star/geometry/Matrix2D.hpp>
17 
18 #include <rtl/ref.hxx>
19 
20 
21 /* Definition of CanvasFont class */
22 
23 namespace oglcanvas
24 {
25  class SpriteCanvas;
26 
27  typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont > CanvasFontBaseT;
28 
29  class CanvasFont : public ::cppu::BaseMutex,
30  public CanvasFontBaseT
31  {
32  public:
34 
36  CanvasFont(const CanvasFont&) = delete;
37  const CanvasFont& operator=(const CanvasFont&) = delete;
38 
39  CanvasFont( const css::rendering::FontRequest& fontRequest,
40  const css::uno::Sequence< css::beans::PropertyValue >& extraFontProperties,
41  const css::geometry::Matrix2D& fontMatrix );
42 
43  // XCanvasFont
44  virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout( const css::rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) override;
45  virtual css::rendering::FontRequest SAL_CALL getFontRequest( ) override;
46  virtual css::rendering::FontMetrics SAL_CALL getFontMetrics( ) override;
47  virtual css::uno::Sequence< double > SAL_CALL getAvailableSizes( ) override;
48  virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getExtraFontProperties( ) override;
49 
50  const css::geometry::Matrix2D& getFontMatrix() const { return maFontMatrix; }
51 
52  sal_uInt32 getEmphasisMark() const { return mnEmphasisMark; }
53 
54  private:
55  css::rendering::FontRequest maFontRequest;
56  sal_uInt32 mnEmphasisMark;
57  css::geometry::Matrix2D maFontMatrix;
58  };
59 }
60 
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getExtraFontProperties() override
signed char sal_Int8
sal_uInt32 getEmphasisMark() const
CanvasFont(const CanvasFont &)=delete
make noncopyable
virtual css::rendering::FontMetrics SAL_CALL getFontMetrics() override
virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout(const css::rendering::StringContext &aText, sal_Int8 nDirection, sal_Int64 nRandomSeed) override
virtual css::rendering::FontRequest SAL_CALL getFontRequest() override
virtual css::uno::Sequence< double > SAL_CALL getAvailableSizes() override
const CanvasFont & operator=(const CanvasFont &)=delete
rtl::Reference< CanvasFont > ImplRef
css::geometry::Matrix2D maFontMatrix
css::rendering::FontRequest maFontRequest
const css::geometry::Matrix2D & getFontMatrix() const
Product of this component's factory.
::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont > CanvasFontBaseT