LibreOffice Module desktop (master) 1
lokinteractionhandler.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <osl/conditn.hxx>
25
26#include <com/sun/star/lang/XInitialization.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
28#include <com/sun/star/task/InteractionClassification.hpp>
29#include <com/sun/star/task/XInteractionHandler2.hpp>
30
31namespace desktop {
32 struct LibLibreOffice_Impl;
33 struct LibLODocument_Impl;
34}
35
44class LOKInteractionHandler: public cppu::WeakImplHelper<com::sun::star::lang::XServiceInfo,
45 com::sun::star::lang::XInitialization,
46 com::sun::star::task::XInteractionHandler2>
47{
48private:
51
53 OString m_command;
54
55 OUString m_Password;
57 osl::Condition m_havePassword;
58
61
72 void postError(css::task::InteractionClassification classif, const char* kind, ErrCode code, const OUString &message);
73
74 bool handleIOException(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
75 bool handleNetworkException(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
76 bool handlePasswordRequest(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
77 static bool handleMacroConfirmationRequest(const css::uno::Reference<css::task::XInteractionRequest>& xRequest);
78
79 static bool handleFilterOptionsRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& Request);
80
81public:
82 void SetPassword(char const* pPassword);
83
84 explicit LOKInteractionHandler(
85 OString command,
87 desktop::LibLODocument_Impl *pLOKDocumt = nullptr);
88
89 virtual ~LOKInteractionHandler() override;
90
91 virtual OUString SAL_CALL getImplementationName() override;
92
93 virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) override;
94
96
97 virtual void SAL_CALL initialize(com::sun::star::uno::Sequence<com::sun::star::uno::Any > const & rArguments) override;
98
99 virtual void SAL_CALL handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const & rRequest) override;
100
101 virtual sal_Bool SAL_CALL handleInteractionRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& Request) override;
102};
103
104/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
InteractionHandler is an interface that provides the user with various dialogs / error messages.
bool handleIOException(const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &rContinuations, const css::uno::Any &rRequest)
desktop::LibLODocument_Impl * m_pLOKDocument
desktop::LibLibreOffice_Impl * m_pLOKit
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.
virtual ~LOKInteractionHandler() override
LOKInteractionHandler(const LOKInteractionHandler &)=delete
virtual OUString SAL_CALL getImplementationName() override
virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SetPassword(char const *pPassword)
bool handleNetworkException(const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &rContinuations, const css::uno::Any &rRequest)
virtual sal_Bool SAL_CALL supportsService(OUString const &rServiceName) override
LOKInteractionHandler & operator=(const LOKInteractionHandler &)=delete
bool handlePasswordRequest(const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &rContinuations, const css::uno::Any &rRequest)
static bool handleFilterOptionsRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest > &Request)
virtual sal_Bool SAL_CALL handleInteractionRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest > &Request) override
OString m_command
Command for which we use this interaction handler (like "load", "save", "saveas", ....
virtual void SAL_CALL initialize(com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &rArguments) override
static bool handleMacroConfirmationRequest(const css::uno::Reference< css::task::XInteractionRequest > &xRequest)
virtual void SAL_CALL handle(com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest > const &rRequest) override
Definition: app.cxx:167
unsigned char sal_Bool