LibreOffice Module scripting (master) 1
basscript.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <bcholder.hxx>
23#include <com/sun/star/script/provider/XScript.hpp>
24#include <com/sun/star/document/XScriptInvocationContext.hpp>
29#include <basic/sbmeth.hxx>
30#include <svl/lstner.hxx>
31
32class BasicManager;
33
34
35namespace basprov
36{
37
38
39
40
41 typedef ::cppu::WeakImplHelper<
42 css::script::provider::XScript > BasicScriptImpl_BASE;
43
44
46 public cppu::BaseMutex,
49 public ::comphelper::OPropertyArrayUsageHelper< BasicScriptImpl >
50 {
51 private:
53 OUString m_funcName;
55 css::uno::Reference< css::document::XScriptInvocationContext >
57 // hack, OPropertyContainer doesn't allow you to define a property of unknown
58 // type ( I guess because an Any can't contain an Any... I've always wondered why?
59 // as it's not unusual to do that in corba )
60 css::uno::Sequence< css::uno::Any > m_caller;
61 protected:
62 // OPropertySetHelper
63 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ) override;
64
65 // OPropertyArrayUsageHelper
66 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
67
68 public:
70 OUString funcName,
71 SbMethodRef xMethod
72 );
74 OUString funcName,
75 SbMethodRef xMethod,
76 BasicManager& documentBasicManager,
77 const css::uno::Reference< css::document::XScriptInvocationContext >& documentScriptContext
78 );
79 virtual ~BasicScriptImpl() override;
80
81 // XInterface
83
84 // XTypeProvider
85 DECLARE_XTYPEPROVIDER()
86
87 // XScript
88 virtual css::uno::Any SAL_CALL invoke(
89 const css::uno::Sequence< css::uno::Any >& aParams,
90 css::uno::Sequence< sal_Int16 >& aOutParamIndex,
91 css::uno::Sequence< css::uno::Any >& aOutParam ) override;
92 // XPropertySet
93 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
94
95 // SfxListener
96 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
97 };
98
99
100} // namespace basprov
101
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: basscript.cxx:125
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: basscript.cxx:145
BasicManager * m_documentBasicManager
Definition: basscript.hxx:54
css::uno::Reference< css::document::XScriptInvocationContext > m_xDocumentScriptContext
Definition: basscript.hxx:56
virtual ~BasicScriptImpl() override
Definition: basscript.cxx:83
css::uno::Sequence< css::uno::Any > m_caller
Definition: basscript.hxx:60
BasicScriptImpl(OUString funcName, SbMethodRef xMethod)
Definition: basscript.cxx:58
virtual css::uno::Any SAL_CALL invoke(const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Sequence< sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam) override
Definition: basscript.cxx:155
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
Definition: basscript.cxx:134
BasicScriptImpl(OUString funcName, SbMethodRef xMethod, BasicManager &documentBasicManager, const css::uno::Reference< css::document::XScriptInvocationContext > &documentScriptContext)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: basscript.cxx:94
::cppu::WeakImplHelper< css::script::provider::XScript > BasicScriptImpl_BASE
Definition: basscript.hxx:42
#define DECLARE_XINTERFACE()