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