1*f8e07b45SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f8e07b45SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f8e07b45SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f8e07b45SAndrew Rist * distributed with this work for additional information 6*f8e07b45SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f8e07b45SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f8e07b45SAndrew Rist * "License"); you may not use this file except in compliance 9*f8e07b45SAndrew Rist * with the License. You may obtain a copy of the License at 10*f8e07b45SAndrew Rist * 11*f8e07b45SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*f8e07b45SAndrew Rist * 13*f8e07b45SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f8e07b45SAndrew Rist * software distributed under the License is distributed on an 15*f8e07b45SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f8e07b45SAndrew Rist * KIND, either express or implied. See the License for the 17*f8e07b45SAndrew Rist * specific language governing permissions and limitations 18*f8e07b45SAndrew Rist * under the License. 19*f8e07b45SAndrew Rist * 20*f8e07b45SAndrew Rist *************************************************************/ 21*f8e07b45SAndrew Rist 22*f8e07b45SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef __FRAMEWORK_HANDLER_OXT_HANDLER_HXX_ 25cdf0e10cSrcweir #define __FRAMEWORK_HANDLER_OXT_HANDLER_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 28cdf0e10cSrcweir // my own includes 29cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 30cdf0e10cSrcweir 31cdf0e10cSrcweir #ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_ 32cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx> 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir #ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_ 36cdf0e10cSrcweir #include <threadhelp/resetableguard.hxx> 37cdf0e10cSrcweir #endif 38cdf0e10cSrcweir 39cdf0e10cSrcweir #ifndef __FRAMEWORK_MACROS_XINTERFACE_HXX_ 40cdf0e10cSrcweir #include <macros/xinterface.hxx> 41cdf0e10cSrcweir #endif 42cdf0e10cSrcweir 43cdf0e10cSrcweir #ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_ 44cdf0e10cSrcweir #include <macros/xtypeprovider.hxx> 45cdf0e10cSrcweir #endif 46cdf0e10cSrcweir 47cdf0e10cSrcweir #ifndef __FRAMEWORK_MACROS_XSERVICEINFO_HXX_ 48cdf0e10cSrcweir #include <macros/xserviceinfo.hxx> 49cdf0e10cSrcweir #endif 50cdf0e10cSrcweir 51cdf0e10cSrcweir #ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ 52cdf0e10cSrcweir #include <macros/debug.hxx> 53cdf0e10cSrcweir #endif 54cdf0e10cSrcweir 55cdf0e10cSrcweir #ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ 56cdf0e10cSrcweir #include <macros/generic.hxx> 57cdf0e10cSrcweir #endif 58cdf0e10cSrcweir 59cdf0e10cSrcweir #ifndef __FRAMEWORK_GENERAL_H_ 60cdf0e10cSrcweir #include <general.h> 61cdf0e10cSrcweir #endif 62cdf0e10cSrcweir 63cdf0e10cSrcweir #ifndef __FRAMEWORK_STDTYPES_H_ 64cdf0e10cSrcweir #include <stdtypes.h> 65cdf0e10cSrcweir #endif 66cdf0e10cSrcweir 67cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 68cdf0e10cSrcweir // interface includes 69cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 70cdf0e10cSrcweir 71cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_ 72cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp> 73cdf0e10cSrcweir #endif 74cdf0e10cSrcweir 75cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ 76cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 77cdf0e10cSrcweir #endif 78cdf0e10cSrcweir 79cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XNOTIFYINGDISPATCH_HPP_ 80cdf0e10cSrcweir #include <com/sun/star/frame/XNotifyingDispatch.hpp> 81cdf0e10cSrcweir #endif 82cdf0e10cSrcweir 83cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_ 84cdf0e10cSrcweir #include <com/sun/star/frame/XStatusListener.hpp> 85cdf0e10cSrcweir #endif 86cdf0e10cSrcweir 87cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ 88cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 89cdf0e10cSrcweir #endif 90cdf0e10cSrcweir 91cdf0e10cSrcweir #ifndef _COM_SUN_STAR_DOCUMENT_XEXTENDEDFILTERDETECTION_HPP_ 92cdf0e10cSrcweir #include <com/sun/star/document/XExtendedFilterDetection.hpp> 93cdf0e10cSrcweir #endif 94cdf0e10cSrcweir 95cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ 96cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 97cdf0e10cSrcweir #endif 98cdf0e10cSrcweir 99cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UTIL_URL_HPP_ 100cdf0e10cSrcweir #include <com/sun/star/util/URL.hpp> 101cdf0e10cSrcweir #endif 102cdf0e10cSrcweir 103cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 104cdf0e10cSrcweir // other includes 105cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 106cdf0e10cSrcweir 107cdf0e10cSrcweir #ifndef _CPPUHELPER_WEAK_HXX_ 108cdf0e10cSrcweir #include <cppuhelper/weak.hxx> 109cdf0e10cSrcweir #endif 110cdf0e10cSrcweir 111cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 112cdf0e10cSrcweir // namespace 113cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 114cdf0e10cSrcweir 115cdf0e10cSrcweir namespace framework{ 116cdf0e10cSrcweir 117cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 118cdf0e10cSrcweir // exported const 119cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 120cdf0e10cSrcweir 121cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 122cdf0e10cSrcweir // exported definitions 123cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 124cdf0e10cSrcweir 125cdf0e10cSrcweir /*-************************************************************************************************************//** 126cdf0e10cSrcweir @short handler to detect and play sounds ("wav" and "au" only!) 127cdf0e10cSrcweir @descr Register this implementation as a content handler to detect and/or play wav- and au-sounds. 128cdf0e10cSrcweir It doesn't depend from the target platform. But one instance of this class 129cdf0e10cSrcweir can play one sound at the same time only. Means every new dispatch request will stop the 130cdf0e10cSrcweir might still running one. So we support one operation/one URL/one listener at the same time 131cdf0e10cSrcweir only. 132cdf0e10cSrcweir 133cdf0e10cSrcweir @devstatus ready 134cdf0e10cSrcweir @threadsafe yes 135cdf0e10cSrcweir *//*-*************************************************************************************************************/ 136cdf0e10cSrcweir class Oxt_Handler : // interfaces 137cdf0e10cSrcweir public css::lang::XTypeProvider 138cdf0e10cSrcweir , public css::lang::XServiceInfo 139cdf0e10cSrcweir , public css::frame::XNotifyingDispatch // => XDispatch 140cdf0e10cSrcweir , public css::document::XExtendedFilterDetection 141cdf0e10cSrcweir // baseclasses 142cdf0e10cSrcweir // Order is neccessary for right initialization! 143cdf0e10cSrcweir , private ThreadHelpBase 144cdf0e10cSrcweir , public ::cppu::OWeakObject 145cdf0e10cSrcweir { 146cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 147cdf0e10cSrcweir // public methods 148cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 149cdf0e10cSrcweir public: 150cdf0e10cSrcweir 151cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 152cdf0e10cSrcweir // constructor / destructor 153cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 154cdf0e10cSrcweir Oxt_Handler( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); 155cdf0e10cSrcweir virtual ~Oxt_Handler( ); 156cdf0e10cSrcweir 157cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 158cdf0e10cSrcweir // XInterface, XTypeProvider, XServiceInfo 159cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 160cdf0e10cSrcweir FWK_DECLARE_XINTERFACE 161cdf0e10cSrcweir FWK_DECLARE_XTYPEPROVIDER 162cdf0e10cSrcweir DECLARE_XSERVICEINFO 163cdf0e10cSrcweir 164cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 165cdf0e10cSrcweir // XNotifyingDispatch 166cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 167cdf0e10cSrcweir virtual void SAL_CALL dispatchWithNotification(const css::util::URL& aURL , 168cdf0e10cSrcweir const css::uno::Sequence< css::beans::PropertyValue >& lArguments, 169cdf0e10cSrcweir const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) throw( css::uno::RuntimeException ); 170cdf0e10cSrcweir 171cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 172cdf0e10cSrcweir // XDispatch 173cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 174cdf0e10cSrcweir virtual void SAL_CALL dispatch ( const css::util::URL& aURL , 175cdf0e10cSrcweir const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException ); 176cdf0e10cSrcweir // not supported ! 177cdf0e10cSrcweir virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& /*xListener*/ , 178cdf0e10cSrcweir const css::util::URL& /*aURL*/ ) throw( css::uno::RuntimeException ) {}; 179cdf0e10cSrcweir virtual void SAL_CALL removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& /*xListener*/ , 180cdf0e10cSrcweir const css::util::URL& /*aURL*/ ) throw( css::uno::RuntimeException ) {}; 181cdf0e10cSrcweir 182cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 183cdf0e10cSrcweir // XExtendedFilterDetection 184cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 185cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL detect ( css::uno::Sequence< css::beans::PropertyValue >& lDescriptor ) throw( css::uno::RuntimeException ); 186cdf0e10cSrcweir 187cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 188cdf0e10cSrcweir // protected methods 189cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 190cdf0e10cSrcweir protected: 191cdf0e10cSrcweir 192cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 193cdf0e10cSrcweir // private methods 194cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 195cdf0e10cSrcweir private: 196cdf0e10cSrcweir 197cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 198cdf0e10cSrcweir // variables 199cdf0e10cSrcweir // (should be private everyway!) 200cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 201cdf0e10cSrcweir private: 202cdf0e10cSrcweir 203cdf0e10cSrcweir css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// global uno service factory to create new services 204cdf0e10cSrcweir css::uno::Reference< css::uno::XInterface > m_xSelfHold ; /// we must protect us against dieing during async(!) dispatch() call! 205cdf0e10cSrcweir css::uno::Reference< css::frame::XDispatchResultListener > m_xListener ; 206cdf0e10cSrcweir 207cdf0e10cSrcweir }; // class Oxt_Handler 208cdf0e10cSrcweir 209cdf0e10cSrcweir } // namespace framework 210cdf0e10cSrcweir 211cdf0e10cSrcweir #endif // #ifndef __FRAMEWORK_HANDLER_OXT_HANDLER_HXX_ 212