1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _SFX_FRMLOAD_HXX
21 #define _SFX_FRMLOAD_HXX
23 #include "sfx2/sfxuno.hxx"
24 #include "sfx2/objsh.hxx"
26 #include <com/sun/star/frame/XLoadEventListener.hpp>
27 #include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
28 #include <com/sun/star/frame/XController2.hpp>
29 #include <com/sun/star/frame/XModel2.hpp>
30 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
31 #include <com/sun/star/uno/Exception.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
34 #include <com/sun/star/frame/XFrame.hpp>
35 #include <com/sun/star/task/XInteractionHandler.hpp>
37 #include <rtl/ustring.hxx>
38 #include <cppuhelper/implbase1.hxx>
39 #include <cppuhelper/implbase2.hxx>
40 #include <cppuhelper/implbase3.hxx>
41 #include <cppuhelper/factory.hxx>
42 #include <comphelper/namedvaluecollection.hxx>
45 class SfxFilterMatcher
;
47 class SAL_DLLPRIVATE SfxFrameLoader_Impl
: public ::cppu::WeakImplHelper2
< ::com::sun::star::frame::XSynchronousFrameLoader
, ::com::sun::star::lang::XServiceInfo
>
49 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_aContext
;
52 SfxFrameLoader_Impl( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxContext
);
56 //----------------------------------------------------------------------------------
57 // XSynchronousFrameLoader
58 //----------------------------------------------------------------------------------
59 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
);
60 virtual void SAL_CALL
cancel() throw( ::com::sun::star::uno::RuntimeException
);
63 virtual ~SfxFrameLoader_Impl();
66 const SfxFilter
* impl_getFilterFromServiceName_nothrow(
67 const OUString
& i_rServiceName
70 OUString
impl_askForFilter_nothrow(
71 const ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionHandler
>& i_rxHandler
,
72 const OUString
& i_rDocumentURL
75 const SfxFilter
* impl_detectFilterForURL(
76 const OUString
& _rURL
,
77 const ::comphelper::NamedValueCollection
& i_rDescriptor
,
78 const SfxFilterMatcher
& rMatcher
81 sal_Bool
impl_createNewDocWithSlotParam(
82 const sal_uInt16 _nSlotID
,
83 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& i_rxFrame
,
87 void impl_determineFilter(
88 ::comphelper::NamedValueCollection
& io_rDescriptor
91 bool impl_determineTemplateDocument(
92 ::comphelper::NamedValueCollection
& io_rDescriptor
95 sal_uInt16
impl_findSlotParam(
96 const OUString
& i_rFactoryURL
99 SfxObjectShellRef
impl_findObjectShell(
100 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel2
>& i_rxDocument
103 void impl_lockHiddenDocument(
104 SfxObjectShell
& i_rDocument
,
105 const ::comphelper::NamedValueCollection
& i_rDescriptor
108 void impl_handleCaughtError_nothrow(
109 const ::com::sun::star::uno::Any
& i_rCaughtError
,
110 const ::comphelper::NamedValueCollection
& i_rDescriptor
113 void impl_removeLoaderArguments(
114 ::comphelper::NamedValueCollection
& io_rDescriptor
117 sal_Int16
impl_determineEffectiveViewId_nothrow(
118 const SfxObjectShell
& i_rDocument
,
119 const ::comphelper::NamedValueCollection
& i_rDescriptor
122 ::comphelper::NamedValueCollection
123 impl_extractViewCreationArgs(
124 ::comphelper::NamedValueCollection
& io_rDescriptor
127 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XController2
>
128 impl_createDocumentView(
129 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel2
>& i_rModel
,
130 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& i_rFrame
,
131 const ::comphelper::NamedValueCollection
& i_rViewFactoryArgs
,
132 const OUString
& i_rViewName
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */