1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef _SFX_FRMLOAD_HXX 29*cdf0e10cSrcweir #define _SFX_FRMLOAD_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include "sfx2/sfxuno.hxx" 32*cdf0e10cSrcweir #include "sfx2/objsh.hxx" 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir /** === begin UNO includes === **/ 35*cdf0e10cSrcweir #include <com/sun/star/frame/XLoadEventListener.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/frame/XSynchronousFrameLoader.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/frame/XController2.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/frame/XModel2.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/document/XExtendedFilterDetection.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/uno/Exception.hpp> 41*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 42*cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp> 43*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 44*cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 45*cdf0e10cSrcweir #include <com/sun/star/task/XInteractionHandler.hpp> 46*cdf0e10cSrcweir /** === end UNO includes === **/ 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir #include <rtl/ustring.hxx> 49*cdf0e10cSrcweir #include <tools/debug.hxx> 50*cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 51*cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> 52*cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> 53*cdf0e10cSrcweir #include <cppuhelper/factory.hxx> 54*cdf0e10cSrcweir #include <tools/link.hxx> 55*cdf0e10cSrcweir #include <tools/string.hxx> 56*cdf0e10cSrcweir #include <comphelper/componentcontext.hxx> 57*cdf0e10cSrcweir #include <comphelper/namedvaluecollection.hxx> 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir class SfxFilter; 60*cdf0e10cSrcweir class SfxFilterMatcher; 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir class SfxFrameWeak; 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir class SAL_DLLPRIVATE SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo > 65*cdf0e10cSrcweir { 66*cdf0e10cSrcweir ::comphelper::ComponentContext m_aContext; 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir public: 69*cdf0e10cSrcweir SfxFrameLoader_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory ); 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir SFX_DECL_XSERVICEINFO 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir //---------------------------------------------------------------------------------- 74*cdf0e10cSrcweir // XSynchronousFrameLoader 75*cdf0e10cSrcweir //---------------------------------------------------------------------------------- 76*cdf0e10cSrcweir virtual sal_Bool SAL_CALL load( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ) throw( ::com::sun::star::uno::RuntimeException ); 77*cdf0e10cSrcweir virtual void SAL_CALL cancel() throw( ::com::sun::star::uno::RuntimeException ); 78*cdf0e10cSrcweir 79*cdf0e10cSrcweir protected: 80*cdf0e10cSrcweir virtual ~SfxFrameLoader_Impl(); 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir private: 83*cdf0e10cSrcweir const SfxFilter* impl_getFilterFromServiceName_nothrow( 84*cdf0e10cSrcweir const ::rtl::OUString& i_rServiceName 85*cdf0e10cSrcweir ) const; 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir ::rtl::OUString impl_askForFilter_nothrow( 88*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& i_rxHandler, 89*cdf0e10cSrcweir const ::rtl::OUString& i_rDocumentURL 90*cdf0e10cSrcweir ) const; 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir const SfxFilter* impl_detectFilterForURL( 93*cdf0e10cSrcweir const ::rtl::OUString& _rURL, 94*cdf0e10cSrcweir const ::comphelper::NamedValueCollection& i_rDescriptor, 95*cdf0e10cSrcweir const SfxFilterMatcher& rMatcher 96*cdf0e10cSrcweir ) const; 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir sal_Bool impl_createNewDocWithSlotParam( 99*cdf0e10cSrcweir const sal_uInt16 _nSlotID, 100*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame, 101*cdf0e10cSrcweir const bool i_bHidden 102*cdf0e10cSrcweir ); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir void impl_determineFilter( 105*cdf0e10cSrcweir ::comphelper::NamedValueCollection& io_rDescriptor 106*cdf0e10cSrcweir ) const; 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir bool impl_determineTemplateDocument( 109*cdf0e10cSrcweir ::comphelper::NamedValueCollection& io_rDescriptor 110*cdf0e10cSrcweir ) const; 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir sal_uInt16 impl_findSlotParam( 113*cdf0e10cSrcweir const ::rtl::OUString& i_rFactoryURL 114*cdf0e10cSrcweir ) const; 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir SfxObjectShellRef impl_findObjectShell( 117*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rxDocument 118*cdf0e10cSrcweir ) const; 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir void impl_lockHiddenDocument( 121*cdf0e10cSrcweir SfxObjectShell& i_rDocument, 122*cdf0e10cSrcweir const ::comphelper::NamedValueCollection& i_rDescriptor 123*cdf0e10cSrcweir ) const; 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir void impl_handleCaughtError_nothrow( 126*cdf0e10cSrcweir const ::com::sun::star::uno::Any& i_rCaughtError, 127*cdf0e10cSrcweir const ::comphelper::NamedValueCollection& i_rDescriptor 128*cdf0e10cSrcweir ) const; 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir void impl_removeLoaderArguments( 131*cdf0e10cSrcweir ::comphelper::NamedValueCollection& io_rDescriptor 132*cdf0e10cSrcweir ); 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir sal_Int16 impl_determineEffectiveViewId_nothrow( 135*cdf0e10cSrcweir const SfxObjectShell& i_rDocument, 136*cdf0e10cSrcweir const ::comphelper::NamedValueCollection& i_rDescriptor 137*cdf0e10cSrcweir ); 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir ::comphelper::NamedValueCollection 140*cdf0e10cSrcweir impl_extractViewCreationArgs( 141*cdf0e10cSrcweir ::comphelper::NamedValueCollection& io_rDescriptor 142*cdf0e10cSrcweir ); 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > 145*cdf0e10cSrcweir impl_createDocumentView( 146*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rModel, 147*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, 148*cdf0e10cSrcweir const ::comphelper::NamedValueCollection& i_rViewFactoryArgs, 149*cdf0e10cSrcweir const ::rtl::OUString& i_rViewName 150*cdf0e10cSrcweir ); 151*cdf0e10cSrcweir }; 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir #endif 154