LibreOffice Module sw (master)  1
mailmrge.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 <vcl/svapp.hxx>
21 #include <vcl/settings.hxx>
22 
23 #include <tools/urlobj.hxx>
24 #include <svl/urihelper.hxx>
25 #include <unotools/pathoptions.hxx>
26 #include <svx/svxdlg.hxx>
27 #include <svx/dialogs.hrc>
28 #include <view.hxx>
29 #include <docsh.hxx>
31 #include <wrtsh.hxx>
32 #include <dbmgr.hxx>
33 #include <dbui.hxx>
34 #include <prtopt.hxx>
35 #include <swmodule.hxx>
36 #include <modcfg.hxx>
37 #include <mailmergehelper.hxx>
38 #include <mailmrge.hxx>
39 #include <sfx2/docfile.hxx>
40 #include <sfx2/docfilt.hxx>
42 #include <com/sun/star/container/XChild.hpp>
43 #include <com/sun/star/container/XContainerQuery.hpp>
44 #include <com/sun/star/container/XEnumeration.hpp>
45 #include <com/sun/star/form/runtime/XFormController.hpp>
46 #include <com/sun/star/frame/Frame.hpp>
47 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
48 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
49 #include <com/sun/star/sdbcx/XRowLocate.hpp>
50 #include <com/sun/star/sdb/XResultSetAccess.hpp>
51 #include <com/sun/star/sdbc/XDataSource.hpp>
52 #include <com/sun/star/ui/dialogs/FolderPicker.hpp>
53 #include <com/sun/star/view/XSelectionSupplier.hpp>
56 #include <cppuhelper/implbase.hxx>
57 
58 #include <unomid.h>
59 
60 #include <algorithm>
61 
62 using namespace ::com::sun::star;
63 using namespace ::com::sun::star::container;
64 using namespace ::com::sun::star::lang;
65 using namespace ::com::sun::star::sdb;
66 using namespace ::com::sun::star::sdbc;
67 using namespace ::com::sun::star::sdbcx;
68 using namespace ::com::sun::star::beans;
69 using namespace ::com::sun::star::util;
70 using namespace ::com::sun::star::uno;
71 using namespace ::com::sun::star::frame;
72 using namespace ::com::sun::star::form;
73 using namespace ::com::sun::star::view;
74 using namespace ::com::sun::star::ui::dialogs;
75 
77  uno::Reference<runtime::XFormController> xFController;
78  uno::Reference<XSelectionChangeListener> xChgLstnr;
79  uno::Reference<XSelectionSupplier> xSelSupp;
80 };
81 
82 class SwXSelChgLstnr_Impl : public cppu::WeakImplHelper
83  <
84  view::XSelectionChangeListener
85  >
86 {
88 public:
89  explicit SwXSelChgLstnr_Impl(SwMailMergeDlg& rParentDlg);
90 
91  virtual void SAL_CALL selectionChanged( const EventObject& aEvent ) override;
92  virtual void SAL_CALL disposing( const EventObject& Source ) override;
93 };
94 
96  rParent(rParentDlg)
97 {}
98 
99 void SwXSelChgLstnr_Impl::selectionChanged( const EventObject& )
100 {
101  //call the parent to enable selection mode
102  Sequence <Any> aSelection;
103  if(rParent.pImpl->xSelSupp.is())
104  rParent.pImpl->xSelSupp->getSelection() >>= aSelection;
105 
106  bool bEnable = aSelection.hasElements();
107  rParent.m_pMarkedRB->Enable(bEnable);
108  if(bEnable)
110  else if(rParent.m_pMarkedRB->IsChecked()) {
112  rParent.m_aSelection.realloc(0);
113  }
114 }
115 
116 void SwXSelChgLstnr_Impl::disposing( const EventObject& )
117 {
118  OSL_FAIL("disposing");
119 }
120 
122  const OUString& rSourceName,
123  const OUString& rTableName,
124  sal_Int32 nCommandType,
125  const uno::Reference< XConnection>& _xConnection,
126  Sequence< Any > const * pSelection) :
127 
128  SvxStandardDialog(pParent, "MailmergeDialog", "modules/swriter/ui/mailmerge.ui"),
129 
130  pImpl (new SwMailMergeDlg_Impl),
131 
132  rSh (rShell),
133  nMergeType (DBMGR_MERGE_EMAIL)
134 {
135  Size aDialogSize( GetSizePixel() );
136  get(m_pBeamerWin, "beamer");
137 
138  get(m_pAllRB, "all");
139  get(m_pMarkedRB, "selected");
140  get(m_pFromRB, "rbfrom");
141  get(m_pFromNF, "from");
142  get(m_pToNF, "to");
143 
144  get(m_pPrinterRB, "printer");
145  get(m_pMailingRB, "electronic");
146  get(m_pFileRB, "file");
147 
148  get(m_pSingleJobsCB, "singlejobs");
149 
150  get(m_pSaveMergedDocumentFT, "savemergeddoclabel");
151  get(m_pSaveSingleDocRB, "singledocument");
152  get(m_pSaveIndividualRB, "individualdocuments");
153  get(m_pGenerateFromDataBaseCB, "generate");
154 
155  get(m_pColumnFT, "fieldlabel");
156  get(m_pColumnLB, "field");
157 
158  get(m_pPathFT, "pathlabel");
159  get(m_pPathED, "path");
160  get(m_pPathPB, "pathpb");
161  get(m_pFilterFT, "fileformatlabel");
162  get(m_pFilterLB, "fileformat");
163 
164  get(m_pAddressFieldLB, "address");
165  get(m_pSubjectFT, "subjectlabel");
166  get(m_pSubjectED, "subject");
167  get(m_pFormatFT, "mailformatlabel");
168  get(m_pAttachFT, "attachmentslabel");
169  get(m_pAttachED, "attachments");
170  get(m_pAttachPB, "attach");
171  get(m_pFormatHtmlCB, "html");
172  get(m_pFormatRtfCB, "rtf");
173  get(m_pFormatSwCB, "swriter");
174 
175  get(m_pOkBTN, "ok");
176 
177  m_pSingleJobsCB->Show(false); // not supported in since cws printerpullpages anymore
178  //task #97066# mailing of form letters is currently not supported
179  m_pMailingRB->Show(false);
180  m_pSubjectFT->Show(false);
181  m_pSubjectED->Show(false);
182  m_pFormatFT->Show(false);
183  m_pFormatSwCB->Show(false);
184  m_pFormatHtmlCB->Show(false);
185  m_pFormatRtfCB->Show(false);
186  m_pAttachFT->Show(false);
187  m_pAttachED->Show(false);
188  m_pAttachPB->Show(false);
189 
190  Point aMailPos = m_pMailingRB->GetPosPixel();
191  Point aFilePos = m_pFileRB->GetPosPixel();
192  aFilePos.AdjustX( -((aFilePos.X() - aMailPos.X()) /2) );
193  m_pFileRB->SetPosPixel(aFilePos);
194  uno::Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
195  if(pSelection) {
196  m_aSelection = *pSelection;
197  m_pBeamerWin->Show(false);
198  } else {
199  try {
200  // create a frame wrapper for myself
201  m_xFrame = frame::Frame::create( comphelper::getProcessComponentContext() );
202  m_pUIBuilder->drop_ownership(m_pBeamerWin);
204  } catch (const Exception&) {
205  m_xFrame.clear();
206  }
207  if(m_xFrame.is()) {
208  URL aURL;
209  aURL.Complete = ".component:DB/DataSourceBrowser";
210  uno::Reference<XDispatch> xD = m_xFrame->queryDispatch(aURL,
211  "",
212  0x0C);
213  if(xD.is()) {
214  Sequence<PropertyValue> aProperties(3);
215  PropertyValue* pProperties = aProperties.getArray();
216  pProperties[0].Name = "DataSourceName";
217  pProperties[0].Value <<= rSourceName;
218  pProperties[1].Name = "Command";
219  pProperties[1].Value <<= rTableName;
220  pProperties[2].Name = "CommandType";
221  pProperties[2].Value <<= nCommandType;
222  xD->dispatch(aURL, aProperties);
223  m_pBeamerWin->Show();
224  }
225  uno::Reference<XController> xController = m_xFrame->getController();
226  pImpl->xFController.set(xController, UNO_QUERY);
227  if(pImpl->xFController.is()) {
228  uno::Reference< awt::XControl > xCtrl = pImpl->xFController->getCurrentControl( );
229  pImpl->xSelSupp.set(xCtrl, UNO_QUERY);
230  if(pImpl->xSelSupp.is()) {
231  pImpl->xChgLstnr = new SwXSelChgLstnr_Impl(*this);
232  pImpl->xSelSupp->addSelectionChangeListener( pImpl->xChgLstnr );
233  }
234  }
235  }
236  }
237 
238  pModOpt = SW_MOD()->GetModuleConfig();
239 
240  MailTextFormats nMailingMode(pModOpt->GetMailingFormats());
241  m_pFormatSwCB->Check(bool(nMailingMode & MailTextFormats::OFFICE));
242  m_pFormatHtmlCB->Check(bool(nMailingMode & MailTextFormats::HTML));
243  m_pFormatRtfCB->Check(bool(nMailingMode & MailTextFormats::RTF));
244 
245  m_pAllRB->Check();
246 
247  // Install handlers
248  Link<Button*,void> aLk = LINK(this, SwMailMergeDlg, ButtonHdl);
249  m_pOkBTN->SetClickHdl(aLk);
250 
251  m_pPathPB->SetClickHdl(LINK(this, SwMailMergeDlg, InsertPathHdl));
252 
253  aLk = LINK(this, SwMailMergeDlg, OutputTypeHdl);
255  m_pFileRB->SetClickHdl(aLk);
256 
257  //#i63267# printing might be disabled
259  m_pPrinterRB->Enable(bIsPrintable);
260  OutputTypeHdl(bIsPrintable ? m_pPrinterRB : m_pFileRB);
261 
262  aLk = LINK(this, SwMailMergeDlg, FilenameHdl);
264  bool bColumn = pModOpt->IsNameFromColumn();
265  if(bColumn)
267 
268  FilenameHdl( m_pGenerateFromDataBaseCB );
269  aLk = LINK(this, SwMailMergeDlg, SaveTypeHdl);
273  aLk.Call( m_pSaveSingleDocRB );
274 
275  Link<Edit&,void> aLk2 = LINK(this, SwMailMergeDlg, ModifyHdl);
276  m_pFromNF->SetModifyHdl(aLk2);
277  m_pToNF->SetModifyHdl(aLk2);
280 
281  SwDBManager* pDBManager = rSh.GetDBManager();
282  if(_xConnection.is())
283  SwDBManager::GetColumnNames(m_pAddressFieldLB, _xConnection, rTableName);
284  else
285  pDBManager->GetColumnNames(m_pAddressFieldLB, rSourceName, rTableName);
286  for(sal_Int32 nEntry = 0; nEntry < m_pAddressFieldLB->GetEntryCount(); ++nEntry)
288 
289  m_pAddressFieldLB->SelectEntry("EMAIL");
290 
291  OUString sPath(pModOpt->GetMailingPath());
292  if(sPath.isEmpty()) {
293  SvtPathOptions aPathOpt;
294  sPath = aPathOpt.GetWorkPath();
295  }
296  INetURLObject aURL(sPath);
297  if(aURL.GetProtocol() == INetProtocol::File)
299  else
300  m_pPathED->SetText(aURL.GetFull());
301 
302  if (!bColumn ) {
303  m_pColumnLB->SelectEntry("NAME");
304  } else
306 
311 
312  const bool bEnable = m_aSelection.hasElements();
313  m_pMarkedRB->Enable(bEnable);
314  if (bEnable)
315  m_pMarkedRB->Check();
316  else {
317  m_pAllRB->Check();
318  m_pMarkedRB->Enable(false);
319  }
320  SetMinOutputSizePixel(aDialogSize);
321  try {
322  uno::Reference< container::XNameContainer> xFilterFactory(
323  xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY_THROW);
324  uno::Reference< container::XContainerQuery > xQuery(xFilterFactory, UNO_QUERY_THROW);
325  const OUString sCommand("matchByDocumentService=com.sun.star.text.TextDocument:iflags="
326  + OUString::number(static_cast<sal_Int32>(SfxFilterFlags::EXPORT))
327  + ":eflags="
328  + OUString::number(static_cast<sal_Int32>(SfxFilterFlags::NOTINFILEDLG))
329  + ":default_first");
330  uno::Reference< container::XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand);
331  const OUString sName("Name");
332  sal_Int32 nODT = -1;
333  while(xList->hasMoreElements()) {
334  comphelper::SequenceAsHashMap aFilter(xList->nextElement());
335  const OUString sFilter = aFilter.getUnpackedValueOrDefault(sName, OUString());
336 
337  uno::Any aProps = xFilterFactory->getByName(sFilter);
338  uno::Sequence< beans::PropertyValue > aFilterProperties;
339  aProps >>= aFilterProperties;
340  OUString sUIName2;
341  const beans::PropertyValue* pFilterProperties = aFilterProperties.getConstArray();
342  for(sal_Int32 nProp = 0; nProp < aFilterProperties.getLength(); ++nProp) {
343  if(pFilterProperties[nProp].Name == "UIName") {
344  pFilterProperties[nProp].Value >>= sUIName2;
345  break;
346  }
347  }
348  if( !sUIName2.isEmpty() ) {
349  const sal_Int32 nFilter = m_pFilterLB->InsertEntry( sUIName2 );
350  if( sFilter == "writer8" )
351  nODT = nFilter;
352  m_pFilterLB->SetEntryData( nFilter, new OUString( sFilter ) );
353  }
354  }
355  m_pFilterLB->SelectEntryPos( nODT );
356  } catch (const uno::Exception&) {
357  }
358 }
359 
361 {
362  disposeOnce();
363 }
364 
366 {
367  if(m_xFrame.is()) {
368  m_xFrame->setComponent(nullptr, nullptr);
369  m_xFrame->dispose();
370  }
371 
372  for( sal_Int32 nFilter = 0; nFilter < m_pFilterLB->GetEntryCount(); ++nFilter ) {
373  OUString* pData = static_cast< OUString* >( m_pFilterLB->GetEntryData(nFilter) );
374  delete pData;
375  }
376  pImpl.reset();
378  m_pAllRB.clear();
379  m_pMarkedRB.clear();
380  m_pFromRB.clear();
381  m_pFromNF.clear();
382  m_pToNF.clear();
385  m_pFileRB.clear();
391  m_pColumnFT.clear();
392  m_pColumnLB.clear();
393  m_pPathFT.clear();
394  m_pPathED.clear();
395  m_pPathPB.clear();
396  m_pFilterFT.clear();
397  m_pFilterLB.clear();
401  m_pFormatFT.clear();
402  m_pAttachFT.clear();
403  m_pAttachED.clear();
404  m_pAttachPB.clear();
408  m_pOkBTN.clear();
410 }
411 
413 {
414 }
415 
416 IMPL_LINK( SwMailMergeDlg, ButtonHdl, Button *, pBtn, void )
417 {
418  if (pBtn == m_pOkBTN && ExecQryShell() )
419  EndDialog(RET_OK);
420 }
421 
422 IMPL_LINK( SwMailMergeDlg, OutputTypeHdl, Button *, pBtn, void )
423 {
424  bool bPrint = pBtn == m_pPrinterRB;
425  m_pSingleJobsCB->Enable(bPrint);
426 
427  m_pSaveMergedDocumentFT->Enable( !bPrint );
428  m_pSaveSingleDocRB->Enable( !bPrint );
429  m_pSaveIndividualRB->Enable( !bPrint );
430 
431  if( !bPrint ) {
432  SaveTypeHdl( m_pSaveSingleDocRB->IsChecked() ? m_pSaveSingleDocRB : m_pSaveIndividualRB );
433  } else {
434  m_pPathFT->Enable(false);
435  m_pPathED->Enable(false);
436  m_pPathPB->Enable(false);
437  m_pColumnFT->Enable(false);
438  m_pColumnLB->Enable(false);
439  m_pFilterFT->Enable(false);
440  m_pFilterLB->Enable(false);
441  m_pGenerateFromDataBaseCB->Enable(false);
442  }
443 }
444 
445 IMPL_LINK( SwMailMergeDlg, SaveTypeHdl, Button*, pBtn, void )
446 {
447  bool bIndividual = pBtn == m_pSaveIndividualRB;
448 
449  m_pGenerateFromDataBaseCB->Enable( bIndividual );
450  if( bIndividual ) {
451  FilenameHdl( m_pGenerateFromDataBaseCB );
452  } else {
453  m_pColumnFT->Enable(false);
454  m_pColumnLB->Enable(false);
455  m_pPathFT->Enable( false );
456  m_pPathED->Enable( false );
457  m_pPathPB->Enable( false );
458  m_pFilterFT->Enable( false );
459  m_pFilterLB->Enable( false );
460  }
461 }
462 
463 IMPL_LINK( SwMailMergeDlg, FilenameHdl, Button*, pBox, void )
464 {
465  bool bEnable = static_cast<CheckBox*>(pBox)->IsChecked();
466  m_pColumnFT->Enable( bEnable );
467  m_pColumnLB->Enable(bEnable);
468  m_pPathFT->Enable( bEnable );
469  m_pPathED->Enable(bEnable);
470  m_pPathPB->Enable( bEnable );
471  m_pFilterFT->Enable( bEnable );
472  m_pFilterLB->Enable( bEnable );
473 }
474 
476 {
477  m_pFromRB->Check();
478 }
479 
481 {
483 }
484 
486 {
487  SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium();
488  INetURLObject aAbs;
489  if( pMedium )
490  aAbs = pMedium->GetURLObject();
491  if( INetProtocol::NotValid == aAbs.GetProtocol() )
492  {
493  SvtPathOptions aPathOpt;
494  aAbs.SetURL( aPathOpt.GetWorkPath() );
495  }
498 }
499 
501 {
502  if(pImpl->xSelSupp.is()) {
503  pImpl->xSelSupp->removeSelectionChangeListener( pImpl->xChgLstnr );
504  }
505 
506  if (m_pPrinterRB->IsChecked())
508  else {
512 
513  if (!AskUserFilename()) {
516  m_sSaveFilter = *static_cast<const OUString*>(m_pFilterLB->GetSelectedEntryData());
517  m_sFilename = OUString();
518  } else {
519  //#i97667# reset column name - otherwise it's remembered from the last run
520  pModOpt->SetNameFromColumn(OUString());
521  //start save as dialog
522  OUString sFilter;
524  if (m_sFilename.isEmpty())
525  return false;
526  m_sSaveFilter = sFilter;
527  }
528  }
529 
530  if (m_pFromRB->IsChecked()) { // Insert list
531  // Safe: the maximal value of the fields is limited
532  sal_Int32 nStart = sal::static_int_cast<sal_Int32>(m_pFromNF->GetValue());
533  sal_Int32 nEnd = sal::static_int_cast<sal_Int32>(m_pToNF->GetValue());
534 
535  if (nEnd < nStart)
536  std::swap(nEnd, nStart);
537 
538  m_aSelection.realloc(nEnd - nStart + 1);
539  Any* pSelection = m_aSelection.getArray();
540  for (sal_Int32 i = nStart; i <= nEnd; ++i, ++pSelection)
541  *pSelection <<= i;
542  } else if (m_pAllRB->IsChecked() )
543  m_aSelection.realloc(0); // Empty selection = insert all
544  else {
545  if(pImpl->xSelSupp.is()) {
546  //update selection
547  uno::Reference< XRowLocate > xRowLocate(GetResultSet(),UNO_QUERY);
548  uno::Reference< XResultSet > xRes(xRowLocate,UNO_QUERY);
549  pImpl->xSelSupp->getSelection() >>= m_aSelection;
550  if ( xRowLocate.is() ) {
551  Any* pBegin = m_aSelection.getArray();
552  Any* pEnd = pBegin + m_aSelection.getLength();
553  for (; pBegin != pEnd ; ++pBegin) {
554  if ( xRowLocate->moveToBookmark(*pBegin) )
555  *pBegin <<= xRes->getRow();
556  }
557  }
558  }
559  }
561  SwPrintData aPrtData( rIDDA.getPrintData() );
563  rIDDA.setPrintData(aPrtData);
564 
566 
567  MailTextFormats nMailingMode = MailTextFormats::NONE;
568 
569  if (m_pFormatSwCB->IsChecked())
570  nMailingMode |= MailTextFormats::OFFICE;
571  if (m_pFormatHtmlCB->IsChecked())
572  nMailingMode |= MailTextFormats::HTML;
573  if (m_pFormatRtfCB->IsChecked())
574  nMailingMode |= MailTextFormats::RTF;
575  pModOpt->SetMailingFormats(nMailingMode);
576  return true;
577 }
578 
580 {
581  if( AskUserFilename() )
582  return m_sFilename;
583  OUString sPath( pModOpt->GetMailingPath() );
584  if( sPath.isEmpty() ) {
585  SvtPathOptions aPathOpt;
586  sPath = aPathOpt.GetWorkPath();
587  }
588  if( !sPath.endsWith("/") )
589  sPath += "/";
590  return sPath;
591 }
592 
593 IMPL_LINK_NOARG(SwMailMergeDlg, InsertPathHdl, Button*, void)
594 {
595  uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
596  uno::Reference < XFolderPicker2 > xFP = FolderPicker::create(xContext);
597  xFP->setDisplayDirectory( GetURLfromPath() );
598  if( xFP->execute() == RET_OK ) {
599  INetURLObject aURL(xFP->getDirectory());
600  if(aURL.GetProtocol() == INetProtocol::File)
601  m_pPathED->SetText(aURL.PathToFileName());
602  else
603  m_pPathED->SetText(aURL.GetFull());
604  }
605 }
606 
607 uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const
608 {
609  uno::Reference< XResultSet > xResSetClone;
610  if ( pImpl->xFController.is() ) {
611  // we create a clone to do the task
612  uno::Reference< XResultSetAccess > xResultSetAccess( pImpl->xFController->getModel(),UNO_QUERY);
613  if ( xResultSetAccess.is() )
614  xResSetClone = xResultSetAccess->createResultSet();
615  }
616  return xResSetClone;
617 }
618 
620  : GenericDialogController(pParent, "modules/swriter/ui/mailmergedialog.ui", "MailMergeDialog")
621  , m_xThisDocRB(m_xBuilder->weld_radio_button("document"))
622 {
623 }
624 
626 {
627 }
628 
630  : GenericDialogController(pParent, "modules/swriter/ui/mergeconnectdialog.ui", "MergeConnectDialog")
631  , m_xUseExistingRB(m_xBuilder->weld_radio_button("existing"))
632 {
633 }
634 
636 {
637 }
638 
639 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual Point GetPosPixel() const
void GetColumnNames(ListBox *pListBox, const OUString &rDBName, const OUString &rTableName)
Fill listbox with all column names of a database table.
Definition: dbmgr.cxx:754
IMPL_LINK(SwMailMergeDlg, ButtonHdl, Button *, pBtn, void)
Definition: mailmrge.cxx:416
OUString GetSelectedEntry(sal_Int32 nSelIndex=0) const
virtual void SAL_CALL disposing(const EventObject &Source) override
Definition: mailmrge.cxx:116
SwMailMergeCreateFromDlg(weld::Window *pParent)
Definition: mailmrge.cxx:619
sal_Int32 GetSelectedEntryPos(sal_Int32 nSelIndex=0) const
void SetClickHdl(const Link< Button *, void > &rLink)
long AdjustX(long nHorzMove)
VclPtr< FixedText > m_pFilterFT
Definition: mailmrge.hxx:79
void SetMax(sal_Int64 nNewMax)
css::uno::Sequence< css::uno::Any > m_aSelection
Definition: mailmrge.hxx:101
VclPtr< CheckBox > m_pFormatHtmlCB
Definition: mailmrge.hxx:89
css::uno::Reference< css::sdbc::XResultSet > GetResultSet() const
Definition: mailmrge.cxx:607
static const AllSettings & GetSettings()
std::unique_ptr< SwMailMergeDlg_Impl > pImpl
Definition: mailmrge.hxx:95
VclPtr< CheckBox > m_pSingleJobsCB
Definition: mailmrge.hxx:66
VclPtr< FixedText > m_pPathFT
Definition: mailmrge.hxx:76
IMPL_LINK_NOARG(SwMailMergeDlg, ModifyHdl, Edit &, void)
Definition: mailmrge.cxx:475
friend class SwXSelChgLstnr_Impl
Definition: mailmrge.hxx:52
OUString Name
bool AskUserFilename() const
Definition: mailmrge.cxx:480
sal_Int64 GetValue() const
VclPtr< Edit > m_pPathED
Definition: mailmrge.hxx:77
uno::Reference< XSelectionChangeListener > xChgLstnr
Definition: mailmrge.cxx:78
#define LISTBOX_ENTRY_NOTFOUND
OUString PathToFileName() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:86
SwMailMergeDlg(vcl::Window *pParent, SwWrtShell &rSh, const OUString &rSourceName, const OUString &rTableName, sal_Int32 nCommandType, const css::uno::Reference< css::sdbc::XConnection > &xConnection, css::uno::Sequence< css::uno::Any > const *pSelection)
Definition: mailmrge.cxx:121
void SelectEntry(const OUString &rStr, bool bSelect=true)
VclPtr< RadioButton > m_pMailingRB
Definition: mailmrge.hxx:63
const SwView & GetView() const
Definition: wrtsh.hxx:424
Reference< XController > xController
virtual void SetModifyHdl(const Link< Edit &, void > &rLink)
void Enable(bool bEnable=true, bool bChild=true)
sal_Int32 GetEntryCount() const
Print mail merge.
Definition: dbmgr.hxx:88
bool IsChecked() const
virtual void SAL_CALL selectionChanged(const EventObject &aEvent) override
Definition: mailmrge.cxx:99
void * GetEntryData(sal_Int32 nPos) const
Send mail merge as email.
Definition: dbmgr.hxx:89
virtual ~SwMailMergeCreateFromDlg() override
Definition: mailmrge.cxx:625
const OUString & GetMailingPath() const
Definition: modcfg.hxx:341
SwModuleOptions * pModOpt
Definition: mailmrge.hxx:98
OUString GetEntry(sal_Int32 nPos) const
VclPtr< NumericField > m_pFromNF
Definition: mailmrge.hxx:59
uno::Reference< XSelectionSupplier > xSelSupp
Definition: mailmrge.cxx:79
css::uno::Reference< css::frame::XFrame2 > m_xFrame
Definition: mailmrge.hxx:102
void SetNameFromColumn(const OUString &rSet)
Definition: modcfg.hxx:338
void SetMailingPath(const OUString &sPath)
Definition: modcfg.hxx:342
SwDBManager * GetDBManager() const
For evaluation of DB fields (new DB-manager).
Definition: edfld.cxx:340
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2590
virtual ~SwMailMergeFieldConnectionsDlg() override
Definition: mailmrge.cxx:635
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
VclPtr< Edit > m_pSubjectED
Definition: mailmrge.hxx:84
SwMailMergeDlg & rParent
Definition: mailmrge.cxx:87
OUString CallSaveAsDialog(weld::Window *pParent, OUString &rFilter)
#define SW_MOD()
Definition: swmodule.hxx:255
#define SAL_MAX_INT32
MailTextFormats GetMailingFormats() const
Definition: modcfg.hxx:321
void Check(bool bCheck=true)
VclPtr< FixedText > m_pFormatFT
Definition: mailmrge.hxx:85
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
SwWrtShell & rSh
Definition: mailmrge.hxx:97
VclPtr< FixedText > m_pSubjectFT
Definition: mailmrge.hxx:83
void SetMailingFormats(MailTextFormats nSet)
Definition: modcfg.hxx:322
OUString GetURLfromPath() const
Definition: mailmrge.cxx:485
virtual ~SwMailMergeDlg() override
Definition: mailmrge.cxx:360
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
OUString sName
int i
VclPtr< ListBox > m_pColumnLB
Definition: mailmrge.hxx:75
virtual OUString GetText() const override
sal_Int32 GetSelectedEntryCount() const
bool IsChecked() const
weld::Window * GetFrameWeld(SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
Object Value
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=LISTBOX_APPEND)
OUString m_sFilename
Definition: mailmrge.hxx:105
void Check(bool bCheck=true)
VclPtr< ListBox > m_pAddressFieldLB
Definition: mailmrge.hxx:82
VclPtr< NumericField > m_pToNF
Definition: mailmrge.hxx:60
long X() const
virtual void dispose() override
Definition: mailmrge.cxx:365
VclPtr< CheckBox > m_pGenerateFromDataBaseCB
Definition: mailmrge.hxx:72
SwDocShell * GetDocShell()
Definition: view.cxx:1115
VclPtr< FixedText > m_pAttachFT
Definition: mailmrge.hxx:86
VclPtr< RadioButton > m_pFileRB
Definition: mailmrge.hxx:64
Provides access to the formatting devices of a document.
OUString GetTargetURL() const
Definition: mailmrge.cxx:579
VclPtr< RadioButton > m_pSaveIndividualRB
Definition: mailmrge.hxx:70
VclPtr< PushButton > m_pAttachPB
Definition: mailmrge.hxx:88
OUString m_sSaveFilter
Definition: mailmrge.hxx:104
bool ExecQryShell()
Definition: mailmrge.cxx:500
void SetSinglePrintJob(bool b)
Definition: modcfg.hxx:325
const OUString & GetWorkPath() const
VclPtr< CheckBox > m_pFormatSwCB
Definition: mailmrge.hxx:91
Reference< XMultiServiceFactory > getProcessServiceFactory()
VclPtr< FixedText > m_pColumnFT
Definition: mailmrge.hxx:74
uno::Reference< runtime::XFormController > xFController
Definition: mailmrge.cxx:77
MailTextFormats
Definition: modcfg.hxx:37
VclPtr< OKButton > m_pOkBTN
Definition: mailmrge.hxx:93
void SetPrintSingleJobs(bool b)
Definition: printdata.hxx:164
virtual void Apply() override
Definition: mailmrge.cxx:412
VclPtr< FixedText > m_pSaveMergedDocumentFT
Definition: mailmrge.hxx:68
Save mail merge as files.
Definition: dbmgr.hxx:90
VclPtr< vcl::Window > m_pBeamerWin
Definition: mailmrge.hxx:54
SwXSelChgLstnr_Impl(SwMailMergeDlg &rParentDlg)
Definition: mailmrge.cxx:95
INetProtocol GetProtocol() const
RET_OK
VclPtr< CheckBox > m_pFormatRtfCB
Definition: mailmrge.hxx:90
virtual void setPrintData(const SwPrintData &rPrtData)=0
Sets the PrintData.
VclPtr< PushButton > m_pPathPB
Definition: mailmrge.hxx:78
SwMailMergeFieldConnectionsDlg(weld::Window *pParent)
Definition: mailmrge.cxx:629
const INetURLObject & GetURLObject() const
Reference< XComponentContext > getProcessComponentContext()
VclPtr< RadioButton > m_pSaveSingleDocRB
Definition: mailmrge.hxx:69
const OUString & GetNameFromColumn() const
Definition: modcfg.hxx:337
void SetIsNameFromColumn(bool bSet)
Definition: modcfg.hxx:329
VclPtr< RadioButton > m_pMarkedRB
Definition: mailmrge.hxx:57
const MiscSettings & GetMiscSettings() const
VclPtr< Edit > m_pAttachED
Definition: mailmrge.hxx:87
bool SetURL(OUString const &rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
void * GetSelectedEntryData() const
virtual void SetText(const OUString &rStr) override
bool GetDisablePrinting() const
void SetEntryData(sal_Int32 nPos, void *pNewData)
VclPtr< RadioButton > m_pFromRB
Definition: mailmrge.hxx:58
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
VclPtr< ListBox > m_pFilterLB
Definition: mailmrge.hxx:80
VclPtr< RadioButton > m_pPrinterRB
Definition: mailmrge.hxx:62
virtual void SetPosPixel(const Point &rNewPos)
bool IsNameFromColumn() const
Definition: modcfg.hxx:328
VclPtr< RadioButton > m_pAllRB
Definition: mailmrge.hxx:56
OUString GetFull() const
DBManagerOptions nMergeType
Definition: mailmrge.hxx:100
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SfxMedium * GetMedium() const