LibreOffice Module desktop (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LOKInteractionHandler Class Reference

InteractionHandler is an interface that provides the user with various dialogs / error messages. More...

#include <lokinteractionhandler.hxx>

Inheritance diagram for LOKInteractionHandler:
[legend]
Collaboration diagram for LOKInteractionHandler:
[legend]

Public Member Functions

void SetPassword (char const *pPassword)
 
 LOKInteractionHandler (const OString &rCommand, desktop::LibLibreOffice_Impl *, desktop::LibLODocument_Impl *pLOKDocumt=nullptr)
 
virtual ~LOKInteractionHandler () override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (OUString const &rServiceName) override
 
virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL initialize (com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &rArguments) override
 
virtual void SAL_CALL handle (com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest > const &rRequest) override
 
virtual sal_Bool SAL_CALL handleInteractionRequest (const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest > &Request) override
 

Private Member Functions

 LOKInteractionHandler (const LOKInteractionHandler &)=delete
 
LOKInteractionHandleroperator= (const LOKInteractionHandler &)=delete
 
void postError (css::task::InteractionClassification classif, const char *kind, ErrCode code, const OUString &message)
 Call the LOK_CALLBACK_ERROR on the LOK document (if available) or LOK lib. More...
 
bool handleIOException (const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation >> &rContinuations, const css::uno::Any &rRequest)
 
bool handleNetworkException (const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation >> &rContinuations, const css::uno::Any &rRequest)
 
bool handlePasswordRequest (const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation >> &rContinuations, const css::uno::Any &rRequest)
 

Private Attributes

desktop::LibLibreOffice_Implm_pLOKit
 
desktop::LibLODocument_Implm_pLOKDocument
 
OString m_command
 Command for which we use this interaction handler (like "load", "save", "saveas", ...) More...
 
OUString m_Password
 
bool m_usePassword
 
osl::Condition m_havePassword
 

Detailed Description

InteractionHandler is an interface that provides the user with various dialogs / error messages.

We need an own implementation for the LibreOfficeKit so that we can route the information easily via callbacks.

TODO: the callbacks are not implemented yet, we just approve any interaction that we get.

Definition at line 46 of file lokinteractionhandler.hxx.

Constructor & Destructor Documentation

LOKInteractionHandler::LOKInteractionHandler ( const LOKInteractionHandler )
privatedelete
LOKInteractionHandler::LOKInteractionHandler ( const OString &  rCommand,
desktop::LibLibreOffice_Impl pLOKit,
desktop::LibLODocument_Impl pLOKDocumt = nullptr 
)
explicit

Definition at line 49 of file lokinteractionhandler.cxx.

References m_pLOKit.

LOKInteractionHandler::~LOKInteractionHandler ( )
overridevirtual

Definition at line 61 of file lokinteractionhandler.cxx.

Member Function Documentation

OUString SAL_CALL LOKInteractionHandler::getImplementationName ( )
overridevirtual

Definition at line 65 of file lokinteractionhandler.cxx.

uno::Sequence< OUString > SAL_CALL LOKInteractionHandler::getSupportedServiceNames ( )
overridevirtual

Definition at line 75 of file lokinteractionhandler.cxx.

void SAL_CALL LOKInteractionHandler::handle ( com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest > const &  rRequest)
overridevirtual

Definition at line 88 of file lokinteractionhandler.cxx.

References handleInteractionRequest().

sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest ( const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest > &  Request)
overridevirtual

Definition at line 330 of file lokinteractionhandler.cxx.

References handleIOException(), handleNetworkException(), and handlePasswordRequest().

Referenced by handle().

bool LOKInteractionHandler::handleIOException ( const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation >> &  rContinuations,
const css::uno::Any &  rRequest 
)
private
bool LOKInteractionHandler::handleNetworkException ( const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation >> &  rContinuations,
const css::uno::Any &  rRequest 
)
private
bool LOKInteractionHandler::handlePasswordRequest ( const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation >> &  rContinuations,
const css::uno::Any &  rRequest 
)
private
void SAL_CALL LOKInteractionHandler::initialize ( com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &  rArguments)
overridevirtual

Definition at line 84 of file lokinteractionhandler.cxx.

LOKInteractionHandler& LOKInteractionHandler::operator= ( const LOKInteractionHandler )
privatedelete
void LOKInteractionHandler::postError ( css::task::InteractionClassification  classif,
const char *  kind,
ErrCode  code,
const OUString &  message 
)
private

Call the LOK_CALLBACK_ERROR on the LOK document (if available) or LOK lib.

The error itself is a JSON message, like: { "classification": "error" | "warning" | "info" "kind": "network" etc. "code": 403 | 404 | ... "message": freeform description }

Definition at line 95 of file lokinteractionhandler.cxx.

References SfxViewShell::Current(), SfxLokHelper::getView(), m_command, m_pLOKDocument, m_pLOKit, desktop::LibLibreOffice_Impl::mpCallback, desktop::LibLibreOffice_Impl::mpCallbackData, and desktop::LibLODocument_Impl::mpCallbackFlushHandlers.

Referenced by handleIOException(), and handleNetworkException().

void LOKInteractionHandler::SetPassword ( char const *  pPassword)

Definition at line 351 of file lokinteractionhandler.cxx.

References m_havePassword, m_Password, and m_usePassword.

sal_Bool SAL_CALL LOKInteractionHandler::supportsService ( OUString const &  rServiceName)
overridevirtual

Definition at line 70 of file lokinteractionhandler.cxx.

References cppu::supportsService().

Member Data Documentation

OString LOKInteractionHandler::m_command
private

Command for which we use this interaction handler (like "load", "save", "saveas", ...)

Definition at line 55 of file lokinteractionhandler.hxx.

Referenced by postError().

osl::Condition LOKInteractionHandler::m_havePassword
private

Definition at line 59 of file lokinteractionhandler.hxx.

Referenced by handlePasswordRequest(), and SetPassword().

OUString LOKInteractionHandler::m_Password
private

Definition at line 57 of file lokinteractionhandler.hxx.

Referenced by handlePasswordRequest(), and SetPassword().

desktop::LibLODocument_Impl* LOKInteractionHandler::m_pLOKDocument
private

Definition at line 52 of file lokinteractionhandler.hxx.

Referenced by postError().

desktop::LibLibreOffice_Impl* LOKInteractionHandler::m_pLOKit
private
bool LOKInteractionHandler::m_usePassword
private

Definition at line 58 of file lokinteractionhandler.hxx.

Referenced by handlePasswordRequest(), and SetPassword().


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