xref: /aoo41x/main/sfx2/inc/guisaveas.hxx (revision 353d8f4d)
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 #ifndef _SFX_GUISAVEAS_HXX_
25 #define _SFX_GUISAVEAS_HXX_
26 
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 #include <com/sun/star/beans/PropertyValue.hpp>
30 #include <com/sun/star/beans/NamedValue.hpp>
31 #include <com/sun/star/container/XNameAccess.hpp>
32 #include <com/sun/star/container/XContainerQuery.hpp>
33 #include <com/sun/star/frame/XModel.hpp>
34 #include <com/sun/star/frame/XModuleManager.hpp>
35 
36 #include <comphelper/sequenceashashmap.hxx>
37 #include <sfx2/signaturestate.hxx>
38 
39 
40 namespace com { namespace sun { namespace star {
41     namespace document {
42         class XDocumentInfo;
43     }
44 } } }
45 
46 class Window;
47 class ModelData_Impl;
48 
49 class SfxStoringHelper
50 {
51 	friend class ModelData_Impl;
52 
53 private:
54 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
55 	::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xFilterCFG;
56 	::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery > m_xFilterQuery;
57 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
58 	::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xNamedModManager;
59 
60 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory();
61 	::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetFilterConfiguration();
62 	::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery > GetFilterQuery();
63 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > GetModuleManager();
64 	::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetNamedModuleManager();
65 
66 
67 public:
68 	SfxStoringHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
69 
70 	sal_Bool GUIStoreModel(
71 					const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel,
72 					const ::rtl::OUString& aSlotName,
73 					::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgsSequence,
74                     sal_Bool bPreselectPassword,
75                     ::rtl::OUString aUserSelectedName,
76                     sal_uInt16 nDocumentSignatureState = SIGNATURESTATE_NOSIGNATURES );
77 
78 	static sal_Bool CheckFilterOptionsAppearence(
79 					const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xFilterCFG,
80 					const ::rtl::OUString& aFilterName );
81 
82 
83 	static void SetDocInfoState(
84         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel,
85         const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentInfo>& i_xOldDocInfo,
86         sal_Bool bNoModify );
87 
88 	static sal_Bool WarnUnacceptableFormat(
89 									const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel,
90 									::rtl::OUString aOldUIName,
91 									::rtl::OUString aDefUIName,
92 									sal_Bool bCanProceedFurther );
93 
94 	static void ExecuteFilterDialog( SfxStoringHelper& _rStorageHelper
95 									,const ::rtl::OUString& sFilterName
96 									,const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel
97 									,/*OUT*/::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgsSequence
98 								);
99 
100 	static Window* GetModelWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
101 
102 };
103 
104 #endif
105 
106