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 #ifndef _MAILMERGEOUTPUTPAGE_HXX 28 #define _MAILMERGEOUTPUTPAGE_HXX 29 #include <svtools/wizardmachine.hxx> 30 #ifndef _SV_BUTTON_HXX 31 #include <vcl/button.hxx> 32 #endif 33 #include <svtools/stdctrl.hxx> 34 #include <vcl/combobox.hxx> 35 #include <vcl/field.hxx> 36 #include <vcl/lstbox.hxx> 37 #include <sfx2/objsh.hxx> 38 #include <sfx2/basedlgs.hxx> 39 #include <svtools/svtabbx.hxx> 40 #include <svtools/headbar.hxx> 41 #include <svtools/prgsbar.hxx> 42 #include "swdllapi.h" 43 #include "mailmergehelper.hxx" 44 45 class SwMailMergeWizard; 46 class SfxPrinter; 47 class SwSendMailDialog; 48 49 namespace com{ namespace sun{ namespace star{ 50 namespace mail{ 51 class XMailMessage; 52 } 53 }}} 54 /*-- 02.04.2004 09:21:06--------------------------------------------------- 55 56 -----------------------------------------------------------------------*/ 57 class SwMailMergeOutputPage : public svt::OWizardPage 58 { 59 SwBoldFixedInfo m_aHeaderFI; 60 FixedInfo m_aOptionsFI; 61 RadioButton m_aSaveStartDocRB; 62 RadioButton m_aSaveMergedDocRB; 63 RadioButton m_aPrintRB; 64 RadioButton m_aSendMailRB; 65 66 FixedLine m_aSeparatorFL; 67 68 PushButton m_aSaveStartDocPB; 69 70 RadioButton m_aSaveAsOneRB; 71 RadioButton m_aSaveIndividualRB; 72 RadioButton m_aPrintAllRB; //has to be here for tab control reasons 73 RadioButton m_aSendAllRB; //has to be here for tab control reasons 74 //this group is used in save and print 75 RadioButton m_aFromRB; 76 NumericField m_aFromNF; 77 FixedText m_aToFT; 78 NumericField m_aToNF; 79 PushButton m_aSaveNowPB; 80 81 FixedText m_aPrinterFT; 82 ListBox m_aPrinterLB; 83 PushButton m_aPrinterSettingsPB; 84 PushButton m_aPrintNowPB; 85 86 FixedText m_aMailToFT; 87 ListBox m_aMailToLB; 88 PushButton m_aCopyToPB; 89 FixedText m_aSubjectFT; 90 Edit m_aSubjectED; 91 FixedText m_aSendAsFT; 92 ListBox m_aSendAsLB; 93 FixedText m_aAttachmentFT; 94 Edit m_aAttachmentED; 95 PushButton m_aSendAsPB; 96 PushButton m_aSendDocumentsPB; 97 98 //some FixedLine labels 99 String m_sSaveStartST; 100 String m_sSaveMergedST; 101 String m_sPrintST; 102 String m_sSendMailST; 103 104 //misc strings 105 String m_sDefaultAttachmentST; 106 String m_sNoSubjectQueryST; 107 String m_sNoSubjectST; 108 String m_sNoAttachmentNameST; 109 String m_sConfigureMail; 110 111 String m_sBody; 112 113 long m_nFromToRBPos; 114 long m_nFromToFTPos; 115 long m_nFromToNFPos; 116 long m_nRBOffset; 117 118 bool m_bCancelSaving; 119 120 SwMailMergeWizard* m_pWizard; 121 122 //some dialog data 123 Printer* m_pTempPrinter; 124 SfxPrinter* m_pDocumentPrinterCopy; 125 String m_sCC; 126 String m_sBCC; 127 128 129 DECL_LINK(OutputTypeHdl_Impl, RadioButton*); 130 DECL_LINK(CopyToHdl_Impl, PushButton*); 131 DECL_LINK(SaveStartHdl_Impl, PushButton* ); 132 DECL_LINK(SaveOutputHdl_Impl, PushButton* ); 133 DECL_LINK(PrinterChangeHdl_Impl, ListBox* ); 134 DECL_LINK(PrintHdl_Impl, PushButton* ); 135 DECL_LINK(PrinterSetupHdl_Impl, PushButton* ); 136 DECL_LINK(SendTypeHdl_Impl, ListBox*); 137 DECL_LINK(SendAsHdl_Impl, PushButton*); 138 DECL_LINK(SendDocumentsHdl_Impl, PushButton*); 139 DECL_LINK(DocumentSelectionHdl_Impl, RadioButton*); 140 DECL_LINK(SaveCancelHdl_Impl, Button*); 141 protected: 142 virtual bool canAdvance() const; 143 virtual void ActivatePage(); 144 public: 145 SwMailMergeOutputPage( SwMailMergeWizard* _pParent); 146 ~SwMailMergeOutputPage(); 147 148 }; 149 /*-- 21.05.2004 12:48:50--------------------------------------------------- 150 151 -----------------------------------------------------------------------*/ 152 struct SwMailDescriptor 153 { 154 ::rtl::OUString sEMail; 155 ::rtl::OUString sAttachmentURL; 156 ::rtl::OUString sAttachmentName; 157 ::rtl::OUString sMimeType; 158 ::rtl::OUString sSubject; 159 ::rtl::OUString sBodyMimeType; 160 ::rtl::OUString sBodyContent; 161 162 163 ::rtl::OUString sCC; 164 ::rtl::OUString sBCC; 165 }; 166 struct SwSendMailDialog_Impl; 167 class SwMailMergeConfigItem; 168 class SW_DLLPUBLIC SwSendMailDialog : public ModelessDialog //SfxModalDialog 169 { 170 FixedLine m_aStatusFL; 171 FixedText m_aStatusFT; 172 173 FixedLine m_aTransferStatusFL; 174 FixedText m_aTransferStatusFT; 175 FixedInfo m_PausedFI; 176 ProgressBar m_aProgressBar; 177 FixedText m_aErrorStatusFT; 178 179 PushButton m_aDetailsPB; 180 HeaderBar m_aStatusHB; 181 SvTabListBox m_aStatusLB; 182 183 FixedLine m_aSeparatorFL; 184 185 PushButton m_aStopPB; 186 PushButton m_aClosePB; 187 188 String m_sMore; 189 String m_sLess; 190 String m_sContinue; 191 String m_sStop; 192 String m_sSend; 193 String m_sTransferStatus; 194 String m_sErrorStatus; 195 String m_sSendingTo; 196 String m_sCompleted; 197 String m_sFailed; 198 String m_sTerminateQuery; 199 200 bool m_bCancel; 201 bool m_bDesctructionEnabled; 202 203 ImageList m_aImageList; 204 ImageList m_aImageListHC; 205 206 SwSendMailDialog_Impl* m_pImpl; 207 SwMailMergeConfigItem* m_pConfigItem; 208 sal_Int32 m_nStatusHeight; 209 sal_Int32 m_nSendCount; 210 sal_Int32 m_nErrorCount; 211 212 SW_DLLPRIVATE DECL_LINK( DetailsHdl_Impl, PushButton* ); 213 SW_DLLPRIVATE DECL_LINK( StopHdl_Impl, PushButton* ); 214 SW_DLLPRIVATE DECL_LINK( CloseHdl_Impl, PushButton* ); 215 SW_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, StartSendMails, SwSendMailDialog* ); 216 SW_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, StopSendMails, SwSendMailDialog* ); 217 SW_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer* ); 218 219 SW_DLLPRIVATE void IterateMails(); 220 SW_DLLPRIVATE void SendMails(); 221 SW_DLLPRIVATE void UpdateTransferStatus(); 222 223 virtual void StateChanged( StateChangedType nStateChange ); 224 225 public: 226 SwSendMailDialog( Window* pParent, SwMailMergeConfigItem& ); 227 ~SwSendMailDialog(); 228 229 void AddDocument( SwMailDescriptor& rDesc ); 230 void SetDocumentCount( sal_Int32 nAllDocuments ); 231 void EnableDesctruction() {m_bDesctructionEnabled = true;} 232 void ShowDialog(); 233 234 void DocumentSent( ::com::sun::star::uno::Reference< ::com::sun::star::mail::XMailMessage>, 235 bool bResult, 236 const ::rtl::OUString* pError ); 237 void AllMailsSent(); 238 239 }; 240 #endif 241 242 243