1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: mmoutputpage.hxx,v $
10 * $Revision: 1.10.136.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _MAILMERGEOUTPUTPAGE_HXX
31 #define _MAILMERGEOUTPUTPAGE_HXX
32 #include <svtools/wizardmachine.hxx>
33 #ifndef _SV_BUTTON_HXX
34 #include <vcl/button.hxx>
36 #include <svtools/stdctrl.hxx>
37 #include <vcl/combobox.hxx>
38 #include <vcl/field.hxx>
39 #include <vcl/lstbox.hxx>
40 #include <sfx2/objsh.hxx>
41 #include <sfx2/basedlgs.hxx>
42 #include <svtools/svtabbx.hxx>
43 #include <svtools/headbar.hxx>
44 #include <svtools/prgsbar.hxx>
46 #include "mailmergehelper.hxx"
48 class SwMailMergeWizard
;
50 class SwSendMailDialog
;
52 namespace com
{ namespace sun
{ namespace star
{
57 /*-- 02.04.2004 09:21:06---------------------------------------------------
59 -----------------------------------------------------------------------*/
60 class SwMailMergeOutputPage
: public svt::OWizardPage
62 SwBoldFixedInfo m_aHeaderFI
;
63 FixedInfo m_aOptionsFI
;
64 RadioButton m_aSaveStartDocRB
;
65 RadioButton m_aSaveMergedDocRB
;
66 RadioButton m_aPrintRB
;
67 RadioButton m_aSendMailRB
;
69 FixedLine m_aSeparatorFL
;
71 PushButton m_aSaveStartDocPB
;
73 RadioButton m_aSaveAsOneRB
;
74 RadioButton m_aSaveIndividualRB
;
75 RadioButton m_aPrintAllRB
; //has to be here for tab control reasons
76 RadioButton m_aSendAllRB
; //has to be here for tab control reasons
77 //this group is used in save and print
78 RadioButton m_aFromRB
;
79 NumericField m_aFromNF
;
82 PushButton m_aSaveNowPB
;
84 FixedText m_aPrinterFT
;
86 PushButton m_aPrinterSettingsPB
;
87 PushButton m_aPrintNowPB
;
89 FixedText m_aMailToFT
;
91 PushButton m_aCopyToPB
;
92 FixedText m_aSubjectFT
;
94 FixedText m_aSendAsFT
;
96 FixedText m_aAttachmentFT
;
98 PushButton m_aSendAsPB
;
99 PushButton m_aSendDocumentsPB
;
101 //some FixedLine labels
102 String m_sSaveStartST
;
103 String m_sSaveMergedST
;
105 String m_sSendMailST
;
108 String m_sDefaultAttachmentST
;
109 String m_sNoSubjectQueryST
;
110 String m_sNoSubjectST
;
111 String m_sNoAttachmentNameST
;
112 String m_sConfigureMail
;
121 bool m_bCancelSaving
;
123 SwMailMergeWizard
* m_pWizard
;
126 Printer
* m_pTempPrinter
;
127 SfxPrinter
* m_pDocumentPrinterCopy
;
132 DECL_LINK(OutputTypeHdl_Impl
, RadioButton
*);
133 DECL_LINK(CopyToHdl_Impl
, PushButton
*);
134 DECL_LINK(SaveStartHdl_Impl
, PushButton
* );
135 DECL_LINK(SaveOutputHdl_Impl
, PushButton
* );
136 DECL_LINK(PrinterChangeHdl_Impl
, ListBox
* );
137 DECL_LINK(PrintHdl_Impl
, PushButton
* );
138 DECL_LINK(PrinterSetupHdl_Impl
, PushButton
* );
139 DECL_LINK(SendTypeHdl_Impl
, ListBox
*);
140 DECL_LINK(SendAsHdl_Impl
, PushButton
*);
141 DECL_LINK(SendDocumentsHdl_Impl
, PushButton
*);
142 DECL_LINK(DocumentSelectionHdl_Impl
, RadioButton
*);
143 DECL_LINK(SaveCancelHdl_Impl
, Button
*);
145 virtual bool canAdvance() const;
146 virtual void ActivatePage();
148 SwMailMergeOutputPage( SwMailMergeWizard
* _pParent
);
149 ~SwMailMergeOutputPage();
152 /*-- 21.05.2004 12:48:50---------------------------------------------------
154 -----------------------------------------------------------------------*/
155 struct SwMailDescriptor
157 ::rtl::OUString sEMail
;
158 ::rtl::OUString sAttachmentURL
;
159 ::rtl::OUString sAttachmentName
;
160 ::rtl::OUString sMimeType
;
161 ::rtl::OUString sSubject
;
162 ::rtl::OUString sBodyMimeType
;
163 ::rtl::OUString sBodyContent
;
167 ::rtl::OUString sBCC
;
169 struct SwSendMailDialog_Impl
;
170 class SwMailMergeConfigItem
;
171 class SW_DLLPUBLIC SwSendMailDialog
: public ModelessDialog
//SfxModalDialog
173 FixedLine m_aStatusFL
;
174 FixedText m_aStatusFT
;
176 FixedLine m_aTransferStatusFL
;
177 FixedText m_aTransferStatusFT
;
178 FixedInfo m_PausedFI
;
179 ProgressBar m_aProgressBar
;
180 FixedText m_aErrorStatusFT
;
182 PushButton m_aDetailsPB
;
183 HeaderBar m_aStatusHB
;
184 SvTabListBox m_aStatusLB
;
186 FixedLine m_aSeparatorFL
;
188 PushButton m_aStopPB
;
189 PushButton m_aClosePB
;
196 String m_sTransferStatus
;
197 String m_sErrorStatus
;
201 String m_sTerminateQuery
;
204 bool m_bDesctructionEnabled
;
206 ImageList m_aImageList
;
207 ImageList m_aImageListHC
;
209 SwSendMailDialog_Impl
* m_pImpl
;
210 SwMailMergeConfigItem
* m_pConfigItem
;
211 sal_Int32 m_nStatusHeight
;
212 sal_Int32 m_nSendCount
;
213 sal_Int32 m_nErrorCount
;
215 SW_DLLPRIVATE
DECL_LINK( DetailsHdl_Impl
, PushButton
* );
216 SW_DLLPRIVATE
DECL_LINK( StopHdl_Impl
, PushButton
* );
217 SW_DLLPRIVATE
DECL_LINK( CloseHdl_Impl
, PushButton
* );
218 SW_DLLPRIVATE
DECL_STATIC_LINK( SwSendMailDialog
, StartSendMails
, SwSendMailDialog
* );
219 SW_DLLPRIVATE
DECL_STATIC_LINK( SwSendMailDialog
, StopSendMails
, SwSendMailDialog
* );
220 SW_DLLPRIVATE
DECL_STATIC_LINK( SwSendMailDialog
, RemoveThis
, Timer
* );
222 SW_DLLPRIVATE
void IterateMails();
223 SW_DLLPRIVATE
void SendMails();
224 SW_DLLPRIVATE
void UpdateTransferStatus();
226 virtual void StateChanged( StateChangedType nStateChange
);
229 SwSendMailDialog( Window
* pParent
, SwMailMergeConfigItem
& );
232 void AddDocument( SwMailDescriptor
& rDesc
);
233 void SetDocumentCount( sal_Int32 nAllDocuments
);
234 void EnableDesctruction() {m_bDesctructionEnabled
= true;}
237 void DocumentSent( ::com::sun::star::uno::Reference
< ::com::sun::star::mail::XMailMessage
>,
239 const ::rtl::OUString
* pError
);