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  SfxModalDialog(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  auto pProp = std::find_if(aFilterProperties.begin(), aFilterProperties.end(),
342  [](const beans::PropertyValue& rProp) { return rProp.Name == "UIName"; });
343  if (pProp != aFilterProperties.end())
344  pProp->Value >>= sUIName2;
345  if( !sUIName2.isEmpty() ) {
346  const sal_Int32 nFilter = m_pFilterLB->InsertEntry( sUIName2 );
347  if( sFilter == "writer8" )
348  nODT = nFilter;
349  m_pFilterLB->SetEntryData( nFilter, new OUString( sFilter ) );
350  }
351  }
352  m_pFilterLB->SelectEntryPos( nODT );
353  } catch (const uno::Exception&) {
354  }
355 }
356 
358 {
359  disposeOnce();
360 }
361 
363 {
364  if(m_xFrame.is()) {
365  m_xFrame->setComponent(nullptr, nullptr);
366  m_xFrame->dispose();
367  }
368 
369  for( sal_Int32 nFilter = 0; nFilter < m_pFilterLB->GetEntryCount(); ++nFilter ) {
370  OUString* pData = static_cast< OUString* >( m_pFilterLB->GetEntryData(nFilter) );
371  delete pData;
372  }
373  pImpl.reset();
375  m_pAllRB.clear();
376  m_pMarkedRB.clear();
377  m_pFromRB.clear();
378  m_pFromNF.clear();
379  m_pToNF.clear();
382  m_pFileRB.clear();
388  m_pColumnFT.clear();
389  m_pColumnLB.clear();
390  m_pPathFT.clear();
391  m_pPathED.clear();
392  m_pPathPB.clear();
393  m_pFilterFT.clear();
394  m_pFilterLB.clear();
398  m_pFormatFT.clear();
399  m_pAttachFT.clear();
400  m_pAttachED.clear();
401  m_pAttachPB.clear();
405  m_pOkBTN.clear();
407 }
408 
409 IMPL_LINK( SwMailMergeDlg, ButtonHdl, Button *, pBtn, void )
410 {
411  if (pBtn == m_pOkBTN && ExecQryShell() )
412  EndDialog(RET_OK);
413 }
414 
415 IMPL_LINK( SwMailMergeDlg, OutputTypeHdl, Button *, pBtn, void )
416 {
417  bool bPrint = pBtn == m_pPrinterRB;
418  m_pSingleJobsCB->Enable(bPrint);
419 
420  m_pSaveMergedDocumentFT->Enable( !bPrint );
421  m_pSaveSingleDocRB->Enable( !bPrint );
422  m_pSaveIndividualRB->Enable( !bPrint );
423 
424  if( !bPrint ) {
425  SaveTypeHdl( m_pSaveSingleDocRB->IsChecked() ? m_pSaveSingleDocRB : m_pSaveIndividualRB );
426  } else {
427  m_pPathFT->Enable(false);
428  m_pPathED->Enable(false);
429  m_pPathPB->Enable(false);
430  m_pColumnFT->Enable(false);
431  m_pColumnLB->Enable(false);
432  m_pFilterFT->Enable(false);
433  m_pFilterLB->Enable(false);
434  m_pGenerateFromDataBaseCB->Enable(false);
435  }
436 }
437 
438 IMPL_LINK( SwMailMergeDlg, SaveTypeHdl, Button*, pBtn, void )
439 {
440  bool bIndividual = pBtn == m_pSaveIndividualRB;
441 
442  m_pGenerateFromDataBaseCB->Enable( bIndividual );
443  if( bIndividual ) {
444  FilenameHdl( m_pGenerateFromDataBaseCB );
445  } else {
446  m_pColumnFT->Enable(false);
447  m_pColumnLB->Enable(false);
448  m_pPathFT->Enable( false );
449  m_pPathED->Enable( false );
450  m_pPathPB->Enable( false );
451  m_pFilterFT->Enable( false );
452  m_pFilterLB->Enable( false );
453  }
454 }
455 
456 IMPL_LINK( SwMailMergeDlg, FilenameHdl, Button*, pBox, void )
457 {
458  bool bEnable = static_cast<CheckBox*>(pBox)->IsChecked();
459  m_pColumnFT->Enable( bEnable );
460  m_pColumnLB->Enable(bEnable);
461  m_pPathFT->Enable( bEnable );
462  m_pPathED->Enable(bEnable);
463  m_pPathPB->Enable( bEnable );
464  m_pFilterFT->Enable( bEnable );
465  m_pFilterLB->Enable( bEnable );
466 }
467 
469 {
470  m_pFromRB->Check();
471 }
472 
474 {
476 }
477 
479 {
480  SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium();
481  INetURLObject aAbs;
482  if( pMedium )
483  aAbs = pMedium->GetURLObject();
484  if( INetProtocol::NotValid == aAbs.GetProtocol() )
485  {
486  SvtPathOptions aPathOpt;
487  aAbs.SetURL( aPathOpt.GetWorkPath() );
488  }
491 }
492 
494 {
495  if(pImpl->xSelSupp.is()) {
496  pImpl->xSelSupp->removeSelectionChangeListener( pImpl->xChgLstnr );
497  }
498 
499  if (m_pPrinterRB->IsChecked())
501  else {
505 
506  if (!AskUserFilename()) {
509  m_sSaveFilter = *static_cast<const OUString*>(m_pFilterLB->GetSelectedEntryData());
510  m_sFilename = OUString();
511  } else {
512  //#i97667# reset column name - otherwise it's remembered from the last run
513  pModOpt->SetNameFromColumn(OUString());
514  //start save as dialog
515  OUString sFilter;
517  if (m_sFilename.isEmpty())
518  return false;
519  m_sSaveFilter = sFilter;
520  }
521  }
522 
523  if (m_pFromRB->IsChecked()) { // Insert list
524  // Safe: the maximal value of the fields is limited
525  sal_Int32 nStart = sal::static_int_cast<sal_Int32>(m_pFromNF->GetValue());
526  sal_Int32 nEnd = sal::static_int_cast<sal_Int32>(m_pToNF->GetValue());
527 
528  if (nEnd < nStart)
529  std::swap(nEnd, nStart);
530 
531  m_aSelection.realloc(nEnd - nStart + 1);
532  Any* pSelection = m_aSelection.getArray();
533  for (sal_Int32 i = nStart; i <= nEnd; ++i, ++pSelection)
534  *pSelection <<= i;
535  } else if (m_pAllRB->IsChecked() )
536  m_aSelection.realloc(0); // Empty selection = insert all
537  else {
538  if(pImpl->xSelSupp.is()) {
539  //update selection
540  uno::Reference< XRowLocate > xRowLocate(GetResultSet(),UNO_QUERY);
541  uno::Reference< XResultSet > xRes(xRowLocate,UNO_QUERY);
542  pImpl->xSelSupp->getSelection() >>= m_aSelection;
543  if ( xRowLocate.is() ) {
544  for (Any& rRow : m_aSelection) {
545  if ( xRowLocate->moveToBookmark(rRow) )
546  rRow <<= xRes->getRow();
547  }
548  }
549  }
550  }
552  SwPrintData aPrtData( rIDDA.getPrintData() );
554  rIDDA.setPrintData(aPrtData);
555 
557 
558  MailTextFormats nMailingMode = MailTextFormats::NONE;
559 
560  if (m_pFormatSwCB->IsChecked())
561  nMailingMode |= MailTextFormats::OFFICE;
562  if (m_pFormatHtmlCB->IsChecked())
563  nMailingMode |= MailTextFormats::HTML;
564  if (m_pFormatRtfCB->IsChecked())
565  nMailingMode |= MailTextFormats::RTF;
566  pModOpt->SetMailingFormats(nMailingMode);
567  return true;
568 }
569 
571 {
572  if( AskUserFilename() )
573  return m_sFilename;
574  OUString sPath( pModOpt->GetMailingPath() );
575  if( sPath.isEmpty() ) {
576  SvtPathOptions aPathOpt;
577  sPath = aPathOpt.GetWorkPath();
578  }
579  if( !sPath.endsWith("/") )
580  sPath += "/";
581  return sPath;
582 }
583 
584 IMPL_LINK_NOARG(SwMailMergeDlg, InsertPathHdl, Button*, void)
585 {
586  uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
587  uno::Reference < XFolderPicker2 > xFP = FolderPicker::create(xContext);
588  xFP->setDisplayDirectory( GetURLfromPath() );
589  if( xFP->execute() == RET_OK ) {
590  INetURLObject aURL(xFP->getDirectory());
591  if(aURL.GetProtocol() == INetProtocol::File)
592  m_pPathED->SetText(aURL.PathToFileName());
593  else
594  m_pPathED->SetText(aURL.GetFull());
595  }
596 }
597 
598 uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const
599 {
600  uno::Reference< XResultSet > xResSetClone;
601  if ( pImpl->xFController.is() ) {
602  // we create a clone to do the task
603  uno::Reference< XResultSetAccess > xResultSetAccess( pImpl->xFController->getModel(),UNO_QUERY);
604  if ( xResultSetAccess.is() )
605  xResSetClone = xResultSetAccess->createResultSet();
606  }
607  return xResSetClone;
608 }
609 
611  : GenericDialogController(pParent, "modules/swriter/ui/mailmergedialog.ui", "MailMergeDialog")
612  , m_xThisDocRB(m_xBuilder->weld_radio_button("document"))
613 {
614 }
615 
617 {
618 }
619 
621  : GenericDialogController(pParent, "modules/swriter/ui/mergeconnectdialog.ui", "MergeConnectDialog")
622  , m_xUseExistingRB(m_xBuilder->weld_radio_button("existing"))
623 {
624 }
625 
627 {
628 }
629 
630 /* 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:752
IMPL_LINK(SwMailMergeDlg, ButtonHdl, Button *, pBtn, void)
Definition: mailmrge.cxx:409
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:610
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:81
void SetMax(sal_Int64 nNewMax)
css::uno::Sequence< css::uno::Any > m_aSelection
Definition: mailmrge.hxx:103
VclPtr< CheckBox > m_pFormatHtmlCB
Definition: mailmrge.hxx:91
css::uno::Reference< css::sdbc::XResultSet > GetResultSet() const
Definition: mailmrge.cxx:598
static const AllSettings & GetSettings()
std::unique_ptr< SwMailMergeDlg_Impl > pImpl
Definition: mailmrge.hxx:97
VclPtr< CheckBox > m_pSingleJobsCB
Definition: mailmrge.hxx:68
VclPtr< FixedText > m_pPathFT
Definition: mailmrge.hxx:78
IMPL_LINK_NOARG(SwMailMergeDlg, ModifyHdl, Edit &, void)
Definition: mailmrge.cxx:468
friend class SwXSelChgLstnr_Impl
Definition: mailmrge.hxx:54
bool AskUserFilename() const
Definition: mailmrge.cxx:473
sal_Int64 GetValue() const
VclPtr< Edit > m_pPathED
Definition: mailmrge.hxx:79
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:88
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:65
const SwView & GetView() const
Definition: wrtsh.hxx:426
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:616
const OUString & GetMailingPath() const
Definition: modcfg.hxx:342
SwModuleOptions * pModOpt
Definition: mailmrge.hxx:100
OUString GetEntry(sal_Int32 nPos) const
VclPtr< NumericField > m_pFromNF
Definition: mailmrge.hxx:61
uno::Reference< XSelectionSupplier > xSelSupp
Definition: mailmrge.cxx:79
css::uno::Reference< css::frame::XFrame2 > m_xFrame
Definition: mailmrge.hxx:104
void SetNameFromColumn(const OUString &rSet)
Definition: modcfg.hxx:339
void SetMailingPath(const OUString &sPath)
Definition: modcfg.hxx:343
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:2589
virtual ~SwMailMergeFieldConnectionsDlg() override
Definition: mailmrge.cxx:626
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
VclPtr< Edit > m_pSubjectED
Definition: mailmrge.hxx:86
SwMailMergeDlg & rParent
Definition: mailmrge.cxx:87
OUString CallSaveAsDialog(weld::Window *pParent, OUString &rFilter)
#define SW_MOD()
Definition: swmodule.hxx:256
#define SAL_MAX_INT32
MailTextFormats GetMailingFormats() const
Definition: modcfg.hxx:322
void Check(bool bCheck=true)
VclPtr< FixedText > m_pFormatFT
Definition: mailmrge.hxx:87
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
SwWrtShell & rSh
Definition: mailmrge.hxx:99
VclPtr< FixedText > m_pSubjectFT
Definition: mailmrge.hxx:85
void SetMailingFormats(MailTextFormats nSet)
Definition: modcfg.hxx:323
OUString GetURLfromPath() const
Definition: mailmrge.cxx:478
virtual ~SwMailMergeDlg() override
Definition: mailmrge.cxx:357
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
virtual void dispose() override
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
OUString sName
int i
VclPtr< ListBox > m_pColumnLB
Definition: mailmrge.hxx:77
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:107
void Check(bool bCheck=true)
VclPtr< ListBox > m_pAddressFieldLB
Definition: mailmrge.hxx:84
VclPtr< NumericField > m_pToNF
Definition: mailmrge.hxx:62
long X() const
virtual void dispose() override
Definition: mailmrge.cxx:362
VclPtr< CheckBox > m_pGenerateFromDataBaseCB
Definition: mailmrge.hxx:74
SwDocShell * GetDocShell()
Definition: view.cxx:1127
VclPtr< FixedText > m_pAttachFT
Definition: mailmrge.hxx:88
VclPtr< RadioButton > m_pFileRB
Definition: mailmrge.hxx:66
Provides access to the formatting devices of a document.
OUString GetTargetURL() const
Definition: mailmrge.cxx:570
VclPtr< RadioButton > m_pSaveIndividualRB
Definition: mailmrge.hxx:72
VclPtr< PushButton > m_pAttachPB
Definition: mailmrge.hxx:90
OUString m_sSaveFilter
Definition: mailmrge.hxx:106
bool ExecQryShell()
Definition: mailmrge.cxx:493
void SetSinglePrintJob(bool b)
Definition: modcfg.hxx:326
const OUString & GetWorkPath() const
VclPtr< CheckBox > m_pFormatSwCB
Definition: mailmrge.hxx:93
Reference< XMultiServiceFactory > getProcessServiceFactory()
VclPtr< FixedText > m_pColumnFT
Definition: mailmrge.hxx:76
uno::Reference< runtime::XFormController > xFController
Definition: mailmrge.cxx:77
MailTextFormats
Definition: modcfg.hxx:38
VclPtr< OKButton > m_pOkBTN
Definition: mailmrge.hxx:95
void SetPrintSingleJobs(bool b)
Definition: printdata.hxx:164
VclPtr< FixedText > m_pSaveMergedDocumentFT
Definition: mailmrge.hxx:70
Save mail merge as files.
Definition: dbmgr.hxx:90
VclPtr< vcl::Window > m_pBeamerWin
Definition: mailmrge.hxx:56
SwXSelChgLstnr_Impl(SwMailMergeDlg &rParentDlg)
Definition: mailmrge.cxx:95
INetProtocol GetProtocol() const
RET_OK
VclPtr< CheckBox > m_pFormatRtfCB
Definition: mailmrge.hxx:92
virtual void setPrintData(const SwPrintData &rPrtData)=0
Sets the PrintData.
VclPtr< PushButton > m_pPathPB
Definition: mailmrge.hxx:80
SwMailMergeFieldConnectionsDlg(weld::Window *pParent)
Definition: mailmrge.cxx:620
const INetURLObject & GetURLObject() const
Reference< XComponentContext > getProcessComponentContext()
VclPtr< RadioButton > m_pSaveSingleDocRB
Definition: mailmrge.hxx:71
const OUString & GetNameFromColumn() const
Definition: modcfg.hxx:338
void SetIsNameFromColumn(bool bSet)
Definition: modcfg.hxx:330
VclPtr< RadioButton > m_pMarkedRB
Definition: mailmrge.hxx:59
const MiscSettings & GetMiscSettings() const
VclPtr< Edit > m_pAttachED
Definition: mailmrge.hxx:89
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:60
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
VclPtr< ListBox > m_pFilterLB
Definition: mailmrge.hxx:82
VclPtr< RadioButton > m_pPrinterRB
Definition: mailmrge.hxx:64
virtual void SetPosPixel(const Point &rNewPos)
bool IsNameFromColumn() const
Definition: modcfg.hxx:329
VclPtr< RadioButton > m_pAllRB
Definition: mailmrge.hxx:58
OUString GetFull() const
DBManagerOptions nMergeType
Definition: mailmrge.hxx:102
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