1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
25 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
26 #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
27 #include <com/sun/star/embed/XStorage.hpp>
31 /** helper class which holds and manipulates a BasicManager
33 class SfxBasicManagerHolder
36 BasicManager
* mpBasicManager
;
37 ::com::sun::star::uno::Reference
< ::com::sun::star::script::XStorageBasedLibraryContainer
>
39 ::com::sun::star::uno::Reference
< ::com::sun::star::script::XStorageBasedLibraryContainer
>
43 SfxBasicManagerHolder();
50 /** returns <TRUE/> if and only if the instance is currently bound to a non-<NULL/>
53 bool isValid() const { return mpBasicManager
!= NULL
; }
55 /** returns the BasicManager which this instance is currently bound to
58 get() const { return mpBasicManager
; }
60 /** binds the instance to the given BasicManager
62 void reset( BasicManager
* _pBasicManager
);
64 ::com::sun::star::uno::Reference
< ::com::sun::star::script::XLibraryContainer
>
65 getLibraryContainer( ContainerType _eType
);
67 /** calls the storeLibraries at both our script and basic library container
69 void storeAllLibraries();
71 /** calls the setStorage at all our XStorageBasedLibraryContainer.
74 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& _rxStorage
77 /** calls the storeLibrariesToStorage at all our XStorageBasedLibraryContainer.
79 void storeLibrariesToStorage(
80 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& _rxStorage
84 /** checks if any modules in the SfxLibraryContainer exceed the binary
87 sal_Bool
LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence
< OUString
>& sModules
);
91 void impl_releaseContainers();
93 bool impl_getContainer(
95 ::com::sun::star::uno::Reference
< ::com::sun::star::script::XStorageBasedLibraryContainer
>& _out_rxContainer
);
98 class SfxApplicationScriptLibraryContainer
102 static ::com::sun::star::uno::Sequence
< OUString
> impl_getStaticSupportedServiceNames();
103 static OUString
impl_getStaticImplementationName();
104 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL impl_createInstance
105 ( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
)
106 throw( ::com::sun::star::uno::Exception
);
107 static ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XSingleServiceFactory
> impl_createFactory
108 ( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
);
112 class SfxApplicationDialogLibraryContainer
116 static ::com::sun::star::uno::Sequence
< OUString
> impl_getStaticSupportedServiceNames();
117 static OUString
impl_getStaticImplementationName();
118 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL impl_createInstance
119 ( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
)
120 throw( ::com::sun::star::uno::Exception
);
121 static ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XSingleServiceFactory
> impl_createFactory
122 ( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
);
126 #endif // APPBASLIB_HXX
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */