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: basscript.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 ************************************************************************/
31 #ifndef SCRIPTING_BASSCRIPT_HXX
32 #define SCRIPTING_BASSCRIPT_HXX
34 #include "bcholder.hxx"
35 #include <com/sun/star/script/provider/XScript.hpp>
36 #include <com/sun/star/document/XScriptInvocationContext.hpp>
37 #include <cppuhelper/implbase1.hxx>
38 #include <comphelper/proparrhlp.hxx>
39 #include <comphelper/propertycontainer.hxx>
40 #include <basic/sbmeth.hxx>
44 //.........................................................................
47 //.........................................................................
49 // ----------------------------------------------------
50 // class BasicScriptImpl
51 // ----------------------------------------------------
53 typedef ::cppu::WeakImplHelper1
<
54 ::com::sun::star::script::provider::XScript
> BasicScriptImpl_BASE
;
57 class BasicScriptImpl
: public BasicScriptImpl_BASE
,
58 public ::scripting_helper::OMutexHolder
,
59 public ::scripting_helper::OBroadcastHelperHolder
,
60 public ::comphelper::OPropertyContainer
,
61 public ::comphelper::OPropertyArrayUsageHelper
< BasicScriptImpl
>
64 SbMethodRef m_xMethod
;
65 ::rtl::OUString m_funcName
;
66 BasicManager
* m_documentBasicManager
;
67 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XScriptInvocationContext
>
68 m_xDocumentScriptContext
;
69 // hack, OPropertyContainer doesn't allow you to define a property of unknown
70 // type ( I guess because an Any can't contain an Any... I've always wondered why?
71 // as its not unusual to do that in corba )
72 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> m_caller
;
75 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper( );
77 // OPropertyArrayUsageHelper
78 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const;
82 const ::rtl::OUString
& funcName
,
86 const ::rtl::OUString
& funcName
,
88 BasicManager
& documentBasicManager
,
89 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XScriptInvocationContext
>& documentScriptContext
91 virtual ~BasicScriptImpl();
97 DECLARE_XTYPEPROVIDER()
100 virtual ::com::sun::star::uno::Any SAL_CALL
invoke(
101 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aParams
,
102 ::com::sun::star::uno::Sequence
< sal_Int16
>& aOutParamIndex
,
103 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aOutParam
)
105 ::com::sun::star::script::provider::ScriptFrameworkErrorException
,
106 ::com::sun::star::reflection::InvocationTargetException
,
107 ::com::sun::star::uno::RuntimeException
);
109 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( )
110 throw (::com::sun::star::uno::RuntimeException
);
113 //.........................................................................
114 } // namespace basprov
115 //.........................................................................
117 #endif // SCRIPTING_BASSCRIPT_HXX