1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: appbaslib.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <com/sun/star/uno/Sequence.hxx>
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
37 #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
38 #include <com/sun/star/embed/XStorage.hpp>
42 /** helper class which holds and manipulates a BasicManager
44 class SfxBasicManagerHolder
47 BasicManager
* mpBasicManager
;
48 ::com::sun::star::uno::Reference
< ::com::sun::star::script::XStorageBasedLibraryContainer
>
50 ::com::sun::star::uno::Reference
< ::com::sun::star::script::XStorageBasedLibraryContainer
>
54 SfxBasicManagerHolder();
61 /** returns <TRUE/> if and only if the instance is currently bound to a non-<NULL/>
64 bool isValid() const { return mpBasicManager
!= NULL
; }
66 /** returns the BasicManager which this instance is currently bound to
69 get() const { return mpBasicManager
; }
71 /** binds the instance to the given BasicManager
73 void reset( BasicManager
* _pBasicManager
);
75 ::com::sun::star::uno::Reference
< ::com::sun::star::script::XLibraryContainer
>
76 getLibraryContainer( ContainerType _eType
);
78 /** determines whether any of our library containers is modified, i.e. returns <TRUE/>
79 in its isContainerModified call.
81 bool isAnyContainerModified() const;
83 /** calls the storeLibraries at both our script and basic library container
85 void storeAllLibraries();
87 /** calls the setStorage at all our XStorageBasedLibraryContainer.
90 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& _rxStorage
93 /** calls the storeLibrariesToStorage at all our XStorageBasedLibraryContainer.
95 void storeLibrariesToStorage(
96 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& _rxStorage
100 /** checks if any modules in the SfxLibraryContainer exceed the binary
103 sal_Bool
LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence
< rtl::OUString
>& sModules
);
107 void impl_releaseContainers();
109 bool impl_getContainer(
110 ContainerType _eType
,
111 ::com::sun::star::uno::Reference
< ::com::sun::star::script::XStorageBasedLibraryContainer
>& _out_rxContainer
);
114 class SfxApplicationScriptLibraryContainer
118 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> impl_getStaticSupportedServiceNames();
119 static ::rtl::OUString
impl_getStaticImplementationName();
120 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL impl_createInstance
121 ( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
)
122 throw( ::com::sun::star::uno::Exception
);
123 static ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XSingleServiceFactory
> impl_createFactory
124 ( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
);
128 class SfxApplicationDialogLibraryContainer
132 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> impl_getStaticSupportedServiceNames();
133 static ::rtl::OUString
impl_getStaticImplementationName();
134 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL impl_createInstance
135 ( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
)
136 throw( ::com::sun::star::uno::Exception
);
137 static ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XSingleServiceFactory
> impl_createFactory
138 ( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
);
142 #endif // APPBASLIB_HXX