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