Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_SW_SOURCE_UI_DBUI_MMOUTPUTPAGE_HXX
20 : #define INCLUDED_SW_SOURCE_UI_DBUI_MMOUTPUTPAGE_HXX
21 : #include <svtools/wizardmachine.hxx>
22 : #include <vcl/button.hxx>
23 : #include <vcl/layout.hxx>
24 : #include <svtools/stdctrl.hxx>
25 : #include <vcl/combobox.hxx>
26 : #include <vcl/field.hxx>
27 : #include <vcl/lstbox.hxx>
28 : #include <vcl/prgsbar.hxx>
29 : #include <sfx2/objsh.hxx>
30 : #include <sfx2/basedlgs.hxx>
31 : #include <svtools/simptabl.hxx>
32 : #include <svtools/svtabbx.hxx>
33 : #include <svtools/headbar.hxx>
34 : #include "mailmergehelper.hxx"
35 :
36 : class SwMailMergeWizard;
37 : class SfxPrinter;
38 : class SwSendMailDialog;
39 :
40 : namespace com{ namespace sun{ namespace star{
41 : namespace mail{
42 : class XMailMessage;
43 : }
44 : }}}
45 :
46 : class SwMailMergeOutputPage : public svt::OWizardPage
47 : {
48 : RadioButton* m_pSaveStartDocRB;
49 : RadioButton* m_pSaveMergedDocRB;
50 : RadioButton* m_pPrintRB;
51 : RadioButton* m_pSendMailRB;
52 :
53 : VclFrame* m_pSeparator;
54 :
55 : PushButton* m_pSaveStartDocPB;
56 :
57 : RadioButton* m_pSaveAsOneRB;
58 : RadioButton* m_pSaveIndividualRB;
59 : RadioButton* m_pPrintAllRB; //has to be here for tab control reasons
60 : RadioButton* m_pSendAllRB; //has to be here for tab control reasons
61 : //this group is used in save and print
62 : RadioButton* m_pFromRB;
63 : NumericField* m_pFromNF;
64 : FixedText* m_pToFT;
65 : NumericField* m_pToNF;
66 : PushButton* m_pSaveNowPB;
67 :
68 : FixedText* m_pPrinterFT;
69 : ListBox* m_pPrinterLB;
70 : PushButton* m_pPrinterSettingsPB;
71 : PushButton* m_pPrintNowPB;
72 :
73 : FixedText* m_pMailToFT;
74 : ListBox* m_pMailToLB;
75 : PushButton* m_pCopyToPB;
76 : FixedText* m_pSubjectFT;
77 : Edit* m_pSubjectED;
78 : FixedText* m_pSendAsFT;
79 : ListBox* m_pSendAsLB;
80 : VclContainer* m_pAttachmentGroup;
81 : Edit* m_pAttachmentED;
82 : PushButton* m_pSendAsPB;
83 : PushButton* m_pSendDocumentsPB;
84 :
85 : //some FixedLine labels
86 : OUString m_sSaveStartST;
87 : OUString m_sSaveMergedST;
88 : OUString m_sPrintST;
89 : OUString m_sSendMailST;
90 :
91 : //misc strings
92 : OUString m_sDefaultAttachmentST;
93 : OUString m_sNoSubjectST;
94 : OUString m_sConfigureMail;
95 :
96 : OUString m_sBody;
97 :
98 : bool m_bCancelSaving;
99 :
100 : SwMailMergeWizard* m_pWizard;
101 :
102 : //some dialog data
103 : Printer* m_pTempPrinter;
104 : OUString m_sCC;
105 : OUString m_sBCC;
106 :
107 : DECL_LINK(OutputTypeHdl_Impl, RadioButton*);
108 : DECL_LINK(CopyToHdl_Impl, PushButton*);
109 : DECL_LINK(SaveStartHdl_Impl, PushButton* );
110 : DECL_LINK(SaveOutputHdl_Impl, PushButton* );
111 : DECL_LINK(PrinterChangeHdl_Impl, ListBox* );
112 : DECL_LINK(PrintHdl_Impl, void *);
113 : DECL_LINK(PrinterSetupHdl_Impl, PushButton* );
114 : DECL_LINK(SendTypeHdl_Impl, ListBox*);
115 : DECL_LINK(SendAsHdl_Impl, PushButton*);
116 : DECL_LINK(SendDocumentsHdl_Impl, PushButton*);
117 : DECL_LINK(DocumentSelectionHdl_Impl, RadioButton*);
118 : DECL_LINK(SaveCancelHdl_Impl, void *);
119 : protected:
120 : virtual bool canAdvance() const SAL_OVERRIDE;
121 : virtual void ActivatePage() SAL_OVERRIDE;
122 : public:
123 : SwMailMergeOutputPage( SwMailMergeWizard* _pParent);
124 : virtual ~SwMailMergeOutputPage();
125 :
126 : };
127 :
128 0 : struct SwMailDescriptor
129 : {
130 : OUString sEMail;
131 : OUString sAttachmentURL;
132 : OUString sAttachmentName;
133 : OUString sMimeType;
134 : OUString sSubject;
135 : OUString sBodyMimeType;
136 : OUString sBodyContent;
137 :
138 : OUString sCC;
139 : OUString sBCC;
140 : };
141 : struct SwSendMailDialog_Impl;
142 : class SwMailMergeConfigItem;
143 : class SwSendMailDialog : public ModelessDialog //SfxModalDialog
144 : {
145 : FixedText *m_pTransferStatus;
146 : FixedText *m_pPaused;
147 : ProgressBar *m_pProgressBar;
148 : FixedText *m_pErrorStatus;
149 :
150 : SvSimpleTableContainer *m_pContainer;
151 : HeaderBar *m_pStatusHB;
152 : SvSimpleTable *m_pStatus;
153 :
154 : PushButton *m_pStop;
155 : PushButton *m_pClose;
156 :
157 : OUString m_sContinue;
158 : OUString m_sStop;
159 : OUString m_sTransferStatus;
160 : OUString m_sErrorStatus;
161 : OUString m_sSendingTo;
162 : OUString m_sCompleted;
163 : OUString m_sFailed;
164 :
165 : bool m_bCancel;
166 : bool m_bDesctructionEnabled;
167 :
168 : ImageList m_aImageList;
169 :
170 : SwSendMailDialog_Impl* m_pImpl;
171 : SwMailMergeConfigItem* m_pConfigItem;
172 : sal_Int32 m_nStatusHeight;
173 : sal_Int32 m_nSendCount;
174 : sal_Int32 m_nErrorCount;
175 :
176 : SAL_DLLPRIVATE DECL_LINK( StopHdl_Impl, PushButton* );
177 : SAL_DLLPRIVATE DECL_LINK( CloseHdl_Impl, void* );
178 : SAL_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, StartSendMails, SwSendMailDialog* );
179 : SAL_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, StopSendMails, SwSendMailDialog* );
180 : SAL_DLLPRIVATE DECL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer* );
181 :
182 : SAL_DLLPRIVATE void IterateMails();
183 : SAL_DLLPRIVATE void SendMails();
184 : SAL_DLLPRIVATE void UpdateTransferStatus();
185 :
186 : virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
187 :
188 : public:
189 : SwSendMailDialog( vcl::Window* pParent, SwMailMergeConfigItem& );
190 : virtual ~SwSendMailDialog();
191 :
192 : void AddDocument( SwMailDescriptor& rDesc );
193 : void SetDocumentCount( sal_Int32 nAllDocuments );
194 0 : void EnableDesctruction() {m_bDesctructionEnabled = true;}
195 : void ShowDialog();
196 :
197 : void DocumentSent( ::com::sun::star::uno::Reference< ::com::sun::star::mail::XMailMessage>,
198 : bool bResult,
199 : const OUString* pError );
200 : void AllMailsSent();
201 :
202 : };
203 : #endif
204 :
205 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|