Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / scripting / source / basprov / basscript.hxx
blob2adcd9c8b311d8477d6277340f4dd2051e17654f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <com/sun/star/script/provider/XScript.hpp>
23 #include <com/sun/star/document/XScriptInvocationContext.hpp>
24 #include <cppuhelper/implbase.hxx>
25 #include <comphelper/compbase.hxx>
26 #include <comphelper/proparrhlp.hxx>
27 #include <comphelper/propertycontainer2.hxx>
28 #include <basic/sbmeth.hxx>
29 #include <svl/lstner.hxx>
31 class BasicManager;
34 namespace basprov
40 typedef ::comphelper::WeakImplHelper<
41 css::script::provider::XScript > BasicScriptImpl_BASE;
44 class BasicScriptImpl : public BasicScriptImpl_BASE, public SfxListener,
45 public ::comphelper::OPropertyContainer2,
46 public ::comphelper::OPropertyArrayUsageHelper< BasicScriptImpl >
48 private:
49 SbMethodRef m_xMethod;
50 OUString m_funcName;
51 BasicManager* m_documentBasicManager;
52 css::uno::Reference< css::document::XScriptInvocationContext >
53 m_xDocumentScriptContext;
54 // hack, OPropertyContainer doesn't allow you to define a property of unknown
55 // type ( I guess because an Any can't contain an Any... I've always wondered why?
56 // as it's not unusual to do that in corba )
57 css::uno::Sequence< css::uno::Any > m_caller;
58 protected:
59 // OPropertySetHelper
60 virtual ::cppu::IPropertyArrayHelper& getInfoHelper( ) override;
62 // OPropertyArrayUsageHelper
63 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
65 public:
66 BasicScriptImpl(
67 OUString funcName,
68 SbMethodRef xMethod
70 BasicScriptImpl(
71 OUString funcName,
72 SbMethodRef xMethod,
73 BasicManager& documentBasicManager,
74 const css::uno::Reference< css::document::XScriptInvocationContext >& documentScriptContext
76 virtual ~BasicScriptImpl() override;
78 // XInterface
79 DECLARE_XINTERFACE()
81 // XTypeProvider
82 DECLARE_XTYPEPROVIDER()
84 // XScript
85 virtual css::uno::Any SAL_CALL invoke(
86 const css::uno::Sequence< css::uno::Any >& aParams,
87 css::uno::Sequence< sal_Int16 >& aOutParamIndex,
88 css::uno::Sequence< css::uno::Any >& aOutParam ) override;
89 // XPropertySet
90 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
92 // SfxListener
93 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
97 } // namespace basprov
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */