Bump version to 4.1-6
[LibreOffice.git] / sfx2 / source / inc / appbaslib.hxx
blobafec42ee9107ac22cdd6674ac098cdea9522bb3a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef APPBASLIB_HXX
21 #define APPBASLIB_HXX
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>
29 class BasicManager;
31 /** helper class which holds and manipulates a BasicManager
33 class SfxBasicManagerHolder
35 private:
36 BasicManager* mpBasicManager;
37 ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer >
38 mxBasicContainer;
39 ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer >
40 mxDialogContainer;
42 public:
43 SfxBasicManagerHolder();
45 enum ContainerType
47 SCRIPTS, DIALOGS
50 /** returns <TRUE/> if and only if the instance is currently bound to a non-<NULL/>
51 BasicManager.
53 bool isValid() const { return mpBasicManager != NULL; }
55 /** returns the BasicManager which this instance is currently bound to
57 BasicManager*
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.
73 void setStorage(
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
85 limits.
87 sal_Bool LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence< OUString >& sModules );
90 private:
91 void impl_releaseContainers();
93 bool impl_getContainer(
94 ContainerType _eType,
95 ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer >& _out_rxContainer );
98 class SfxApplicationScriptLibraryContainer
100 public:
101 // Service
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
114 public:
115 // Service
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: */