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