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_PROVIDER_SCRIPTIMPL_HXX
21 #define INCLUDED_SCRIPTING_SOURCE_PROVIDER_SCRIPTIMPL_HXX
23 #include <cppuhelper/implbase1.hxx>
24 #include <osl/mutex.hxx>
26 #include <com/sun/star/lang/IllegalArgumentException.hpp>
27 #include <com/sun/star/uno/RuntimeException.hpp>
28 #include <com/sun/star/script/CannotConvertException.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/reflection/InvocationTargetException.hpp>
32 #include <drafts/com/sun/star/script/framework/provider/XScript.hpp>
33 #include <drafts/com/sun/star/script/framework/runtime/XScriptInvocation.hpp>
35 namespace func_provider
39 public ::cppu::WeakImplHelper1
< ::drafts::com::sun::star::script::framework::provider::XScript
>
43 /*************************************************************
44 ScriptImpl Constructor
45 @param runtimeMgr which is a service that implement a XScriptInvocation
46 @param scriptURI the received ScriptURI that needs to be resolve and invoked
49 const css::uno::Reference
< css::beans::XPropertySet
> & scriptingContext
,
50 const css::uno::Reference
< ::drafts::com::sun::star::script::framework::runtime::XScriptInvocation
> & runtimeMgr
,
51 const OUString
& scriptURI
)
52 throw ( css::uno::RuntimeException
);
54 /*************************************************************
59 /*************************************************************
61 @param aParams all parameters; pure, out params are undefined in sequence,
62 i.e., the value has to be ignored by the callee
63 @param aOutParamIndex out indices
64 @param aOutParam out parameters
67 the value returned from the function being invoked
69 @throws IllegalArgumentException
70 if there is no matching script name
72 @throws CannotConvertException
73 if args do not match or cannot be converted the those
76 @throws InvocationTargetException
77 if the running script throws an exception this information is captured and
78 rethrown as this exception type.
81 virtual css::uno::Any SAL_CALL
invoke(
82 const css::uno::Sequence
< css::uno::Any
> & aParams
,
83 css::uno::Sequence
< sal_Int16
> & aOutParamIndex
,
84 css::uno::Sequence
< css::uno::Any
> & aOutParam
)
85 throw ( css::lang::IllegalArgumentException
,
86 css::script::CannotConvertException
,
87 css::reflection::InvocationTargetException
,
88 css::uno::RuntimeException
);
91 css::uno::Reference
< css::beans::XPropertySet
> m_XScriptingContext
;
92 css::uno::Reference
< ::drafts::com::sun::star::script::framework::runtime::XScriptInvocation
> m_RunTimeManager
;
95 /* copy ctor disabled, i.e. not defined */
96 ScriptImpl( const ScriptImpl
& );
97 /* assignment disabled, i.e. not defined */
98 ScriptImpl
& operator = ( const ScriptImpl
& );
100 } // namespace func_provider
101 #endif // INCLUDED_SCRIPTING_SOURCE_PROVIDER_SCRIPTIMPL_HXX
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */