Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / framework / inc / dispatch / systemexec.hxx
blobd90fbecec3adde87990e5d14f909c3e93ae49dfa
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 #ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_SYSTEMEXEC_HXX
21 #define INCLUDED_FRAMEWORK_INC_DISPATCH_SYSTEMEXEC_HXX
23 #include <macros/xserviceinfo.hxx>
24 #include <general.h>
25 #include <stdtypes.h>
27 #include <com/sun/star/lang/XTypeProvider.hpp>
28 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
29 #include <com/sun/star/frame/XDispatch.hpp>
30 #include <com/sun/star/frame/XDispatchProvider.hpp>
31 #include <com/sun/star/util/URL.hpp>
32 #include <com/sun/star/beans/PropertyValue.hpp>
33 #include <com/sun/star/frame/XStatusListener.hpp>
35 #include <cppuhelper/implbase.hxx>
37 namespace framework{
39 /**
40 @short protocol handler for "systemexec:*" URLs
41 @descr It's a special dispatch/provider object which is registered for such URL pattern and will
42 be automatically used by the framework dispatch mechanism if such URL occurred.
43 It forwards all URL's to the underlying operating system.
44 So it would e.g. be possible to open HTML files outside the office within a web browser.
46 @base OWeakObject
47 provides XWeak and ref count mechanism
49 @devstatus ready to use
51 class SystemExec : public ::cppu::WeakImplHelper<
52 css::lang::XServiceInfo ,
53 css::frame::XDispatchProvider ,
54 css::frame::XNotifyingDispatch > // => XDispatch
56 /* member */
57 private:
59 /// reference to global uno service manager which had created us
60 css::uno::Reference< css::uno::XComponentContext > m_xContext;
62 /* interface */
63 public:
65 // ctor/dtor
66 SystemExec( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
67 virtual ~SystemExec( ) override;
69 // XInterface, XTypeProvider, XServiceInfo
70 DECLARE_XSERVICEINFO_NOFACTORY
71 /* Helper for registry */
72 /// @throws css::uno::Exception
73 static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
74 static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
76 // XDispatchProvider
77 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,
78 const OUString& sTarget ,
79 sal_Int32 nFlags ) override;
80 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) override;
82 // XNotifyingDispatch
83 virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL ,
84 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
85 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) override;
87 // XDispatch
88 virtual void SAL_CALL dispatch ( const css::util::URL& aURL ,
89 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override;
90 virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
91 const css::util::URL& aURL ) override;
92 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
93 const css::util::URL& aURL ) override;
95 /* internal */
96 private:
98 void impl_notifyResultListener(const css::uno::Reference< css::frame::XDispatchResultListener >& xListener,
99 const sal_Int16 nState );
101 }; // class SystemExec
103 } // namespace framework
105 #endif // INCLUDED_FRAMEWORK_INC_DISPATCH_SYSTEMEXEC_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */