1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef __FRAMEWORK_DISPATCH_MAILTODISPATCHER_HXX_ 29 #define __FRAMEWORK_DISPATCH_MAILTODISPATCHER_HXX_ 30 31 //_________________________________________________________________________________________________________________ 32 // my own includes 33 //_________________________________________________________________________________________________________________ 34 35 #include <macros/generic.hxx> 36 #include <macros/xinterface.hxx> 37 #include <macros/xtypeprovider.hxx> 38 #include <macros/xserviceinfo.hxx> 39 #include <macros/debug.hxx> 40 #include <threadhelp/threadhelpbase.hxx> 41 #include <general.h> 42 #include <stdtypes.h> 43 44 //_________________________________________________________________________________________________________________ 45 // interface includes 46 //_________________________________________________________________________________________________________________ 47 #include <com/sun/star/lang/XTypeProvider.hpp> 48 #include <com/sun/star/frame/XNotifyingDispatch.hpp> 49 #include <com/sun/star/frame/XDispatch.hpp> 50 #include <com/sun/star/frame/XDispatchProvider.hpp> 51 #include <com/sun/star/util/URL.hpp> 52 #include <com/sun/star/beans/PropertyValue.hpp> 53 #include <com/sun/star/frame/XStatusListener.hpp> 54 55 //_________________________________________________________________________________________________________________ 56 // other includes 57 //_________________________________________________________________________________________________________________ 58 #include <cppuhelper/weak.hxx> 59 60 //_________________________________________________________________________________________________________________ 61 // namespace 62 //_________________________________________________________________________________________________________________ 63 64 namespace framework{ 65 66 //_________________________________________________________________________________________________________________ 67 // exported const 68 //_________________________________________________________________________________________________________________ 69 70 //_________________________________________________________________________________________________________________ 71 // exported definitions 72 //_________________________________________________________________________________________________________________ 73 74 /** 75 @short protocol handler for "mailto:" URLs 76 @descr It's a special dispatch object which is used registered for "mailto:*" URLs and 77 will be automaticly used from the framework dispatch mechanism if such URL occured. 78 79 @base ThreadHelpBase 80 exports a lock member to guarantee right initialize value of it 81 @base OWeakObject 82 provides XWeak and ref count mechanism 83 84 @devstatus ready to use 85 86 @modified 02.05.2002 08:12, as96863 87 */ 88 class MailToDispatcher : // interfaces 89 public css::lang::XTypeProvider , 90 public css::lang::XServiceInfo , 91 public css::frame::XDispatchProvider , 92 public css::frame::XNotifyingDispatch, // => XDispatch 93 // baseclasses 94 // Order is neccessary for right initialization! 95 private ThreadHelpBase , 96 public cppu::OWeakObject 97 { 98 /* member */ 99 private: 100 101 /// reference to global uno service manager which had created us 102 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; 103 104 /* interface */ 105 public: 106 107 // ctor/dtor 108 MailToDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); 109 virtual ~MailToDispatcher( ); 110 111 // XInterface, XTypeProvider, XServiceInfo 112 FWK_DECLARE_XINTERFACE 113 FWK_DECLARE_XTYPEPROVIDER 114 DECLARE_XSERVICEINFO 115 116 // XDispatchProvider 117 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL , 118 const ::rtl::OUString& sTarget , 119 sal_Int32 nFlags ) throw( css::uno::RuntimeException ); 120 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 ); 121 122 // XNotifyingDispatch 123 virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL , 124 const css::uno::Sequence< css::beans::PropertyValue >& lArguments, 125 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) throw( css::uno::RuntimeException ); 126 127 // XDispatch 128 virtual void SAL_CALL dispatch ( const css::util::URL& aURL , 129 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException ); 130 virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xListener , 131 const css::util::URL& aURL ) throw( css::uno::RuntimeException ); 132 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener , 133 const css::util::URL& aURL ) throw( css::uno::RuntimeException ); 134 135 /* internal */ 136 private: 137 138 sal_Bool implts_dispatch( const css::util::URL& aURL , 139 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException ); 140 141 }; // class MailToDispatcher 142 143 } // namespace framework 144 145 #endif // #ifndef __FRAMEWORK_DISPATCH_MAILTODISPATCHER_HXX_ 146