xref: /aoo42x/main/sw/source/ui/dbui/mmoutputpage.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _MAILMERGEOUTPUTPAGE_HXX
28*cdf0e10cSrcweir #define _MAILMERGEOUTPUTPAGE_HXX
29*cdf0e10cSrcweir #include <svtools/wizardmachine.hxx>
30*cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX
31*cdf0e10cSrcweir #include <vcl/button.hxx>
32*cdf0e10cSrcweir #endif
33*cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
34*cdf0e10cSrcweir #include <vcl/combobox.hxx>
35*cdf0e10cSrcweir #include <vcl/field.hxx>
36*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
37*cdf0e10cSrcweir #include <sfx2/objsh.hxx>
38*cdf0e10cSrcweir #include <sfx2/basedlgs.hxx>
39*cdf0e10cSrcweir #include <svtools/svtabbx.hxx>
40*cdf0e10cSrcweir #include <svtools/headbar.hxx>
41*cdf0e10cSrcweir #include <svtools/prgsbar.hxx>
42*cdf0e10cSrcweir #include "swdllapi.h"
43*cdf0e10cSrcweir #include "mailmergehelper.hxx"
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir class SwMailMergeWizard;
46*cdf0e10cSrcweir class SfxPrinter;
47*cdf0e10cSrcweir class SwSendMailDialog;
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir namespace com{ namespace sun{ namespace star{
50*cdf0e10cSrcweir     namespace mail{
51*cdf0e10cSrcweir         class XMailMessage;
52*cdf0e10cSrcweir     }
53*cdf0e10cSrcweir }}}
54*cdf0e10cSrcweir /*-- 02.04.2004 09:21:06---------------------------------------------------
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
57*cdf0e10cSrcweir class SwMailMergeOutputPage : public svt::OWizardPage
58*cdf0e10cSrcweir {
59*cdf0e10cSrcweir     SwBoldFixedInfo m_aHeaderFI;
60*cdf0e10cSrcweir     FixedInfo       m_aOptionsFI;
61*cdf0e10cSrcweir     RadioButton     m_aSaveStartDocRB;
62*cdf0e10cSrcweir     RadioButton     m_aSaveMergedDocRB;
63*cdf0e10cSrcweir     RadioButton     m_aPrintRB;
64*cdf0e10cSrcweir     RadioButton     m_aSendMailRB;
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir     FixedLine       m_aSeparatorFL;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir     PushButton      m_aSaveStartDocPB;
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir     RadioButton     m_aSaveAsOneRB;
71*cdf0e10cSrcweir     RadioButton     m_aSaveIndividualRB;
72*cdf0e10cSrcweir     RadioButton     m_aPrintAllRB; //has to be here for tab control reasons
73*cdf0e10cSrcweir     RadioButton     m_aSendAllRB;  //has to be here for tab control reasons
74*cdf0e10cSrcweir     //this group is used in save and print
75*cdf0e10cSrcweir     RadioButton     m_aFromRB;
76*cdf0e10cSrcweir     NumericField    m_aFromNF;
77*cdf0e10cSrcweir     FixedText       m_aToFT;
78*cdf0e10cSrcweir     NumericField    m_aToNF;
79*cdf0e10cSrcweir     PushButton      m_aSaveNowPB;
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     FixedText       m_aPrinterFT;
82*cdf0e10cSrcweir     ListBox         m_aPrinterLB;
83*cdf0e10cSrcweir     PushButton      m_aPrinterSettingsPB;
84*cdf0e10cSrcweir     PushButton      m_aPrintNowPB;
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir     FixedText       m_aMailToFT;
87*cdf0e10cSrcweir     ListBox         m_aMailToLB;
88*cdf0e10cSrcweir     PushButton      m_aCopyToPB;
89*cdf0e10cSrcweir     FixedText       m_aSubjectFT;
90*cdf0e10cSrcweir     Edit            m_aSubjectED;
91*cdf0e10cSrcweir     FixedText       m_aSendAsFT;
92*cdf0e10cSrcweir     ListBox         m_aSendAsLB;
93*cdf0e10cSrcweir     FixedText       m_aAttachmentFT;
94*cdf0e10cSrcweir     Edit            m_aAttachmentED;
95*cdf0e10cSrcweir     PushButton      m_aSendAsPB;
96*cdf0e10cSrcweir     PushButton      m_aSendDocumentsPB;
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir     //some FixedLine labels
99*cdf0e10cSrcweir     String          m_sSaveStartST;
100*cdf0e10cSrcweir     String          m_sSaveMergedST;
101*cdf0e10cSrcweir     String          m_sPrintST;
102*cdf0e10cSrcweir     String          m_sSendMailST;
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir     //misc strings
105*cdf0e10cSrcweir     String          m_sDefaultAttachmentST;
106*cdf0e10cSrcweir     String          m_sNoSubjectQueryST;
107*cdf0e10cSrcweir     String          m_sNoSubjectST;
108*cdf0e10cSrcweir     String          m_sNoAttachmentNameST;
109*cdf0e10cSrcweir     String          m_sConfigureMail;
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir     String          m_sBody;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     long            m_nFromToRBPos;
114*cdf0e10cSrcweir     long            m_nFromToFTPos;
115*cdf0e10cSrcweir     long            m_nFromToNFPos;
116*cdf0e10cSrcweir     long            m_nRBOffset;
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     bool            m_bCancelSaving;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir     SwMailMergeWizard*  m_pWizard;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     //some dialog data
123*cdf0e10cSrcweir     Printer*        m_pTempPrinter;
124*cdf0e10cSrcweir     SfxPrinter*     m_pDocumentPrinterCopy;
125*cdf0e10cSrcweir     String          m_sCC;
126*cdf0e10cSrcweir     String          m_sBCC;
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir     DECL_LINK(OutputTypeHdl_Impl, RadioButton*);
130*cdf0e10cSrcweir     DECL_LINK(CopyToHdl_Impl, PushButton*);
131*cdf0e10cSrcweir     DECL_LINK(SaveStartHdl_Impl, PushButton* );
132*cdf0e10cSrcweir     DECL_LINK(SaveOutputHdl_Impl, PushButton* );
133*cdf0e10cSrcweir     DECL_LINK(PrinterChangeHdl_Impl, ListBox* );
134*cdf0e10cSrcweir     DECL_LINK(PrintHdl_Impl, PushButton* );
135*cdf0e10cSrcweir     DECL_LINK(PrinterSetupHdl_Impl, PushButton* );
136*cdf0e10cSrcweir     DECL_LINK(SendTypeHdl_Impl, ListBox*);
137*cdf0e10cSrcweir     DECL_LINK(SendAsHdl_Impl, PushButton*);
138*cdf0e10cSrcweir     DECL_LINK(SendDocumentsHdl_Impl, PushButton*);
139*cdf0e10cSrcweir     DECL_LINK(DocumentSelectionHdl_Impl, RadioButton*);
140*cdf0e10cSrcweir     DECL_LINK(SaveCancelHdl_Impl, Button*);
141*cdf0e10cSrcweir protected:
142*cdf0e10cSrcweir 		virtual bool    canAdvance() const;
143*cdf0e10cSrcweir         virtual void    ActivatePage();
144*cdf0e10cSrcweir public:
145*cdf0e10cSrcweir         SwMailMergeOutputPage( SwMailMergeWizard* _pParent);
146*cdf0e10cSrcweir         ~SwMailMergeOutputPage();
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir };
149*cdf0e10cSrcweir /*-- 21.05.2004 12:48:50---------------------------------------------------
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
152*cdf0e10cSrcweir struct SwMailDescriptor
153*cdf0e10cSrcweir {
154*cdf0e10cSrcweir     ::rtl::OUString                             sEMail;
155*cdf0e10cSrcweir     ::rtl::OUString                             sAttachmentURL;
156*cdf0e10cSrcweir     ::rtl::OUString                             sAttachmentName;
157*cdf0e10cSrcweir     ::rtl::OUString                             sMimeType;
158*cdf0e10cSrcweir     ::rtl::OUString                             sSubject;
159*cdf0e10cSrcweir     ::rtl::OUString                             sBodyMimeType;
160*cdf0e10cSrcweir     ::rtl::OUString                             sBodyContent;
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir     ::rtl::OUString                             sCC;
164*cdf0e10cSrcweir     ::rtl::OUString                             sBCC;
165*cdf0e10cSrcweir };
166*cdf0e10cSrcweir struct SwSendMailDialog_Impl;
167*cdf0e10cSrcweir class SwMailMergeConfigItem;
168*cdf0e10cSrcweir class SW_DLLPUBLIC SwSendMailDialog : public ModelessDialog //SfxModalDialog
169*cdf0e10cSrcweir {
170*cdf0e10cSrcweir     FixedLine               m_aStatusFL;
171*cdf0e10cSrcweir     FixedText               m_aStatusFT;
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir     FixedLine               m_aTransferStatusFL;
174*cdf0e10cSrcweir     FixedText               m_aTransferStatusFT;
175*cdf0e10cSrcweir     FixedInfo               m_PausedFI;
176*cdf0e10cSrcweir     ProgressBar             m_aProgressBar;
177*cdf0e10cSrcweir     FixedText               m_aErrorStatusFT;
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir     PushButton              m_aDetailsPB;
180*cdf0e10cSrcweir     HeaderBar               m_aStatusHB;
181*cdf0e10cSrcweir     SvTabListBox            m_aStatusLB;
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir     FixedLine               m_aSeparatorFL;
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir     PushButton              m_aStopPB;
186*cdf0e10cSrcweir     PushButton              m_aClosePB;
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir     String                  m_sMore;
189*cdf0e10cSrcweir     String                  m_sLess;
190*cdf0e10cSrcweir     String                  m_sContinue;
191*cdf0e10cSrcweir     String                  m_sStop;
192*cdf0e10cSrcweir     String                  m_sSend;
193*cdf0e10cSrcweir     String                  m_sTransferStatus;
194*cdf0e10cSrcweir     String                  m_sErrorStatus;
195*cdf0e10cSrcweir     String                  m_sSendingTo;
196*cdf0e10cSrcweir     String                  m_sCompleted;
197*cdf0e10cSrcweir     String                  m_sFailed;
198*cdf0e10cSrcweir     String                  m_sTerminateQuery;
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir     bool                    m_bCancel;
201*cdf0e10cSrcweir     bool                    m_bDesctructionEnabled;
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir     ImageList               m_aImageList;
204*cdf0e10cSrcweir     ImageList               m_aImageListHC;
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir     SwSendMailDialog_Impl*  m_pImpl;
207*cdf0e10cSrcweir     SwMailMergeConfigItem*  m_pConfigItem;
208*cdf0e10cSrcweir     sal_Int32               m_nStatusHeight;
209*cdf0e10cSrcweir     sal_Int32               m_nSendCount;
210*cdf0e10cSrcweir     sal_Int32               m_nErrorCount;
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir     SW_DLLPRIVATE DECL_LINK( DetailsHdl_Impl, PushButton* );
213*cdf0e10cSrcweir     SW_DLLPRIVATE DECL_LINK( StopHdl_Impl, PushButton* );
214*cdf0e10cSrcweir     SW_DLLPRIVATE DECL_LINK( CloseHdl_Impl, PushButton* );
215*cdf0e10cSrcweir     SW_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, StartSendMails, SwSendMailDialog* );
216*cdf0e10cSrcweir     SW_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, StopSendMails, SwSendMailDialog* );
217*cdf0e10cSrcweir     SW_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer* );
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir     SW_DLLPRIVATE void        IterateMails();
220*cdf0e10cSrcweir     SW_DLLPRIVATE void        SendMails();
221*cdf0e10cSrcweir     SW_DLLPRIVATE void        UpdateTransferStatus();
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir     virtual void        StateChanged( StateChangedType nStateChange );
224*cdf0e10cSrcweir 
225*cdf0e10cSrcweir public:
226*cdf0e10cSrcweir     SwSendMailDialog( Window* pParent, SwMailMergeConfigItem& );
227*cdf0e10cSrcweir     ~SwSendMailDialog();
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir     void                AddDocument( SwMailDescriptor& rDesc );
230*cdf0e10cSrcweir     void                SetDocumentCount( sal_Int32 nAllDocuments );
231*cdf0e10cSrcweir     void                EnableDesctruction() {m_bDesctructionEnabled = true;}
232*cdf0e10cSrcweir     void                ShowDialog();
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir     void                DocumentSent( ::com::sun::star::uno::Reference< ::com::sun::star::mail::XMailMessage>,
235*cdf0e10cSrcweir                                         bool bResult,
236*cdf0e10cSrcweir                                         const ::rtl::OUString* pError );
237*cdf0e10cSrcweir     void                AllMailsSent();
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir };
240*cdf0e10cSrcweir #endif
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 
243