merged tag ooo/DEV300_m102
[LibreOffice.git] / sfx2 / source / inc / appbaslib.hxx
blob5bc7662e8f9bd5be1ce06e7bb17f76019b4b156d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef APPBASLIB_HXX
29 #define APPBASLIB_HXX
31 #include <com/sun/star/uno/Sequence.hxx>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
34 #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
35 #include <com/sun/star/embed/XStorage.hpp>
37 class BasicManager;
39 /** helper class which holds and manipulates a BasicManager
41 class SfxBasicManagerHolder
43 private:
44 BasicManager* mpBasicManager;
45 ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer >
46 mxBasicContainer;
47 ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer >
48 mxDialogContainer;
50 public:
51 SfxBasicManagerHolder();
53 enum ContainerType
55 SCRIPTS, DIALOGS
58 /** returns <TRUE/> if and only if the instance is currently bound to a non-<NULL/>
59 BasicManager.
61 bool isValid() const { return mpBasicManager != NULL; }
63 /** returns the BasicManager which this instance is currently bound to
65 BasicManager*
66 get() const { return mpBasicManager; }
68 /** binds the instance to the given BasicManager
70 void reset( BasicManager* _pBasicManager );
72 ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >
73 getLibraryContainer( ContainerType _eType );
75 /** determines whether any of our library containers is modified, i.e. returns <TRUE/>
76 in its isContainerModified call.
78 bool isAnyContainerModified() const;
80 /** calls the storeLibraries at both our script and basic library container
82 void storeAllLibraries();
84 /** calls the setStorage at all our XStorageBasedLibraryContainer.
86 void setStorage(
87 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage
90 /** calls the storeLibrariesToStorage at all our XStorageBasedLibraryContainer.
92 void storeLibrariesToStorage(
93 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage
97 /** checks if any modules in the SfxLibraryContainer exceed the binary
98 limits.
100 sal_Bool LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence< rtl::OUString >& sModules );
103 private:
104 void impl_releaseContainers();
106 bool impl_getContainer(
107 ContainerType _eType,
108 ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer >& _out_rxContainer );
111 class SfxApplicationScriptLibraryContainer
113 public:
114 // Service
115 static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames();
116 static ::rtl::OUString impl_getStaticImplementationName();
117 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance
118 ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager )
119 throw( ::com::sun::star::uno::Exception );
120 static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory
121 ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
125 class SfxApplicationDialogLibraryContainer
127 public:
128 // Service
129 static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames();
130 static ::rtl::OUString impl_getStaticImplementationName();
131 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance
132 ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager )
133 throw( ::com::sun::star::uno::Exception );
134 static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory
135 ( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
139 #endif // APPBASLIB_HXX