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 #include "sal/config.h" 25 #include "sfx2/dllapi.h" 26 #include "sal/types.h" 27 28 #include <com/sun/star/view/XPrintable.hpp> 29 #include <com/sun/star/view/XPrintJobBroadcaster.hpp> 30 #include <com/sun/star/uno/Sequence.hxx> 31 #include <com/sun/star/uno/Reference.hxx> 32 #include <com/sun/star/uno/Any.hxx> 33 #include <com/sun/star/lang/XInitialization.hpp> 34 #include <osl/mutex.hxx> 35 #include <cppuhelper/implbase3.hxx> 36 37 struct IMPL_PrintListener_DataContainer; 38 class SfxViewShell; 39 class SfxPrinter; 40 41 class SfxPrintHelper : public cppu::WeakImplHelper3 42 < com::sun::star::view::XPrintable 43 , com::sun::star::view::XPrintJobBroadcaster 44 , com::sun::star::lang::XInitialization > 45 { 46 public: 47 48 SfxPrintHelper() ; 49 virtual ~SfxPrintHelper() ; 50 51 void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 52 virtual void SAL_CALL addPrintJobListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XPrintJobListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 53 virtual void SAL_CALL removePrintJobListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XPrintJobListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 54 virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > SAL_CALL getPrinter() throw (::com::sun::star::uno::RuntimeException); 55 virtual void SAL_CALL setPrinter( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& seqPrinter ) 56 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 57 virtual void SAL_CALL print( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& seqOptions ) 58 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 59 60 private: 61 62 osl::Mutex m_aMutex; 63 IMPL_PrintListener_DataContainer* m_pData ; 64 virtual void impl_setPrinter(const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rPrinter,SfxPrinter*& pPrinter,sal_uInt16& nChangeFlags,SfxViewShell*& pViewSh); 65 } ; 66