Get the style color and number just once
[LibreOffice.git] / scripting / source / protocolhandler / scripthandler.hxx
blob74667b5a4ed96747296f68bf219b0c34d197d005
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/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>
26 #include <cppuhelper/implbase.hxx>
27 #include <com/sun/star/script/provider/XScriptProvider.hpp>
30 namespace com::sun::star {
32 namespace document {
33 class XScriptInvocationContext;
35 namespace uno {
36 class Any;
37 class XComponentContext;
39 namespace lang {
40 class XMultiServiceFactory;
41 class XSingleServiceFactory;
43 namespace frame {
44 class XFrame;
45 class XDispatch;
46 class XNotifyingDispatch;
47 class XDispatchResultListener;
48 struct DispatchDescriptor;
50 namespace beans {
51 struct PropertyValue;
53 namespace util {
54 struct URL;
58 namespace scripting_protocolhandler
61 class ScriptProtocolHandler :
62 public ::cppu::WeakImplHelper< css::frame::XDispatchProvider,
63 css::frame::XNotifyingDispatch, css::lang::XServiceInfo, css::lang::XInitialization >
65 private:
66 bool m_bInitialised;
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;
72 void createScriptProvider();
73 bool getScriptInvocation();
75 public:
76 explicit ScriptProtocolHandler( const css::uno::Reference < css::uno::XComponentContext >& xContext );
77 virtual ~ScriptProtocolHandler() override;
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;
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
89 queryDispatches(
90 const css::uno::Sequence < css::frame::DispatchDescriptor >& seqDescriptor ) override;
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;
107 /* Implementation for XInitialization */
108 virtual void SAL_CALL initialize(
109 const css::uno::Sequence < css::uno::Any >& aArguments ) override;
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */