merge the formfield patch from ooo-build
[ooovba.git] / framework / inc / dispatch / servicehandler.hxx
blob4b08e0622bd74ace3682fc05def1f7f1f618283c
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: servicehandler.hxx,v $
10 * $Revision: 1.5 $
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_DISPATCH_SERVICEHANDLER_HXX_
32 #define __FRAMEWORK_DISPATCH_SERVICEHANDLER_HXX_
34 //_________________________________________________________________________________________________________________
35 // my own includes
36 //_________________________________________________________________________________________________________________
38 #include <macros/generic.hxx>
39 #include <macros/xinterface.hxx>
40 #include <macros/xtypeprovider.hxx>
41 #include <macros/xserviceinfo.hxx>
42 #include <macros/debug.hxx>
43 #include <threadhelp/threadhelpbase.hxx>
44 #include <general.h>
45 #include <stdtypes.h>
47 //_________________________________________________________________________________________________________________
48 // interface includes
49 //_________________________________________________________________________________________________________________
50 #include <com/sun/star/lang/XTypeProvider.hpp>
51 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
52 #include <com/sun/star/frame/XDispatch.hpp>
53 #include <com/sun/star/frame/XDispatchProvider.hpp>
54 #include <com/sun/star/util/URL.hpp>
55 #include <com/sun/star/beans/PropertyValue.hpp>
56 #include <com/sun/star/frame/XStatusListener.hpp>
58 //_________________________________________________________________________________________________________________
59 // other includes
60 //_________________________________________________________________________________________________________________
61 #include <cppuhelper/weak.hxx>
63 //_________________________________________________________________________________________________________________
64 // namespace
65 //_________________________________________________________________________________________________________________
67 namespace framework{
69 //_________________________________________________________________________________________________________________
70 // exported const
71 //_________________________________________________________________________________________________________________
73 //_________________________________________________________________________________________________________________
74 // exported definitions
75 //_________________________________________________________________________________________________________________
77 /**
78 @short protocol handler for "service:*" URLs
79 @descr It's a special dispatch/provider object which is registered for such URL pattern and will
80 be automaticly used by the framework dispatch mechanism if such URL occured.
81 His job is to create any registered uno components which must be coded inside
82 dispatched URL (may with some optional given parameters). After that such created
83 service must be hold his self alive. Such mechanism can be usefull for UI components
84 (e.g. Dialogs, Wizards) only.
86 @base ThreadHelpBase
87 exports a lock member to guarantee right initialize value of it
88 @base OWeakObject
89 provides XWeak and ref count mechanism
91 @devstatus ready to use
93 @modified 02.05.2002 08:13, as96863
95 class ServiceHandler : // interfaces
96 public css::lang::XTypeProvider ,
97 public css::lang::XServiceInfo ,
98 public css::frame::XDispatchProvider ,
99 public css::frame::XNotifyingDispatch, // => XDispatch
100 // baseclasses
101 // Order is neccessary for right initialization!
102 private ThreadHelpBase ,
103 public cppu::OWeakObject
105 /* member */
106 private:
108 /// reference to global uno service manager which had created us
109 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
111 /* interface */
112 public:
114 // ctor/dtor
115 ServiceHandler( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
116 virtual ~ServiceHandler( );
118 // XInterface, XTypeProvider, XServiceInfo
119 FWK_DECLARE_XINTERFACE
120 FWK_DECLARE_XTYPEPROVIDER
121 DECLARE_XSERVICEINFO
123 // XDispatchProvider
124 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,
125 const ::rtl::OUString& sTarget ,
126 sal_Int32 nFlags ) throw( css::uno::RuntimeException );
127 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) throw( css::uno::RuntimeException );
129 // XNotifyingDispatch
130 virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL ,
131 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
132 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) throw( css::uno::RuntimeException );
134 // XDispatch
135 virtual void SAL_CALL dispatch ( const css::util::URL& aURL ,
136 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException );
137 virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
138 const css::util::URL& aURL ) throw( css::uno::RuntimeException );
139 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
140 const css::util::URL& aURL ) throw( css::uno::RuntimeException );
142 /* internal */
143 private:
145 css::uno::Reference< css::uno::XInterface > implts_dispatch( const css::util::URL& aURL ,
146 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException );
148 }; // class ServiceHandler
150 } // namespace framework
152 #endif // #ifndef __FRAMEWORK_DISPATCH_SERVICEHANDLER_HXX_