1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_SCRIPTING_SOURCE_BASPROV_BASSCRIPT_HXX
21 #define INCLUDED_SCRIPTING_SOURCE_BASPROV_BASSCRIPT_HXX
23 #include "bcholder.hxx"
24 #include <com/sun/star/script/provider/XScript.hpp>
25 #include <com/sun/star/document/XScriptInvocationContext.hpp>
26 #include <cppuhelper/implbase1.hxx>
27 #include <comphelper/proparrhlp.hxx>
28 #include <comphelper/propertycontainer.hxx>
29 #include <basic/sbmeth.hxx>
30 #include <svl/lstner.hxx>
40 // class BasicScriptImpl
43 typedef ::cppu::WeakImplHelper1
<
44 ::com::sun::star::script::provider::XScript
> BasicScriptImpl_BASE
;
47 class BasicScriptImpl
: public BasicScriptImpl_BASE
, public SfxListener
,
48 public ::scripting_helper::OMutexHolder
,
49 public ::scripting_helper::OBroadcastHelperHolder
,
50 public ::comphelper::OPropertyContainer
,
51 public ::comphelper::OPropertyArrayUsageHelper
< BasicScriptImpl
>
54 SbMethodRef m_xMethod
;
56 BasicManager
* m_documentBasicManager
;
57 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XScriptInvocationContext
>
58 m_xDocumentScriptContext
;
59 // hack, OPropertyContainer doesn't allow you to define a property of unknown
60 // type ( I guess because an Any can't contain an Any... I've always wondered why?
61 // as its not unusual to do that in corba )
62 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> m_caller
;
65 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper( ) SAL_OVERRIDE
;
67 // OPropertyArrayUsageHelper
68 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const SAL_OVERRIDE
;
72 const OUString
& funcName
,
76 const OUString
& funcName
,
78 BasicManager
& documentBasicManager
,
79 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XScriptInvocationContext
>& documentScriptContext
81 virtual ~BasicScriptImpl();
87 DECLARE_XTYPEPROVIDER()
90 virtual ::com::sun::star::uno::Any SAL_CALL
invoke(
91 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aParams
,
92 ::com::sun::star::uno::Sequence
< sal_Int16
>& aOutParamIndex
,
93 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aOutParam
)
95 ::com::sun::star::script::provider::ScriptFrameworkErrorException
,
96 ::com::sun::star::reflection::InvocationTargetException
,
97 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
99 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( )
100 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
103 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) SAL_OVERRIDE
;
107 } // namespace basprov
110 #endif // INCLUDED_SCRIPTING_SOURCE_BASPROV_BASSCRIPT_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */