cid#1607171 Data race condition
[LibreOffice.git] / framework / inc / dispatch / mailtodispatcher.hxx
blobd6fe52d93b84254b4eabb8ebc9a5e5e1eca481f3
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/XNotifyingDispatch.hpp>
23 #include <com/sun/star/frame/XDispatch.hpp>
24 #include <com/sun/star/frame/XDispatchProvider.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/uno/XComponentContext.hpp>
27 #include <com/sun/star/util/URL.hpp>
28 #include <com/sun/star/beans/PropertyValue.hpp>
29 #include <com/sun/star/frame/XStatusListener.hpp>
31 #include <cppuhelper/implbase.hxx>
33 namespace framework{
35 /**
36 @short protocol handler for "mailto:" URLs
37 @descr It's a special dispatch object which is used registered for "mailto:*" URLs and
38 will be automatically used from the framework dispatch mechanism if such URL occurred.
40 @base OWeakObject
41 provides XWeak and ref count mechanism
43 @devstatus ready to use
45 class MailToDispatcher final : public ::cppu::WeakImplHelper<
46 css::lang::XServiceInfo,
47 css::frame::XDispatchProvider,
48 css::frame::XNotifyingDispatch> // => XDispatch
50 /* member */
51 private:
53 /// reference to global uno service manager which had created us
54 css::uno::Reference< css::uno::XComponentContext > m_xContext;
56 /* interface */
57 public:
59 // ctor/dtor
60 MailToDispatcher( css::uno::Reference< css::uno::XComponentContext > xContext );
61 virtual ~MailToDispatcher( ) override;
63 /* interface XServiceInfo */
64 virtual OUString SAL_CALL getImplementationName() override;
65 virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override;
66 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
68 // XDispatchProvider
69 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,
70 const OUString& sTarget ,
71 sal_Int32 nFlags ) override;
72 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) override;
74 // XNotifyingDispatch
75 virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL ,
76 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
77 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) override;
79 // XDispatch
80 virtual void SAL_CALL dispatch ( const css::util::URL& aURL ,
81 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override;
82 virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
83 const css::util::URL& aURL ) override;
84 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
85 const css::util::URL& aURL ) override;
87 /* internal */
88 private:
89 /// @throws css::uno::RuntimeException
90 bool implts_dispatch( const css::util::URL& aURL );
92 }; // class MailToDispatcher
94 } // namespace framework
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */