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 <ucbhelper/content.hxx>
25 
26 namespace dp_manager {
27 
33  : public ::cppu::WeakImplHelper< css::ucb::XCommandEnvironment,
34  css::task::XInteractionHandler,
35  css::ucb::XProgressHandler >
36 {
37  css::uno::Reference< css::task::XInteractionHandler> m_forwardHandler;
38 protected:
39  void handle_(bool approve,
40  css::uno::Reference< css::task::XInteractionRequest> const & xRequest );
41 public:
42  virtual ~BaseCommandEnv() override;
44  explicit BaseCommandEnv(
45  css::uno::Reference< css::task::XInteractionHandler> const & handler);
46 
47  // XCommandEnvironment
48  virtual css::uno::Reference<css::task::XInteractionHandler > SAL_CALL
49  getInteractionHandler() override;
50  virtual css::uno::Reference<css::ucb::XProgressHandler >
51  SAL_CALL getProgressHandler() override;
52 
53  // XInteractionHandler
54  virtual void SAL_CALL handle(
55  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
56 
57  // XProgressHandler
58  virtual void SAL_CALL push( css::uno::Any const & Status ) override;
59  virtual void SAL_CALL update( css::uno::Any const & Status ) override;
60  virtual void SAL_CALL pop() override;
61 };
62 
64 {
65 public:
67  explicit TmpRepositoryCommandEnv(css::uno::Reference< css::task::XInteractionHandler> const & handler);
68 
69 // XInteractionHandler
70  virtual void SAL_CALL handle(
71  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
72 
73 };
74 
80 {
81 private:
82  OUString m_repository;
84 public:
86  css::uno::Reference< css::task::XInteractionHandler> const & handler,
87  bool bSuppressLicense,
88  OUString const & repository);
89 
90 // XInteractionHandler
91  virtual void SAL_CALL handle(
92  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
93 
94 };
95 
101 {
102 
103 public:
104  explicit NoLicenseCommandEnv(css::uno::Reference< css::task::XInteractionHandler> const & handler);
105 
106 // XInteractionHandler
107  virtual void SAL_CALL handle(
108  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
109 
110 };
111 
112 /* For use in XExtensionManager::addExtension in the call to
113  XPackage::checkPrerequisites
114  It prevents all user interactions. The license is always accepted.
115  It remembers if there was a platform or a dependency exception in
116  the member m_bException. if there was any other exception then m_bUnknownException
117  is set.
118 
119  */
121 {
122 public:
124  // XInteractionHandler
125  virtual void SAL_CALL handle(
126  css::uno::Reference<css::task::XInteractionRequest > const & xRequest ) override;
127 
128  // Set to true if a PlatformException or a DependencyException were handled.
129  css::uno::Any m_Exception;
130  // Set to true if an unknown exception was handled.
131  css::uno::Any m_UnknownException;
132 };
133 
134 }
135 
136 #endif
137 
138 /* 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)