LibreOffice Module sw (master)  1
mmoutputtypepage.cxx
Go to the documentation of this file.
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 
20 #include "mmoutputtypepage.hxx"
21 #include <mailmergewizard.hxx>
22 #include <mmconfigitem.hxx>
23 #include <dbui.hrc>
24 #include <strings.hrc>
25 #include <bitmaps.hlst>
26 #include <swtypes.hxx>
27 
28 #include <rtl/ref.hxx>
29 #include <com/sun/star/mail/XSmtpService.hpp>
30 #include <vcl/fixed.hxx>
31 #include <vcl/idle.hxx>
32 #include <vcl/svapp.hxx>
33 #include <vcl/weld.hxx>
34 
35 #include <cmdid.h>
36 #include <swunohelper.hxx>
37 #include <mmresultdialogs.hxx>
38 #include <maildispatcher.hxx>
39 #include <imaildsplistener.hxx>
40 
41 using namespace ::com::sun::star;
42 
44  : svt::OWizardPage(pParent, "modules/swriter/ui/mmoutputtypepage.ui", "MMOutputTypePage")
45  , m_pWizard(pWizard)
46  , m_xLetterRB(m_xBuilder->weld_radio_button("letter"))
47  , m_xMailRB(m_xBuilder->weld_radio_button("email"))
48  , m_xLetterHint(m_xBuilder->weld_label("letterft"))
49  , m_xMailHint(m_xBuilder->weld_label("emailft"))
50 {
52  m_xLetterRB->connect_toggled(aLink);
53  m_xMailRB->connect_toggled(aLink);
54 
56  if(rConfigItem.IsOutputToLetter())
57  m_xLetterRB->set_active(true);
58  else
59  m_xMailRB->set_active(true);
60  TypeHdl_Impl(*m_xLetterRB);
61 }
62 
64 {
65  disposeOnce();
66 }
67 
69 {
70  m_pWizard.clear();
72 }
73 
75 {
76  bool bLetter = m_xLetterRB->get_active();
77  m_xLetterHint->set_visible(bLetter);
78  m_xMailHint->set_visible(!bLetter);
79  m_pWizard->GetConfigItem().SetOutputToLetter(bLetter);
80  m_pWizard->updateRoadmapItemLabel( MM_ADDRESSBLOCKPAGE );
81  m_pWizard->UpdateRoadmap();
82 }
83 
85 {
86  friend class SwSendMailDialog;
87  ::osl::Mutex aDescriptorMutex;
88 
89  std::vector< SwMailDescriptor > aDescriptors;
90  sal_uInt32 nCurrentDescriptor;
93  uno::Reference< mail::XMailService > xConnectedInMailService;
95 
97  nCurrentDescriptor(0)
98  {
99  aRemoveIdle.SetPriority(TaskPriority::LOWEST);
100  }
101 
103  {
104  // Shutdown must be called when the last reference to the
105  // mail dispatcher will be released in order to force a
106  // shutdown of the mail dispatcher thread.
107  // 'join' with the mail dispatcher thread leads to a
108  // deadlock (SolarMutex).
109  if( xMailDispatcher.is() && !xMailDispatcher->isShutdownRequested() )
110  xMailDispatcher->shutdown();
111  }
113 };
114 
116 {
117  ::osl::MutexGuard aGuard(aDescriptorMutex);
118  if(nCurrentDescriptor < aDescriptors.size())
119  {
121  return &aDescriptors[nCurrentDescriptor - 1];
122  }
123  return nullptr;
124 }
125 
127 {
129 
130 public:
131  explicit SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg);
132 
133  virtual void started(::rtl::Reference<MailDispatcher> xMailDispatcher) override;
134  virtual void stopped(::rtl::Reference<MailDispatcher> xMailDispatcher) override;
135  virtual void idle(::rtl::Reference<MailDispatcher> xMailDispatcher) override;
136  virtual void mailDelivered(::rtl::Reference<MailDispatcher> xMailDispatcher,
137  uno::Reference< mail::XMailMessage> xMailMessage) override;
138  virtual void mailDeliveryError(::rtl::Reference<MailDispatcher> xMailDispatcher,
139  uno::Reference< mail::XMailMessage> xMailMessage, const OUString& sErrorMessage) override;
140 
141  static void DeleteAttachments( uno::Reference< mail::XMailMessage > const & xMessage );
142 };
143 
145  m_pSendMailDialog(&rParentDlg)
146 {
147 }
148 
150 {
151 }
152 
154  ::rtl::Reference<MailDispatcher> /*xMailDispatcher*/)
155 {
156 }
157 
159 {
160  SolarMutexGuard aGuard;
163 }
164 
166  ::rtl::Reference<MailDispatcher> /*xMailDispatcher*/,
167  uno::Reference< mail::XMailMessage> xMailMessage)
168 {
169  SolarMutexGuard aGuard;
171  m_pSendMailDialog->DocumentSent( xMailMessage, true, nullptr );
172  DeleteAttachments( xMailMessage );
173 }
174 
176  ::rtl::Reference<MailDispatcher> /*xMailDispatcher*/,
177  uno::Reference< mail::XMailMessage> xMailMessage,
178  const OUString& sErrorMessage)
179 {
180  SolarMutexGuard aGuard;
182  m_pSendMailDialog->DocumentSent( xMailMessage, false, &sErrorMessage );
183  DeleteAttachments( xMailMessage );
184 }
185 
186 void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMailMessage > const & xMessage )
187 {
188  uno::Sequence< mail::MailAttachment > aAttachments = xMessage->getAttachments();
189 
190  for(const auto& rAttachment : aAttachments)
191  {
192  try
193  {
194  uno::Reference< beans::XPropertySet > xTransferableProperties( rAttachment.Data, uno::UNO_QUERY_THROW);
195  OUString sURL;
196  xTransferableProperties->getPropertyValue("URL") >>= sURL;
197  if(!sURL.isEmpty())
199  }
200  catch (const uno::Exception&)
201  {
202  }
203  }
204 }
205 
207 {
208  std::unique_ptr<weld::TextView> m_xDetailED;
209 public:
210  SwSendWarningBox_Impl(weld::Window* pParent, const OUString& rDetails)
211  : MessageDialogController(pParent, "modules/swriter/ui/warnemaildialog.ui", "WarnEmailDialog", "grid")
212  , m_xDetailED(m_xBuilder->weld_text_view("errors"))
213  {
214  m_xDetailED->set_size_request(80 * m_xDetailED->get_approximate_digit_width(),
215  8 * m_xDetailED->get_text_height());
216  m_xDetailED->set_text(rDetails);
217  }
218 };
219 
220 #define ITEMID_TASK 1
221 #define ITEMID_STATUS 2
222 
224  Dialog(pParent, "SendMailsDialog", "modules/swriter/ui/mmsendmails.ui"),
225  m_pTransferStatus(get<FixedText>("transferstatus")),
226  m_pPaused(get<FixedText>("paused")),
227  m_pProgressBar(get<ProgressBar>("progress")),
228  m_pErrorStatus(get<FixedText>("errorstatus")),
229  m_pContainer(get<SvSimpleTableContainer>("container")),
230  m_pStop(get<PushButton>("stop")),
231  m_pClose(get<PushButton>("cancel")),
232  m_sContinue(SwResId( ST_CONTINUE )),
233  m_sStop(m_pStop->GetText()),
234  m_sTransferStatus(m_pTransferStatus->GetText()),
235  m_sErrorStatus( m_pErrorStatus->GetText()),
236  m_sSendingTo( SwResId(ST_SENDINGTO )),
237  m_sCompleted( SwResId(ST_COMPLETED )),
238  m_sFailed( SwResId(ST_FAILED )),
239  m_bCancel(false),
240  m_bDestructionEnabled(false),
241  m_pImpl(new SwSendMailDialog_Impl),
242  m_pConfigItem(&rConfigItem),
243  m_nExpectedCount(0),
244  m_nSendCount(0),
245  m_nErrorCount(0)
246 {
247  Size aSize = m_pContainer->LogicToPixel(Size(226, 80), MapMode(MapUnit::MapAppFont));
248  m_pContainer->set_width_request(aSize.Width());
249  m_pContainer->set_height_request(aSize.Height());
252 
253  OUString sTask(SwResId(ST_TASK));
254  OUString sStatus(SwResId(ST_STATUS));
255 
256  m_pStop->SetClickHdl(LINK( this, SwSendMailDialog, StopHdl_Impl));
257  m_pClose->SetClickHdl(LINK( this, SwSendMailDialog, CloseHdl_Impl));
258 
259  long nPos1 = aSize.Width()/3 * 2;
260  long nPos2 = aSize.Width()/3;
262  nPos1,
263  HeaderBarItemBits::LEFT );
265  nPos2,
266  HeaderBarItemBits::LEFT );
267 
268  static long nTabs[] = {0, nPos1};
269  m_pStatus->SetStyle( m_pStatus->GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
270  m_pStatus->SetSelectionMode( SelectionMode::Single );
271  m_pStatus->SetTabs(SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel);
272  m_pStatus->SetSpaceBetweenEntries(3);
273 
274  m_pPaused->Show(false);
276 }
277 
279 {
280  disposeOnce();
281 }
282 
284 {
285  if(m_pImpl->xMailDispatcher.is())
286  {
287  try
288  {
289  if(m_pImpl->xMailDispatcher->isStarted())
290  m_pImpl->xMailDispatcher->stop();
291  if(m_pImpl->xConnectedInMailService.is() && m_pImpl->xConnectedInMailService->isConnected())
292  m_pImpl->xConnectedInMailService->disconnect();
293 
294  uno::Reference<mail::XMailMessage> xMessage =
295  m_pImpl->xMailDispatcher->dequeueMailMessage();
296  while(xMessage.is())
297  {
299  xMessage = m_pImpl->xMailDispatcher->dequeueMailMessage();
300  }
301  }
302  catch (const uno::Exception&)
303  {
304  }
305  }
306  m_pImpl.reset();
309  m_pPaused.clear();
313  m_pStatusHB.clear();
314  m_pStop.clear();
315  m_pClose.clear();
316 
317  Dialog::dispose();
318 }
319 
321 {
322  ::osl::MutexGuard aGuard(m_pImpl->aDescriptorMutex);
323  m_pImpl->aDescriptors.push_back(rDesc);
324  // if the dialog is already running then continue sending of documents
325  if(m_pImpl->xMailDispatcher.is())
326  {
327  IterateMails();
328  }
329 }
330 
331 IMPL_LINK( SwSendMailDialog, StopHdl_Impl, Button*, pButton, void )
332 {
333  m_bCancel = true;
334  if(m_pImpl->xMailDispatcher.is())
335  {
336  if(m_pImpl->xMailDispatcher->isStarted())
337  {
338  m_pImpl->xMailDispatcher->stop();
339  pButton->SetText(m_sContinue);
340  m_pPaused->Show();
341  }
342  else
343  {
344  m_pImpl->xMailDispatcher->start();
345  pButton->SetText(m_sStop);
346  m_pPaused->Show(false);
347  }
348  }
349 }
350 
351 IMPL_LINK_NOARG(SwSendMailDialog, CloseHdl_Impl, Button*, void)
352 {
353  Dialog::Show( false );
354 
355  if ( m_bDestructionEnabled )
356  disposeOnce();
357  else
358  {
359  m_pImpl->aRemoveIdle.SetInvokeHandler( LINK( this, SwSendMailDialog, RemoveThis ) );
360  m_pImpl->aRemoveIdle.Start();
361  }
362 }
363 
364 IMPL_STATIC_LINK( SwSendMailDialog, StartSendMails, void*, pDialog, void )
365 {
366  static_cast<SwSendMailDialog*>(pDialog)->SendMails();
367 }
368 
369 IMPL_LINK( SwSendMailDialog, RemoveThis, Timer*, pTimer, void )
370 {
371  if( m_pImpl->xMailDispatcher.is() )
372  {
373  if(m_pImpl->xMailDispatcher->isStarted())
374  m_pImpl->xMailDispatcher->stop();
375  if(!m_pImpl->xMailDispatcher->isShutdownRequested())
376  m_pImpl->xMailDispatcher->shutdown();
377  }
378 
379  if( m_bDestructionEnabled &&
380  (!m_pImpl->xMailDispatcher.is() ||
381  !m_pImpl->xMailDispatcher->isRunning()))
382  {
383  disposeOnce();
384  }
385  else
386  {
387  pTimer->Start();
388  }
389 }
390 
391 IMPL_STATIC_LINK( SwSendMailDialog, StopSendMails, void*, p, void )
392 {
393  SwSendMailDialog* pDialog = static_cast<SwSendMailDialog*>(p);
394  if(pDialog->m_pImpl->xMailDispatcher.is() &&
395  pDialog->m_pImpl->xMailDispatcher->isStarted())
396  {
397  pDialog->m_pImpl->xMailDispatcher->stop();
398  pDialog->m_pStop->SetText(pDialog->m_sContinue);
399  pDialog->m_pPaused->Show();
400  }
401 }
402 
404 {
405  if(!m_pConfigItem)
406  {
407  OSL_FAIL("config item not set");
408  return;
409  }
410  EnterWait();
411  //get a mail server connection
412  uno::Reference< mail::XSmtpService > xSmtpServer =
414  m_pImpl->xConnectedInMailService,
415  OUString(), OUString(), GetFrameWeld());
416  bool bIsLoggedIn = xSmtpServer.is() && xSmtpServer->isConnected();
417  LeaveWait();
418  if(!bIsLoggedIn)
419  {
420  OSL_FAIL("create error message");
421  return;
422  }
423  m_pImpl->xMailDispatcher.set( new MailDispatcher(xSmtpServer));
424  IterateMails();
425  m_pImpl->xMailListener = new SwMailDispatcherListener_Impl(*this);
426  m_pImpl->xMailDispatcher->addListener(m_pImpl->xMailListener);
427  if(!m_bCancel)
428  {
429  m_pImpl->xMailDispatcher->start();
430  }
431 }
432 
434 {
435  const SwMailDescriptor* pCurrentMailDescriptor = m_pImpl->GetNextDescriptor();
436  while( pCurrentMailDescriptor )
437  {
438  if(!SwMailMergeHelper::CheckMailAddress( pCurrentMailDescriptor->sEMail ))
439  {
440  Image aInsertImg(StockImage::Yes, RID_BMP_FORMULA_CANCEL);
441 
442  OUString sMessage = m_sSendingTo;
443  OUString sTmp(pCurrentMailDescriptor->sEMail);
444  sTmp += "\t";
445  sTmp += m_sFailed;
446  m_pStatus->InsertEntry( sMessage.replaceFirst("%1", sTmp), aInsertImg, aInsertImg);
447  ++m_nSendCount;
448  ++m_nErrorCount;
450  pCurrentMailDescriptor = m_pImpl->GetNextDescriptor();
451  continue;
452  }
453  SwMailMessage* pMessage = new SwMailMessage;
454  uno::Reference< mail::XMailMessage > xMessage = pMessage;
457  pMessage->addRecipient( pCurrentMailDescriptor->sEMail );
460  if(!pCurrentMailDescriptor->sAttachmentURL.isEmpty())
461  {
462  mail::MailAttachment aAttach;
463  aAttach.Data =
464  new SwMailTransferable(
465  pCurrentMailDescriptor->sAttachmentURL,
466  pCurrentMailDescriptor->sAttachmentName,
467  pCurrentMailDescriptor->sMimeType );
468  aAttach.ReadableName = pCurrentMailDescriptor->sAttachmentName;
469  pMessage->addAttachment( aAttach );
470  }
471  pMessage->setSubject( pCurrentMailDescriptor->sSubject );
472  uno::Reference< datatransfer::XTransferable> xBody =
473  new SwMailTransferable(
474  pCurrentMailDescriptor->sBodyContent,
475  pCurrentMailDescriptor->sBodyMimeType);
476  pMessage->setBody( xBody );
477 
478  //CC and BCC are tokenized by ';'
479  if(!pCurrentMailDescriptor->sCC.isEmpty())
480  {
481  sal_Int32 nPos = 0;
482  do
483  {
484  OUString sTmp = pCurrentMailDescriptor->sCC.getToken( 0, ';', nPos );
485  if( !sTmp.isEmpty() )
486  pMessage->addCcRecipient( sTmp );
487  }
488  while (nPos >= 0);
489  }
490  if(!pCurrentMailDescriptor->sBCC.isEmpty())
491  {
492  sal_Int32 nPos = 0;
493  do
494  {
495  OUString sTmp = pCurrentMailDescriptor->sBCC.getToken( 0, ';', nPos );
496  if( !sTmp.isEmpty() )
497  pMessage->addBccRecipient( sTmp );
498  }
499  while (nPos >= 0);
500  }
501  m_pImpl->xMailDispatcher->enqueueMailMessage( xMessage );
502  pCurrentMailDescriptor = m_pImpl->GetNextDescriptor();
503  }
505 }
506 
507 void SwSendMailDialog::ShowDialog(sal_Int32 nExpectedCount)
508 {
510  StartSendMails ), this, true );
511  m_nExpectedCount = nExpectedCount > 0 ? nExpectedCount : 1;
512  Dialog::Show();
513 }
514 
515 void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> const & xMessage,
516  bool bResult,
517  const OUString* pError )
518 {
519  //sending should stop on send errors
520  if(pError &&
521  m_pImpl->xMailDispatcher.is() && m_pImpl->xMailDispatcher->isStarted())
522  {
524  StopSendMails ), this, true );
525  }
526  Image aInsertImg(StockImage::Yes, bResult ? OUString(RID_BMP_FORMULA_APPLY) : OUString(RID_BMP_FORMULA_CANCEL));
527 
528  OUString sMessage = m_sSendingTo;
529  OUString sTmp(xMessage->getRecipients()[0]);
530  sTmp += "\t";
531  sTmp += bResult ? m_sCompleted : m_sFailed;
532  m_pStatus->InsertEntry( sMessage.replaceFirst("%1", sTmp), aInsertImg, aInsertImg);
533  ++m_nSendCount;
534  if(!bResult)
535  ++m_nErrorCount;
536 
538 
539  if (pError)
540  {
541  SwSendWarningBox_Impl aDlg(GetFrameWeld(), *pError);
542  (void)aDlg.run();
543  }
544 }
545 
547 {
548  OUString sStatus( m_sTransferStatus );
549  sStatus = sStatus.replaceFirst("%1", OUString::number(m_nSendCount) );
550  sStatus = sStatus.replaceFirst("%2", OUString::number(m_nExpectedCount));
551  m_pTransferStatus->SetText(sStatus);
552 
553  sStatus = m_sErrorStatus.replaceFirst("%1", OUString::number(m_nErrorCount) );
554  m_pErrorStatus->SetText(sStatus);
555 
556  if (!m_pImpl->aDescriptors.empty())
557  {
558  assert(m_nExpectedCount && "div-by-zero");
559  m_pProgressBar->SetValue(static_cast<sal_uInt16>(m_nSendCount * 100 / m_nExpectedCount));
560  }
561  else
563 }
564 
566 {
567  // Leave open if some kind of error occurred
569  {
570  m_pStop->Enable( false );
571  Dialog::Show( false );
572  }
573 }
574 
575 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString const m_sTransferStatus
long Width() const
SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem &)
virtual void dispose() override
virtual void SAL_CALL setBody(const css::uno::Reference< css::datatransfer::XTransferable > &_body) override
OUString sMessage
void SetValue(sal_uInt16 nNewPercent)
void ShowDialog(sal_Int32 nExpectedCount)
uno::Reference< mail::XSmtpService > ConnectToSmtpServer(SwMailMergeConfigItem const &rConfigItem, uno::Reference< mail::XMailService > &rxInMailService, const OUString &rInMailServerPassword, const OUString &rOutMailServerPassword, weld::Window *pDialogParentWindow)
SwMailMergeConfigItem & GetConfigItem()
virtual void SetTabs() override
void SetClickHdl(const Link< Button *, void > &rLink)
OUString const m_sContinue
OUString const & GetMailAddress() const
long Height() const
IMPL_LINK(SwSendMailDialog, StopHdl_Impl, Button *, pButton, void)
OUString const m_sFailed
std::unique_ptr< SwSendMailDialog_Impl > m_pImpl
void EnterWait()
void disposeAndClear()
MailDispatcher listener interface.
std::unique_ptr< weld::Builder > m_xBuilder
VclPtr< SvSimpleTableContainer > m_pContainer
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
virtual void idle(::rtl::Reference< MailDispatcher > xMailDispatcher) override
Called when there are no more mail messages to deliver.
sal_Int32 m_nExpectedCount
bool UCB_DeleteFile(const OUString &rURL)
Definition: swunohelper.cxx:59
::rtl::Reference< IMailDispatcherListener > xMailListener
weld::Window * GetFrameWeld() const
VclPtr< FixedText > m_pPaused
virtual void dispose() override
void Enable(bool bEnable=true, bool bChild=true)
#define MM_ADDRESSBLOCKPAGE
WinBits const WB_HSCROLL
VclPtr< SvSimpleTable > m_pStatus
VclPtr< HeaderBar > m_pStatusHB
void InsertItem(sal_uInt16 nItemId, const OUString &rText, long nSize, HeaderBarItemBits nBits=HeaderBarItemBits::STDSTYLE, sal_uInt16 nPos=HEADERBAR_APPEND)
virtual ~SwMailMergeOutputTypePage() override
void SetSenderName(const OUString &rSenderName)
#define SAL_N_ELEMENTS(arr)
HeaderBar & GetTheHeaderBar()
OUString const m_sErrorStatus
void clear()
std::vector< SwMailDescriptor > aDescriptors
void AddDocument(SwMailDescriptor const &rDesc)
SwMailMergeOutputTypePage(SwMailMergeWizard *pWizard, TabPageParent pParent)
VclPtr< SwSendMailDialog > m_pSendMailDialog
void DocumentSent(css::uno::Reference< css::mail::XMailMessage > const &xMessage, bool bResult, const OUString *pError)
virtual void SetText(const OUString &rStr) override
VclPtr< FixedText > m_pTransferStatus
VclPtr< PushButton > m_pClose
virtual void SAL_CALL addCcRecipient(const OUString &sRecipientAddress) override
OUString const m_sCompleted
OUString const & GetMailReplyTo() const
std::unique_ptr< weld::RadioButton > m_xMailRB
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
VclPtr< ProgressBar > m_pProgressBar
VclPtr< PushButton > m_pStop
WinBits const WB_SORT
SwSendWarningBox_Impl(weld::Window *pParent, const OUString &rDetails)
VclPtr< SwMailMergeWizard > m_pWizard
const SwMailDescriptor * GetNextDescriptor()
IMPL_STATIC_LINK(SwSendMailDialog, StartSendMails, void *, pDialog, void)
std::unique_ptr< weld::TextView > m_xDetailED
virtual void SAL_CALL addRecipient(const OUString &sRecipientAddress) override
OUString const & GetMailDisplayName() const
virtual void started(::rtl::Reference< MailDispatcher > xMailDispatcher) override
Called when the MailDispatcher is started.
virtual void stopped(::rtl::Reference< MailDispatcher > xMailDispatcher) override
Called when the MailDispatcher is stopped.
virtual void dispose() override
virtual void mailDeliveryError(::rtl::Reference< MailDispatcher > xMailDispatcher, uno::Reference< mail::XMailMessage > xMailMessage, const OUString &sErrorMessage) override
OUString const m_sSendingTo
virtual void mailDelivered(::rtl::Reference< MailDispatcher > xMailDispatcher, uno::Reference< mail::XMailMessage > xMailMessage) override
static void DeleteAttachments(uno::Reference< mail::XMailMessage > const &xMessage)
#define ITEMID_STATUS
virtual void SAL_CALL addBccRecipient(const OUString &sRecipientAddress) override
virtual void SAL_CALL setReplyToAddress(const OUString &_replytoaddress) override
static VclPtr< reference_type > Create(Arg &&...arg)
#define ITEMID_TASK
virtual short run()
SwMailMergeConfigItem *const m_pConfigItem
SwMailDispatcherListener_Impl(SwSendMailDialog &rParentDlg)
VclPtr< FixedText > m_pErrorStatus
WinBits const WB_TABSTOP
virtual void dispose() override
virtual void SAL_CALL addAttachment(const css::mail::MailAttachment &aMailAttachment) override
bool CheckMailAddress(const OUString &rMailAddress)
void SetPriority(TaskPriority ePriority)
std::unique_ptr< weld::RadioButton > m_xLetterRB
IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl, weld::ToggleButton &, void)
A MailDispatcher should be used for sending a bunch a mail messages asynchronously.
void LeaveWait()
virtual void SAL_CALL setSubject(const OUString &_subject) override
bool IsMailReplyTo() const
sal_Int32 nPos
::rtl::Reference< MailDispatcher > xMailDispatcher
WinBits const WB_CLIPCHILDREN
virtual ~SwSendMailDialog() override
bool isDisposed() const
uno::Reference< mail::XMailService > xConnectedInMailService
void SetSenderAddress(const OUString &rSenderAddress)
bool IsOutputToLetter() const
MessageDialogController(weld::Widget *pParent, const OUString &rUIFile, const OString &rDialogId, const OString &rRelocateId=OString())
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo