1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_INSTALLDIALOG_HXX
29 #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_INSTALLDIALOG_HXX
30 
31 #include "sal/config.h"
32 #ifndef _SV_BUTTON_HXX
33 #include "vcl/button.hxx"
34 #endif
35 #include "vcl/fixed.hxx"
36 #include "vcl/dialog.hxx"
37 #include "svtools/prgsbar.hxx"
38 #include "rtl/ref.hxx"
39 #include <vector>
40 
41 #include "dp_gui_autoscrolledit.hxx"
42 /// @HTML
43 
44 namespace com { namespace sun { namespace star { namespace deployment {
45     class XExtensionManager;
46 }}}}
47 namespace com { namespace sun { namespace star { namespace uno {
48     class XComponentContext;
49 }}}}
50 namespace com { namespace sun { namespace star { namespace xml { namespace dom {
51     class XNode;
52 }}}}}
53 namespace com { namespace sun { namespace star { namespace xml { namespace xpath {
54     class XXPathAPI;
55 }}}}}
56 
57 class Window;
58 namespace osl {
59     class Condition;
60 }
61 
62 namespace dp_gui {
63 
64     struct UpdateData;
65     class UpdateCommandEnv;
66 
67 
68 /**
69    The modal &ldquo;Download and Installation&rdquo; dialog.
70 */
71 class UpdateInstallDialog: public ModalDialog {
72 public:
73     /**
74        Create an instance.
75 
76        @param parent
77        the parent window, may be null
78     */
79     UpdateInstallDialog(Window * parent, std::vector<UpdateData> & aVecUpdateData,
80         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xCtx);
81 
82     ~UpdateInstallDialog();
83 
84     sal_Bool Close();
85     virtual short Execute();
86 
87 private:
88     UpdateInstallDialog(UpdateInstallDialog &); // not defined
89     void operator =(UpdateInstallDialog &); // not defined
90 
91     class Thread;
92     friend class Thread;
93     friend class UpdateCommandEnv;
94 
95     DECL_LINK(cancelHandler, void *);
96 
97     //signals in the dialog that we have finished.
98     void updateDone();
99     //Writes a particular error into the info listbox.
100     enum INSTALL_ERROR
101     {
102         ERROR_DOWNLOAD,
103         ERROR_INSTALLATION,
104         ERROR_LICENSE_DECLINED
105     };
106     void setError(INSTALL_ERROR err, ::rtl::OUString const & sExtension, ::rtl::OUString const & exceptionMessage);
107     void setError(::rtl::OUString const & exceptionMessage);
108     ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > getExtensionManager() const
109             { return m_xExtensionManager; }
110 
111     rtl::Reference< Thread > m_thread;
112     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xComponentContext;
113     ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
114     //Signals that an error occurred during download and installation
115     bool m_bError;
116     bool m_bNoEntry;
117     bool m_bActivated;
118 
119     ::rtl::OUString m_sInstalling;
120     ::rtl::OUString m_sFinished;
121     ::rtl::OUString m_sNoErrors;
122     ::rtl::OUString m_sErrorDownload;
123     ::rtl::OUString m_sErrorInstallation;
124     ::rtl::OUString m_sErrorLicenseDeclined;
125     ::rtl::OUString m_sNoInstall;
126     ::rtl::OUString m_sThisErrorOccurred;
127 
128     FixedText m_ft_action;
129     ProgressBar m_statusbar;
130     FixedText m_ft_extension_name;
131     FixedText m_ft_results;
132     AutoScrollEdit m_mle_info;
133     FixedLine m_line;
134     HelpButton m_help;
135     OKButton m_ok;
136     CancelButton m_cancel;
137 };
138 
139 
140 
141 
142 }
143 
144 #endif
145