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