1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski 24*b1cdbd2cSJim Jagielski // MARKER(update_precomp.py): autogen include statement, do not remove 25*b1cdbd2cSJim Jagielski #include "precompiled_canvas.hxx" 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski #include "null_canvasfont.hxx" 28*b1cdbd2cSJim Jagielski #include "null_textlayout.hxx" 29*b1cdbd2cSJim Jagielski #include "null_spritecanvas.hxx" 30*b1cdbd2cSJim Jagielski 31*b1cdbd2cSJim Jagielski #include <com/sun/star/rendering/XSpriteCanvas.hpp> 32*b1cdbd2cSJim Jagielski #include <com/sun/star/rendering/PanoseWeight.hpp> 33*b1cdbd2cSJim Jagielski 34*b1cdbd2cSJim Jagielski using namespace ::com::sun::star; 35*b1cdbd2cSJim Jagielski 36*b1cdbd2cSJim Jagielski namespace nullcanvas 37*b1cdbd2cSJim Jagielski { CanvasFont(const rendering::FontRequest & rFontRequest,const uno::Sequence<beans::PropertyValue> &,const geometry::Matrix2D & fontMatrix)38*b1cdbd2cSJim Jagielski CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, 39*b1cdbd2cSJim Jagielski const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/, 40*b1cdbd2cSJim Jagielski const geometry::Matrix2D& fontMatrix ) : 41*b1cdbd2cSJim Jagielski CanvasFont_Base( m_aMutex ), 42*b1cdbd2cSJim Jagielski maFontRequest( rFontRequest ), 43*b1cdbd2cSJim Jagielski maFontMatrix( fontMatrix ) 44*b1cdbd2cSJim Jagielski { 45*b1cdbd2cSJim Jagielski } 46*b1cdbd2cSJim Jagielski disposing()47*b1cdbd2cSJim Jagielski void SAL_CALL CanvasFont::disposing() 48*b1cdbd2cSJim Jagielski { 49*b1cdbd2cSJim Jagielski ::osl::MutexGuard aGuard( m_aMutex ); 50*b1cdbd2cSJim Jagielski } 51*b1cdbd2cSJim Jagielski createTextLayout(const rendering::StringContext & aText,sal_Int8 nDirection,sal_Int64 nRandomSeed)52*b1cdbd2cSJim Jagielski uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText, 53*b1cdbd2cSJim Jagielski sal_Int8 nDirection, 54*b1cdbd2cSJim Jagielski sal_Int64 nRandomSeed ) throw (uno::RuntimeException) 55*b1cdbd2cSJim Jagielski { 56*b1cdbd2cSJim Jagielski ::osl::MutexGuard aGuard( m_aMutex ); 57*b1cdbd2cSJim Jagielski 58*b1cdbd2cSJim Jagielski return new TextLayout( aText, nDirection, nRandomSeed, ImplRef( this ) ); 59*b1cdbd2cSJim Jagielski } 60*b1cdbd2cSJim Jagielski getAvailableSizes()61*b1cdbd2cSJim Jagielski uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( ) throw (uno::RuntimeException) 62*b1cdbd2cSJim Jagielski { 63*b1cdbd2cSJim Jagielski ::osl::MutexGuard aGuard( m_aMutex ); 64*b1cdbd2cSJim Jagielski 65*b1cdbd2cSJim Jagielski // TODO 66*b1cdbd2cSJim Jagielski return uno::Sequence< double >(); 67*b1cdbd2cSJim Jagielski } 68*b1cdbd2cSJim Jagielski getExtraFontProperties()69*b1cdbd2cSJim Jagielski uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( ) throw (uno::RuntimeException) 70*b1cdbd2cSJim Jagielski { 71*b1cdbd2cSJim Jagielski ::osl::MutexGuard aGuard( m_aMutex ); 72*b1cdbd2cSJim Jagielski 73*b1cdbd2cSJim Jagielski // TODO 74*b1cdbd2cSJim Jagielski return uno::Sequence< beans::PropertyValue >(); 75*b1cdbd2cSJim Jagielski } 76*b1cdbd2cSJim Jagielski getFontRequest()77*b1cdbd2cSJim Jagielski rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( ) throw (uno::RuntimeException) 78*b1cdbd2cSJim Jagielski { 79*b1cdbd2cSJim Jagielski ::osl::MutexGuard aGuard( m_aMutex ); 80*b1cdbd2cSJim Jagielski 81*b1cdbd2cSJim Jagielski return maFontRequest; 82*b1cdbd2cSJim Jagielski } 83*b1cdbd2cSJim Jagielski getFontMetrics()84*b1cdbd2cSJim Jagielski rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( ) throw (uno::RuntimeException) 85*b1cdbd2cSJim Jagielski { 86*b1cdbd2cSJim Jagielski ::osl::MutexGuard aGuard( m_aMutex ); 87*b1cdbd2cSJim Jagielski 88*b1cdbd2cSJim Jagielski // TODO 89*b1cdbd2cSJim Jagielski return rendering::FontMetrics(); 90*b1cdbd2cSJim Jagielski } 91*b1cdbd2cSJim Jagielski 92*b1cdbd2cSJim Jagielski #define SERVICE_NAME "com.sun.star.rendering.CanvasFont" 93*b1cdbd2cSJim Jagielski #define IMPLEMENTATION_NAME "NullCanvas::CanvasFont" 94*b1cdbd2cSJim Jagielski getImplementationName()95*b1cdbd2cSJim Jagielski ::rtl::OUString SAL_CALL CanvasFont::getImplementationName() throw( uno::RuntimeException ) 96*b1cdbd2cSJim Jagielski { 97*b1cdbd2cSJim Jagielski return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) ); 98*b1cdbd2cSJim Jagielski } 99*b1cdbd2cSJim Jagielski supportsService(const::rtl::OUString & ServiceName)100*b1cdbd2cSJim Jagielski sal_Bool SAL_CALL CanvasFont::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException ) 101*b1cdbd2cSJim Jagielski { 102*b1cdbd2cSJim Jagielski return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) ); 103*b1cdbd2cSJim Jagielski } 104*b1cdbd2cSJim Jagielski getSupportedServiceNames()105*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > SAL_CALL CanvasFont::getSupportedServiceNames() throw( uno::RuntimeException ) 106*b1cdbd2cSJim Jagielski { 107*b1cdbd2cSJim Jagielski uno::Sequence< ::rtl::OUString > aRet(1); 108*b1cdbd2cSJim Jagielski aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); 109*b1cdbd2cSJim Jagielski 110*b1cdbd2cSJim Jagielski return aRet; 111*b1cdbd2cSJim Jagielski } 112*b1cdbd2cSJim Jagielski getFontMatrix() const113*b1cdbd2cSJim Jagielski const ::com::sun::star::geometry::Matrix2D& CanvasFont::getFontMatrix() const 114*b1cdbd2cSJim Jagielski { 115*b1cdbd2cSJim Jagielski return maFontMatrix; 116*b1cdbd2cSJim Jagielski } 117*b1cdbd2cSJim Jagielski } 118