1*6998d047SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*6998d047SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*6998d047SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*6998d047SAndrew Rist  * distributed with this work for additional information
6*6998d047SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*6998d047SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*6998d047SAndrew Rist  * "License"); you may not use this file except in compliance
9*6998d047SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*6998d047SAndrew Rist  *
11*6998d047SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*6998d047SAndrew Rist  *
13*6998d047SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*6998d047SAndrew Rist  * software distributed under the License is distributed on an
15*6998d047SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6998d047SAndrew Rist  * KIND, either express or implied.  See the License for the
17*6998d047SAndrew Rist  * specific language governing permissions and limitations
18*6998d047SAndrew Rist  * under the License.
19*6998d047SAndrew Rist  *
20*6998d047SAndrew Rist  *************************************************************/
21*6998d047SAndrew Rist 
22*6998d047SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SCRIPTING_BASSCRIPT_HXX
25cdf0e10cSrcweir #define SCRIPTING_BASSCRIPT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/script/provider/XScript.hpp>
28cdf0e10cSrcweir #include <com/sun/star/document/XScriptInvocationContext.hpp>
29cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
30cdf0e10cSrcweir #include <basic/sbmeth.hxx>
31cdf0e10cSrcweir #include <svl/lstner.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir 
34cdf0e10cSrcweir class BasicManager;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //.........................................................................
37cdf0e10cSrcweir namespace basprov
38cdf0e10cSrcweir {
39cdf0e10cSrcweir //.........................................................................
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     //	----------------------------------------------------
42cdf0e10cSrcweir     //	class BasicScriptImpl
43cdf0e10cSrcweir     //	----------------------------------------------------
44cdf0e10cSrcweir 
45cdf0e10cSrcweir     typedef ::cppu::WeakImplHelper1<
46cdf0e10cSrcweir         ::com::sun::star::script::provider::XScript > BasicScriptImpl_BASE;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 
49cdf0e10cSrcweir     class BasicScriptImpl : public BasicScriptImpl_BASE, public SfxListener
50cdf0e10cSrcweir     {
51cdf0e10cSrcweir     private:
52cdf0e10cSrcweir         SbMethodRef         m_xMethod;
53cdf0e10cSrcweir         ::rtl::OUString     m_funcName;
54cdf0e10cSrcweir         BasicManager*       m_documentBasicManager;
55cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::document::XScriptInvocationContext >
56cdf0e10cSrcweir                             m_xDocumentScriptContext;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     public:
59cdf0e10cSrcweir         BasicScriptImpl(
60cdf0e10cSrcweir             const ::rtl::OUString& funcName,
61cdf0e10cSrcweir             SbMethodRef xMethod
62cdf0e10cSrcweir         );
63cdf0e10cSrcweir         BasicScriptImpl(
64cdf0e10cSrcweir             const ::rtl::OUString& funcName,
65cdf0e10cSrcweir             SbMethodRef xMethod,
66cdf0e10cSrcweir             BasicManager& documentBasicManager,
67cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::document::XScriptInvocationContext >& documentScriptContext
68cdf0e10cSrcweir         );
69cdf0e10cSrcweir         virtual ~BasicScriptImpl();
70cdf0e10cSrcweir 
71cdf0e10cSrcweir         // XScript
72cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL invoke(
73cdf0e10cSrcweir             const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
74cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
75cdf0e10cSrcweir             ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam )
76cdf0e10cSrcweir             throw (
77cdf0e10cSrcweir                     ::com::sun::star::script::provider::ScriptFrameworkErrorException,
78cdf0e10cSrcweir                     ::com::sun::star::reflection::InvocationTargetException,
79cdf0e10cSrcweir                     ::com::sun::star::uno::RuntimeException );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir         // SfxListener
82cdf0e10cSrcweir         virtual void		Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
83cdf0e10cSrcweir     };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir //.........................................................................
86cdf0e10cSrcweir }	// namespace basprov
87cdf0e10cSrcweir //.........................................................................
88cdf0e10cSrcweir 
89cdf0e10cSrcweir #endif // SCRIPTING_BASSCRIPT_HXX
90