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 <view.hxx>
27 #include <docsh.hxx>
29 #include <printdata.hxx>
30 #include <wrtsh.hxx>
31 #include <dbmgr.hxx>
32 #include <swmodule.hxx>
33 #include <modcfg.hxx>
34 #include <mailmergehelper.hxx>
35 #include <mailmrge.hxx>
36 #include <sfx2/docfile.hxx>
39 #include <com/sun/star/container/XContainerQuery.hpp>
40 #include <com/sun/star/container/XEnumeration.hpp>
41 #include <com/sun/star/form/runtime/XFormController.hpp>
42 #include <com/sun/star/frame/Frame.hpp>
43 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
44 #include <com/sun/star/sdbcx/XRowLocate.hpp>
45 #include <com/sun/star/sdb/XResultSetAccess.hpp>
46 #include <com/sun/star/ui/dialogs/FolderPicker.hpp>
47 #include <com/sun/star/view/XSelectionSupplier.hpp>
49 #include <cppuhelper/implbase.hxx>
50 
51 #include <algorithm>
52 
53 using namespace ::com::sun::star;
54 using namespace ::com::sun::star::container;
55 using namespace ::com::sun::star::lang;
56 using namespace ::com::sun::star::sdb;
57 using namespace ::com::sun::star::sdbc;
58 using namespace ::com::sun::star::sdbcx;
59 using namespace ::com::sun::star::beans;
60 using namespace ::com::sun::star::util;
61 using namespace ::com::sun::star::uno;
62 using namespace ::com::sun::star::frame;
63 using namespace ::com::sun::star::form;
64 using namespace ::com::sun::star::view;
65 using namespace ::com::sun::star::ui::dialogs;
66 
68  uno::Reference<runtime::XFormController> xFController;
69  uno::Reference<XSelectionChangeListener> xChgLstnr;
70  uno::Reference<XSelectionSupplier> xSelSupp;
71 };
72 
73 class SwXSelChgLstnr_Impl : public cppu::WeakImplHelper
74  <
75  view::XSelectionChangeListener
76  >
77 {
79 public:
80  explicit SwXSelChgLstnr_Impl(SwMailMergeDlg& rParentDlg);
81 
82  virtual void SAL_CALL selectionChanged( const EventObject& aEvent ) override;
83  virtual void SAL_CALL disposing( const EventObject& Source ) override;
84 };
85 
87  rParent(rParentDlg)
88 {}
89 
90 void SwXSelChgLstnr_Impl::selectionChanged( const EventObject& )
91 {
92  //call the parent to enable selection mode
93  Sequence <Any> aSelection;
94  if(rParent.pImpl->xSelSupp.is())
95  rParent.pImpl->xSelSupp->getSelection() >>= aSelection;
96 
97  bool bEnable = aSelection.hasElements();
98  rParent.m_xMarkedRB->set_sensitive(bEnable);
99  if(bEnable)
100  rParent.m_xMarkedRB->set_active(true);
101  else if(rParent.m_xMarkedRB->get_active()) {
102  rParent.m_xAllRB->set_active(true);
103  rParent.m_aSelection.realloc(0);
104  }
105 }
106 
107 void SwXSelChgLstnr_Impl::disposing( const EventObject& )
108 {
109  OSL_FAIL("disposing");
110 }
111 
113  const OUString& rSourceName,
114  const OUString& rTableName,
115  sal_Int32 nCommandType,
116  const uno::Reference< XConnection>& _xConnection,
117  Sequence< Any > const * pSelection)
118  : SfxDialogController(pParent, "modules/swriter/ui/mailmerge.ui", "MailmergeDialog")
119  , pImpl(new SwMailMergeDlg_Impl)
120  , rSh(rShell)
121  , nMergeType(DBMGR_MERGE_EMAIL)
122  , m_xBeamerWin(m_xBuilder->weld_container("beamer"))
123  , m_xAllRB(m_xBuilder->weld_radio_button("all"))
124  , m_xMarkedRB(m_xBuilder->weld_radio_button("selected"))
125  , m_xFromRB(m_xBuilder->weld_radio_button("rbfrom"))
126  , m_xFromNF(m_xBuilder->weld_spin_button("from"))
127  , m_xToNF(m_xBuilder->weld_spin_button("to"))
128  , m_xPrinterRB(m_xBuilder->weld_radio_button("printer"))
129  , m_xMailingRB(m_xBuilder->weld_radio_button("electronic"))
130  , m_xFileRB(m_xBuilder->weld_radio_button("file"))
131  , m_xSingleJobsCB(m_xBuilder->weld_check_button("singlejobs"))
132  , m_xSaveMergedDocumentFT(m_xBuilder->weld_label("savemergeddoclabel"))
133  , m_xSaveSingleDocRB(m_xBuilder->weld_radio_button("singledocument"))
134  , m_xSaveIndividualRB(m_xBuilder->weld_radio_button("individualdocuments"))
135  , m_xGenerateFromDataBaseCB(m_xBuilder->weld_check_button("generate"))
136  , m_xColumnFT(m_xBuilder->weld_label("fieldlabel"))
137  , m_xColumnLB(m_xBuilder->weld_combo_box("field"))
138  , m_xPathFT(m_xBuilder->weld_label("pathlabel"))
139  , m_xPathED(m_xBuilder->weld_entry("path"))
140  , m_xPathPB(m_xBuilder->weld_button("pathpb"))
141  , m_xFilterFT(m_xBuilder->weld_label("fileformatlabel"))
142  , m_xFilterLB(m_xBuilder->weld_combo_box("fileformat"))
143  , m_xAddressFieldLB(m_xBuilder->weld_combo_box("address"))
144  , m_xSubjectFT(m_xBuilder->weld_label("subjectlabel"))
145  , m_xSubjectED(m_xBuilder->weld_entry("subject"))
146  , m_xFormatFT(m_xBuilder->weld_label("mailformatlabel"))
147  , m_xAttachFT(m_xBuilder->weld_label("attachmentslabel"))
148  , m_xAttachED(m_xBuilder->weld_entry("attachments"))
149  , m_xAttachPB(m_xBuilder->weld_button("attach"))
150  , m_xFormatHtmlCB(m_xBuilder->weld_check_button("html"))
151  , m_xFormatRtfCB(m_xBuilder->weld_check_button("rtf"))
152  , m_xFormatSwCB(m_xBuilder->weld_check_button("swriter"))
153  , m_xOkBTN(m_xBuilder->weld_button("ok"))
154 {
155  m_xSingleJobsCB->hide(); // not supported in since cws printerpullpages anymore
156  //task #97066# mailing of form letters is currently not supported
157  m_xMailingRB->hide();
158  m_xSubjectFT->hide();
159  m_xSubjectED->hide();
160  m_xFormatFT->hide();
161  m_xFormatSwCB->hide();
162  m_xFormatHtmlCB->hide();
163  m_xFormatRtfCB->hide();
164  m_xAttachFT->hide();
165  m_xAttachED->hide();
166  m_xAttachPB->hide();
167 
168  uno::Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
169  if(pSelection) {
170  m_aSelection = *pSelection;
171  m_xBeamerWin->hide();
172  } else {
173  try {
174  // create a frame wrapper for myself
175  m_xFrame = frame::Frame::create( comphelper::getProcessComponentContext() );
176  m_xFrame->initialize(m_xBeamerWin->CreateChildFrame());
177  } catch (const Exception&) {
178  m_xFrame.clear();
179  }
180  if(m_xFrame.is()) {
181  URL aURL;
182  aURL.Complete = ".component:DB/DataSourceBrowser";
183  uno::Reference<XDispatch> xD = m_xFrame->queryDispatch(aURL,
184  "",
185  0x0C);
186  if(xD.is()) {
187  Sequence<PropertyValue> aProperties(3);
188  PropertyValue* pProperties = aProperties.getArray();
189  pProperties[0].Name = "DataSourceName";
190  pProperties[0].Value <<= rSourceName;
191  pProperties[1].Name = "Command";
192  pProperties[1].Value <<= rTableName;
193  pProperties[2].Name = "CommandType";
194  pProperties[2].Value <<= nCommandType;
195  xD->dispatch(aURL, aProperties);
196  m_xBeamerWin->show();
197  }
198  uno::Reference<XController> xController = m_xFrame->getController();
199  pImpl->xFController.set(xController, UNO_QUERY);
200  if(pImpl->xFController.is()) {
201  uno::Reference< awt::XControl > xCtrl = pImpl->xFController->getCurrentControl( );
202  pImpl->xSelSupp.set(xCtrl, UNO_QUERY);
203  if(pImpl->xSelSupp.is()) {
204  pImpl->xChgLstnr = new SwXSelChgLstnr_Impl(*this);
205  pImpl->xSelSupp->addSelectionChangeListener( pImpl->xChgLstnr );
206  }
207  }
208  }
209  }
210 
211  pModOpt = SW_MOD()->GetModuleConfig();
212 
213  MailTextFormats nMailingMode(pModOpt->GetMailingFormats());
214  m_xFormatSwCB->set_active(bool(nMailingMode & MailTextFormats::OFFICE));
215  m_xFormatHtmlCB->set_active(bool(nMailingMode & MailTextFormats::HTML));
216  m_xFormatRtfCB->set_active(bool(nMailingMode & MailTextFormats::RTF));
217 
218  m_xAllRB->set_active(true);
219 
220  // Install handlers
221  m_xOkBTN->connect_clicked(LINK(this, SwMailMergeDlg, ButtonHdl));
222 
223  m_xPathPB->connect_clicked(LINK(this, SwMailMergeDlg, InsertPathHdl));
224 
225  m_xPrinterRB->connect_toggled(LINK(this, SwMailMergeDlg, OutputTypeHdl));
226  m_xFileRB->connect_toggled(LINK(this, SwMailMergeDlg, OutputTypeHdl));
227 
228  //#i63267# printing might be disabled
230  m_xPrinterRB->set_sensitive(bIsPrintable);
231  OutputTypeHdl(bIsPrintable ? *m_xPrinterRB : *m_xFileRB);
232 
233  m_xGenerateFromDataBaseCB->connect_toggled(LINK(this, SwMailMergeDlg, FilenameHdl));
234  bool bColumn = pModOpt->IsNameFromColumn();
235  if(bColumn)
236  m_xGenerateFromDataBaseCB->set_active(true);
237 
238  FilenameHdl(*m_xGenerateFromDataBaseCB);
239  m_xSaveSingleDocRB->set_active(true);
240  m_xSaveSingleDocRB->connect_toggled(LINK(this, SwMailMergeDlg, SaveTypeHdl));
241  m_xSaveIndividualRB->connect_toggled(LINK(this, SwMailMergeDlg, SaveTypeHdl));
242  SaveTypeHdl(*m_xSaveSingleDocRB);
243 
244  Link<weld::SpinButton&,void> aLk2 = LINK(this, SwMailMergeDlg, ModifyHdl);
245  m_xFromNF->connect_value_changed(aLk2);
246  m_xToNF->connect_value_changed(aLk2);
247  m_xFromNF->set_max(SAL_MAX_INT32);
248  m_xToNF->set_max(SAL_MAX_INT32);
249 
250  SwDBManager* pDBManager = rSh.GetDBManager();
251  if(_xConnection.is())
252  SwDBManager::GetColumnNames(*m_xAddressFieldLB, _xConnection, rTableName);
253  else
254  pDBManager->GetColumnNames(*m_xAddressFieldLB, rSourceName, rTableName);
255  for(sal_Int32 nEntry = 0, nEntryCount = m_xAddressFieldLB->get_count(); nEntry < nEntryCount; ++nEntry)
256  m_xColumnLB->append_text(m_xAddressFieldLB->get_text(nEntry));
257 
258  m_xAddressFieldLB->set_active_text("EMAIL");
259 
260  OUString sPath(pModOpt->GetMailingPath());
261  if(sPath.isEmpty()) {
262  SvtPathOptions aPathOpt;
263  sPath = aPathOpt.GetWorkPath();
264  }
265  INetURLObject aURL(sPath);
266  if(aURL.GetProtocol() == INetProtocol::File)
267  m_xPathED->set_text(aURL.PathToFileName());
268  else
269  m_xPathED->set_text(aURL.GetFull());
270 
271  if (!bColumn ) {
272  m_xColumnLB->set_active_text("NAME");
273  } else
274  m_xColumnLB->set_active_text(pModOpt->GetNameFromColumn());
275 
276  if (m_xAddressFieldLB->get_active() == -1)
277  m_xAddressFieldLB->set_active(0);
278  if (m_xColumnLB->get_active() == -1)
279  m_xColumnLB->set_active(0);
280 
281  const bool bEnable = m_aSelection.hasElements();
282  m_xMarkedRB->set_sensitive(bEnable);
283  if (bEnable)
284  m_xMarkedRB->set_active(true);
285  else {
286  m_xAllRB->set_active(true);
287  m_xMarkedRB->set_sensitive(false);
288  }
289  try {
290  uno::Reference< container::XNameContainer> xFilterFactory(
291  xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY_THROW);
292  uno::Reference< container::XContainerQuery > xQuery(xFilterFactory, UNO_QUERY_THROW);
293  const OUString sCommand("matchByDocumentService=com.sun.star.text.TextDocument:iflags="
294  + OUString::number(static_cast<sal_Int32>(SfxFilterFlags::EXPORT))
295  + ":eflags="
296  + OUString::number(static_cast<sal_Int32>(SfxFilterFlags::NOTINFILEDLG))
297  + ":default_first");
298  uno::Reference< container::XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand);
299  const OUString sName("Name");
300  sal_Int32 nODT = -1;
301  while(xList->hasMoreElements()) {
302  comphelper::SequenceAsHashMap aFilter(xList->nextElement());
303  const OUString sFilter = aFilter.getUnpackedValueOrDefault(sName, OUString());
304 
305  uno::Any aProps = xFilterFactory->getByName(sFilter);
306  uno::Sequence< beans::PropertyValue > aFilterProperties;
307  aProps >>= aFilterProperties;
308  OUString sUIName2;
309  auto pProp = std::find_if(aFilterProperties.begin(), aFilterProperties.end(),
310  [](const beans::PropertyValue& rProp) { return rProp.Name == "UIName"; });
311  if (pProp != aFilterProperties.end())
312  pProp->Value >>= sUIName2;
313  if( !sUIName2.isEmpty() ) {
314  if( sFilter == "writer8" )
315  nODT = m_xFilterLB->get_count();
316  m_xFilterLB->append(sFilter, sUIName2);
317  }
318  }
319  m_xFilterLB->set_active( nODT );
320  } catch (const uno::Exception&) {
321  }
322 }
323 
325 {
326  if(m_xFrame.is()) {
327  m_xFrame->setComponent(nullptr, nullptr);
328  m_xFrame->dispose();
329  }
330 }
331 
333 {
334  if (ExecQryShell())
335  m_xDialog->response(RET_OK);
336 }
337 
339 {
340  bool bPrint = m_xPrinterRB->get_active();
341  m_xSingleJobsCB->set_sensitive(bPrint);
342 
343  m_xSaveMergedDocumentFT->set_sensitive( !bPrint );
344  m_xSaveSingleDocRB->set_sensitive( !bPrint );
345  m_xSaveIndividualRB->set_sensitive( !bPrint );
346 
347  if( !bPrint ) {
348  SaveTypeHdl( m_xSaveSingleDocRB->get_active() ? *m_xSaveSingleDocRB : *m_xSaveIndividualRB );
349  } else {
350  m_xPathFT->set_sensitive(false);
351  m_xPathED->set_sensitive(false);
352  m_xPathPB->set_sensitive(false);
353  m_xColumnFT->set_sensitive(false);
354  m_xColumnLB->set_sensitive(false);
355  m_xFilterFT->set_sensitive(false);
356  m_xFilterLB->set_sensitive(false);
357  m_xGenerateFromDataBaseCB->set_sensitive(false);
358  }
359 }
360 
362 {
363  bool bIndividual = m_xSaveIndividualRB->get_active();
364 
365  m_xGenerateFromDataBaseCB->set_sensitive( bIndividual );
366  if( bIndividual ) {
367  FilenameHdl(*m_xGenerateFromDataBaseCB);
368  } else {
369  m_xColumnFT->set_sensitive(false);
370  m_xColumnLB->set_sensitive(false);
371  m_xPathFT->set_sensitive( false );
372  m_xPathED->set_sensitive( false );
373  m_xPathPB->set_sensitive( false );
374  m_xFilterFT->set_sensitive( false );
375  m_xFilterLB->set_sensitive( false );
376  }
377 }
378 
379 IMPL_LINK( SwMailMergeDlg, FilenameHdl, weld::ToggleButton&, rBox, void )
380 {
381  bool bEnable = rBox.get_active();
382  m_xColumnFT->set_sensitive( bEnable );
383  m_xColumnLB->set_sensitive(bEnable);
384  m_xPathFT->set_sensitive( bEnable );
385  m_xPathED->set_sensitive(bEnable);
386  m_xPathPB->set_sensitive( bEnable );
387  m_xFilterFT->set_sensitive( bEnable );
388  m_xFilterLB->set_sensitive( bEnable );
389 }
390 
392 {
393  m_xFromRB->set_active(true);
394 }
395 
397 {
398  return (m_xSaveSingleDocRB->get_active() || !m_xGenerateFromDataBaseCB->get_active());
399 }
400 
402 {
403  SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium();
404  INetURLObject aAbs;
405  if( pMedium )
406  aAbs = pMedium->GetURLObject();
407  if( INetProtocol::NotValid == aAbs.GetProtocol() )
408  {
409  SvtPathOptions aPathOpt;
410  aAbs.SetURL( aPathOpt.GetWorkPath() );
411  }
413  aAbs, m_xPathED->get_text(), URIHelper::GetMaybeFileHdl());
414 }
415 
417 {
418  if(pImpl->xSelSupp.is()) {
419  pImpl->xSelSupp->removeSelectionChangeListener( pImpl->xChgLstnr );
420  }
421 
422  if (m_xPrinterRB->get_active())
424  else {
428 
429  if (!AskUserFilename()) {
430  pModOpt->SetNameFromColumn(m_xColumnLB->get_active_text());
431  if (m_xFilterLB->get_active() != -1)
432  m_sSaveFilter = m_xFilterLB->get_active_id();
433  m_sFilename = OUString();
434  } else {
435  //#i97667# reset column name - otherwise it's remembered from the last run
436  pModOpt->SetNameFromColumn(OUString());
437  //start save as dialog
438  OUString sFilter;
440  if (m_sFilename.isEmpty())
441  return false;
442  m_sSaveFilter = sFilter;
443  }
444  }
445 
446  if (m_xFromRB->get_active()) { // Insert list
447  // Safe: the maximal value of the fields is limited
448  sal_Int32 nStart = m_xFromNF->get_value();
449  sal_Int32 nEnd = m_xToNF->get_value();
450 
451  if (nEnd < nStart)
452  std::swap(nEnd, nStart);
453 
454  m_aSelection.realloc(nEnd - nStart + 1);
455  Any* pSelection = m_aSelection.getArray();
456  for (sal_Int32 i = nStart; i <= nEnd; ++i, ++pSelection)
457  *pSelection <<= i;
458  } else if (m_xAllRB->get_active() )
459  m_aSelection.realloc(0); // Empty selection = insert all
460  else {
461  if(pImpl->xSelSupp.is()) {
462  //update selection
463  uno::Reference< XRowLocate > xRowLocate(GetResultSet(),UNO_QUERY);
464  uno::Reference< XResultSet > xRes(xRowLocate,UNO_QUERY);
465  pImpl->xSelSupp->getSelection() >>= m_aSelection;
466  if ( xRowLocate.is() ) {
467  for (Any& rRow : m_aSelection) {
468  if ( xRowLocate->moveToBookmark(rRow) )
469  rRow <<= xRes->getRow();
470  }
471  }
472  }
473  }
475  SwPrintData aPrtData( rIDDA.getPrintData() );
476  aPrtData.SetPrintSingleJobs(m_xSingleJobsCB->get_active());
477  rIDDA.setPrintData(aPrtData);
478 
479  pModOpt->SetSinglePrintJob(m_xSingleJobsCB->get_active());
480 
481  MailTextFormats nMailingMode = MailTextFormats::NONE;
482 
483  if (m_xFormatSwCB->get_active())
484  nMailingMode |= MailTextFormats::OFFICE;
485  if (m_xFormatHtmlCB->get_active())
486  nMailingMode |= MailTextFormats::HTML;
487  if (m_xFormatRtfCB->get_active())
488  nMailingMode |= MailTextFormats::RTF;
489  pModOpt->SetMailingFormats(nMailingMode);
490  return true;
491 }
492 
494 {
495  if( AskUserFilename() )
496  return m_sFilename;
497  OUString sPath( pModOpt->GetMailingPath() );
498  if( sPath.isEmpty() ) {
499  SvtPathOptions aPathOpt;
500  sPath = aPathOpt.GetWorkPath();
501  }
502  if( !sPath.endsWith("/") )
503  sPath += "/";
504  return sPath;
505 }
506 
508 {
509  uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
510  uno::Reference < XFolderPicker2 > xFP = FolderPicker::create(xContext);
511  xFP->setDisplayDirectory( GetURLfromPath() );
512  if( xFP->execute() == RET_OK ) {
513  INetURLObject aURL(xFP->getDirectory());
514  if(aURL.GetProtocol() == INetProtocol::File)
515  m_xPathED->set_text(aURL.PathToFileName());
516  else
517  m_xPathED->set_text(aURL.GetFull());
518  }
519 }
520 
521 uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const
522 {
523  uno::Reference< XResultSet > xResSetClone;
524  if ( pImpl->xFController.is() ) {
525  // we create a clone to do the task
526  uno::Reference< XResultSetAccess > xResultSetAccess( pImpl->xFController->getModel(),UNO_QUERY);
527  if ( xResultSetAccess.is() )
528  xResSetClone = xResultSetAccess->createResultSet();
529  }
530  return xResSetClone;
531 }
532 
534  : GenericDialogController(pParent, "modules/swriter/ui/mailmergedialog.ui", "MailMergeDialog")
535  , m_xThisDocRB(m_xBuilder->weld_radio_button("document"))
536 {
537 }
538 
540 {
541 }
542 
544  : GenericDialogController(pParent, "modules/swriter/ui/mergeconnectdialog.ui", "MergeConnectDialog")
545  , m_xUseExistingRB(m_xBuilder->weld_radio_button("existing"))
546 {
547 }
548 
550 {
551 }
552 
553 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
URL aURL
virtual void SAL_CALL disposing(const EventObject &Source) override
Definition: mailmrge.cxx:107
SwMailMergeCreateFromDlg(weld::Window *pParent)
Definition: mailmrge.cxx:533
std::unique_ptr< weld::Label > m_xSubjectFT
Definition: mailmrge.hxx:89
std::unique_ptr< weld::Container > m_xBeamerWin
Definition: mailmrge.hxx:60
std::unique_ptr< weld::Entry > m_xSubjectED
Definition: mailmrge.hxx:90
std::unique_ptr< weld::ComboBox > m_xFilterLB
Definition: mailmrge.hxx:86
std::unique_ptr< weld::SpinButton > m_xToNF
Definition: mailmrge.hxx:66
css::uno::Sequence< css::uno::Any > m_aSelection
Definition: mailmrge.hxx:54
std::unique_ptr< weld::RadioButton > m_xMarkedRB
Definition: mailmrge.hxx:63
std::unique_ptr< weld::Label > m_xFormatFT
Definition: mailmrge.hxx:91
css::uno::Reference< css::sdbc::XResultSet > GetResultSet() const
Definition: mailmrge.cxx:521
std::unique_ptr< weld::CheckButton > m_xSingleJobsCB
Definition: mailmrge.hxx:72
static const AllSettings & GetSettings()
std::unique_ptr< SwMailMergeDlg_Impl > pImpl
Definition: mailmrge.hxx:48
std::unique_ptr< weld::CheckButton > m_xFormatRtfCB
Definition: mailmrge.hxx:96
friend class SwXSelChgLstnr_Impl
Definition: mailmrge.hxx:46
bool AskUserFilename() const
Definition: mailmrge.cxx:396
std::unique_ptr< weld::Entry > m_xPathED
Definition: mailmrge.hxx:83
uno::Reference< XSelectionChangeListener > xChgLstnr
Definition: mailmrge.cxx:69
std::unique_ptr< weld::Entry > m_xAttachED
Definition: mailmrge.hxx:93
OUString PathToFileName() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
const SwView & GetView() const
Definition: wrtsh.hxx:428
Reference< XController > xController
PropertiesInfo aProperties
std::unique_ptr< weld::RadioButton > m_xSaveSingleDocRB
Definition: mailmrge.hxx:75
Print mail merge.
Definition: dbmgr.hxx:88
virtual void SAL_CALL selectionChanged(const EventObject &aEvent) override
Definition: mailmrge.cxx:90
std::unique_ptr< weld::Button > m_xOkBTN
Definition: mailmrge.hxx:99
Send mail merge as email.
Definition: dbmgr.hxx:89
virtual ~SwMailMergeCreateFromDlg() override
Definition: mailmrge.cxx:539
IMPL_LINK_NOARG(SwMailMergeDlg, ButtonHdl, weld::Button &, void)
Definition: mailmrge.cxx:332
std::unique_ptr< weld::CheckButton > m_xFormatHtmlCB
Definition: mailmrge.hxx:95
std::unique_ptr< weld::RadioButton > m_xMailingRB
Definition: mailmrge.hxx:69
const OUString & GetMailingPath() const
Definition: modcfg.hxx:342
std::unique_ptr< weld::RadioButton > m_xAllRB
Definition: mailmrge.hxx:62
SwModuleOptions * pModOpt
Definition: mailmrge.hxx:51
const char * sName
uno::Reference< XSelectionSupplier > xSelSupp
Definition: mailmrge.cxx:70
css::uno::Reference< css::frame::XFrame2 > m_xFrame
Definition: mailmrge.hxx:55
std::unique_ptr< weld::ComboBox > m_xAddressFieldLB
Definition: mailmrge.hxx:88
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:336
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2580
virtual ~SwMailMergeFieldConnectionsDlg() override
Definition: mailmrge.cxx:549
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
SwMailMergeDlg & rParent
Definition: mailmrge.cxx:78
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
std::unique_ptr< weld::ComboBox > m_xColumnLB
Definition: mailmrge.hxx:81
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
SwWrtShell & rSh
Definition: mailmrge.hxx:50
void SetMailingFormats(MailTextFormats nSet)
Definition: modcfg.hxx:323
OUString GetURLfromPath() const
Definition: mailmrge.cxx:401
virtual ~SwMailMergeDlg() override
Definition: mailmrge.cxx:324
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
std::unique_ptr< weld::RadioButton > m_xFromRB
Definition: mailmrge.hxx:64
int i
std::unique_ptr< weld::RadioButton > m_xFileRB
Definition: mailmrge.hxx:70
Object Value
OUString m_sFilename
Definition: mailmrge.hxx:58
IMPL_LINK(SwMailMergeDlg, FilenameHdl, weld::ToggleButton &, rBox, void)
Definition: mailmrge.cxx:379
SwDocShell * GetDocShell()
Definition: view.cxx:1107
std::unique_ptr< weld::Label > m_xAttachFT
Definition: mailmrge.hxx:92
std::unique_ptr< weld::CheckButton > m_xFormatSwCB
Definition: mailmrge.hxx:97
Provides access to the formatting devices of a document.
OUString GetTargetURL() const
Definition: mailmrge.cxx:493
SwMailMergeDlg(weld::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:112
OUString m_sSaveFilter
Definition: mailmrge.hxx:57
bool ExecQryShell()
Definition: mailmrge.cxx:416
void SetSinglePrintJob(bool b)
Definition: modcfg.hxx:326
const OUString & GetWorkPath() const
Reference< XMultiServiceFactory > getProcessServiceFactory()
std::unique_ptr< weld::Button > m_xPathPB
Definition: mailmrge.hxx:84
uno::Reference< runtime::XFormController > xFController
Definition: mailmrge.cxx:68
MailTextFormats
Definition: modcfg.hxx:38
void SetPrintSingleJobs(bool b)
Definition: printdata.hxx:164
Save mail merge as files.
Definition: dbmgr.hxx:90
SwXSelChgLstnr_Impl(SwMailMergeDlg &rParentDlg)
Definition: mailmrge.cxx:86
std::unique_ptr< weld::SpinButton > m_xFromNF
Definition: mailmrge.hxx:65
INetProtocol GetProtocol() const
RET_OK
virtual void setPrintData(const SwPrintData &rPrtData)=0
Sets the PrintData.
Reference< XExecutableDialog > m_xDialog
SwMailMergeFieldConnectionsDlg(weld::Window *pParent)
Definition: mailmrge.cxx:543
const INetURLObject & GetURLObject() const
Reference< XComponentContext > getProcessComponentContext()
const OUString & GetNameFromColumn() const
Definition: modcfg.hxx:338
void SetIsNameFromColumn(bool bSet)
Definition: modcfg.hxx:330
const MiscSettings & GetMiscSettings() const
std::unique_ptr< weld::RadioButton > m_xPrinterRB
Definition: mailmrge.hxx:68
bool SetURL(OUString const &rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
void GetColumnNames(weld::ComboBox &rBox, const OUString &rDBName, const OUString &rTableName)
Fill listbox with all column names of a database table.
Definition: dbmgr.cxx:737
bool GetDisablePrinting() const
std::unique_ptr< weld::Button > m_xAttachPB
Definition: mailmrge.hxx:94
std::unique_ptr< weld::CheckButton > m_xGenerateFromDataBaseCB
Definition: mailmrge.hxx:78
std::unique_ptr< weld::RadioButton > m_xSaveIndividualRB
Definition: mailmrge.hxx:76
bool IsNameFromColumn() const
Definition: modcfg.hxx:329
OUString GetFull() const
DBManagerOptions nMergeType
Definition: mailmrge.hxx:53
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