Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include "null_canvasfont.hxx"
31 : : #include "null_textlayout.hxx"
32 : : #include "null_spritecanvas.hxx"
33 : :
34 : : #include <com/sun/star/rendering/XSpriteCanvas.hpp>
35 : : #include <com/sun/star/rendering/PanoseWeight.hpp>
36 : :
37 : : using namespace ::com::sun::star;
38 : :
39 : : namespace nullcanvas
40 : : {
41 : 0 : CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest,
42 : : const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/,
43 : : const geometry::Matrix2D& fontMatrix ) :
44 : : CanvasFont_Base( m_aMutex ),
45 : : maFontRequest( rFontRequest ),
46 : 0 : maFontMatrix( fontMatrix )
47 : : {
48 : 0 : }
49 : :
50 : 0 : void SAL_CALL CanvasFont::disposing()
51 : : {
52 : 0 : ::osl::MutexGuard aGuard( m_aMutex );
53 : 0 : }
54 : :
55 : 0 : uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText,
56 : : sal_Int8 nDirection,
57 : : sal_Int64 nRandomSeed ) throw (uno::RuntimeException)
58 : : {
59 : 0 : ::osl::MutexGuard aGuard( m_aMutex );
60 : :
61 : 0 : return new TextLayout( aText, nDirection, nRandomSeed, ImplRef( this ) );
62 : : }
63 : :
64 : 0 : uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( ) throw (uno::RuntimeException)
65 : : {
66 : 0 : ::osl::MutexGuard aGuard( m_aMutex );
67 : :
68 : : // TODO
69 : 0 : return uno::Sequence< double >();
70 : : }
71 : :
72 : 0 : uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( ) throw (uno::RuntimeException)
73 : : {
74 : 0 : ::osl::MutexGuard aGuard( m_aMutex );
75 : :
76 : : // TODO
77 : 0 : return uno::Sequence< beans::PropertyValue >();
78 : : }
79 : :
80 : 0 : rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( ) throw (uno::RuntimeException)
81 : : {
82 : 0 : ::osl::MutexGuard aGuard( m_aMutex );
83 : :
84 : 0 : return maFontRequest;
85 : : }
86 : :
87 : 0 : rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( ) throw (uno::RuntimeException)
88 : : {
89 : 0 : ::osl::MutexGuard aGuard( m_aMutex );
90 : :
91 : : // TODO
92 : 0 : return rendering::FontMetrics();
93 : : }
94 : :
95 : : #define SERVICE_NAME "com.sun.star.rendering.CanvasFont"
96 : : #define IMPLEMENTATION_NAME "NullCanvas::CanvasFont"
97 : :
98 : 0 : ::rtl::OUString SAL_CALL CanvasFont::getImplementationName() throw( uno::RuntimeException )
99 : : {
100 : 0 : return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
101 : : }
102 : :
103 : 0 : sal_Bool SAL_CALL CanvasFont::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException )
104 : : {
105 : 0 : return ServiceName == SERVICE_NAME;
106 : : }
107 : :
108 : 0 : uno::Sequence< ::rtl::OUString > SAL_CALL CanvasFont::getSupportedServiceNames() throw( uno::RuntimeException )
109 : : {
110 : 0 : uno::Sequence< ::rtl::OUString > aRet(1);
111 : 0 : aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
112 : :
113 : 0 : return aRet;
114 : : }
115 : 0 : }
116 : :
117 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|