LibreOffice Module sw (master)  1
mailmergehelper.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 <swtypes.hxx>
21 #include <mailmergehelper.hxx>
22 #include <mmconfigitem.hxx>
23 #include <docsh.hxx>
24 #include <sfx2/filedlghelper.hxx>
25 #include <sfx2/docfile.hxx>
26 #include <sfx2/app.hxx>
27 #include <sfx2/fcontnr.hxx>
28 #include <com/sun/star/sdbc/SQLException.hpp>
29 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
30 #include <com/sun/star/sdb/XColumn.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
33 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
34 #include <com/sun/star/mail/MailServiceProvider.hpp>
35 #include <com/sun/star/mail/XSmtpService.hpp>
37 #include <vcl/event.hxx>
38 #include <vcl/settings.hxx>
39 #include <vcl/builderfactory.hxx>
40 #include <vcl/svapp.hxx>
41 
42 #include <sfx2/passwd.hxx>
43 
44 #include <dbui.hrc>
45 #include <strings.hrc>
46 
47 using namespace ::com::sun::star;
48 using namespace ::com::sun::star::uno;
49 using namespace ::com::sun::star::container;
50 using namespace ::com::sun::star::sdb;
51 using namespace ::com::sun::star::sdbc;
52 using namespace ::com::sun::star::sdbcx;
53 
55 {
56 
57 OUString CallSaveAsDialog(weld::Window* pParent, OUString& rFilter)
58 {
59  ::sfx2::FileDialogHelper aDialog( ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,
60  FileDialogFlags::NONE,
61  SwDocShell::Factory().GetFactoryName(), SfxFilterFlags::NONE, SfxFilterFlags::NONE, pParent);
62 
63  if (aDialog.Execute()!=ERRCODE_NONE)
64  {
65  return OUString();
66  }
67 
68  rFilter = aDialog.GetRealFilter();
69  uno::Reference < ui::dialogs::XFilePicker3 > xFP = aDialog.GetFilePicker();
70  return xFP->getSelectedFiles().getConstArray()[0];
71 }
72 
73 /*
74  simple address check: check for '@'
75  for at least one '.' after the '@'
76  and for at least two characters before and after the dot
77 */
78 bool CheckMailAddress( const OUString& rMailAddress )
79 {
80  const sal_Int32 nPosAt = rMailAddress.indexOf('@');
81  if (nPosAt<0 || rMailAddress.lastIndexOf('@')!=nPosAt)
82  return false;
83  const sal_Int32 nPosDot = rMailAddress.indexOf('.', nPosAt);
84  return !(nPosDot<0 || nPosDot-nPosAt<3 || rMailAddress.getLength()-nPosDot<3);
85 }
86 
87 uno::Reference< mail::XSmtpService > ConnectToSmtpServer(
88  SwMailMergeConfigItem const & rConfigItem,
89  uno::Reference< mail::XMailService >& rxInMailService,
90  const OUString& rInMailServerPassword,
91  const OUString& rOutMailServerPassword,
92  weld::Window* pDialogParentWindow )
93 {
94  uno::Reference< mail::XSmtpService > xSmtpServer;
95  uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
96  try
97  {
98  uno::Reference< mail::XMailServiceProvider > xMailServiceProvider(
99  mail::MailServiceProvider::create( xContext ) );
100  xSmtpServer.set(xMailServiceProvider->create(mail::MailServiceType_SMTP), uno::UNO_QUERY);
101 
102  uno::Reference< mail::XConnectionListener> xConnectionListener(new SwConnectionListener());
103 
104  if(rConfigItem.IsAuthentication() && rConfigItem.IsSMTPAfterPOP())
105  {
106  uno::Reference< mail::XMailService > xInMailService =
107  xMailServiceProvider->create(
108  rConfigItem.IsInServerPOP() ?
109  mail::MailServiceType_POP3 : mail::MailServiceType_IMAP);
110  //authenticate at the POP or IMAP server first
111  OUString sPasswd = rConfigItem.GetInServerPassword();
112  if(!rInMailServerPassword.isEmpty())
113  sPasswd = rInMailServerPassword;
114  uno::Reference<mail::XAuthenticator> xAuthenticator =
115  new SwAuthenticator(
116  rConfigItem.GetInServerUserName(),
117  sPasswd,
118  pDialogParentWindow);
119 
120  xInMailService->addConnectionListener(xConnectionListener);
121  //check connection
122  uno::Reference< uno::XCurrentContext> xConnectionContext =
124  rConfigItem.GetInServerName(),
125  rConfigItem.GetInServerPort(),
126  "Insecure");
127  xInMailService->connect(xConnectionContext, xAuthenticator);
128  rxInMailService = xInMailService;
129  }
130  uno::Reference< mail::XAuthenticator> xAuthenticator;
131  if(rConfigItem.IsAuthentication() &&
132  !rConfigItem.IsSMTPAfterPOP() &&
133  !rConfigItem.GetMailUserName().isEmpty())
134  {
135  OUString sPasswd = rConfigItem.GetMailPassword();
136  if(!rOutMailServerPassword.isEmpty())
137  sPasswd = rOutMailServerPassword;
138  xAuthenticator =
139  new SwAuthenticator(rConfigItem.GetMailUserName(),
140  sPasswd,
141  pDialogParentWindow);
142  }
143  else
144  xAuthenticator = new SwAuthenticator();
145  //just to check if the server exists
146  xSmtpServer->getSupportedConnectionTypes();
147  //check connection
148 
149  uno::Reference< uno::XCurrentContext> xConnectionContext =
151  rConfigItem.GetMailServer(),
152  rConfigItem.GetMailPort(),
153  rConfigItem.IsSecureConnection() ? OUString("Ssl") : OUString("Insecure") );
154  xSmtpServer->connect(xConnectionContext, xAuthenticator);
155  rxInMailService.set( xSmtpServer, uno::UNO_QUERY );
156  }
157  catch (const uno::Exception&)
158  {
159  OSL_FAIL("exception caught");
160  }
161  return xSmtpServer;
162 }
163 
164 } //namespace
165 
167 {
168  std::vector< OUString > aAddresses;
169  sal_uInt16 nRows;
170  sal_uInt16 nColumns;
171  sal_uInt16 nSelectedAddress;
173 
175  nRows(1),
176  nColumns(1),
177  nSelectedAddress(0),
178  bEnableScrollBar(false)
179  {
180  }
181 };
182 
184  : Window( pParent, nStyle )
185  , aVScrollBar(VclPtr<ScrollBar>::Create(this, WB_VSCROLL))
186  , pImpl(new SwAddressPreview_Impl())
187 {
188  aVScrollBar->SetScrollHdl(LINK(this, SwAddressPreview, ScrollHdl));
190  Show();
191 }
192 
194 {
195  disposeOnce();
196 }
197 
199 {
202 }
203 
205 
206 void SwAddressPreview::positionScrollBar()
207 {
208  Size aSize(GetOutputSizePixel());
209  Size aScrollSize(aVScrollBar->get_preferred_size().Width(), aSize.Height());
210  aVScrollBar->SetSizePixel(aScrollSize);
211  Point aSrollPos(aSize.Width() - aScrollSize.Width(), 0);
212  aVScrollBar->SetPosPixel(aSrollPos);
213 }
214 
216 {
217  Window::Resize();
219 }
220 
222 {
223  Invalidate();
224 }
225 
226 void SwAddressPreview::AddAddress(const OUString& rAddress)
227 {
228  pImpl->aAddresses.push_back(rAddress);
229  UpdateScrollBar();
230 }
231 
232 void SwAddressPreview::SetAddress(const OUString& rAddress)
233 {
234  pImpl->aAddresses.clear();
235  pImpl->aAddresses.push_back(rAddress);
236  aVScrollBar->Show(false);
237  Invalidate();
238 }
239 
241 {
242  OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAddresses.size(), "selection invalid");
243  return pImpl->nSelectedAddress;
244 }
245 
246 void SwAddressPreview::SelectAddress(sal_uInt16 nSelect)
247 {
248  OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAddresses.size(), "selection invalid");
249  pImpl->nSelectedAddress = nSelect;
250  // now make it visible..
251  sal_uInt16 nSelectRow = nSelect / pImpl->nColumns;
252  sal_uInt16 nStartRow = static_cast<sal_uInt16>(aVScrollBar->GetThumbPos());
253  if( (nSelectRow < nStartRow) || (nSelectRow >= (nStartRow + pImpl->nRows) ))
254  aVScrollBar->SetThumbPos( nSelectRow );
255 }
256 
258 {
259  pImpl->aAddresses.clear();
260  pImpl->nSelectedAddress = 0;
261  UpdateScrollBar();
262 }
263 
264 void SwAddressPreview::SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns)
265 {
266  pImpl->nRows = nRows;
267  pImpl->nColumns = nColumns;
268  UpdateScrollBar();
269 }
270 
272 {
273  if(pImpl->nColumns)
274  {
276  sal_uInt16 nResultingRows = static_cast<sal_uInt16>(pImpl->aAddresses.size() + pImpl->nColumns - 1) / pImpl->nColumns;
277  ++nResultingRows;
278  aVScrollBar->Show(pImpl->bEnableScrollBar && nResultingRows > pImpl->nRows);
279  aVScrollBar->SetRange(Range(0, nResultingRows));
280  if(aVScrollBar->GetThumbPos() > nResultingRows)
281  aVScrollBar->SetThumbPos(nResultingRows);
282  }
283 }
284 
286 {
287  const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
288  rRenderContext.SetFillColor(rSettings.GetWindowColor());
289  rRenderContext.SetLineColor(COL_TRANSPARENT);
290  rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), GetOutputSizePixel()));
291  Color aPaintColor(IsEnabled() ? rSettings.GetWindowTextColor() : rSettings.GetDisableColor());
292  rRenderContext.SetLineColor(aPaintColor);
293  vcl::Font aFont(rRenderContext.GetFont());
294  aFont.SetColor(aPaintColor);
295  rRenderContext.SetFont(aFont);
296 
297  Size aSize(GetOutputSizePixel());
298  sal_uInt16 nStartRow = 0;
299  if(aVScrollBar->IsVisible())
300  {
301  aSize.AdjustWidth( -(aVScrollBar->GetSizePixel().Width()) );
302  nStartRow = static_cast<sal_uInt16>(aVScrollBar->GetThumbPos());
303  }
304  Size aPartSize(aSize.Width() / pImpl->nColumns,
305  aSize.Height() / pImpl->nRows);
306  aPartSize.AdjustWidth( -2 );
307  aPartSize.AdjustHeight( -2 );
308 
309  sal_uInt16 nAddress = nStartRow * pImpl->nColumns;
310  const sal_uInt16 nNumAddresses = static_cast<sal_uInt16>(pImpl->aAddresses.size());
311  for (sal_uInt16 nRow = 0; nRow < pImpl->nRows ; ++nRow)
312  {
313  for (sal_uInt16 nCol = 0; nCol < pImpl->nColumns; ++nCol)
314  {
315  if (nAddress >= nNumAddresses)
316  break;
317  Point aPos(nCol * aPartSize.Width(),
318  nRow * aPartSize.Height());
319  aPos.Move(1, 1);
320  bool bIsSelected = nAddress == pImpl->nSelectedAddress;
321  if ((pImpl->nColumns * pImpl->nRows) == 1)
322  bIsSelected = false;
323  OUString adr(pImpl->aAddresses[nAddress]);
324  DrawText_Impl(rRenderContext, adr, aPos, aPartSize, bIsSelected);
325  ++nAddress;
326  }
327  }
328  rRenderContext.SetClipRegion();
329 }
330 
332 {
333  Window::MouseButtonDown(rMEvt);
334  if (rMEvt.IsLeft() && pImpl->nRows && pImpl->nColumns)
335  {
336  //determine the selected address
337  const Point& rMousePos = rMEvt.GetPosPixel();
338  Size aSize(GetOutputSizePixel());
339  Size aPartSize( aSize.Width()/pImpl->nColumns, aSize.Height()/pImpl->nRows );
340  sal_uInt32 nRow = rMousePos.Y() / aPartSize.Height() ;
341  if(aVScrollBar->IsVisible())
342  {
343  nRow += static_cast<sal_uInt16>(aVScrollBar->GetThumbPos());
344  }
345  sal_uInt32 nCol = rMousePos.X() / aPartSize.Width();
346  sal_uInt32 nSelect = nRow * pImpl->nColumns + nCol;
347 
348  if( nSelect < pImpl->aAddresses.size() &&
349  pImpl->nSelectedAddress != static_cast<sal_uInt16>(nSelect))
350  {
351  pImpl->nSelectedAddress = static_cast<sal_uInt16>(nSelect);
352  m_aSelectHdl.Call(nullptr);
353  }
354  Invalidate();
355  }
356 }
357 
359 {
360  sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
361  bool bHandled = false;
362  if (pImpl->nRows && pImpl->nColumns)
363  {
364  sal_uInt32 nSelectedRow = pImpl->nSelectedAddress / pImpl->nColumns;
365  sal_uInt32 nSelectedColumn = pImpl->nSelectedAddress - (nSelectedRow * pImpl->nColumns);
366  switch(nKey)
367  {
368  case KEY_UP:
369  if(nSelectedRow)
370  --nSelectedRow;
371  bHandled = true;
372  break;
373  case KEY_DOWN:
374  if(pImpl->aAddresses.size() > sal_uInt32(pImpl->nSelectedAddress + pImpl->nColumns))
375  ++nSelectedRow;
376  bHandled = true;
377  break;
378  case KEY_LEFT:
379  if(nSelectedColumn)
380  --nSelectedColumn;
381  bHandled = true;
382  break;
383  case KEY_RIGHT:
384  if(nSelectedColumn < sal_uInt32(pImpl->nColumns - 1) &&
385  pImpl->aAddresses.size() - 1 > pImpl->nSelectedAddress )
386  ++nSelectedColumn;
387  bHandled = true;
388  break;
389  }
390  sal_uInt32 nSelect = nSelectedRow * pImpl->nColumns + nSelectedColumn;
391  if( nSelect < pImpl->aAddresses.size() &&
392  pImpl->nSelectedAddress != static_cast<sal_uInt16>(nSelect))
393  {
394  pImpl->nSelectedAddress = static_cast<sal_uInt16>(nSelect);
395  m_aSelectHdl.Call(nullptr);
396  Invalidate();
397  }
398  }
399  if (!bHandled)
400  Window::KeyInput(rKEvt);
401 }
402 
404 {
405  if (nStateChange == StateChangedType::Enable)
406  Invalidate();
407  Window::StateChanged(nStateChange);
408 }
409 
410 void SwAddressPreview::DrawText_Impl(vcl::RenderContext& rRenderContext, const OUString& rAddress,
411  const Point& rTopLeft, const Size& rSize, bool bIsSelected)
412 {
413  rRenderContext.SetClipRegion(vcl::Region(tools::Rectangle(rTopLeft, rSize)));
414  if (bIsSelected)
415  {
416  //selection rectangle
417  rRenderContext.SetFillColor(COL_TRANSPARENT);
418  rRenderContext.DrawRect(tools::Rectangle(rTopLeft, rSize));
419  }
420  sal_Int32 nHeight = GetTextHeight();
421  Point aStart = rTopLeft;
422  //put it away from the border
423  aStart.Move(2, 2);
424  sal_Int32 nPos = 0;
425  do
426  {
427  rRenderContext.DrawText(aStart, rAddress.getToken(0, '\n', nPos));
428  aStart.AdjustY(nHeight );
429  }
430  while (nPos >= 0);
431 }
432 
434  const OUString& rAddress,
435  SwMailMergeConfigItem const & rConfigItem,
436  const Sequence< OUString>* pAssignments)
437 {
438  //find the column names in the address string (with name assignment!) and
439  //exchange the placeholder (like <Firstname>) with the database content
440  //unassigned columns are expanded to <not assigned>
441  Reference< XColumnsSupplier > xColsSupp( rConfigItem.GetResultSet(), UNO_QUERY);
442  Reference <XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr;
443  Sequence< OUString> aAssignment = pAssignments ?
444  *pAssignments :
445  rConfigItem.GetColumnAssignment(
446  rConfigItem.GetCurrentDBData() );
447  const OUString* pAssignment = aAssignment.getConstArray();
448  const std::vector<std::pair<OUString, int>>& rDefHeaders = rConfigItem.GetDefaultAddressHeaders();
449  OUString sNotAssigned = "<" + SwResId(STR_NOTASSIGNED) + ">";
450 
451  bool bIncludeCountry = rConfigItem.IsIncludeCountry();
452  const OUString rExcludeCountry = rConfigItem.GetExcludeCountry();
453  bool bSpecialReplacementForCountry = (!bIncludeCountry || !rExcludeCountry.isEmpty());
454  OUString sCountryColumn;
455  if( bSpecialReplacementForCountry )
456  {
457  sCountryColumn = rDefHeaders[MM_PART_COUNTRY].first;
458  Sequence< OUString> aSpecialAssignment =
459  rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() );
460  if(aSpecialAssignment.getLength() > MM_PART_COUNTRY && aSpecialAssignment[MM_PART_COUNTRY].getLength())
461  sCountryColumn = aSpecialAssignment[MM_PART_COUNTRY];
462  }
463 
464  SwAddressIterator aIter(rAddress);
465  OUStringBuffer sAddress;
466  while(aIter.HasMore())
467  {
468  SwMergeAddressItem aItem = aIter.Next();
469  if(aItem.bIsColumn)
470  {
471  //get the default column name
472 
473  //find the appropriate assignment
474  OUString sConvertedColumn = aItem.sText;
475  auto nSize = std::min(sal_uInt32(rDefHeaders.size()), sal_uInt32(aAssignment.getLength()));
476  for(sal_uInt32 nColumn = 0; nColumn < nSize; ++nColumn)
477  {
478  if (rDefHeaders[nColumn].first == aItem.sText &&
479  !pAssignment[nColumn].isEmpty())
480  {
481  sConvertedColumn = pAssignment[nColumn];
482  break;
483  }
484  }
485  if(!sConvertedColumn.isEmpty() &&
486  xColAccess.is() &&
487  xColAccess->hasByName(sConvertedColumn))
488  {
489  //get the content and exchange it in the address string
490  Any aCol = xColAccess->getByName(sConvertedColumn);
491  Reference< XColumn > xColumn;
492  aCol >>= xColumn;
493  if(xColumn.is())
494  {
495  try
496  {
497  OUString sReplace = xColumn->getString();
498 
499  if( bSpecialReplacementForCountry && sCountryColumn == sConvertedColumn )
500  {
501  if( !rExcludeCountry.isEmpty() && sReplace != rExcludeCountry )
502  aItem.sText = sReplace;
503  else
504  aItem.sText.clear();
505  }
506  else
507  {
508  aItem.sText = sReplace;
509  }
510  }
511  catch (const sdbc::SQLException&)
512  {
513  OSL_FAIL("SQLException caught");
514  }
515  }
516  }
517  else
518  {
519  aItem.sText = sNotAssigned;
520  }
521 
522  }
523  sAddress.append(aItem.sText);
524  }
525  return sAddress.makeStringAndClear();
526 }
527 
528 AddressPreview::AddressPreview(std::unique_ptr<weld::ScrolledWindow> xWindow)
529  : pImpl(new SwAddressPreview_Impl())
530  , m_xVScrollBar(std::move(xWindow))
531 {
532  m_xVScrollBar->set_user_managed_scrolling();
533  m_xVScrollBar->connect_vadjustment_changed(LINK(this, AddressPreview, ScrollHdl));
534 }
535 
537 {
538 }
539 
541 {
542  Invalidate();
543 }
544 
545 void AddressPreview::AddAddress(const OUString& rAddress)
546 {
547  pImpl->aAddresses.push_back(rAddress);
548  UpdateScrollBar();
549 }
550 
551 void AddressPreview::SetAddress(const OUString& rAddress)
552 {
553  pImpl->aAddresses.clear();
554  pImpl->aAddresses.push_back(rAddress);
555  m_xVScrollBar->set_vpolicy(VclPolicyType::NEVER);
556  Invalidate();
557 }
558 
560 {
561  OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAddresses.size(), "selection invalid");
562  return pImpl->nSelectedAddress;
563 }
564 
565 void AddressPreview::SelectAddress(sal_uInt16 nSelect)
566 {
567  OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAddresses.size(), "selection invalid");
568  pImpl->nSelectedAddress = nSelect;
569  // now make it visible..
570  sal_uInt16 nSelectRow = nSelect / pImpl->nColumns;
571  sal_uInt16 nStartRow = m_xVScrollBar->vadjustment_get_value();
572  if( (nSelectRow < nStartRow) || (nSelectRow >= (nStartRow + pImpl->nRows) ))
573  m_xVScrollBar->vadjustment_set_value(nSelectRow);
574 }
575 
576 void AddressPreview::ReplaceSelectedAddress(const OUString& rNew)
577 {
578  pImpl->aAddresses[pImpl->nSelectedAddress] = rNew;
579  Invalidate();
580 }
581 
583 {
584  pImpl->aAddresses.erase(pImpl->aAddresses.begin() + pImpl->nSelectedAddress);
585  if(pImpl->nSelectedAddress)
586  --pImpl->nSelectedAddress;
587  UpdateScrollBar();
588  Invalidate();
589 }
590 
591 void AddressPreview::SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns)
592 {
593  pImpl->nRows = nRows;
594  pImpl->nColumns = nColumns;
595  UpdateScrollBar();
596 }
597 
599 {
600  pImpl->bEnableScrollBar = true;
601 }
602 
604 {
605  if (pImpl->nColumns)
606  {
607  sal_uInt16 nResultingRows = static_cast<sal_uInt16>(pImpl->aAddresses.size() + pImpl->nColumns - 1) / pImpl->nColumns;
608  ++nResultingRows;
609  auto nValue = m_xVScrollBar->vadjustment_get_value();
610  if (nValue > nResultingRows)
611  nValue = nResultingRows;
612  m_xVScrollBar->set_vpolicy(pImpl->bEnableScrollBar && nResultingRows > pImpl->nRows ? VclPolicyType::ALWAYS : VclPolicyType::NEVER);
613  m_xVScrollBar->vadjustment_configure(nValue, 0, nResultingRows, 1, 10, pImpl->nRows);
614  }
615 }
616 
618 {
619  const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
620  rRenderContext.SetFillColor(rSettings.GetWindowColor());
621  rRenderContext.SetLineColor(COL_TRANSPARENT);
622  rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), GetOutputSizePixel()));
623  Color aPaintColor(IsEnabled() ? rSettings.GetWindowTextColor() : rSettings.GetDisableColor());
624  rRenderContext.SetLineColor(aPaintColor);
625 
626  if (vcl::Window* pDefaultDevice = dynamic_cast<vcl::Window*>(Application::GetDefaultDevice()))
627  pDefaultDevice->SetPointFont(rRenderContext, GetDrawingArea()->get_font());
628  vcl::Font aFont(rRenderContext.GetFont());
629  aFont.SetColor(aPaintColor);
630  rRenderContext.SetFont(aFont);
631 
632  Size aSize(GetOutputSizePixel());
633  sal_uInt16 nStartRow = 0;
634  if (m_xVScrollBar->get_vpolicy() != VclPolicyType::NEVER)
635  {
636  aSize.AdjustWidth(-m_xVScrollBar->get_vscroll_width());
637  nStartRow = m_xVScrollBar->vadjustment_get_value();
638  }
639  Size aPartSize(aSize.Width() / pImpl->nColumns,
640  aSize.Height() / pImpl->nRows);
641  aPartSize.AdjustWidth( -2 );
642  aPartSize.AdjustHeight( -2 );
643 
644  sal_uInt16 nAddress = nStartRow * pImpl->nColumns;
645  const sal_uInt16 nNumAddresses = static_cast<sal_uInt16>(pImpl->aAddresses.size());
646  for (sal_uInt16 nRow = 0; nRow < pImpl->nRows ; ++nRow)
647  {
648  for (sal_uInt16 nCol = 0; nCol < pImpl->nColumns; ++nCol)
649  {
650  if (nAddress >= nNumAddresses)
651  break;
652  Point aPos(nCol * aPartSize.Width(),
653  nRow * aPartSize.Height());
654  aPos.Move(1, 1);
655  bool bIsSelected = nAddress == pImpl->nSelectedAddress;
656  if ((pImpl->nColumns * pImpl->nRows) == 1)
657  bIsSelected = false;
658  OUString adr(pImpl->aAddresses[nAddress]);
659  DrawText_Impl(rRenderContext, adr, aPos, aPartSize, bIsSelected);
660  ++nAddress;
661  }
662  }
663  rRenderContext.SetClipRegion();
664 }
665 
667 {
668  if (rMEvt.IsLeft() && pImpl->nRows && pImpl->nColumns)
669  {
670  //determine the selected address
671  const Point& rMousePos = rMEvt.GetPosPixel();
672  Size aSize(GetOutputSizePixel());
673  Size aPartSize( aSize.Width()/pImpl->nColumns, aSize.Height()/pImpl->nRows );
674  sal_uInt32 nRow = rMousePos.Y() / aPartSize.Height() ;
675  if (m_xVScrollBar->get_vpolicy() != VclPolicyType::NEVER)
676  {
677  nRow += m_xVScrollBar->vadjustment_get_value();
678  }
679  sal_uInt32 nCol = rMousePos.X() / aPartSize.Width();
680  sal_uInt32 nSelect = nRow * pImpl->nColumns + nCol;
681 
682  if( nSelect < pImpl->aAddresses.size() &&
683  pImpl->nSelectedAddress != static_cast<sal_uInt16>(nSelect))
684  {
685  pImpl->nSelectedAddress = static_cast<sal_uInt16>(nSelect);
686  }
687  Invalidate();
688  }
689  return true;
690 }
691 
692 bool AddressPreview::KeyInput( const KeyEvent& rKEvt )
693 {
694  sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
695  bool bHandled = false;
696  if (pImpl->nRows && pImpl->nColumns)
697  {
698  sal_uInt32 nSelectedRow = pImpl->nSelectedAddress / pImpl->nColumns;
699  sal_uInt32 nSelectedColumn = pImpl->nSelectedAddress - (nSelectedRow * pImpl->nColumns);
700  switch(nKey)
701  {
702  case KEY_UP:
703  if(nSelectedRow)
704  --nSelectedRow;
705  bHandled = true;
706  break;
707  case KEY_DOWN:
708  if(pImpl->aAddresses.size() > sal_uInt32(pImpl->nSelectedAddress + pImpl->nColumns))
709  ++nSelectedRow;
710  bHandled = true;
711  break;
712  case KEY_LEFT:
713  if(nSelectedColumn)
714  --nSelectedColumn;
715  bHandled = true;
716  break;
717  case KEY_RIGHT:
718  if(nSelectedColumn < sal_uInt32(pImpl->nColumns - 1) &&
719  pImpl->aAddresses.size() - 1 > pImpl->nSelectedAddress )
720  ++nSelectedColumn;
721  bHandled = true;
722  break;
723  }
724  sal_uInt32 nSelect = nSelectedRow * pImpl->nColumns + nSelectedColumn;
725  if( nSelect < pImpl->aAddresses.size() &&
726  pImpl->nSelectedAddress != static_cast<sal_uInt16>(nSelect))
727  {
728  pImpl->nSelectedAddress = static_cast<sal_uInt16>(nSelect);
729  Invalidate();
730  }
731  }
732  return bHandled;
733 }
734 
735 void AddressPreview::DrawText_Impl(vcl::RenderContext& rRenderContext, const OUString& rAddress,
736  const Point& rTopLeft, const Size& rSize, bool bIsSelected)
737 {
738  rRenderContext.SetClipRegion(vcl::Region(tools::Rectangle(rTopLeft, rSize)));
739  if (bIsSelected)
740  {
741  //selection rectangle
742  rRenderContext.SetFillColor(COL_TRANSPARENT);
743  rRenderContext.DrawRect(tools::Rectangle(rTopLeft, rSize));
744  }
745  sal_Int32 nHeight = GetTextHeight();
746  Point aStart = rTopLeft;
747  //put it away from the border
748  aStart.Move(2, 2);
749  sal_Int32 nPos = 0;
750  do
751  {
752  rRenderContext.DrawText(aStart, rAddress.getToken(0, '\n', nPos));
753  aStart.AdjustY(nHeight );
754  }
755  while (nPos >= 0);
756 }
757 
759 {
760  //currently the string may either start with a '<' then it's a column
761  //otherwise it's simple text maybe containing a return
762  SwMergeAddressItem aRet;
763  if(!sAddress.isEmpty())
764  {
765  if(sAddress[0] == '<')
766  {
767  aRet.bIsColumn = true;
768  sal_Int32 nClose = sAddress.indexOf('>');
769  OSL_ENSURE(nClose != -1, "closing '>' not found");
770  if( nClose != -1 )
771  {
772  aRet.sText = sAddress.copy(1, nClose - 1);
773  sAddress = sAddress.copy(nClose + 1);
774  }
775  else
776  {
777  aRet.sText = sAddress.copy(1, 1);
778  sAddress = sAddress.copy(1);
779  }
780  }
781  else
782  {
783  sal_Int32 nOpen = sAddress.indexOf('<');
784  sal_Int32 nReturn = sAddress.indexOf('\n');
785  if(nReturn == 0)
786  {
787  aRet.bIsReturn = true;
788  aRet.sText = "\n";
789  sAddress = sAddress.copy(1);
790  }
791  else if(-1 == nOpen && -1 == nReturn)
792  {
793  aRet.sText = sAddress;
794  sAddress.clear();
795  }
796  else
797  {
798  if (nOpen == -1)
799  nOpen = sAddress.getLength();
800  if (nReturn == -1)
801  nReturn = sAddress.getLength();
802  sal_Int32 nTarget = std::min(nOpen, nReturn);
803  aRet.sText = sAddress.copy(0, nTarget);
804  sAddress = sAddress.copy(nTarget);
805  }
806  }
807  }
808  return aRet;
809 
810 }
811 
813 {
814 }
815 
817 {
818  return m_aUserName;
819 }
820 
822 {
823  if(!m_aUserName.isEmpty() && m_aPassword.isEmpty() && m_pParentWindow)
824  {
826  aPasswdDlg.SetMinLen(0);
827  if (RET_OK == aPasswdDlg.run())
828  m_aPassword = aPasswdDlg.GetPassword();
829  }
830  return m_aPassword;
831 }
832 
834  const OUString& rMailServer, sal_Int16 nPort,
835  const OUString& rConnectionType) :
836  m_sMailServer(rMailServer),
837  m_nPort(nPort),
838  m_sConnectionType(rConnectionType)
839 {
840 }
841 
843 {
844 }
845 
847 {
848  uno::Any aRet;
849  if( rName == "ServerName" )
850  aRet <<= m_sMailServer;
851  else if( rName == "Port" )
852  aRet <<= static_cast<sal_Int32>(m_nPort);
853  else if( rName == "ConnectionType" )
854  aRet <<= m_sConnectionType;
855  return aRet;
856 }
857 
859 {
860 }
861 
862 void SwConnectionListener::connected(const lang::EventObject& /*aEvent*/)
863 {
864 }
865 
866 void SwConnectionListener::disconnected(const lang::EventObject& /*aEvent*/)
867 {
868 }
869 
870 void SwConnectionListener::disposing(const lang::EventObject& /*aEvent*/)
871 {
872 }
873 
874 SwMailTransferable::SwMailTransferable(const OUString& rBody, const OUString& rMimeType) :
875  cppu::WeakComponentImplHelper< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex),
876  m_aMimeType( rMimeType ),
877  m_sBody( rBody ),
878  m_bIsBody( true )
879 {
880 }
881 
883  const OUString& rName, const OUString& rMimeType) :
884  cppu::WeakComponentImplHelper< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex),
885  m_aMimeType( rMimeType ),
886  m_aURL(rURL),
887  m_aName( rName ),
888  m_bIsBody( false )
889 {
890 }
891 
893 {
894 }
895 
896 uno::Any SwMailTransferable::getTransferData( const datatransfer::DataFlavor& /*aFlavor*/ )
897 {
898  uno::Any aRet;
899  if( m_bIsBody )
900  aRet <<= m_sBody;
901  else
902  {
904  SfxMedium aMedium( m_aURL, StreamMode::STD_READ );
905  SvStream* pStream = aMedium.GetInStream();
906  if ( aMedium.GetErrorCode() == ERRCODE_NONE && pStream)
907  {
908  aData.realloc(pStream->TellEnd());
909  pStream->Seek(0);
910  sal_Int8 * pData = aData.getArray();
911  pStream->ReadBytes( pData, aData.getLength() );
912  }
913  aRet <<= aData;
914  }
915  return aRet;
916 }
917 
918 uno::Sequence< datatransfer::DataFlavor > SwMailTransferable::getTransferDataFlavors( )
919 {
920  uno::Sequence< datatransfer::DataFlavor > aRet(1);
921  aRet[0].MimeType = m_aMimeType;
922  if( m_bIsBody )
923  {
924  aRet[0].DataType = cppu::UnoType<OUString>::get();
925  }
926  else
927  {
928  aRet[0].HumanPresentableName = m_aName;
929  aRet[0].DataType = cppu::UnoType<uno::Sequence<sal_Int8>>::get();
930  }
931  return aRet;
932 }
933 
935  const datatransfer::DataFlavor& aFlavor )
936 {
937  return (aFlavor.MimeType == m_aMimeType);
938 }
939 
940 uno::Reference< beans::XPropertySetInfo > SwMailTransferable::getPropertySetInfo( )
941 {
942  return uno::Reference< beans::XPropertySetInfo >();
943 }
944 
945 void SwMailTransferable::setPropertyValue( const OUString& , const uno::Any& )
946 {
947 }
948 
949 uno::Any SwMailTransferable::getPropertyValue( const OUString& rPropertyName )
950 {
951  uno::Any aRet;
952  if ( rPropertyName == "URL" )
953  aRet <<= m_aURL;
954  return aRet;
955 }
956 
958  const OUString&, const uno::Reference< beans::XPropertyChangeListener >& )
959 {
960 }
961 
963  const OUString&,
964  const uno::Reference< beans::XPropertyChangeListener >& )
965 {
966 }
967 
969  const OUString&,
970  const uno::Reference< beans::XVetoableChangeListener >& )
971 {
972 }
973 
975  const OUString& ,
976  const uno::Reference< beans::XVetoableChangeListener >& )
977 {
978 }
979 
981  cppu::WeakComponentImplHelper< mail::XMailMessage>(m_aMutex)
982 {
983 }
984 
986 {
987 }
988 
990 {
991  return m_sSenderName;
992 }
993 
995 {
996  return m_sSenderAddress;
997 }
998 
1000 {
1001  return m_sReplyToAddress;
1002 }
1003 
1004 void SwMailMessage::setReplyToAddress( const OUString& _replytoaddress )
1005 {
1006  m_sReplyToAddress = _replytoaddress;
1007 }
1008 
1010 {
1011  return m_sSubject;
1012 }
1013 
1014 void SwMailMessage::setSubject( const OUString& _subject )
1015 {
1016  m_sSubject = _subject;
1017 }
1018 
1019 uno::Reference< datatransfer::XTransferable > SwMailMessage::getBody()
1020 {
1021  return m_xBody;
1022 }
1023 
1025  const uno::Reference< datatransfer::XTransferable >& rBody )
1026 {
1027  m_xBody = rBody;
1028 }
1029 
1030 void SwMailMessage::addRecipient( const OUString& rRecipientAddress )
1031 {
1032  m_aRecipients.realloc(m_aRecipients.getLength() + 1);
1033  m_aRecipients[m_aRecipients.getLength() - 1] = rRecipientAddress;
1034 }
1035 
1036 void SwMailMessage::addCcRecipient( const OUString& rRecipientAddress )
1037 {
1038  m_aCcRecipients.realloc(m_aCcRecipients.getLength() + 1);
1039  m_aCcRecipients[m_aCcRecipients.getLength() - 1] = rRecipientAddress;
1040 
1041 }
1042 
1043 void SwMailMessage::addBccRecipient( const OUString& rRecipientAddress )
1044 {
1045  m_aBccRecipients.realloc(m_aBccRecipients.getLength() + 1);
1046  m_aBccRecipients[m_aBccRecipients.getLength() - 1] = rRecipientAddress;
1047 }
1048 
1049 uno::Sequence< OUString > SwMailMessage::getRecipients( )
1050 {
1051  return m_aRecipients;
1052 }
1053 
1054 uno::Sequence< OUString > SwMailMessage::getCcRecipients( )
1055 {
1056  return m_aCcRecipients;
1057 }
1058 
1059 uno::Sequence< OUString > SwMailMessage::getBccRecipients( )
1060 {
1061  return m_aBccRecipients;
1062 }
1063 
1064 void SwMailMessage::addAttachment( const mail::MailAttachment& rMailAttachment )
1065 {
1066  m_aAttachments.realloc(m_aAttachments.getLength() + 1);
1067  m_aAttachments[m_aAttachments.getLength() - 1] = rMailAttachment;
1068 }
1069 
1070 uno::Sequence< mail::MailAttachment > SwMailMessage::getAttachments( )
1071 {
1072  return m_aAttachments;
1073 }
1074 
1075 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
void SetClipRegion()
long Width() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
SwMergeAddressItem Next()
bool HasMore() const
AddressPreview(std::unique_ptr< weld::ScrolledWindow > xParent)
OUString const m_sConnectionType
virtual void SAL_CALL setBody(const css::uno::Reference< css::datatransfer::XTransferable > &_body) override
::osl::Mutex m_aMutex
OUString const & GetMailServer() const
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
uno::Reference< mail::XSmtpService > ConnectToSmtpServer(SwMailMergeConfigItem const &rConfigItem, uno::Reference< mail::XMailService > &rxInMailService, const OUString &rInMailServerPassword, const OUString &rOutMailServerPassword, weld::Window *pDialogParentWindow)
long AdjustWidth(long n)
virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor &aFlavor) override
SwConnectionContext(const OUString &rMailServer, sal_Int16 nPort, const OUString &rConnectionType)
long Height() const
signed char sal_Int8
bool IsSecureConnection() const
css::uno::Sequence< OUString > m_aCcRecipients
virtual sal_uInt64 TellEnd()
SwAddressPreview_Impl * pImpl
VclPtr< ScrollBar > aVScrollBar
OUString & GetExcludeCountry() const
const StyleSettings & GetStyleSettings() const
void SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual Size GetSizePixel() const
OUString const m_aURL
css::uno::Reference< css::datatransfer::XTransferable > m_xBody
std::vector< OUString > aAddresses
long GetThumbPos() const
sal_uInt64 Seek(sal_uInt64 nPos)
sal_uInt16 GetCode() const
const SwDBData & GetCurrentDBData() const
IMPL_LINK_NOARG(SwAddressPreview, ScrollHdl, ScrollBar *, void)
virtual short run() override
WinBits const WB_VSCROLL
sal_Int16 GetMailPort() const
virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override
weld::Window * m_pParentWindow
virtual void dispose() override
void DrawText_Impl(vcl::RenderContext &rRenderContext, const OUString &rAddress, const Point &rTopLeft, const Size &rSize, bool bIsSelected)
#define KEY_LEFT
virtual ~AddressPreview() override
Size const & GetOutputSizePixel() const
OUString const m_sBody
void SetAddress(const OUString &rAddress)
static OutputDevice * GetDefaultDevice()
StateChangedType
sal_Int64 WinBits
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
virtual ~SwConnectionContext() override
virtual ~SwAuthenticator() override
void AddAddress(const OUString &rAddress)
The address string is a list of address elements separated by spaces and breaks.
OUString GetRealFilter() const
const vcl::Font & GetFont() const
Link< LinkParamNone *, void > m_aSelectHdl
css::uno::Sequence< OUString > m_aBccRecipients
sal_Int16 const m_nPort
virtual OUString SAL_CALL getSubject() override
void SelectAddress(sal_uInt16 nSelect)
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual ~SwAddressPreview() override
virtual void SAL_CALL disposing(const css::lang::EventObject &aEvent) override
void DrawRect(const tools::Rectangle &rRect)
bool IsAuthentication() const
OUString const & GetInServerPassword() const
OUString const m_aName
sal_Int16 GetInServerPort() const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
css::uno::Reference< css::sdbc::XResultSet > const & GetResultSet() const
css::uno::Sequence< css::mail::MailAttachment > m_aAttachments
void SetLineColor()
css::uno::Sequence< OUString > m_aRecipients
const std::vector< std::pair< OUString, int > > & GetDefaultAddressHeaders() const
const Color & GetDisableColor() const
virtual void SAL_CALL disconnected(const css::lang::EventObject &aEvent) override
OUString CallSaveAsDialog(weld::Window *pParent, OUString &rFilter)
void RemoveSelectedAddress()
long AdjustY(long nVertMove)
class SAL_NO_VTABLE XPropertySet
virtual OUString SAL_CALL getUserName() override
void SetVisibleSize(long nNewSize)
void SetRange(const Range &rRange)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
OUString m_sSenderAddress
void SetFillColor()
virtual void KeyInput(const KeyEvent &rKEvt) override
virtual void SAL_CALL addCcRecipient(const OUString &sRecipientAddress) override
unsigned char sal_Bool
std::unique_ptr< SwAddressPreview_Impl > pImpl
#define VCL_BUILDER_FACTORY_CONSTRUCTOR(typeName, arg2)
void AddAddress(const OUString &rAddress)
The address string is a list of address elements separated by spaces and breaks.
virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor &aFlavor) override
void ReplaceSelectedAddress(const OUString &)
css::uno::Type const & get()
void SelectAddress(sal_uInt16 nSelect)
const AllSettings & GetSettings() const
Size GetOutputSizePixel() const
GUIDCNamePair const aData
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
virtual css::uno::Sequence< OUString > SAL_CALL getRecipients() override
virtual ~SwMailMessage() override
long GetTextHeight() const
bool IsInServerPOP() const
long X() const
ErrCode GetErrorCode() const
virtual void SAL_CALL addRecipient(const OUString &sRecipientAddress) override
void SetColor(const Color &)
void SetMinLen(sal_uInt16 Len)
css::uno::Sequence< OUString > GetColumnAssignment(const SwDBData &rDBData) const
virtual css::uno::Sequence< OUString > SAL_CALL getBccRecipients() override
std::size_t ReadBytes(void *pData, std::size_t nSize)
OUString m_sSenderName
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
OUString const m_sMailServer
void DrawText_Impl(vcl::RenderContext &rRenderContext, const OUString &rAddress, const Point &rTopLeft, const Size &rSize, bool bIsSelected)
sal_uInt16 GetSelectedAddress() const
OUString const & GetInServerUserName() const
virtual css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL getBody() override
SvStream * GetInStream()
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual void SAL_CALL connected(const css::lang::EventObject &aEvent) override
const vcl::KeyCode & GetKeyCode() const
void SetAddress(const OUString &rAddress)
weld::DrawingArea * GetDrawingArea() const
virtual bool KeyInput(const KeyEvent &rKEvt) override
virtual OUString SAL_CALL getReplyToAddress() override
#define KEY_DOWN
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
OUString m_sReplyToAddress
#define ERRCODE_NONE
void SetFont(const vcl::Font &rNewFont)
virtual ~SwMailTransferable() override
bool IsVisible() const
OUString const m_aMimeType
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:34
bool IsLeft() const
virtual void SAL_CALL addBccRecipient(const OUString &sRecipientAddress) override
RET_OK
SwAddressPreview(vcl::Window *pParent, WinBits nStyle)
virtual OUString SAL_CALL getSenderAddress() override
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
virtual void SAL_CALL setReplyToAddress(const OUString &_replytoaddress) override
SwMailTransferable(const OUString &rURL, const OUString &rName, const OUString &rMimeType)
virtual css::uno::Sequence< OUString > SAL_CALL getCcRecipients() override
OUString GetPassword() const
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
const Color & GetWindowColor() const
const Point & GetPosPixel() const
virtual void Resize() override
bool IsIncludeCountry() const
virtual css::uno::Any SAL_CALL getValueByName(const OUString &Name) override
virtual void StateChanged(StateChangedType nStateChange) override
virtual OUString SAL_CALL getSenderName() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
sal_uInt16 GetSelectedAddress() const
bool IsSMTPAfterPOP() const
void SAL_CALL first(const css::awt::SpinEvent &rEvent) override
virtual void SAL_CALL addAttachment(const css::mail::MailAttachment &aMailAttachment) override
virtual void dispose() override
bool IsEnabled() const
void Move(long nHorzMove, long nVertMove)
std::unique_ptr< weld::ScrolledWindow > m_xVScrollBar
bool CheckMailAddress(const OUString &rMailAddress)
OUString const m_aUserName
virtual ~SwConnectionListener() override
virtual void SAL_CALL setSubject(const OUString &_subject) override
const css::uno::Reference< css::ui::dialogs::XFilePicker3 > & GetFilePicker() const
OUString const & GetMailPassword() const
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
sal_Int32 nPos
static OUString FillData(const OUString &rAddress, SwMailMergeConfigItem const &rConfigItem, const css::uno::Sequence< OUString > *pAssignments=nullptr)
const Color & GetWindowTextColor() const
#define KEY_RIGHT
void SetThumbPos(long nThumbPos)
void SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns)
OUString const & GetMailUserName() const
long Y() const
virtual OUString SAL_CALL getPassword() override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
OUString const & GetInServerName() const
virtual css::uno::Sequence< css::mail::MailAttachment > SAL_CALL getAttachments() override
#define KEY_UP
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)