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_PROTOCOLHANDLER_SCRIPTHANDLER_HXX
21 #define INCLUDED_SCRIPTING_SOURCE_PROTOCOLHANDLER_SCRIPTHANDLER_HXX
23 #include <com/sun/star/frame/XDispatchProvider.hpp>
24 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XInitialization.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <com/sun/star/script/provider/XScriptProvider.hpp>
31 namespace com::sun::star
{
34 class XScriptInvocationContext
;
38 class XComponentContext
;
41 class XMultiServiceFactory
;
42 class XSingleServiceFactory
;
47 class XNotifyingDispatch
;
48 class XDispatchResultListener
;
49 struct DispatchDescriptor
;
59 namespace scripting_protocolhandler
62 class ScriptProtocolHandler
:
63 public ::cppu::WeakImplHelper
< css::frame::XDispatchProvider
,
64 css::frame::XNotifyingDispatch
, css::lang::XServiceInfo
, css::lang::XInitialization
>
68 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
69 css::uno::Reference
< css::frame::XFrame
> m_xFrame
;
70 css::uno::Reference
< css::script::provider::XScriptProvider
> m_xScriptProvider
;
71 css::uno::Reference
< css::document::XScriptInvocationContext
> m_xScriptInvocation
;
73 void createScriptProvider();
74 bool getScriptInvocation();
77 explicit ScriptProtocolHandler( const css::uno::Reference
< css::uno::XComponentContext
>& xContext
);
78 virtual ~ScriptProtocolHandler() override
;
81 virtual OUString SAL_CALL
getImplementationName() override
;
82 virtual sal_Bool SAL_CALL
supportsService( const OUString
& sServiceName
) override
;
83 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
85 /* Implementation for XDispatchProvider */
86 virtual css::uno::Reference
< css::frame::XDispatch
> SAL_CALL
87 queryDispatch( const css::util::URL
& aURL
, const OUString
& sTargetFrameName
,
88 sal_Int32 eSearchFlags
) override
;
89 virtual css::uno::Sequence
< css::uno::Reference
< css::frame::XDispatch
> > SAL_CALL
91 const css::uno::Sequence
< css::frame::DispatchDescriptor
>& seqDescriptor
) override
;
93 /* Implementation for X(Notifying)Dispatch */
94 virtual void SAL_CALL
dispatchWithNotification(
95 const css::util::URL
& aURL
,
96 const css::uno::Sequence
< css::beans::PropertyValue
>& lArgs
,
97 const css::uno::Reference
< css::frame::XDispatchResultListener
>& Listener
) override
;
98 virtual void SAL_CALL
dispatch(
99 const css::util::URL
& aURL
,
100 const css::uno::Sequence
< css::beans::PropertyValue
>& lArgs
) override
;
101 virtual void SAL_CALL
addStatusListener(
102 const css::uno::Reference
< css::frame::XStatusListener
>& xControl
,
103 const css::util::URL
& aURL
) override
;
104 virtual void SAL_CALL
removeStatusListener(
105 const css::uno::Reference
< css::frame::XStatusListener
>& xControl
,
106 const css::util::URL
& aURL
) override
;
108 /* Implementation for XInitialization */
109 virtual void SAL_CALL
initialize(
110 const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */