LibreOffice Module desktop (master) 1
Public Member Functions | Private Member Functions | Static 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 (OString command, 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)
 

Static Private Member Functions

static bool handleMacroConfirmationRequest (const css::uno::Reference< css::task::XInteractionRequest > &xRequest)
 
static bool handleFilterOptionsRequest (const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest > &Request)
 

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 44 of file lokinteractionhandler.hxx.

Constructor & Destructor Documentation

◆ LOKInteractionHandler() [1/2]

LOKInteractionHandler::LOKInteractionHandler ( const LOKInteractionHandler )
privatedelete

◆ LOKInteractionHandler() [2/2]

LOKInteractionHandler::LOKInteractionHandler ( OString  command,
desktop::LibLibreOffice_Impl pLOKit,
desktop::LibLODocument_Impl pLOKDocumt = nullptr 
)
explicit

Definition at line 55 of file lokinteractionhandler.cxx.

References m_pLOKit.

◆ ~LOKInteractionHandler()

LOKInteractionHandler::~LOKInteractionHandler ( )
overridevirtual

Definition at line 67 of file lokinteractionhandler.cxx.

Member Function Documentation

◆ getImplementationName()

OUString SAL_CALL LOKInteractionHandler::getImplementationName ( )
overridevirtual

Definition at line 71 of file lokinteractionhandler.cxx.

◆ getSupportedServiceNames()

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

Definition at line 81 of file lokinteractionhandler.cxx.

◆ handle()

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

Definition at line 94 of file lokinteractionhandler.cxx.

References handleInteractionRequest().

◆ handleFilterOptionsRequest()

bool LOKInteractionHandler::handleFilterOptionsRequest ( const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest > &  Request)
staticprivate

Definition at line 353 of file lokinteractionhandler.cxx.

Referenced by handleInteractionRequest().

◆ handleInteractionRequest()

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

◆ handleIOException()

bool LOKInteractionHandler::handleIOException ( const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &  rContinuations,
const css::uno::Any &  rRequest 
)
private

◆ handleMacroConfirmationRequest()

bool LOKInteractionHandler::handleMacroConfirmationRequest ( const css::uno::Reference< css::task::XInteractionRequest > &  xRequest)
staticprivate

◆ handleNetworkException()

bool LOKInteractionHandler::handleNetworkException ( const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &  rContinuations,
const css::uno::Any &  rRequest 
)
private

◆ handlePasswordRequest()

bool LOKInteractionHandler::handlePasswordRequest ( const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &  rContinuations,
const css::uno::Any &  rRequest 
)
private

◆ initialize()

void SAL_CALL LOKInteractionHandler::initialize ( com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &  rArguments)
overridevirtual

Definition at line 90 of file lokinteractionhandler.cxx.

◆ operator=()

LOKInteractionHandler & LOKInteractionHandler::operator= ( const LOKInteractionHandler )
privatedelete

◆ postError()

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 101 of file lokinteractionhandler.cxx.

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

Referenced by handleIOException(), and handleNetworkException().

◆ SetPassword()

void LOKInteractionHandler::SetPassword ( char const *  pPassword)

Definition at line 398 of file lokinteractionhandler.cxx.

References m_havePassword, m_Password, and m_usePassword.

◆ supportsService()

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

Definition at line 76 of file lokinteractionhandler.cxx.

References cppu::supportsService().

Member Data Documentation

◆ m_command

OString LOKInteractionHandler::m_command
private

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

Definition at line 53 of file lokinteractionhandler.hxx.

Referenced by postError().

◆ m_havePassword

osl::Condition LOKInteractionHandler::m_havePassword
private

Definition at line 57 of file lokinteractionhandler.hxx.

Referenced by handlePasswordRequest(), and SetPassword().

◆ m_Password

OUString LOKInteractionHandler::m_Password
private

Definition at line 55 of file lokinteractionhandler.hxx.

Referenced by handlePasswordRequest(), and SetPassword().

◆ m_pLOKDocument

desktop::LibLODocument_Impl* LOKInteractionHandler::m_pLOKDocument
private

Definition at line 50 of file lokinteractionhandler.hxx.

Referenced by postError().

◆ m_pLOKit

desktop::LibLibreOffice_Impl* LOKInteractionHandler::m_pLOKit
private

◆ m_usePassword

bool LOKInteractionHandler::m_usePassword
private

Definition at line 56 of file lokinteractionhandler.hxx.

Referenced by handlePasswordRequest(), and SetPassword().


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