LibreOffice Module desktop (master)  1
dp_commandenvironments.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 #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_MANAGER_DP_COMMANDENVIRONMENTS_HXX
21 #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_MANAGER_DP_COMMANDENVIRONMENTS_HXX
22 
23 #include <cppuhelper/implbase.hxx>
24 #include <com/sun/star/task/XInteractionHandler.hpp>
25 #include <com/sun/star/task/XInteractionRequest.hpp>
26 #include <com/sun/star/ucb/XProgressHandler.hpp>
27 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
28 
29 
30 namespace dp_manager {
31 
37  : public ::cppu::WeakImplHelper< css::ucb::XCommandEnvironment,
38  css::task::XInteractionHandler,
39  css::ucb::XProgressHandler >
40 {
41  css::uno::Reference< css::task::XInteractionHandler> m_forwardHandler;
42 protected:
43  void handle_(bool approve,
44  css::uno::Reference< css::task::XInteractionRequest> const & xRequest );
45 public:
46  virtual ~BaseCommandEnv() override;
48  explicit BaseCommandEnv(
49  css::uno::Reference< css::task::XInteractionHandler> const & handler);
50 
51  // XCommandEnvironment
52  virtual css::uno::Reference<css::task::XInteractionHandler > SAL_CALL
53  getInteractionHandler() override;
54  virtual css::uno::Reference<css::ucb::XProgressHandler >
55  SAL_CALL getProgressHandler() override;
56 
57  // XInteractionHandler
58  virtual void SAL_CALL handle(
59  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
60 
61  // XProgressHandler
62  virtual void SAL_CALL push( css::uno::Any const & Status ) override;
63  virtual void SAL_CALL update( css::uno::Any const & Status ) override;
64  virtual void SAL_CALL pop() override;
65 };
66 
68 {
69 public:
71  explicit TmpRepositoryCommandEnv(css::uno::Reference< css::task::XInteractionHandler> const & handler);
72 
73 // XInteractionHandler
74  virtual void SAL_CALL handle(
75  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
76 
77 };
78 
84 {
85 private:
86  OUString m_repository;
88 public:
90  css::uno::Reference< css::task::XInteractionHandler> const & handler,
91  bool bSuppressLicense,
92  OUString const & repository);
93 
94 // XInteractionHandler
95  virtual void SAL_CALL handle(
96  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
97 
98 };
99 
105 {
106 
107 public:
108  explicit NoLicenseCommandEnv(css::uno::Reference< css::task::XInteractionHandler> const & handler);
109 
110 // XInteractionHandler
111  virtual void SAL_CALL handle(
112  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
113 
114 };
115 
116 /* For use in XExtensionManager::addExtension in the call to
117  XPackage::checkPrerequisites
118  It prevents all user interactions. The license is always accepted.
119  It remembers if there was a platform or a dependency exception in
120  the member m_bException. if there was any other exception then m_bUnknownException
121  is set.
122 
123  */
125 {
126 public:
128  // XInteractionHandler
129  virtual void SAL_CALL handle(
130  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
131 
132  // Set to true if a PlatformException or a DependencyException were handled.
133  css::uno::Any m_Exception;
134  // Set to true if an unknown exception was handled.
135  css::uno::Any m_UnknownException;
136 };
137 
138 }
139 
140 #endif
141 
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
LicenseCommandEnv(css::uno::Reference< css::task::XInteractionHandler > const &handler, bool bSuppressLicense, OUString const &repository)
virtual void SAL_CALL handle(css::uno::Reference< css::task::XInteractionRequest > const &xRequest) override
This command environment is to be used when an extension is temporarily stored in the "tmp" repositor...
virtual void SAL_CALL update(css::uno::Any const &Status) override
void handle_(bool approve, css::uno::Reference< css::task::XInteractionRequest > const &xRequest)
virtual css::uno::Reference< css::ucb::XProgressHandler > SAL_CALL getProgressHandler() override
virtual void SAL_CALL push(css::uno::Any const &Status) override
virtual void SAL_CALL handle(css::uno::Reference< css::task::XInteractionRequest > const &xRequest) override
virtual void SAL_CALL pop() override
this class is for use in XPackageManager::checkPrerequisites
css::uno::Reference< css::task::XInteractionHandler > m_forwardHandler
virtual void SAL_CALL handle(css::uno::Reference< css::task::XInteractionRequest > const &xRequest) override
virtual void SAL_CALL handle(css::uno::Reference< css::task::XInteractionRequest > const &xRequest) override
virtual void SAL_CALL handle(css::uno::Reference< css::task::XInteractionRequest > const &xRequest) override
virtual css::uno::Reference< css::task::XInteractionHandler > SAL_CALL getInteractionHandler() override
this class is for use in XPackageManager::synchronize.
NoLicenseCommandEnv(css::uno::Reference< css::task::XInteractionHandler > const &handler)