Update ooo320-m1
[ooovba.git] / framework / inc / dispatch / mailtodispatcher.hxx
blob77c9290b24b1d9506688f268f5cd1b44444f8e4a
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: mailtodispatcher.hxx,v $
10 * $Revision: 1.6 $
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_MAILTODISPATCHER_HXX_
32 #define __FRAMEWORK_DISPATCH_MAILTODISPATCHER_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 "mailto:" URLs
79 @descr It's a special dispatch object which is used registered for "mailto:*" URLs and
80 will be automaticly used from the framework dispatch mechanism if such URL occured.
82 @base ThreadHelpBase
83 exports a lock member to guarantee right initialize value of it
84 @base OWeakObject
85 provides XWeak and ref count mechanism
87 @devstatus ready to use
89 @modified 02.05.2002 08:12, as96863
91 class MailToDispatcher : // interfaces
92 public css::lang::XTypeProvider ,
93 public css::lang::XServiceInfo ,
94 public css::frame::XDispatchProvider ,
95 public css::frame::XNotifyingDispatch, // => XDispatch
96 // baseclasses
97 // Order is neccessary for right initialization!
98 private ThreadHelpBase ,
99 public cppu::OWeakObject
101 /* member */
102 private:
104 /// reference to global uno service manager which had created us
105 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
107 /* interface */
108 public:
110 // ctor/dtor
111 MailToDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
112 virtual ~MailToDispatcher( );
114 // XInterface, XTypeProvider, XServiceInfo
115 FWK_DECLARE_XINTERFACE
116 FWK_DECLARE_XTYPEPROVIDER
117 DECLARE_XSERVICEINFO
119 // XDispatchProvider
120 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,
121 const ::rtl::OUString& sTarget ,
122 sal_Int32 nFlags ) throw( css::uno::RuntimeException );
123 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 );
125 // XNotifyingDispatch
126 virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL ,
127 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
128 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) throw( css::uno::RuntimeException );
130 // XDispatch
131 virtual void SAL_CALL dispatch ( const css::util::URL& aURL ,
132 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException );
133 virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
134 const css::util::URL& aURL ) throw( css::uno::RuntimeException );
135 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
136 const css::util::URL& aURL ) throw( css::uno::RuntimeException );
138 /* internal */
139 private:
141 sal_Bool implts_dispatch( const css::util::URL& aURL ,
142 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException );
144 }; // class MailToDispatcher
146 } // namespace framework
148 #endif // #ifndef __FRAMEWORK_DISPATCH_MAILTODISPATCHER_HXX_