1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_EXTENSIONCMDQUEUE_HXX
21 #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_EXTENSIONCMDQUEUE_HXX
23 #include <sal/config.h>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <rtl/ref.hxx>
30 #include "dp_gui_updatedata.hxx"
34 namespace com
{ namespace sun
{ namespace star
{
35 namespace task
{ class XInteractionRequest
; }
36 namespace uno
{ class XComponentContext
; }
42 class TheExtensionManager
;
45 Manages installing of extensions in the GUI mode. Requests for installing
46 Extensions can be asynchronous. For example, the Extension Manager is running
47 in an office process and someone uses the system integration to install an Extension.
48 That is, the user double clicks an extension symbol in a file browser, which then
49 causes an invocation of "unopkg gui ext". When at that time the Extension Manager
50 already performs a task, triggered by the user (for example, add, update, disable,
51 enable) then adding of the extension will be postponed until the user has finished
54 This class also ensures that the extensions are not installed in the main thread.
55 Doing so would cause a deadlock because of the progress bar which needs to be constantly
58 class ExtensionCmdQueue
{
64 ExtensionCmdQueue( DialogHelper
* pDialogHelper
,
65 TheExtensionManager
*pManager
,
66 const css::uno::Reference
< css::uno::XComponentContext
> & rContext
);
70 void addExtension( const OUString
&rExtensionURL
,
71 const OUString
&rRepository
,
72 const bool bWarnUser
);
73 void removeExtension( const css::uno::Reference
< css::deployment::XPackage
> &rPackage
);
74 void enableExtension( const css::uno::Reference
< css::deployment::XPackage
> &rPackage
,
76 void checkForUpdates(const std::vector
< css::uno::Reference
<
77 css::deployment::XPackage
> > &vList
);
78 void acceptLicense( const css::uno::Reference
< css::deployment::XPackage
> &rPackage
);
79 static void syncRepositories( const css::uno::Reference
< css::uno::XComponentContext
> & xContext
);
81 This call does not block. It signals the internal thread
82 that it should install the remaining extensions and then terminate.
88 ExtensionCmdQueue(ExtensionCmdQueue
const &) = delete;
89 ExtensionCmdQueue
& operator =(ExtensionCmdQueue
const &) = delete;
93 rtl::Reference
< Thread
> m_thread
;
96 void handleInteractionRequest( const css::uno::Reference
< css::uno::XComponentContext
> & xContext
,
97 const css::uno::Reference
< css::task::XInteractionRequest
> & xRequest
);
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */