xref: /AOO41X/main/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx (revision 0a1e2f0e76583da2559a4bad1f4bfca3ca810f57)
1*0a1e2f0eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*0a1e2f0eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*0a1e2f0eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*0a1e2f0eSAndrew Rist  * distributed with this work for additional information
6*0a1e2f0eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*0a1e2f0eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*0a1e2f0eSAndrew Rist  * "License"); you may not use this file except in compliance
9*0a1e2f0eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*0a1e2f0eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*0a1e2f0eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*0a1e2f0eSAndrew Rist  * software distributed under the License is distributed on an
15*0a1e2f0eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0a1e2f0eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*0a1e2f0eSAndrew Rist  * specific language governing permissions and limitations
18*0a1e2f0eSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*0a1e2f0eSAndrew Rist  *************************************************************/
21*0a1e2f0eSAndrew Rist 
22*0a1e2f0eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_INSTALLDIALOG_HXX
25cdf0e10cSrcweir #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_INSTALLDIALOG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX
29cdf0e10cSrcweir #include "vcl/button.hxx"
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir #include "vcl/fixed.hxx"
32cdf0e10cSrcweir #include "vcl/dialog.hxx"
33cdf0e10cSrcweir #include "svtools/prgsbar.hxx"
34cdf0e10cSrcweir #include "rtl/ref.hxx"
35cdf0e10cSrcweir #include <vector>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include "dp_gui_autoscrolledit.hxx"
38cdf0e10cSrcweir /// @HTML
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace deployment {
41cdf0e10cSrcweir     class XExtensionManager;
42cdf0e10cSrcweir }}}}
43cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace uno {
44cdf0e10cSrcweir     class XComponentContext;
45cdf0e10cSrcweir }}}}
46cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace xml { namespace dom {
47cdf0e10cSrcweir     class XNode;
48cdf0e10cSrcweir }}}}}
49cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace xml { namespace xpath {
50cdf0e10cSrcweir     class XXPathAPI;
51cdf0e10cSrcweir }}}}}
52cdf0e10cSrcweir 
53cdf0e10cSrcweir class Window;
54cdf0e10cSrcweir namespace osl {
55cdf0e10cSrcweir     class Condition;
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir namespace dp_gui {
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     struct UpdateData;
61cdf0e10cSrcweir     class UpdateCommandEnv;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 
64cdf0e10cSrcweir /**
65cdf0e10cSrcweir    The modal &ldquo;Download and Installation&rdquo; dialog.
66cdf0e10cSrcweir */
67cdf0e10cSrcweir class UpdateInstallDialog: public ModalDialog {
68cdf0e10cSrcweir public:
69cdf0e10cSrcweir     /**
70cdf0e10cSrcweir        Create an instance.
71cdf0e10cSrcweir 
72cdf0e10cSrcweir        @param parent
73cdf0e10cSrcweir        the parent window, may be null
74cdf0e10cSrcweir     */
75cdf0e10cSrcweir     UpdateInstallDialog(Window * parent, std::vector<UpdateData> & aVecUpdateData,
76cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xCtx);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     ~UpdateInstallDialog();
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     sal_Bool Close();
81cdf0e10cSrcweir     virtual short Execute();
82cdf0e10cSrcweir 
83cdf0e10cSrcweir private:
84cdf0e10cSrcweir     UpdateInstallDialog(UpdateInstallDialog &); // not defined
85cdf0e10cSrcweir     void operator =(UpdateInstallDialog &); // not defined
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     class Thread;
88cdf0e10cSrcweir     friend class Thread;
89cdf0e10cSrcweir     friend class UpdateCommandEnv;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     DECL_LINK(cancelHandler, void *);
92cdf0e10cSrcweir 
93cdf0e10cSrcweir     //signals in the dialog that we have finished.
94cdf0e10cSrcweir     void updateDone();
95cdf0e10cSrcweir     //Writes a particular error into the info listbox.
96cdf0e10cSrcweir     enum INSTALL_ERROR
97cdf0e10cSrcweir     {
98cdf0e10cSrcweir         ERROR_DOWNLOAD,
99cdf0e10cSrcweir         ERROR_INSTALLATION,
100cdf0e10cSrcweir         ERROR_LICENSE_DECLINED
101cdf0e10cSrcweir     };
102cdf0e10cSrcweir     void setError(INSTALL_ERROR err, ::rtl::OUString const & sExtension, ::rtl::OUString const & exceptionMessage);
103cdf0e10cSrcweir     void setError(::rtl::OUString const & exceptionMessage);
getExtensionManager() const104cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > getExtensionManager() const
105cdf0e10cSrcweir             { return m_xExtensionManager; }
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     rtl::Reference< Thread > m_thread;
108cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xComponentContext;
109cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
110cdf0e10cSrcweir     //Signals that an error occurred during download and installation
111cdf0e10cSrcweir     bool m_bError;
112cdf0e10cSrcweir     bool m_bNoEntry;
113cdf0e10cSrcweir     bool m_bActivated;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     ::rtl::OUString m_sInstalling;
116cdf0e10cSrcweir     ::rtl::OUString m_sFinished;
117cdf0e10cSrcweir     ::rtl::OUString m_sNoErrors;
118cdf0e10cSrcweir     ::rtl::OUString m_sErrorDownload;
119cdf0e10cSrcweir     ::rtl::OUString m_sErrorInstallation;
120cdf0e10cSrcweir     ::rtl::OUString m_sErrorLicenseDeclined;
121cdf0e10cSrcweir     ::rtl::OUString m_sNoInstall;
122cdf0e10cSrcweir     ::rtl::OUString m_sThisErrorOccurred;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     FixedText m_ft_action;
125cdf0e10cSrcweir     ProgressBar m_statusbar;
126cdf0e10cSrcweir     FixedText m_ft_extension_name;
127cdf0e10cSrcweir     FixedText m_ft_results;
128cdf0e10cSrcweir     AutoScrollEdit m_mle_info;
129cdf0e10cSrcweir     FixedLine m_line;
130cdf0e10cSrcweir     HelpButton m_help;
131cdf0e10cSrcweir     OKButton m_ok;
132cdf0e10cSrcweir     CancelButton m_cancel;
133cdf0e10cSrcweir };
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 
138cdf0e10cSrcweir }
139cdf0e10cSrcweir 
140cdf0e10cSrcweir #endif
141