1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _GOODIES_RENDERER_HXX 25 #define _GOODIES_RENDERER_HXX 26 27 #include <tools/gen.hxx> 28 #include <comphelper/propertysethelper.hxx> 29 #include <com/sun/star/lang/XServiceInfo.hpp> 30 #include <com/sun/star/awt/XDevice.hpp> 31 #include <com/sun/star/graphic/XGraphic.hpp> 32 #include <com/sun/star/graphic/XGraphicRenderer.hpp> 33 34 35 using namespace com::sun::star; 36 37 class OutputDevice; 38 39 namespace unographic { 40 41 // ------------------- 42 // - GraphicRenderer - 43 // ------------------- 44 45 class GraphicRendererVCL : public ::cppu::OWeakAggObject, 46 public ::com::sun::star::lang::XServiceInfo, 47 public ::com::sun::star::lang::XTypeProvider, 48 public ::comphelper::PropertySetHelper, 49 public ::com::sun::star::graphic::XGraphicRenderer 50 { 51 public: 52 53 GraphicRendererVCL(); 54 ~GraphicRendererVCL() throw(); 55 56 static ::rtl::OUString getImplementationName_Static() throw(); 57 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw(); 58 59 protected: 60 61 static ::comphelper::PropertySetInfo* createPropertySetInfo(); 62 63 // XInterface 64 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); 65 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); 66 virtual void SAL_CALL acquire() throw(); 67 virtual void SAL_CALL release() throw(); 68 69 // XServiceInfo 70 virtual rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); 71 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException ); 72 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); 73 74 // XTypeProvider 75 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 76 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 77 78 // PropertySetHelper 79 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 ); 80 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); 81 82 // XGraphicRenderer 83 virtual void SAL_CALL render( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& Graphic ) throw (::com::sun::star::uno::RuntimeException); 84 85 private: 86 87 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxDevice; 88 89 OutputDevice* mpOutDev; 90 Rectangle maDestRect; 91 ::com::sun::star::uno::Any maRenderData; 92 }; 93 94 } 95 96 #endif 97