merge the formfield patch from ooo-build
[ooovba.git] / framework / inc / dispatch / oxt_handler.hxx
blob2c3f98577ed54106c900adc1bffff993f8aa6ec1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: oxt_handler.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_HANDLER_OXT_HANDLER_HXX_
32 #define __FRAMEWORK_HANDLER_OXT_HANDLER_HXX_
34 //_________________________________________________________________________________________________________________
35 // my own includes
36 //_________________________________________________________________________________________________________________
38 #ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_
39 #include <threadhelp/threadhelpbase.hxx>
40 #endif
42 #ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_
43 #include <threadhelp/resetableguard.hxx>
44 #endif
46 #ifndef __FRAMEWORK_MACROS_XINTERFACE_HXX_
47 #include <macros/xinterface.hxx>
48 #endif
50 #ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
51 #include <macros/xtypeprovider.hxx>
52 #endif
54 #ifndef __FRAMEWORK_MACROS_XSERVICEINFO_HXX_
55 #include <macros/xserviceinfo.hxx>
56 #endif
58 #ifndef __FRAMEWORK_MACROS_DEBUG_HXX_
59 #include <macros/debug.hxx>
60 #endif
62 #ifndef __FRAMEWORK_MACROS_GENERIC_HXX_
63 #include <macros/generic.hxx>
64 #endif
66 #ifndef __FRAMEWORK_GENERAL_H_
67 #include <general.h>
68 #endif
70 #ifndef __FRAMEWORK_STDTYPES_H_
71 #include <stdtypes.h>
72 #endif
74 //_________________________________________________________________________________________________________________
75 // interface includes
76 //_________________________________________________________________________________________________________________
78 #ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
79 #include <com/sun/star/lang/XTypeProvider.hpp>
80 #endif
82 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
83 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
84 #endif
86 #ifndef _COM_SUN_STAR_FRAME_XNOTIFYINGDISPATCH_HPP_
87 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
88 #endif
90 #ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_
91 #include <com/sun/star/frame/XStatusListener.hpp>
92 #endif
94 #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
95 #include <com/sun/star/frame/XFrame.hpp>
96 #endif
98 #ifndef _COM_SUN_STAR_DOCUMENT_XEXTENDEDFILTERDETECTION_HPP_
99 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
100 #endif
102 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
103 #include <com/sun/star/beans/PropertyValue.hpp>
104 #endif
106 #ifndef _COM_SUN_STAR_UTIL_URL_HPP_
107 #include <com/sun/star/util/URL.hpp>
108 #endif
110 //_________________________________________________________________________________________________________________
111 // other includes
112 //_________________________________________________________________________________________________________________
114 #ifndef _CPPUHELPER_WEAK_HXX_
115 #include <cppuhelper/weak.hxx>
116 #endif
118 //_________________________________________________________________________________________________________________
119 // namespace
120 //_________________________________________________________________________________________________________________
122 namespace framework{
124 //_________________________________________________________________________________________________________________
125 // exported const
126 //_________________________________________________________________________________________________________________
128 //_________________________________________________________________________________________________________________
129 // exported definitions
130 //_________________________________________________________________________________________________________________
132 /*-************************************************************************************************************//**
133 @short handler to detect and play sounds ("wav" and "au" only!)
134 @descr Register this implementation as a content handler to detect and/or play wav- and au-sounds.
135 It doesn't depend from the target platform. But one instance of this class
136 can play one sound at the same time only. Means every new dispatch request will stop the
137 might still running one. So we support one operation/one URL/one listener at the same time
138 only.
140 @devstatus ready
141 @threadsafe yes
142 *//*-*************************************************************************************************************/
143 class Oxt_Handler : // interfaces
144 public css::lang::XTypeProvider
145 , public css::lang::XServiceInfo
146 , public css::frame::XNotifyingDispatch // => XDispatch
147 , public css::document::XExtendedFilterDetection
148 // baseclasses
149 // Order is neccessary for right initialization!
150 , private ThreadHelpBase
151 , public ::cppu::OWeakObject
153 //-------------------------------------------------------------------------------------------------------------
154 // public methods
155 //-------------------------------------------------------------------------------------------------------------
156 public:
158 //---------------------------------------------------------------------------------------------------------
159 // constructor / destructor
160 //---------------------------------------------------------------------------------------------------------
161 Oxt_Handler( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
162 virtual ~Oxt_Handler( );
164 //---------------------------------------------------------------------------------------------------------
165 // XInterface, XTypeProvider, XServiceInfo
166 //---------------------------------------------------------------------------------------------------------
167 FWK_DECLARE_XINTERFACE
168 FWK_DECLARE_XTYPEPROVIDER
169 DECLARE_XSERVICEINFO
171 //---------------------------------------------------------------------------------------------------------
172 // XNotifyingDispatch
173 //---------------------------------------------------------------------------------------------------------
174 virtual void SAL_CALL dispatchWithNotification(const css::util::URL& aURL ,
175 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
176 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) throw( css::uno::RuntimeException );
178 //---------------------------------------------------------------------------------------------------------
179 // XDispatch
180 //---------------------------------------------------------------------------------------------------------
181 virtual void SAL_CALL dispatch ( const css::util::URL& aURL ,
182 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException );
183 // not supported !
184 virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& /*xListener*/ ,
185 const css::util::URL& /*aURL*/ ) throw( css::uno::RuntimeException ) {};
186 virtual void SAL_CALL removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& /*xListener*/ ,
187 const css::util::URL& /*aURL*/ ) throw( css::uno::RuntimeException ) {};
189 //---------------------------------------------------------------------------------------------------------
190 // XExtendedFilterDetection
191 //---------------------------------------------------------------------------------------------------------
192 virtual ::rtl::OUString SAL_CALL detect ( css::uno::Sequence< css::beans::PropertyValue >& lDescriptor ) throw( css::uno::RuntimeException );
194 //-------------------------------------------------------------------------------------------------------------
195 // protected methods
196 //-------------------------------------------------------------------------------------------------------------
197 protected:
199 //-------------------------------------------------------------------------------------------------------------
200 // private methods
201 //-------------------------------------------------------------------------------------------------------------
202 private:
204 //-------------------------------------------------------------------------------------------------------------
205 // variables
206 // (should be private everyway!)
207 //-------------------------------------------------------------------------------------------------------------
208 private:
210 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// global uno service factory to create new services
211 css::uno::Reference< css::uno::XInterface > m_xSelfHold ; /// we must protect us against dieing during async(!) dispatch() call!
212 css::uno::Reference< css::frame::XDispatchResultListener > m_xListener ;
214 }; // class Oxt_Handler
216 } // namespace framework
218 #endif // #ifndef __FRAMEWORK_HANDLER_OXT_HANDLER_HXX_