LibreOffice Module framework (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
framework::MailToDispatcher Class Referencefinal

protocol handler for "mailto:" URLs @descr It's a special dispatch object which is used registered for "mailto:*" URLs and will be automatically used from the framework dispatch mechanism if such URL occurred. More...

#include <mailtodispatcher.hxx>

Inheritance diagram for framework::MailToDispatcher:
[legend]
Collaboration diagram for framework::MailToDispatcher:
[legend]

Public Member Functions

 MailToDispatcher (css::uno::Reference< css::uno::XComponentContext > xContext)
 standard ctor @descr This initializes a new instance of this class with needed information for work. More...
 
virtual ~MailToDispatcher () override
 standard dtor More...
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &sServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch (const css::util::URL &aURL, const OUString &sTarget, sal_Int32 nFlags) override
 decide if this dispatch implementation can be used for requested URL or not @descr A protocol handler is registered for a URL pattern inside configuration and will be asked by the generic dispatch mechanism inside framework, if he can handle this special URL which match his registration. More...
 
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches (const css::uno::Sequence< css::frame::DispatchDescriptor > &lDescriptor) override
 do the same like dispatch() but for multiple requests at the same time More...
 
virtual void SAL_CALL dispatchWithNotification (const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments, const css::uno::Reference< css::frame::XDispatchResultListener > &xListener) override
 dispatch with guaranteed notifications about success @descr We use threadsafe internal method to do so. More...
 
virtual void SAL_CALL dispatch (const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments) override
 dispatch URL with arguments @descr We use threadsafe internal method to do so. More...
 
virtual void SAL_CALL addStatusListener (const css::uno::Reference< css::frame::XStatusListener > &xListener, const css::util::URL &aURL) override
 add/remove listener for state events @descr Because we use an external process to forward such mail URLs, and this process doesn't return any notifications about success or failed state - we don't support such status listener. More...
 
virtual void SAL_CALL removeStatusListener (const css::uno::Reference< css::frame::XStatusListener > &xListener, const css::util::URL &aURL) override
 

Private Member Functions

bool implts_dispatch (const css::util::URL &aURL)
 threadsafe helper for dispatch calls @descr We support two interfaces for the same process - dispatch URLs. More...
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 reference to global uno service manager which had created us More...
 

Detailed Description

protocol handler for "mailto:" URLs @descr It's a special dispatch object which is used registered for "mailto:*" URLs and will be automatically used from the framework dispatch mechanism if such URL occurred.

@base OWeakObject provides XWeak and ref count mechanism

@devstatus ready to use

Definition at line 45 of file mailtodispatcher.hxx.

Constructor & Destructor Documentation

◆ MailToDispatcher()

framework::MailToDispatcher::MailToDispatcher ( css::uno::Reference< css::uno::XComponentContext >  xContext)

standard ctor @descr This initializes a new instance of this class with needed information for work.

Parameters
rxContextreference to uno servicemanager for creation of new services

Definition at line 58 of file mailtodispatcher.cxx.

◆ ~MailToDispatcher()

framework::MailToDispatcher::~MailToDispatcher ( )
overridevirtual

standard dtor

Definition at line 66 of file mailtodispatcher.cxx.

Member Function Documentation

◆ addStatusListener()

void SAL_CALL framework::MailToDispatcher::addStatusListener ( const css::uno::Reference< css::frame::XStatusListener > &  xListener,
const css::util::URL &  aURL 
)
overridevirtual

add/remove listener for state events @descr Because we use an external process to forward such mail URLs, and this process doesn't return any notifications about success or failed state - we don't support such status listener.

We have no status to send.

Parameters
xListenerreference to a valid listener for state events
aURLURL about listener will be informed, if something occurred

Definition at line 212 of file mailtodispatcher.cxx.

◆ dispatch()

void SAL_CALL framework::MailToDispatcher::dispatch ( const css::util::URL &  aURL,
const css::uno::Sequence< css::beans::PropertyValue > &  lArguments 
)
overridevirtual

dispatch URL with arguments @descr We use threadsafe internal method to do so.

It returns a state value - but we ignore it. Because we don't support status listener notifications here. Status events are not guaranteed - and we call another service internally which doesn't return any notifications too.

Parameters
aURLmail URL which should be executed
lArgumentslist of optional arguments for this mail request

Definition at line 118 of file mailtodispatcher.cxx.

References aURL, and implts_dispatch().

◆ dispatchWithNotification()

void SAL_CALL framework::MailToDispatcher::dispatchWithNotification ( const css::util::URL &  aURL,
const css::uno::Sequence< css::beans::PropertyValue > &  lArguments,
const css::uno::Reference< css::frame::XDispatchResultListener > &  xListener 
)
overridevirtual

dispatch with guaranteed notifications about success @descr We use threadsafe internal method to do so.

Return state of this function will be used for notification if an optional listener is given.

Parameters
aURLmail URL which should be executed
lArgumentslist of optional arguments for this mail request
xListenerreference to a valid listener for state events

Definition at line 140 of file mailtodispatcher.cxx.

References aEvent, aURL, and implts_dispatch().

◆ getImplementationName()

OUString SAL_CALL framework::MailToDispatcher::getImplementationName ( )
overridevirtual

Definition at line 35 of file mailtodispatcher.cxx.

◆ getSupportedServiceNames()

css::uno::Sequence< OUString > SAL_CALL framework::MailToDispatcher::getSupportedServiceNames ( )
overridevirtual

Definition at line 45 of file mailtodispatcher.cxx.

References framework::SERVICENAME_PROTOCOLHANDLER.

◆ implts_dispatch()

bool framework::MailToDispatcher::implts_dispatch ( const css::util::URL &  aURL)
private

threadsafe helper for dispatch calls @descr We support two interfaces for the same process - dispatch URLs.

Exceptions
css::uno::RuntimeException

That the reason for this internal function. It implements the real dispatch operation and returns a state value which inform caller about success. He can notify listener then by using this return value.

Parameters
aURLmail URL which should be executed
Returns
<TRUE> if dispatch could be started successfully Note: Our internal used shell executor doesn't return any state value - so we must believe that call was successful. <FALSE> if necessary resource couldn't be created or an exception was thrown.

Definition at line 177 of file mailtodispatcher.cxx.

References aURL, and m_xContext.

Referenced by dispatch(), and dispatchWithNotification().

◆ queryDispatch()

css::uno::Reference< css::frame::XDispatch > SAL_CALL framework::MailToDispatcher::queryDispatch ( const css::util::URL &  aURL,
const OUString &  sTarget,
sal_Int32  nFlags 
)
overridevirtual

decide if this dispatch implementation can be used for requested URL or not @descr A protocol handler is registered for a URL pattern inside configuration and will be asked by the generic dispatch mechanism inside framework, if he can handle this special URL which match his registration.

He can agree by returning of a valid dispatch instance or disagree by returning <NULL>. We don't create new dispatch instances here really - we return THIS as result to handle it at the same implementation.

Definition at line 79 of file mailtodispatcher.cxx.

References aURL.

Referenced by queryDispatches().

◆ queryDispatches()

css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL framework::MailToDispatcher::queryDispatches ( const css::uno::Sequence< css::frame::DispatchDescriptor > &  lDescriptor)
overridevirtual

do the same like dispatch() but for multiple requests at the same time

Definition at line 92 of file mailtodispatcher.cxx.

References i, nCount, and queryDispatch().

◆ removeStatusListener()

void SAL_CALL framework::MailToDispatcher::removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener > &  xListener,
const css::util::URL &  aURL 
)
overridevirtual

Definition at line 218 of file mailtodispatcher.cxx.

◆ supportsService()

sal_Bool SAL_CALL framework::MailToDispatcher::supportsService ( const OUString &  sServiceName)
overridevirtual

Definition at line 40 of file mailtodispatcher.cxx.

References sServiceName, and cppu::supportsService().

Member Data Documentation

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > framework::MailToDispatcher::m_xContext
private

reference to global uno service manager which had created us

Definition at line 54 of file mailtodispatcher.hxx.

Referenced by implts_dispatch().


The documentation for this class was generated from the following files: