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 PPPOPTIMIZER_HXX 29 #define PPPOPTIMIZER_HXX 30 31 #include <cppuhelper/implbase4.hxx> 32 #include <com/sun/star/frame/XDispatch.hpp> 33 #include <com/sun/star/frame/XDispatchProvider.hpp> 34 #include <com/sun/star/lang/XServiceInfo.hpp> 35 #include <com/sun/star/lang/XMultiComponentFactory.hpp> 36 #include <com/sun/star/uno/XComponentContext.hpp> 37 #include <com/sun/star/lang/XInitialization.hpp> 38 #include <com/sun/star/frame/XController.hpp> 39 40 // ---------------- 41 // - PPPOptimizer - 42 // ---------------- 43 44 class PPPOptimizer : public cppu::WeakImplHelper4< 45 com::sun::star::lang::XInitialization, 46 com::sun::star::lang::XServiceInfo, 47 com::sun::star::frame::XDispatchProvider, 48 com::sun::star::frame::XDispatch > 49 { 50 com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF; 51 com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController; 52 53 public: 54 55 PPPOptimizer( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF ); 56 virtual ~PPPOptimizer(); 57 58 // XInitialization 59 void SAL_CALL initialize( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) 60 throw( com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException ); 61 62 // XServiceInfo 63 virtual ::rtl::OUString SAL_CALL getImplementationName() 64 throw( com::sun::star::uno::RuntimeException ); 65 66 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName ) 67 throw( com::sun::star::uno::RuntimeException ); 68 69 virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 70 throw( com::sun::star::uno::RuntimeException ); 71 72 // XDispatchProvider 73 virtual com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( 74 const com::sun::star::util::URL& aURL, const rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags ) 75 throw(com::sun::star::uno::RuntimeException); 76 77 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( 78 const com::sun::star::uno::Sequence< com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw( com::sun::star::uno::RuntimeException ); 79 80 // XDispatch 81 virtual void SAL_CALL dispatch( const com::sun::star::util::URL& aURL, 82 const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lArguments ) 83 throw( com::sun::star::uno::RuntimeException ); 84 85 virtual void SAL_CALL addStatusListener( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xListener, 86 const com::sun::star::util::URL& aURL ) 87 throw( com::sun::star::uno::RuntimeException ); 88 virtual void SAL_CALL removeStatusListener( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xListener, 89 const com::sun::star::util::URL& aURL ) 90 throw( com::sun::star::uno::RuntimeException ); 91 92 static sal_Int64 GetFileSize( const rtl::OUString& rURL ); 93 }; 94 95 rtl::OUString PPPOptimizer_getImplementationName(); 96 com::sun::star::uno::Sequence< rtl::OUString > PPPOptimizer_getSupportedServiceNames(); 97 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > PPPOptimizer_createInstance( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rSMgr ) 98 throw( com::sun::star::uno::Exception ); 99 100 #endif // PPPOPTIMIZER_HXX 101