update dev300-m58
[ooovba.git] / canvas / source / null / null_canvasfont.cxx
blob70d6060bc69a5f11c06873ca6fe1eec38c2b166d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: null_canvasfont.cxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_canvas.hxx"
34 #include "null_canvasfont.hxx"
35 #include "null_textlayout.hxx"
36 #include "null_spritecanvas.hxx"
38 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
39 #include <com/sun/star/rendering/PanoseWeight.hpp>
41 using namespace ::com::sun::star;
43 namespace nullcanvas
45 CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest,
46 const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/,
47 const geometry::Matrix2D& fontMatrix ) :
48 CanvasFont_Base( m_aMutex ),
49 maFontRequest( rFontRequest ),
50 maFontMatrix( fontMatrix )
54 void SAL_CALL CanvasFont::disposing()
56 ::osl::MutexGuard aGuard( m_aMutex );
59 uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText,
60 sal_Int8 nDirection,
61 sal_Int64 nRandomSeed ) throw (uno::RuntimeException)
63 ::osl::MutexGuard aGuard( m_aMutex );
65 return new TextLayout( aText, nDirection, nRandomSeed, ImplRef( this ) );
68 uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( ) throw (uno::RuntimeException)
70 ::osl::MutexGuard aGuard( m_aMutex );
72 // TODO
73 return uno::Sequence< double >();
76 uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( ) throw (uno::RuntimeException)
78 ::osl::MutexGuard aGuard( m_aMutex );
80 // TODO
81 return uno::Sequence< beans::PropertyValue >();
84 rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( ) throw (uno::RuntimeException)
86 ::osl::MutexGuard aGuard( m_aMutex );
88 return maFontRequest;
91 rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( ) throw (uno::RuntimeException)
93 ::osl::MutexGuard aGuard( m_aMutex );
95 // TODO
96 return rendering::FontMetrics();
99 #define SERVICE_NAME "com.sun.star.rendering.CanvasFont"
100 #define IMPLEMENTATION_NAME "NullCanvas::CanvasFont"
102 ::rtl::OUString SAL_CALL CanvasFont::getImplementationName() throw( uno::RuntimeException )
104 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
107 sal_Bool SAL_CALL CanvasFont::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException )
109 return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) );
112 uno::Sequence< ::rtl::OUString > SAL_CALL CanvasFont::getSupportedServiceNames() throw( uno::RuntimeException )
114 uno::Sequence< ::rtl::OUString > aRet(1);
115 aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
117 return aRet;
120 const ::com::sun::star::geometry::Matrix2D& CanvasFont::getFontMatrix() const
122 return maFontMatrix;