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_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
21 #define INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
23 #include <macros/xinterface.hxx>
24 #include <macros/xtypeprovider.hxx>
25 #include <macros/xserviceinfo.hxx>
26 #include <macros/generic.hxx>
30 #include <com/sun/star/lang/XTypeProvider.hpp>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
33 #include <com/sun/star/frame/XStatusListener.hpp>
34 #include <com/sun/star/frame/XFrame.hpp>
35 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
36 #include <com/sun/star/beans/PropertyValue.hpp>
37 #include <com/sun/star/util/URL.hpp>
39 #include <cppuhelper/implbase3.hxx>
43 /*-************************************************************************************************************
44 @short handler to detect and play sounds ("wav" and "au" only!)
45 @descr Register this implementation as a content handler to detect and/or play wav- and au-sounds.
46 It doesn't depend from the target platform. But one instance of this class
47 can play one sound at the same time only. Means every new dispatch request will stop the
48 might still running one. So we support one operation/one URL/one listener at the same time
53 *//*-*************************************************************************************************************/
54 class Oxt_Handler
: public ::cppu::WeakImplHelper3
<
55 css::lang::XServiceInfo
,
56 css::frame::XNotifyingDispatch
, // => XDispatch
57 css::document::XExtendedFilterDetection
>
64 // constructor / destructor
66 Oxt_Handler( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xFactory
);
67 virtual ~Oxt_Handler( );
69 // XInterface, XTypeProvider, XServiceInfo
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
) throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual void SAL_CALL
dispatch ( const css::util::URL
& aURL
,
82 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
) throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual void SAL_CALL
addStatusListener ( const css::uno::Reference
< css::frame::XStatusListener
>& /*xListener*/ ,
85 const css::util::URL
& /*aURL*/ ) throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
{};
86 virtual void SAL_CALL
removeStatusListener ( const css::uno::Reference
< css::frame::XStatusListener
>& /*xListener*/ ,
87 const css::util::URL
& /*aURL*/ ) throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
{};
89 // XExtendedFilterDetection
90 virtual OUString SAL_CALL
detect ( css::uno::Sequence
< css::beans::PropertyValue
>& lDescriptor
) throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
99 // (should be private everyway!)
104 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xFactory
; /// global uno service factory to create new services
105 css::uno::Reference
< css::uno::XInterface
> m_xSelfHold
; /// we must protect us against dying during async(!) dispatch() call!
106 css::uno::Reference
< css::frame::XDispatchResultListener
> m_xListener
;
108 }; // class Oxt_Handler
110 } // namespace framework
112 #endif // INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */