merge the formfield patch from ooo-build
[ooovba.git] / scripting / source / basprov / basscript.hxx
blobcbd0ec5272d714044258c5ed019f829603bbc988
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: basscript.hxx,v $
10 * $Revision: 1.8 $
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>
42 class BasicManager;
44 //.........................................................................
45 namespace basprov
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 >
63 private:
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;
73 protected:
74 // OPropertySetHelper
75 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( );
77 // OPropertyArrayUsageHelper
78 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
80 public:
81 BasicScriptImpl(
82 const ::rtl::OUString& funcName,
83 SbMethodRef xMethod
85 BasicScriptImpl(
86 const ::rtl::OUString& funcName,
87 SbMethodRef xMethod,
88 BasicManager& documentBasicManager,
89 const ::com::sun::star::uno::Reference< ::com::sun::star::document::XScriptInvocationContext >& documentScriptContext
91 virtual ~BasicScriptImpl();
93 // XInterface
94 DECLARE_XINTERFACE()
96 // XTypeProvider
97 DECLARE_XTYPEPROVIDER()
99 // XScript
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 )
104 throw (
105 ::com::sun::star::script::provider::ScriptFrameworkErrorException,
106 ::com::sun::star::reflection::InvocationTargetException,
107 ::com::sun::star::uno::RuntimeException );
108 // XPropertySet
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