xref: /trunk/main/svtools/source/inc/renderer.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _GOODIES_RENDERER_HXX
29 #define _GOODIES_RENDERER_HXX
30 
31 #include <tools/gen.hxx>
32 #include <comphelper/propertysethelper.hxx>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/awt/XDevice.hpp>
35 #include <com/sun/star/graphic/XGraphic.hpp>
36 #include <com/sun/star/graphic/XGraphicRenderer.hpp>
37 
38 
39 using namespace com::sun::star;
40 
41 class OutputDevice;
42 
43 namespace unographic {
44 
45 // -------------------
46 // - GraphicRenderer -
47 // -------------------
48 
49 class GraphicRendererVCL : public ::cppu::OWeakAggObject,
50 						   public ::com::sun::star::lang::XServiceInfo,
51 						   public ::com::sun::star::lang::XTypeProvider,
52 						   public ::comphelper::PropertySetHelper,
53 						   public ::com::sun::star::graphic::XGraphicRenderer
54 {
55 public:
56 
57 	GraphicRendererVCL();
58 	~GraphicRendererVCL() throw();
59 
60     static ::rtl::OUString getImplementationName_Static() throw();
61     static ::com::sun::star::uno::Sequence< ::rtl::OUString >  getSupportedServiceNames_Static() throw();
62 
63 protected:
64 
65 	static ::comphelper::PropertySetInfo* createPropertySetInfo();
66 
67 	// XInterface
68 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
69 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
70 	virtual void SAL_CALL acquire() throw();
71 	virtual void SAL_CALL release() throw();
72 
73 	// XServiceInfo
74     virtual rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
75     virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
76     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
77 
78 	// XTypeProvider
79     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
80     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
81 
82 	// PropertySetHelper
83 	virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
84 	virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
85 
86 	// XGraphicRenderer
87     virtual void SAL_CALL render( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& Graphic ) throw (::com::sun::star::uno::RuntimeException);
88 
89 private:
90 
91 	::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxDevice;
92 
93 	OutputDevice*				mpOutDev;
94 	Rectangle					maDestRect;
95 	::com::sun::star::uno::Any	maRenderData;
96 };
97 
98 }
99 
100 #endif
101