1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dp_gui_extensioncmdqueue.hxx,v $
11 * $Revision: 1.3.14.1 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef INCLUDED_DP_GUI_EXTENSIONCMDQUEUE_HXX
33 #define INCLUDED_DP_GUI_EXTENSIONCMDQUEUE_HXX
35 #include "sal/config.h"
37 #include "com/sun/star/uno/Reference.hxx"
38 #include "rtl/ref.hxx"
42 #include "dp_gui_updatedata.hxx"
46 namespace com
{ namespace sun
{ namespace star
{
47 namespace deployment
{ class XPackageManager
; }
48 namespace task
{ class XInteractionRequest
; }
49 namespace uno
{ class XComponentContext
; }
55 class TheExtensionManager
;
58 Manages installing of extensions in the GUI mode. Requests for installing
59 Extensions can be asynchronous. For example, the Extension Manager is running
60 in an office process and someone uses the system integration to install an Extension.
61 That is, the user double clicks an extension symbol in a file browser, which then
62 causes an invocation of "unopkg gui ext". When at that time the Extension Manager
63 already performs a task, triggered by the user (for example, add, update, disable,
64 enable) then adding of the extension will be postponed until the user has finished
67 This class also ensures that the extensions are not installed in the main thread.
68 Doing so would cause a deadlock because of the progress bar which needs to be constantly
71 class ExtensionCmdQueue
{
77 ExtensionCmdQueue( DialogHelper
* pDialogHelper
,
78 TheExtensionManager
*pManager
,
79 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> & rContext
);
85 void addExtension( const ::com::sun::star::uno::Reference
< ::com::sun::star::deployment::XPackageManager
> &rPackageManager
,
86 const ::rtl::OUString
&rExtensionURL
,
87 const bool bWarnUser
);
88 void removeExtension( const ::com::sun::star::uno::Reference
< ::com::sun::star::deployment::XPackageManager
> &rPackageManager
,
89 const ::com::sun::star::uno::Reference
< ::com::sun::star::deployment::XPackage
> &rPackage
);
90 void enableExtension( const ::com::sun::star::uno::Reference
< ::com::sun::star::deployment::XPackage
> &rPackage
,
92 void checkForUpdates( const std::vector
< TUpdateListEntry
> &vList
);
94 This call does not block. It signals the internal thread
95 that it should install the remaining extensions and then terminate.
99 /** Determines if thread of this class has terminated.
101 bool hasTerminated();
103 /** Blocks until the thread has terminated. All URLs in the queue will be processed.
109 ExtensionCmdQueue(ExtensionCmdQueue
&); // not defined
110 void operator =(ExtensionCmdQueue
&); // not defined
114 rtl::Reference
< Thread
> m_thread
;
117 void handleInteractionRequest( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> & xContext
,
118 const ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionRequest
> & xRequest
);