2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-06 17:28:37 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2003-09-16 14:23:32 +00:00
|
|
|
|
2014-04-18 22:47:44 +02:00
|
|
|
#ifndef INCLUDED_SCRIPTING_SOURCE_BASPROV_BASSCRIPT_HXX
|
|
|
|
#define INCLUDED_SCRIPTING_SOURCE_BASPROV_BASSCRIPT_HXX
|
2003-09-16 14:23:32 +00:00
|
|
|
|
2010-10-06 10:16:27 +01:00
|
|
|
#include "bcholder.hxx"
|
2004-10-22 13:03:31 +00:00
|
|
|
#include <com/sun/star/script/provider/XScript.hpp>
|
2008-03-06 15:19:33 +00:00
|
|
|
#include <com/sun/star/document/XScriptInvocationContext.hpp>
|
2015-08-29 07:48:41 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2010-10-06 10:16:27 +01:00
|
|
|
#include <comphelper/proparrhlp.hxx>
|
|
|
|
#include <comphelper/propertycontainer.hxx>
|
2005-04-18 13:14:54 +00:00
|
|
|
#include <basic/sbmeth.hxx>
|
2010-09-14 11:02:43 +02:00
|
|
|
#include <svl/lstner.hxx>
|
2005-04-18 13:14:54 +00:00
|
|
|
|
2008-03-06 15:19:33 +00:00
|
|
|
class BasicManager;
|
|
|
|
|
2014-02-25 20:05:49 +01:00
|
|
|
|
2003-09-16 14:23:32 +00:00
|
|
|
namespace basprov
|
|
|
|
{
|
|
|
|
|
2014-02-25 20:05:49 +01:00
|
|
|
|
2003-09-16 14:23:32 +00:00
|
|
|
// class BasicScriptImpl
|
2014-02-25 20:05:49 +01:00
|
|
|
|
2003-09-16 14:23:32 +00:00
|
|
|
|
2015-08-29 07:48:41 +09:00
|
|
|
typedef ::cppu::WeakImplHelper<
|
2015-10-27 15:38:52 +02:00
|
|
|
css::script::provider::XScript > BasicScriptImpl_BASE;
|
2003-09-16 14:23:32 +00:00
|
|
|
|
|
|
|
|
2011-03-12 02:42:58 +01:00
|
|
|
class BasicScriptImpl : public BasicScriptImpl_BASE, public SfxListener,
|
2010-10-06 10:16:27 +01:00
|
|
|
public ::scripting_helper::OMutexHolder,
|
|
|
|
public ::scripting_helper::OBroadcastHelperHolder,
|
|
|
|
public ::comphelper::OPropertyContainer,
|
|
|
|
public ::comphelper::OPropertyArrayUsageHelper< BasicScriptImpl >
|
2003-09-16 14:23:32 +00:00
|
|
|
{
|
|
|
|
private:
|
2008-03-06 15:19:33 +00:00
|
|
|
SbMethodRef m_xMethod;
|
2015-10-27 15:38:52 +02:00
|
|
|
OUString m_funcName;
|
2008-03-06 15:19:33 +00:00
|
|
|
BasicManager* m_documentBasicManager;
|
2015-10-27 15:38:52 +02:00
|
|
|
css::uno::Reference< css::document::XScriptInvocationContext >
|
2008-03-06 15:19:33 +00:00
|
|
|
m_xDocumentScriptContext;
|
2010-10-06 10:16:27 +01:00
|
|
|
// hack, OPropertyContainer doesn't allow you to define a property of unknown
|
|
|
|
// type ( I guess because an Any can't contain an Any... I've always wondered why?
|
2016-10-01 15:45:53 +02:00
|
|
|
// as it's not unusual to do that in corba )
|
2015-10-27 15:38:52 +02:00
|
|
|
css::uno::Sequence< css::uno::Any > m_caller;
|
2010-10-06 10:16:27 +01:00
|
|
|
protected:
|
|
|
|
// OPropertySetHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ) override;
|
2010-10-06 10:16:27 +01:00
|
|
|
|
|
|
|
// OPropertyArrayUsageHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
|
2008-03-06 15:19:33 +00:00
|
|
|
|
2003-09-16 14:23:32 +00:00
|
|
|
public:
|
2008-03-06 15:19:33 +00:00
|
|
|
BasicScriptImpl(
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& funcName,
|
2016-08-19 16:55:06 +02:00
|
|
|
SbMethodRef const & xMethod
|
2008-03-06 15:19:33 +00:00
|
|
|
);
|
|
|
|
BasicScriptImpl(
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& funcName,
|
2016-08-19 16:55:06 +02:00
|
|
|
SbMethodRef const & xMethod,
|
2008-03-06 15:19:33 +00:00
|
|
|
BasicManager& documentBasicManager,
|
2015-10-27 15:38:52 +02:00
|
|
|
const css::uno::Reference< css::document::XScriptInvocationContext >& documentScriptContext
|
2008-03-06 15:19:33 +00:00
|
|
|
);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~BasicScriptImpl() override;
|
2003-09-16 14:23:32 +00:00
|
|
|
|
2010-10-06 10:16:27 +01:00
|
|
|
// XInterface
|
|
|
|
DECLARE_XINTERFACE()
|
|
|
|
|
|
|
|
// XTypeProvider
|
|
|
|
DECLARE_XTYPEPROVIDER()
|
|
|
|
|
2003-09-16 14:23:32 +00:00
|
|
|
// XScript
|
2015-10-27 15:38:52 +02:00
|
|
|
virtual css::uno::Any SAL_CALL invoke(
|
|
|
|
const css::uno::Sequence< css::uno::Any >& aParams,
|
|
|
|
css::uno::Sequence< sal_Int16 >& aOutParamIndex,
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Sequence< css::uno::Any >& aOutParam ) override;
|
2010-10-06 10:16:27 +01:00
|
|
|
// XPropertySet
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
|
2010-09-14 11:02:43 +02:00
|
|
|
|
|
|
|
// SfxListener
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
|
2003-09-16 14:23:32 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 20:05:49 +01:00
|
|
|
|
2003-09-16 14:23:32 +00:00
|
|
|
} // namespace basprov
|
2014-02-25 20:05:49 +01:00
|
|
|
|
2003-09-16 14:23:32 +00:00
|
|
|
|
2014-04-18 22:47:44 +02:00
|
|
|
#endif // INCLUDED_SCRIPTING_SOURCE_BASPROV_BASSCRIPT_HXX
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|