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  for(sal_uInt32 nColumn = 0;
476  nColumn < rDefHeaders.size() && nColumn < sal_uInt32(aAssignment.getLength());
477  ++nColumn)
478  {
479  if (rDefHeaders[nColumn].first == aItem.sText &&
480  !pAssignment[nColumn].isEmpty())
481  {
482  sConvertedColumn = pAssignment[nColumn];
483  break;
484  }
485  }
486  if(!sConvertedColumn.isEmpty() &&
487  xColAccess.is() &&
488  xColAccess->hasByName(sConvertedColumn))
489  {
490  //get the content and exchange it in the address string
491  Any aCol = xColAccess->getByName(sConvertedColumn);
492  Reference< XColumn > xColumn;
493  aCol >>= xColumn;
494  if(xColumn.is())
495  {
496  try
497  {
498  OUString sReplace = xColumn->getString();
499 
500  if( bSpecialReplacementForCountry && sCountryColumn == sConvertedColumn )
501  {
502  if( !rExcludeCountry.isEmpty() && sReplace != rExcludeCountry )
503  aItem.sText = sReplace;
504  else
505  aItem.sText.clear();
506  }
507  else
508  {
509  aItem.sText = sReplace;
510  }
511  }
512  catch (const sdbc::SQLException&)
513  {
514  OSL_FAIL("SQLException caught");
515  }
516  }
517  }
518  else
519  {
520  aItem.sText = sNotAssigned;
521  }
522 
523  }
524  sAddress.append(aItem.sText);
525  }
526  return sAddress.makeStringAndClear();
527 }
528 
529 AddressPreview::AddressPreview(std::unique_ptr<weld::ScrolledWindow> xWindow)
530  : pImpl(new SwAddressPreview_Impl())
531  , m_xVScrollBar(std::move(xWindow))
532 {
533  m_xVScrollBar->set_user_managed_scrolling();
534  m_xVScrollBar->connect_vadjustment_changed(LINK(this, AddressPreview, ScrollHdl));
535 }
536 
538 {
539 }
540 
542 {
543  Invalidate();
544 }
545 
546 void AddressPreview::AddAddress(const OUString& rAddress)
547 {
548  pImpl->aAddresses.push_back(rAddress);
549  UpdateScrollBar();
550 }
551 
552 void AddressPreview::SetAddress(const OUString& rAddress)
553 {
554  pImpl->aAddresses.clear();
555  pImpl->aAddresses.push_back(rAddress);
556  m_xVScrollBar->set_vpolicy(VclPolicyType::NEVER);
557  Invalidate();
558 }
559 
561 {
562  OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAddresses.size(), "selection invalid");
563  return pImpl->nSelectedAddress;
564 }
565 
566 void AddressPreview::SelectAddress(sal_uInt16 nSelect)
567 {
568  OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAddresses.size(), "selection invalid");
569  pImpl->nSelectedAddress = nSelect;
570  // now make it visible..
571  sal_uInt16 nSelectRow = nSelect / pImpl->nColumns;
572  sal_uInt16 nStartRow = m_xVScrollBar->vadjustment_get_value();
573  if( (nSelectRow < nStartRow) || (nSelectRow >= (nStartRow + pImpl->nRows) ))
574  m_xVScrollBar->vadjustment_set_value(nSelectRow);
575 }
576 
577 void AddressPreview::ReplaceSelectedAddress(const OUString& rNew)
578 {
579  pImpl->aAddresses[pImpl->nSelectedAddress] = rNew;
580  Invalidate();
581 }
582 
584 {
585  pImpl->aAddresses.erase(pImpl->aAddresses.begin() + pImpl->nSelectedAddress);
586  if(pImpl->nSelectedAddress)
587  --pImpl->nSelectedAddress;
588  UpdateScrollBar();
589  Invalidate();
590 }
591 
592 void AddressPreview::SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns)
593 {
594  pImpl->nRows = nRows;
595  pImpl->nColumns = nColumns;
596  UpdateScrollBar();
597 }
598 
600 {
601  pImpl->bEnableScrollBar = true;
602 }
603 
605 {
606  if (pImpl->nColumns)
607  {
608  sal_uInt16 nResultingRows = static_cast<sal_uInt16>(pImpl->aAddresses.size() + pImpl->nColumns - 1) / pImpl->nColumns;
609  ++nResultingRows;
610  auto nValue = m_xVScrollBar->vadjustment_get_value();
611  if (nValue > nResultingRows)
612  nValue = nResultingRows;
613  m_xVScrollBar->set_vpolicy(pImpl->bEnableScrollBar && nResultingRows > pImpl->nRows ? VclPolicyType::ALWAYS : VclPolicyType::NEVER);
614  m_xVScrollBar->vadjustment_configure(nValue, 0, nResultingRows, 1, 10, pImpl->nRows);
615  }
616 }
617 
619 {
620  const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
621  rRenderContext.SetFillColor(rSettings.GetWindowColor());
622  rRenderContext.SetLineColor(COL_TRANSPARENT);
623  rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), GetOutputSizePixel()));
624  Color aPaintColor(IsEnabled() ? rSettings.GetWindowTextColor() : rSettings.GetDisableColor());
625  rRenderContext.SetLineColor(aPaintColor);
626 
627  if (vcl::Window* pDefaultDevice = dynamic_cast<vcl::Window*>(Application::GetDefaultDevice()))
628  pDefaultDevice->SetPointFont(rRenderContext, GetDrawingArea()->get_font());
629  vcl::Font aFont(rRenderContext.GetFont());
630  aFont.SetColor(aPaintColor);
631  rRenderContext.SetFont(aFont);
632 
633  Size aSize(GetOutputSizePixel());
634  sal_uInt16 nStartRow = 0;
635  if (m_xVScrollBar->get_vpolicy() != VclPolicyType::NEVER)
636  {
637  aSize.AdjustWidth(-m_xVScrollBar->get_vscroll_width());
638  nStartRow = m_xVScrollBar->vadjustment_get_value();
639  }
640  Size aPartSize(aSize.Width() / pImpl->nColumns,
641  aSize.Height() / pImpl->nRows);
642  aPartSize.AdjustWidth( -2 );
643  aPartSize.AdjustHeight( -2 );
644 
645  sal_uInt16 nAddress = nStartRow * pImpl->nColumns;
646  const sal_uInt16 nNumAddresses = static_cast<sal_uInt16>(pImpl->aAddresses.size());
647  for (sal_uInt16 nRow = 0; nRow < pImpl->nRows ; ++nRow)
648  {
649  for (sal_uInt16 nCol = 0; nCol < pImpl->nColumns; ++nCol)
650  {
651  if (nAddress >= nNumAddresses)
652  break;
653  Point aPos(nCol * aPartSize.Width(),
654  nRow * aPartSize.Height());
655  aPos.Move(1, 1);
656  bool bIsSelected = nAddress == pImpl->nSelectedAddress;
657  if ((pImpl->nColumns * pImpl->nRows) == 1)
658  bIsSelected = false;
659  OUString adr(pImpl->aAddresses[nAddress]);
660  DrawText_Impl(rRenderContext, adr, aPos, aPartSize, bIsSelected);
661  ++nAddress;
662  }
663  }
664  rRenderContext.SetClipRegion();
665 }
666 
668 {
669  if (rMEvt.IsLeft() && pImpl->nRows && pImpl->nColumns)
670  {
671  //determine the selected address
672  const Point& rMousePos = rMEvt.GetPosPixel();
673  Size aSize(GetOutputSizePixel());
674  Size aPartSize( aSize.Width()/pImpl->nColumns, aSize.Height()/pImpl->nRows );
675  sal_uInt32 nRow = rMousePos.Y() / aPartSize.Height() ;
676  if (m_xVScrollBar->get_vpolicy() != VclPolicyType::NEVER)
677  {
678  nRow += m_xVScrollBar->vadjustment_get_value();
679  }
680  sal_uInt32 nCol = rMousePos.X() / aPartSize.Width();
681  sal_uInt32 nSelect = nRow * pImpl->nColumns + nCol;
682 
683  if( nSelect < pImpl->aAddresses.size() &&
684  pImpl->nSelectedAddress != static_cast<sal_uInt16>(nSelect))
685  {
686  pImpl->nSelectedAddress = static_cast<sal_uInt16>(nSelect);
687  }
688  Invalidate();
689  }
690  return true;
691 }
692 
693 bool AddressPreview::KeyInput( const KeyEvent& rKEvt )
694 {
695  sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
696  bool bHandled = false;
697  if (pImpl->nRows && pImpl->nColumns)
698  {
699  sal_uInt32 nSelectedRow = pImpl->nSelectedAddress / pImpl->nColumns;
700  sal_uInt32 nSelectedColumn = pImpl->nSelectedAddress - (nSelectedRow * pImpl->nColumns);
701  switch(nKey)
702  {
703  case KEY_UP:
704  if(nSelectedRow)
705  --nSelectedRow;
706  bHandled = true;
707  break;
708  case KEY_DOWN:
709  if(pImpl->aAddresses.size() > sal_uInt32(pImpl->nSelectedAddress + pImpl->nColumns))
710  ++nSelectedRow;
711  bHandled = true;
712  break;
713  case KEY_LEFT:
714  if(nSelectedColumn)
715  --nSelectedColumn;
716  bHandled = true;
717  break;
718  case KEY_RIGHT:
719  if(nSelectedColumn < sal_uInt32(pImpl->nColumns - 1) &&
720  pImpl->aAddresses.size() - 1 > pImpl->nSelectedAddress )
721  ++nSelectedColumn;
722  bHandled = true;
723  break;
724  }
725  sal_uInt32 nSelect = nSelectedRow * pImpl->nColumns + nSelectedColumn;
726  if( nSelect < pImpl->aAddresses.size() &&
727  pImpl->nSelectedAddress != static_cast<sal_uInt16>(nSelect))
728  {
729  pImpl->nSelectedAddress = static_cast<sal_uInt16>(nSelect);
730  Invalidate();
731  }
732  }
733  return bHandled;
734 }
735 
736 void AddressPreview::DrawText_Impl(vcl::RenderContext& rRenderContext, const OUString& rAddress,
737  const Point& rTopLeft, const Size& rSize, bool bIsSelected)
738 {
739  rRenderContext.SetClipRegion(vcl::Region(tools::Rectangle(rTopLeft, rSize)));
740  if (bIsSelected)
741  {
742  //selection rectangle
743  rRenderContext.SetFillColor(COL_TRANSPARENT);
744  rRenderContext.DrawRect(tools::Rectangle(rTopLeft, rSize));
745  }
746  sal_Int32 nHeight = GetTextHeight();
747  Point aStart = rTopLeft;
748  //put it away from the border
749  aStart.Move(2, 2);
750  sal_Int32 nPos = 0;
751  do
752  {
753  rRenderContext.DrawText(aStart, rAddress.getToken(0, '\n', nPos));
754  aStart.AdjustY(nHeight );
755  }
756  while (nPos >= 0);
757 }
758 
760 {
761  //currently the string may either start with a '<' then it's a column
762  //otherwise it's simple text maybe containing a return
763  SwMergeAddressItem aRet;
764  if(!sAddress.isEmpty())
765  {
766  if(sAddress[0] == '<')
767  {
768  aRet.bIsColumn = true;
769  sal_Int32 nClose = sAddress.indexOf('>');
770  OSL_ENSURE(nClose != -1, "closing '>' not found");
771  if( nClose != -1 )
772  {
773  aRet.sText = sAddress.copy(1, nClose - 1);
774  sAddress = sAddress.copy(nClose + 1);
775  }
776  else
777  {
778  aRet.sText = sAddress.copy(1, 1);
779  sAddress = sAddress.copy(1);
780  }
781  }
782  else
783  {
784  sal_Int32 nOpen = sAddress.indexOf('<');
785  sal_Int32 nReturn = sAddress.indexOf('\n');
786  if(nReturn == 0)
787  {
788  aRet.bIsReturn = true;
789  aRet.sText = "\n";
790  sAddress = sAddress.copy(1);
791  }
792  else if(-1 == nOpen && -1 == nReturn)
793  {
794  aRet.sText = sAddress;
795  sAddress.clear();
796  }
797  else
798  {
799  if (nOpen == -1)
800  nOpen = sAddress.getLength();
801  if (nReturn == -1)
802  nReturn = sAddress.getLength();
803  sal_Int32 nTarget = std::min(nOpen, nReturn);
804  aRet.sText = sAddress.copy(0, nTarget);
805  sAddress = sAddress.copy(nTarget);
806  }
807  }
808  }
809  return aRet;
810 
811 }
812 
814 {
815 }
816 
818 {
819  return m_aUserName;
820 }
821 
823 {
824  if(!m_aUserName.isEmpty() && m_aPassword.isEmpty() && m_pParentWindow)
825  {
827  aPasswdDlg.SetMinLen(0);
828  if (RET_OK == aPasswdDlg.run())
829  m_aPassword = aPasswdDlg.GetPassword();
830  }
831  return m_aPassword;
832 }
833 
835  const OUString& rMailServer, sal_Int16 nPort,
836  const OUString& rConnectionType) :
837  m_sMailServer(rMailServer),
838  m_nPort(nPort),
839  m_sConnectionType(rConnectionType)
840 {
841 }
842 
844 {
845 }
846 
848 {
849  uno::Any aRet;
850  if( rName == "ServerName" )
851  aRet <<= m_sMailServer;
852  else if( rName == "Port" )
853  aRet <<= static_cast<sal_Int32>(m_nPort);
854  else if( rName == "ConnectionType" )
855  aRet <<= m_sConnectionType;
856  return aRet;
857 }
858 
860 {
861 }
862 
863 void SwConnectionListener::connected(const lang::EventObject& /*aEvent*/)
864 {
865 }
866 
867 void SwConnectionListener::disconnected(const lang::EventObject& /*aEvent*/)
868 {
869 }
870 
871 void SwConnectionListener::disposing(const lang::EventObject& /*aEvent*/)
872 {
873 }
874 
875 SwMailTransferable::SwMailTransferable(const OUString& rBody, const OUString& rMimeType) :
876  cppu::WeakComponentImplHelper< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex),
877  m_aMimeType( rMimeType ),
878  m_sBody( rBody ),
879  m_bIsBody( true )
880 {
881 }
882 
884  const OUString& rName, const OUString& rMimeType) :
885  cppu::WeakComponentImplHelper< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex),
886  m_aMimeType( rMimeType ),
887  m_aURL(rURL),
888  m_aName( rName ),
889  m_bIsBody( false )
890 {
891 }
892 
894 {
895 }
896 
897 uno::Any SwMailTransferable::getTransferData( const datatransfer::DataFlavor& /*aFlavor*/ )
898 {
899  uno::Any aRet;
900  if( m_bIsBody )
901  aRet <<= m_sBody;
902  else
903  {
905  SfxMedium aMedium( m_aURL, StreamMode::STD_READ );
906  SvStream* pStream = aMedium.GetInStream();
907  if ( aMedium.GetErrorCode() == ERRCODE_NONE && pStream)
908  {
909  aData.realloc(pStream->TellEnd());
910  pStream->Seek(0);
911  sal_Int8 * pData = aData.getArray();
912  pStream->ReadBytes( pData, aData.getLength() );
913  }
914  aRet <<= aData;
915  }
916  return aRet;
917 }
918 
919 uno::Sequence< datatransfer::DataFlavor > SwMailTransferable::getTransferDataFlavors( )
920 {
921  uno::Sequence< datatransfer::DataFlavor > aRet(1);
922  aRet[0].MimeType = m_aMimeType;
923  if( m_bIsBody )
924  {
925  aRet[0].DataType = cppu::UnoType<OUString>::get();
926  }
927  else
928  {
929  aRet[0].HumanPresentableName = m_aName;
930  aRet[0].DataType = cppu::UnoType<uno::Sequence<sal_Int8>>::get();
931  }
932  return aRet;
933 }
934 
936  const datatransfer::DataFlavor& aFlavor )
937 {
938  return (aFlavor.MimeType == m_aMimeType);
939 }
940 
941 uno::Reference< beans::XPropertySetInfo > SwMailTransferable::getPropertySetInfo( )
942 {
943  return uno::Reference< beans::XPropertySetInfo >();
944 }
945 
946 void SwMailTransferable::setPropertyValue( const OUString& , const uno::Any& )
947 {
948 }
949 
950 uno::Any SwMailTransferable::getPropertyValue( const OUString& rPropertyName )
951 {
952  uno::Any aRet;
953  if ( rPropertyName == "URL" )
954  aRet <<= m_aURL;
955  return aRet;
956 }
957 
959  const OUString&, const uno::Reference< beans::XPropertyChangeListener >& )
960 {
961 }
962 
964  const OUString&,
965  const uno::Reference< beans::XPropertyChangeListener >& )
966 {
967 }
968 
970  const OUString&,
971  const uno::Reference< beans::XVetoableChangeListener >& )
972 {
973 }
974 
976  const OUString& ,
977  const uno::Reference< beans::XVetoableChangeListener >& )
978 {
979 }
980 
982  cppu::WeakComponentImplHelper< mail::XMailMessage>(m_aMutex)
983 {
984 }
985 
987 {
988 }
989 
991 {
992  return m_sSenderName;
993 }
994 
996 {
997  return m_sSenderAddress;
998 }
999 
1001 {
1002  return m_sReplyToAddress;
1003 }
1004 
1005 void SwMailMessage::setReplyToAddress( const OUString& _replytoaddress )
1006 {
1007  m_sReplyToAddress = _replytoaddress;
1008 }
1009 
1011 {
1012  return m_sSubject;
1013 }
1014 
1015 void SwMailMessage::setSubject( const OUString& _subject )
1016 {
1017  m_sSubject = _subject;
1018 }
1019 
1020 uno::Reference< datatransfer::XTransferable > SwMailMessage::getBody()
1021 {
1022  return m_xBody;
1023 }
1024 
1026  const uno::Reference< datatransfer::XTransferable >& rBody )
1027 {
1028  m_xBody = rBody;
1029 }
1030 
1031 void SwMailMessage::addRecipient( const OUString& rRecipientAddress )
1032 {
1033  m_aRecipients.realloc(m_aRecipients.getLength() + 1);
1034  m_aRecipients[m_aRecipients.getLength() - 1] = rRecipientAddress;
1035 }
1036 
1037 void SwMailMessage::addCcRecipient( const OUString& rRecipientAddress )
1038 {
1039  m_aCcRecipients.realloc(m_aCcRecipients.getLength() + 1);
1040  m_aCcRecipients[m_aCcRecipients.getLength() - 1] = rRecipientAddress;
1041 
1042 }
1043 
1044 void SwMailMessage::addBccRecipient( const OUString& rRecipientAddress )
1045 {
1046  m_aBccRecipients.realloc(m_aBccRecipients.getLength() + 1);
1047  m_aBccRecipients[m_aBccRecipients.getLength() - 1] = rRecipientAddress;
1048 }
1049 
1050 uno::Sequence< OUString > SwMailMessage::getRecipients( )
1051 {
1052  return m_aRecipients;
1053 }
1054 
1055 uno::Sequence< OUString > SwMailMessage::getCcRecipients( )
1056 {
1057  return m_aCcRecipients;
1058 }
1059 
1060 uno::Sequence< OUString > SwMailMessage::getBccRecipients( )
1061 {
1062  return m_aBccRecipients;
1063 }
1064 
1065 void SwMailMessage::addAttachment( const mail::MailAttachment& rMailAttachment )
1066 {
1067  m_aAttachments.realloc(m_aAttachments.getLength() + 1);
1068  m_aAttachments[m_aAttachments.getLength() - 1] = rMailAttachment;
1069 }
1070 
1071 uno::Sequence< mail::MailAttachment > SwMailMessage::getAttachments( )
1072 {
1073  return m_aAttachments;
1074 }
1075 
1076 /* 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)