Line data Source code
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 : #include "null_canvasfont.hxx"
21 : #include "null_textlayout.hxx"
22 : #include "null_spritecanvas.hxx"
23 :
24 : #include <com/sun/star/rendering/XSpriteCanvas.hpp>
25 : #include <com/sun/star/rendering/PanoseWeight.hpp>
26 :
27 : using namespace ::com::sun::star;
28 :
29 : namespace nullcanvas
30 : {
31 0 : CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest,
32 : const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/,
33 : const geometry::Matrix2D& fontMatrix ) :
34 : CanvasFont_Base( m_aMutex ),
35 : maFontRequest( rFontRequest ),
36 0 : maFontMatrix( fontMatrix )
37 : {
38 0 : }
39 :
40 0 : void SAL_CALL CanvasFont::disposing()
41 : {
42 0 : ::osl::MutexGuard aGuard( m_aMutex );
43 0 : }
44 :
45 0 : uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText,
46 : sal_Int8 nDirection,
47 : sal_Int64 nRandomSeed ) throw (uno::RuntimeException)
48 : {
49 0 : ::osl::MutexGuard aGuard( m_aMutex );
50 :
51 0 : return new TextLayout( aText, nDirection, nRandomSeed, ImplRef( this ) );
52 : }
53 :
54 0 : uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( ) throw (uno::RuntimeException)
55 : {
56 0 : ::osl::MutexGuard aGuard( m_aMutex );
57 :
58 : // TODO
59 0 : return uno::Sequence< double >();
60 : }
61 :
62 0 : uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( ) throw (uno::RuntimeException)
63 : {
64 0 : ::osl::MutexGuard aGuard( m_aMutex );
65 :
66 : // TODO
67 0 : return uno::Sequence< beans::PropertyValue >();
68 : }
69 :
70 0 : rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( ) throw (uno::RuntimeException)
71 : {
72 0 : ::osl::MutexGuard aGuard( m_aMutex );
73 :
74 0 : return maFontRequest;
75 : }
76 :
77 0 : rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( ) throw (uno::RuntimeException)
78 : {
79 0 : ::osl::MutexGuard aGuard( m_aMutex );
80 :
81 : // TODO
82 0 : return rendering::FontMetrics();
83 : }
84 :
85 : #define SERVICE_NAME "com.sun.star.rendering.CanvasFont"
86 : #define IMPLEMENTATION_NAME "NullCanvas::CanvasFont"
87 :
88 0 : ::rtl::OUString SAL_CALL CanvasFont::getImplementationName() throw( uno::RuntimeException )
89 : {
90 0 : return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
91 : }
92 :
93 0 : sal_Bool SAL_CALL CanvasFont::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException )
94 : {
95 0 : return ServiceName == SERVICE_NAME;
96 : }
97 :
98 0 : uno::Sequence< ::rtl::OUString > SAL_CALL CanvasFont::getSupportedServiceNames() throw( uno::RuntimeException )
99 : {
100 0 : uno::Sequence< ::rtl::OUString > aRet(1);
101 0 : aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
102 :
103 0 : return aRet;
104 : }
105 0 : }
106 :
107 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|