LibreOffice Module scripting (master) 1
scripthandler.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 <com/sun/star/frame/XDispatchProvider.hpp>
23#include <com/sun/star/frame/XNotifyingDispatch.hpp>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/lang/XInitialization.hpp>
27#include <com/sun/star/script/provider/XScriptProvider.hpp>
28
29
30namespace com::sun::star {
31
32 namespace document {
33 class XScriptInvocationContext;
34 }
35 namespace uno {
36 class Any;
37 class XComponentContext;
38 }
39 namespace lang {
40 class XMultiServiceFactory;
41 class XSingleServiceFactory;
42 }
43 namespace frame {
44 class XFrame;
45 class XDispatch;
46 class XNotifyingDispatch;
47 class XDispatchResultListener;
48 struct DispatchDescriptor;
49 }
50 namespace beans {
51 struct PropertyValue;
52 }
53 namespace util {
54 struct URL;
55 }
56}
57
59{
60
62public ::cppu::WeakImplHelper< css::frame::XDispatchProvider,
63 css::frame::XNotifyingDispatch, css::lang::XServiceInfo, css::lang::XInitialization >
64{
65private:
67 css::uno::Reference < css::uno::XComponentContext > m_xContext;
68 css::uno::Reference < css::frame::XFrame > m_xFrame;
69 css::uno::Reference < css::script::provider::XScriptProvider > m_xScriptProvider;
70 css::uno::Reference< css::document::XScriptInvocationContext > m_xScriptInvocation;
71
74
75public:
76 explicit ScriptProtocolHandler( const css::uno::Reference < css::uno::XComponentContext >& xContext );
77 virtual ~ScriptProtocolHandler() override;
78
79 /* XServiceInfo */
80 virtual OUString SAL_CALL getImplementationName() override;
81 virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override;
82 virtual css::uno::Sequence < OUString > SAL_CALL getSupportedServiceNames() override;
83
84 /* Implementation for XDispatchProvider */
85 virtual css::uno::Reference < css::frame::XDispatch > SAL_CALL
86 queryDispatch( const css::util::URL& aURL, const OUString& sTargetFrameName,
87 sal_Int32 eSearchFlags ) override ;
88 virtual css::uno::Sequence< css::uno::Reference < css::frame::XDispatch > > SAL_CALL
90 const css::uno::Sequence < css::frame::DispatchDescriptor >& seqDescriptor ) override;
91
92 /* Implementation for X(Notifying)Dispatch */
93 virtual void SAL_CALL dispatchWithNotification(
94 const css::util::URL& aURL,
95 const css::uno::Sequence< css::beans::PropertyValue >& lArgs,
96 const css::uno::Reference< css::frame::XDispatchResultListener >& Listener ) override;
97 virtual void SAL_CALL dispatch(
98 const css::util::URL& aURL,
99 const css::uno::Sequence< css::beans::PropertyValue >& lArgs ) override;
100 virtual void SAL_CALL addStatusListener(
101 const css::uno::Reference< css::frame::XStatusListener >& xControl,
102 const css::util::URL& aURL ) override;
103 virtual void SAL_CALL removeStatusListener(
104 const css::uno::Reference< css::frame::XStatusListener >& xControl,
105 const css::util::URL& aURL ) override;
106
107 /* Implementation for XInitialization */
108 virtual void SAL_CALL initialize(
109 const css::uno::Sequence < css::uno::Any >& aArguments ) override;
110};
111
112}
113
114/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScriptProtocolHandler(const css::uno::Reference< css::uno::XComponentContext > &xContext)
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &sTargetFrameName, sal_Int32 eSearchFlags) override
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &seqDescriptor) override
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArgs) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
css::uno::Reference< css::frame::XFrame > m_xFrame
css::uno::Reference< css::script::provider::XScriptProvider > m_xScriptProvider
css::uno::Reference< css::document::XScriptInvocationContext > m_xScriptInvocation
virtual void SAL_CALL dispatchWithNotification(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArgs, const css::uno::Reference< css::frame::XDispatchResultListener > &Listener) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
unsigned char sal_Bool