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 #include "rtl/ustring.hxx"
28 #include "rtl/ref.hxx"
29 #include <cppuhelper/implbase2.hxx>
30 
31 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/uno/RuntimeException.hpp>
34 #include <com/sun/star/registry/XRegistryKey.hpp>
35 
36 #include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
37 #include <com/sun/star/script/provider/XScriptProvider.hpp>
38 
39 #include "ActiveMSPList.hxx"
40 
41 namespace func_provider
42 {
43 // for simplification
44 #define css ::com::sun::star
45 
46 class MasterScriptProviderFactory :
47     public ::cppu::WeakImplHelper2 <
48         css::script::provider::XScriptProviderFactory,
49         css::lang::XServiceInfo >
50 {
51 private:
52 
53     mutable rtl::Reference< ActiveMSPList > m_MSPList;
54 
55     const css::uno::Reference< css::uno::XComponentContext > m_xComponentContext;
56 
57     const rtl::Reference< ActiveMSPList > & getActiveMSPList() const;
58 
59 protected:
60     virtual ~MasterScriptProviderFactory();
61 
62 public:
63     MasterScriptProviderFactory(
64         css::uno::Reference< css::uno::XComponentContext > const & xComponentContext );
65 
66     // XServiceInfo
67     virtual ::rtl::OUString SAL_CALL getImplementationName()
68         throw ( css::uno::RuntimeException );
69 
70     virtual sal_Bool SAL_CALL
71         supportsService( ::rtl::OUString const & serviceName )
72             throw ( css::uno::RuntimeException );
73 
74     virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL
75         getSupportedServiceNames()
76             throw ( css::uno::RuntimeException );
77 
78     // XScriptProviderFactory
79     virtual css::uno::Reference< css::script::provider::XScriptProvider >
80 	    SAL_CALL createScriptProvider( const css::uno::Any& context )
81 	        throw ( css::lang::IllegalArgumentException, css::uno::RuntimeException);
82 };
83 
84 
85 } // namespace func_provider
86