Branch data Line data Source code
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_GUI_DP_GUI_INSTALLDIALOG_HXX
21 : : #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_INSTALLDIALOG_HXX
22 : :
23 : : #include "sal/config.h"
24 : : #include "vcl/button.hxx"
25 : : #include "vcl/fixed.hxx"
26 : : #include "vcl/dialog.hxx"
27 : : #include "svtools/prgsbar.hxx"
28 : : #include "rtl/ref.hxx"
29 : : #include <vector>
30 : :
31 : : #include "dp_gui_autoscrolledit.hxx"
32 : : /// @HTML
33 : :
34 : : namespace com { namespace sun { namespace star { namespace deployment {
35 : : class XExtensionManager;
36 : : }}}}
37 : : namespace com { namespace sun { namespace star { namespace uno {
38 : : class XComponentContext;
39 : : }}}}
40 : :
41 : : class Window;
42 : :
43 : : namespace dp_gui {
44 : :
45 : : struct UpdateData;
46 : : class UpdateCommandEnv;
47 : :
48 : :
49 : : /**
50 : : The modal “Download and Installation” dialog.
51 : : */
52 : : class UpdateInstallDialog: public ModalDialog {
53 : : public:
54 : : /**
55 : : Create an instance.
56 : :
57 : : @param parent
58 : : the parent window, may be null
59 : : */
60 : : UpdateInstallDialog(Window * parent, std::vector<UpdateData> & aVecUpdateData,
61 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xCtx);
62 : :
63 : : ~UpdateInstallDialog();
64 : :
65 : : sal_Bool Close();
66 : : virtual short Execute();
67 : :
68 : : private:
69 : : UpdateInstallDialog(UpdateInstallDialog &); // not defined
70 : : void operator =(UpdateInstallDialog &); // not defined
71 : :
72 : : class Thread;
73 : : friend class Thread;
74 : : friend class UpdateCommandEnv;
75 : :
76 : : DECL_LINK(cancelHandler, void *);
77 : :
78 : : //signals in the dialog that we have finished.
79 : : void updateDone();
80 : : //Writes a particular error into the info listbox.
81 : : enum INSTALL_ERROR
82 : : {
83 : : ERROR_DOWNLOAD,
84 : : ERROR_INSTALLATION,
85 : : ERROR_LICENSE_DECLINED
86 : : };
87 : : void setError(INSTALL_ERROR err, ::rtl::OUString const & sExtension, ::rtl::OUString const & exceptionMessage);
88 : : void setError(::rtl::OUString const & exceptionMessage);
89 : 0 : ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > getExtensionManager() const
90 : 0 : { return m_xExtensionManager; }
91 : :
92 : : rtl::Reference< Thread > m_thread;
93 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xComponentContext;
94 : : ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
95 : : //Signals that an error occurred during download and installation
96 : : bool m_bError;
97 : : bool m_bNoEntry;
98 : : bool m_bActivated;
99 : :
100 : : ::rtl::OUString m_sInstalling;
101 : : ::rtl::OUString m_sFinished;
102 : : ::rtl::OUString m_sNoErrors;
103 : : ::rtl::OUString m_sErrorDownload;
104 : : ::rtl::OUString m_sErrorInstallation;
105 : : ::rtl::OUString m_sErrorLicenseDeclined;
106 : : ::rtl::OUString m_sNoInstall;
107 : : ::rtl::OUString m_sThisErrorOccurred;
108 : :
109 : : FixedText m_ft_action;
110 : : ProgressBar m_statusbar;
111 : : FixedText m_ft_extension_name;
112 : : FixedText m_ft_results;
113 : : AutoScrollEdit m_mle_info;
114 : : FixedLine m_line;
115 : : HelpButton m_help;
116 : : OKButton m_ok;
117 : : CancelButton m_cancel;
118 : : };
119 : :
120 : :
121 : :
122 : :
123 : : }
124 : :
125 : : #endif
126 : :
127 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|