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