2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 20:25:33 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2008-05-15 08:04:14 +00:00
|
|
|
|
2013-11-05 02:25:45 +01:00
|
|
|
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
|
|
|
|
#define INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
|
2008-05-15 08:04:14 +00:00
|
|
|
|
|
|
|
#include <macros/xserviceinfo.hxx>
|
|
|
|
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/frame/XNotifyingDispatch.hpp>
|
|
|
|
#include <com/sun/star/frame/XStatusListener.hpp>
|
|
|
|
#include <com/sun/star/document/XExtendedFilterDetection.hpp>
|
|
|
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
|
|
|
#include <com/sun/star/util/URL.hpp>
|
|
|
|
|
2015-08-14 10:23:57 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2013-07-19 13:38:53 +02:00
|
|
|
|
2008-05-15 08:04:14 +00:00
|
|
|
namespace framework{
|
|
|
|
|
2014-02-25 18:54:02 +01:00
|
|
|
/*-************************************************************************************************************
|
2008-05-15 08:04:14 +00:00
|
|
|
@short handler to detect and play sounds ("wav" and "au" only!)
|
|
|
|
@descr Register this implementation as a content handler to detect and/or play wav- and au-sounds.
|
|
|
|
It doesn't depend from the target platform. But one instance of this class
|
|
|
|
can play one sound at the same time only. Means every new dispatch request will stop the
|
|
|
|
might still running one. So we support one operation/one URL/one listener at the same time
|
|
|
|
only.
|
|
|
|
|
|
|
|
@devstatus ready
|
|
|
|
@threadsafe yes
|
|
|
|
*//*-*************************************************************************************************************/
|
2015-08-14 10:23:57 +09:00
|
|
|
class Oxt_Handler : public ::cppu::WeakImplHelper<
|
2013-07-19 13:38:53 +02:00
|
|
|
css::lang::XServiceInfo,
|
|
|
|
css::frame::XNotifyingDispatch, // => XDispatch
|
|
|
|
css::document::XExtendedFilterDetection >
|
2008-05-15 08:04:14 +00:00
|
|
|
{
|
2014-02-25 18:54:02 +01:00
|
|
|
|
2008-05-15 08:04:14 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
Oxt_Handler( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~Oxt_Handler( ) override;
|
2008-05-15 08:04:14 +00:00
|
|
|
|
|
|
|
// XInterface, XTypeProvider, XServiceInfo
|
2014-02-25 18:54:02 +01:00
|
|
|
|
2017-01-19 17:57:03 +01:00
|
|
|
DECLARE_XSERVICEINFO_NOFACTORY
|
|
|
|
/* Helper for registry */
|
|
|
|
/// @throws css::uno::Exception
|
2017-01-26 12:28:58 +01:00
|
|
|
static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
|
2017-12-13 08:46:01 +01:00
|
|
|
static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
|
2008-05-15 08:04:14 +00:00
|
|
|
|
|
|
|
// XNotifyingDispatch
|
2014-02-25 18:54:02 +01:00
|
|
|
|
2008-05-15 08:04:14 +00:00
|
|
|
virtual void SAL_CALL dispatchWithNotification(const css::util::URL& aURL ,
|
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) override;
|
2008-05-15 08:04:14 +00:00
|
|
|
|
|
|
|
// XDispatch
|
2014-02-25 18:54:02 +01:00
|
|
|
|
2008-05-15 08:04:14 +00:00
|
|
|
virtual void SAL_CALL dispatch ( const css::util::URL& aURL ,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override;
|
2008-05-15 08:04:14 +00:00
|
|
|
// not supported !
|
|
|
|
virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& /*xListener*/ ,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::util::URL& /*aURL*/ ) override {};
|
2008-05-15 08:04:14 +00:00
|
|
|
virtual void SAL_CALL removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& /*xListener*/ ,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::util::URL& /*aURL*/ ) override {};
|
2008-05-15 08:04:14 +00:00
|
|
|
|
|
|
|
// XExtendedFilterDetection
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual OUString SAL_CALL detect ( css::uno::Sequence< css::beans::PropertyValue >& lDescriptor ) override;
|
2008-05-15 08:04:14 +00:00
|
|
|
|
|
|
|
private:
|
2014-03-20 11:49:39 +01:00
|
|
|
osl::Mutex m_mutex;
|
2008-05-15 08:04:14 +00:00
|
|
|
|
2014-04-06 19:36:08 +03:00
|
|
|
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; /// global uno service factory to create new services
|
|
|
|
css::uno::Reference< css::frame::XDispatchResultListener > m_xListener;
|
2008-05-15 08:04:14 +00:00
|
|
|
|
2016-04-15 19:30:30 -04:00
|
|
|
};
|
2008-05-15 08:04:14 +00:00
|
|
|
|
2016-04-15 19:30:30 -04:00
|
|
|
}
|
2008-05-15 08:04:14 +00:00
|
|
|
|
2013-11-05 02:25:45 +01:00
|
|
|
#endif // INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|