xref: /aoo41x/main/sfx2/inc/frmload.hxx (revision 353d8f4d)
1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*353d8f4dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*353d8f4dSAndrew Rist  * distributed with this work for additional information
6*353d8f4dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*353d8f4dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist  * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*353d8f4dSAndrew Rist  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist  *
13*353d8f4dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist  * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*353d8f4dSAndrew Rist  * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist  * under the License.
19*353d8f4dSAndrew Rist  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SFX_FRMLOAD_HXX
25cdf0e10cSrcweir #define _SFX_FRMLOAD_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sfx2/sfxuno.hxx"
28cdf0e10cSrcweir #include "sfx2/objsh.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /** === begin UNO includes === **/
31cdf0e10cSrcweir #include <com/sun/star/frame/XLoadEventListener.hpp>
32cdf0e10cSrcweir #include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
33cdf0e10cSrcweir #include <com/sun/star/frame/XController2.hpp>
34cdf0e10cSrcweir #include <com/sun/star/frame/XModel2.hpp>
35cdf0e10cSrcweir #include <com/sun/star/document/XExtendedFilterDetection.hpp>
36cdf0e10cSrcweir #include <com/sun/star/uno/Exception.hpp>
37cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
38cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp>
39cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
40cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
41cdf0e10cSrcweir #include <com/sun/star/task/XInteractionHandler.hpp>
42cdf0e10cSrcweir /** === end UNO includes === **/
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #include <rtl/ustring.hxx>
45cdf0e10cSrcweir #include <tools/debug.hxx>
46cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
47cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
48cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
49cdf0e10cSrcweir #include <cppuhelper/factory.hxx>
50cdf0e10cSrcweir #include <tools/link.hxx>
51cdf0e10cSrcweir #include <tools/string.hxx>
52cdf0e10cSrcweir #include <comphelper/componentcontext.hxx>
53cdf0e10cSrcweir #include <comphelper/namedvaluecollection.hxx>
54cdf0e10cSrcweir 
55cdf0e10cSrcweir class SfxFilter;
56cdf0e10cSrcweir class SfxFilterMatcher;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir class SfxFrameWeak;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir class SAL_DLLPRIVATE SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo >
61cdf0e10cSrcweir {
62cdf0e10cSrcweir     ::comphelper::ComponentContext  m_aContext;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir public:
65cdf0e10cSrcweir                             SfxFrameLoader_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory );
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     SFX_DECL_XSERVICEINFO
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	//----------------------------------------------------------------------------------
70cdf0e10cSrcweir 	// XSynchronousFrameLoader
71cdf0e10cSrcweir 	//----------------------------------------------------------------------------------
72cdf0e10cSrcweir     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 );
73cdf0e10cSrcweir     virtual void SAL_CALL cancel() throw( ::com::sun::star::uno::RuntimeException );
74cdf0e10cSrcweir 
75cdf0e10cSrcweir protected:
76cdf0e10cSrcweir     virtual                 ~SfxFrameLoader_Impl();
77cdf0e10cSrcweir 
78cdf0e10cSrcweir private:
79cdf0e10cSrcweir     const SfxFilter*    impl_getFilterFromServiceName_nothrow(
80cdf0e10cSrcweir                             const ::rtl::OUString& i_rServiceName
81cdf0e10cSrcweir                         ) const;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     ::rtl::OUString     impl_askForFilter_nothrow(
84cdf0e10cSrcweir                             const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& i_rxHandler,
85cdf0e10cSrcweir                             const ::rtl::OUString& i_rDocumentURL
86cdf0e10cSrcweir                         ) const;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     const SfxFilter*    impl_detectFilterForURL(
89cdf0e10cSrcweir                             const ::rtl::OUString& _rURL,
90cdf0e10cSrcweir                             const ::comphelper::NamedValueCollection& i_rDescriptor,
91cdf0e10cSrcweir                             const SfxFilterMatcher& rMatcher
92cdf0e10cSrcweir                         ) const;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir     sal_Bool            impl_createNewDocWithSlotParam(
95cdf0e10cSrcweir                             const sal_uInt16 _nSlotID,
96cdf0e10cSrcweir                             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame,
97cdf0e10cSrcweir                             const bool i_bHidden
98cdf0e10cSrcweir                         );
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     void                impl_determineFilter(
101cdf0e10cSrcweir                                   ::comphelper::NamedValueCollection& io_rDescriptor
102cdf0e10cSrcweir                         ) const;
103cdf0e10cSrcweir 
104cdf0e10cSrcweir     bool                impl_determineTemplateDocument(
105cdf0e10cSrcweir                             ::comphelper::NamedValueCollection& io_rDescriptor
106cdf0e10cSrcweir                         ) const;
107cdf0e10cSrcweir 
108cdf0e10cSrcweir     sal_uInt16              impl_findSlotParam(
109cdf0e10cSrcweir                             const ::rtl::OUString& i_rFactoryURL
110cdf0e10cSrcweir                         ) const;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     SfxObjectShellRef   impl_findObjectShell(
113cdf0e10cSrcweir                             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rxDocument
114cdf0e10cSrcweir                         ) const;
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     void                impl_lockHiddenDocument(
117cdf0e10cSrcweir                                   SfxObjectShell& i_rDocument,
118cdf0e10cSrcweir                             const ::comphelper::NamedValueCollection& i_rDescriptor
119cdf0e10cSrcweir                         ) const;
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     void                impl_handleCaughtError_nothrow(
122cdf0e10cSrcweir                             const ::com::sun::star::uno::Any& i_rCaughtError,
123cdf0e10cSrcweir                             const ::comphelper::NamedValueCollection& i_rDescriptor
124cdf0e10cSrcweir                         ) const;
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     void                impl_removeLoaderArguments(
127cdf0e10cSrcweir                             ::comphelper::NamedValueCollection& io_rDescriptor
128cdf0e10cSrcweir                         );
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     sal_Int16           impl_determineEffectiveViewId_nothrow(
131cdf0e10cSrcweir                             const SfxObjectShell& i_rDocument,
132cdf0e10cSrcweir                             const ::comphelper::NamedValueCollection& i_rDescriptor
133cdf0e10cSrcweir                         );
134cdf0e10cSrcweir 
135cdf0e10cSrcweir     ::comphelper::NamedValueCollection
136cdf0e10cSrcweir                         impl_extractViewCreationArgs(
137cdf0e10cSrcweir                                   ::comphelper::NamedValueCollection& io_rDescriptor
138cdf0e10cSrcweir                         );
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >
141cdf0e10cSrcweir                         impl_createDocumentView(
142cdf0e10cSrcweir                             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rModel,
143cdf0e10cSrcweir                             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
144cdf0e10cSrcweir                             const ::comphelper::NamedValueCollection& i_rViewFactoryArgs,
145cdf0e10cSrcweir                             const ::rtl::OUString& i_rViewName
146cdf0e10cSrcweir                         );
147cdf0e10cSrcweir };
148cdf0e10cSrcweir 
149cdf0e10cSrcweir #endif
150