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_xMarkedRB->set_sensitive(bEnable);
108  if(bEnable)
109  rParent.m_xMarkedRB->set_active(true);
110  else if(rParent.m_xMarkedRB->get_active()) {
111  rParent.m_xAllRB->set_active(true);
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  : SfxDialogController(pParent, "modules/swriter/ui/mailmerge.ui", "MailmergeDialog")
128  , pImpl(new SwMailMergeDlg_Impl)
129  , rSh(rShell)
130  , nMergeType(DBMGR_MERGE_EMAIL)
131  , m_xBeamerWin(m_xBuilder->weld_container("beamer"))
132  , m_xAllRB(m_xBuilder->weld_radio_button("all"))
133  , m_xMarkedRB(m_xBuilder->weld_radio_button("selected"))
134  , m_xFromRB(m_xBuilder->weld_radio_button("rbfrom"))
135  , m_xFromNF(m_xBuilder->weld_spin_button("from"))
136  , m_xToNF(m_xBuilder->weld_spin_button("to"))
137  , m_xPrinterRB(m_xBuilder->weld_radio_button("printer"))
138  , m_xMailingRB(m_xBuilder->weld_radio_button("electronic"))
139  , m_xFileRB(m_xBuilder->weld_radio_button("file"))
140  , m_xSingleJobsCB(m_xBuilder->weld_check_button("singlejobs"))
141  , m_xSaveMergedDocumentFT(m_xBuilder->weld_label("savemergeddoclabel"))
142  , m_xSaveSingleDocRB(m_xBuilder->weld_radio_button("singledocument"))
143  , m_xSaveIndividualRB(m_xBuilder->weld_radio_button("individualdocuments"))
144  , m_xGenerateFromDataBaseCB(m_xBuilder->weld_check_button("generate"))
145  , m_xColumnFT(m_xBuilder->weld_label("fieldlabel"))
146  , m_xColumnLB(m_xBuilder->weld_combo_box("field"))
147  , m_xPathFT(m_xBuilder->weld_label("pathlabel"))
148  , m_xPathED(m_xBuilder->weld_entry("path"))
149  , m_xPathPB(m_xBuilder->weld_button("pathpb"))
150  , m_xFilterFT(m_xBuilder->weld_label("fileformatlabel"))
151  , m_xFilterLB(m_xBuilder->weld_combo_box("fileformat"))
152  , m_xAddressFieldLB(m_xBuilder->weld_combo_box("address"))
153  , m_xSubjectFT(m_xBuilder->weld_label("subjectlabel"))
154  , m_xSubjectED(m_xBuilder->weld_entry("subject"))
155  , m_xFormatFT(m_xBuilder->weld_label("mailformatlabel"))
156  , m_xAttachFT(m_xBuilder->weld_label("attachmentslabel"))
157  , m_xAttachED(m_xBuilder->weld_entry("attachments"))
158  , m_xAttachPB(m_xBuilder->weld_button("attach"))
159  , m_xFormatHtmlCB(m_xBuilder->weld_check_button("html"))
160  , m_xFormatRtfCB(m_xBuilder->weld_check_button("rtf"))
161  , m_xFormatSwCB(m_xBuilder->weld_check_button("swriter"))
162  , m_xOkBTN(m_xBuilder->weld_button("ok"))
163 {
164  m_xSingleJobsCB->hide(); // not supported in since cws printerpullpages anymore
165  //task #97066# mailing of form letters is currently not supported
166  m_xMailingRB->hide();
167  m_xSubjectFT->hide();
168  m_xSubjectED->hide();
169  m_xFormatFT->hide();
170  m_xFormatSwCB->hide();
171  m_xFormatHtmlCB->hide();
172  m_xFormatRtfCB->hide();
173  m_xAttachFT->hide();
174  m_xAttachED->hide();
175  m_xAttachPB->hide();
176 
177  uno::Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
178  if(pSelection) {
179  m_aSelection = *pSelection;
180  m_xBeamerWin->hide();
181  } else {
182  try {
183  // create a frame wrapper for myself
184  m_xFrame = frame::Frame::create( comphelper::getProcessComponentContext() );
185  m_xFrame->initialize(m_xBeamerWin->CreateChildFrame());
186  } catch (const Exception&) {
187  m_xFrame.clear();
188  }
189  if(m_xFrame.is()) {
190  URL aURL;
191  aURL.Complete = ".component:DB/DataSourceBrowser";
192  uno::Reference<XDispatch> xD = m_xFrame->queryDispatch(aURL,
193  "",
194  0x0C);
195  if(xD.is()) {
196  Sequence<PropertyValue> aProperties(3);
197  PropertyValue* pProperties = aProperties.getArray();
198  pProperties[0].Name = "DataSourceName";
199  pProperties[0].Value <<= rSourceName;
200  pProperties[1].Name = "Command";
201  pProperties[1].Value <<= rTableName;
202  pProperties[2].Name = "CommandType";
203  pProperties[2].Value <<= nCommandType;
204  xD->dispatch(aURL, aProperties);
205  m_xBeamerWin->show();
206  }
207  uno::Reference<XController> xController = m_xFrame->getController();
208  pImpl->xFController.set(xController, UNO_QUERY);
209  if(pImpl->xFController.is()) {
210  uno::Reference< awt::XControl > xCtrl = pImpl->xFController->getCurrentControl( );
211  pImpl->xSelSupp.set(xCtrl, UNO_QUERY);
212  if(pImpl->xSelSupp.is()) {
213  pImpl->xChgLstnr = new SwXSelChgLstnr_Impl(*this);
214  pImpl->xSelSupp->addSelectionChangeListener( pImpl->xChgLstnr );
215  }
216  }
217  }
218  }
219 
220  pModOpt = SW_MOD()->GetModuleConfig();
221 
222  MailTextFormats nMailingMode(pModOpt->GetMailingFormats());
223  m_xFormatSwCB->set_active(bool(nMailingMode & MailTextFormats::OFFICE));
224  m_xFormatHtmlCB->set_active(bool(nMailingMode & MailTextFormats::HTML));
225  m_xFormatRtfCB->set_active(bool(nMailingMode & MailTextFormats::RTF));
226 
227  m_xAllRB->set_active(true);
228 
229  // Install handlers
230  m_xOkBTN->connect_clicked(LINK(this, SwMailMergeDlg, ButtonHdl));
231 
232  m_xPathPB->connect_clicked(LINK(this, SwMailMergeDlg, InsertPathHdl));
233 
234  m_xPrinterRB->connect_toggled(LINK(this, SwMailMergeDlg, OutputTypeHdl));
235  m_xFileRB->connect_toggled(LINK(this, SwMailMergeDlg, OutputTypeHdl));
236 
237  //#i63267# printing might be disabled
239  m_xPrinterRB->set_sensitive(bIsPrintable);
240  OutputTypeHdl(bIsPrintable ? *m_xPrinterRB : *m_xFileRB);
241 
242  m_xGenerateFromDataBaseCB->connect_toggled(LINK(this, SwMailMergeDlg, FilenameHdl));
243  bool bColumn = pModOpt->IsNameFromColumn();
244  if(bColumn)
245  m_xGenerateFromDataBaseCB->set_active(true);
246 
247  FilenameHdl(*m_xGenerateFromDataBaseCB);
248  m_xSaveSingleDocRB->set_active(true);
249  m_xSaveSingleDocRB->connect_toggled(LINK(this, SwMailMergeDlg, SaveTypeHdl));
250  m_xSaveIndividualRB->connect_toggled(LINK(this, SwMailMergeDlg, SaveTypeHdl));
251  SaveTypeHdl(*m_xSaveSingleDocRB);
252 
253  Link<weld::SpinButton&,void> aLk2 = LINK(this, SwMailMergeDlg, ModifyHdl);
254  m_xFromNF->connect_value_changed(aLk2);
255  m_xToNF->connect_value_changed(aLk2);
256  m_xFromNF->set_max(SAL_MAX_INT32);
257  m_xToNF->set_max(SAL_MAX_INT32);
258 
259  SwDBManager* pDBManager = rSh.GetDBManager();
260  if(_xConnection.is())
261  SwDBManager::GetColumnNames(*m_xAddressFieldLB, _xConnection, rTableName);
262  else
263  pDBManager->GetColumnNames(*m_xAddressFieldLB, rSourceName, rTableName);
264  for(sal_Int32 nEntry = 0, nEntryCount = m_xAddressFieldLB->get_count(); nEntry < nEntryCount; ++nEntry)
265  m_xColumnLB->append_text(m_xAddressFieldLB->get_text(nEntry));
266 
267  m_xAddressFieldLB->set_active_text("EMAIL");
268 
269  OUString sPath(pModOpt->GetMailingPath());
270  if(sPath.isEmpty()) {
271  SvtPathOptions aPathOpt;
272  sPath = aPathOpt.GetWorkPath();
273  }
274  INetURLObject aURL(sPath);
275  if(aURL.GetProtocol() == INetProtocol::File)
276  m_xPathED->set_text(aURL.PathToFileName());
277  else
278  m_xPathED->set_text(aURL.GetFull());
279 
280  if (!bColumn ) {
281  m_xColumnLB->set_active_text("NAME");
282  } else
283  m_xColumnLB->set_active_text(pModOpt->GetNameFromColumn());
284 
285  if (m_xAddressFieldLB->get_active() == -1)
286  m_xAddressFieldLB->set_active(0);
287  if (m_xColumnLB->get_active() == -1)
288  m_xColumnLB->set_active(0);
289 
290  const bool bEnable = m_aSelection.hasElements();
291  m_xMarkedRB->set_sensitive(bEnable);
292  if (bEnable)
293  m_xMarkedRB->set_active(true);
294  else {
295  m_xAllRB->set_active(true);
296  m_xMarkedRB->set_sensitive(false);
297  }
298  try {
299  uno::Reference< container::XNameContainer> xFilterFactory(
300  xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY_THROW);
301  uno::Reference< container::XContainerQuery > xQuery(xFilterFactory, UNO_QUERY_THROW);
302  const OUString sCommand("matchByDocumentService=com.sun.star.text.TextDocument:iflags="
303  + OUString::number(static_cast<sal_Int32>(SfxFilterFlags::EXPORT))
304  + ":eflags="
305  + OUString::number(static_cast<sal_Int32>(SfxFilterFlags::NOTINFILEDLG))
306  + ":default_first");
307  uno::Reference< container::XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand);
308  const OUString sName("Name");
309  sal_Int32 nODT = -1;
310  while(xList->hasMoreElements()) {
311  comphelper::SequenceAsHashMap aFilter(xList->nextElement());
312  const OUString sFilter = aFilter.getUnpackedValueOrDefault(sName, OUString());
313 
314  uno::Any aProps = xFilterFactory->getByName(sFilter);
315  uno::Sequence< beans::PropertyValue > aFilterProperties;
316  aProps >>= aFilterProperties;
317  OUString sUIName2;
318  auto pProp = std::find_if(aFilterProperties.begin(), aFilterProperties.end(),
319  [](const beans::PropertyValue& rProp) { return rProp.Name == "UIName"; });
320  if (pProp != aFilterProperties.end())
321  pProp->Value >>= sUIName2;
322  if( !sUIName2.isEmpty() ) {
323  if( sFilter == "writer8" )
324  nODT = m_xFilterLB->get_count();
325  m_xFilterLB->append(sFilter, sUIName2);
326  }
327  }
328  m_xFilterLB->set_active( nODT );
329  } catch (const uno::Exception&) {
330  }
331 }
332 
334 {
335  if(m_xFrame.is()) {
336  m_xFrame->setComponent(nullptr, nullptr);
337  m_xFrame->dispose();
338  }
339 }
340 
342 {
343  if (ExecQryShell())
344  m_xDialog->response(RET_OK);
345 }
346 
348 {
349  bool bPrint = m_xPrinterRB->get_active();
350  m_xSingleJobsCB->set_sensitive(bPrint);
351 
352  m_xSaveMergedDocumentFT->set_sensitive( !bPrint );
353  m_xSaveSingleDocRB->set_sensitive( !bPrint );
354  m_xSaveIndividualRB->set_sensitive( !bPrint );
355 
356  if( !bPrint ) {
357  SaveTypeHdl( m_xSaveSingleDocRB->get_active() ? *m_xSaveSingleDocRB : *m_xSaveIndividualRB );
358  } else {
359  m_xPathFT->set_sensitive(false);
360  m_xPathED->set_sensitive(false);
361  m_xPathPB->set_sensitive(false);
362  m_xColumnFT->set_sensitive(false);
363  m_xColumnLB->set_sensitive(false);
364  m_xFilterFT->set_sensitive(false);
365  m_xFilterLB->set_sensitive(false);
366  m_xGenerateFromDataBaseCB->set_sensitive(false);
367  }
368 }
369 
371 {
372  bool bIndividual = m_xSaveIndividualRB->get_active();
373 
374  m_xGenerateFromDataBaseCB->set_sensitive( bIndividual );
375  if( bIndividual ) {
376  FilenameHdl(*m_xGenerateFromDataBaseCB);
377  } else {
378  m_xColumnFT->set_sensitive(false);
379  m_xColumnLB->set_sensitive(false);
380  m_xPathFT->set_sensitive( false );
381  m_xPathED->set_sensitive( false );
382  m_xPathPB->set_sensitive( false );
383  m_xFilterFT->set_sensitive( false );
384  m_xFilterLB->set_sensitive( false );
385  }
386 }
387 
388 IMPL_LINK( SwMailMergeDlg, FilenameHdl, weld::ToggleButton&, rBox, void )
389 {
390  bool bEnable = rBox.get_active();
391  m_xColumnFT->set_sensitive( bEnable );
392  m_xColumnLB->set_sensitive(bEnable);
393  m_xPathFT->set_sensitive( bEnable );
394  m_xPathED->set_sensitive(bEnable);
395  m_xPathPB->set_sensitive( bEnable );
396  m_xFilterFT->set_sensitive( bEnable );
397  m_xFilterLB->set_sensitive( bEnable );
398 }
399 
401 {
402  m_xFromRB->set_active(true);
403 }
404 
406 {
407  return (m_xSaveSingleDocRB->get_active() || !m_xGenerateFromDataBaseCB->get_active());
408 }
409 
411 {
412  SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium();
413  INetURLObject aAbs;
414  if( pMedium )
415  aAbs = pMedium->GetURLObject();
416  if( INetProtocol::NotValid == aAbs.GetProtocol() )
417  {
418  SvtPathOptions aPathOpt;
419  aAbs.SetURL( aPathOpt.GetWorkPath() );
420  }
422  aAbs, m_xPathED->get_text(), URIHelper::GetMaybeFileHdl());
423 }
424 
426 {
427  if(pImpl->xSelSupp.is()) {
428  pImpl->xSelSupp->removeSelectionChangeListener( pImpl->xChgLstnr );
429  }
430 
431  if (m_xPrinterRB->get_active())
433  else {
437 
438  if (!AskUserFilename()) {
439  pModOpt->SetNameFromColumn(m_xColumnLB->get_active_text());
440  if (m_xFilterLB->get_active() != -1)
441  m_sSaveFilter = m_xFilterLB->get_active_id();
442  m_sFilename = OUString();
443  } else {
444  //#i97667# reset column name - otherwise it's remembered from the last run
445  pModOpt->SetNameFromColumn(OUString());
446  //start save as dialog
447  OUString sFilter;
448  m_sFilename = SwMailMergeHelper::CallSaveAsDialog(m_xDialog.get(), sFilter);
449  if (m_sFilename.isEmpty())
450  return false;
451  m_sSaveFilter = sFilter;
452  }
453  }
454 
455  if (m_xFromRB->get_active()) { // Insert list
456  // Safe: the maximal value of the fields is limited
457  sal_Int32 nStart = m_xFromNF->get_value();
458  sal_Int32 nEnd = m_xToNF->get_value();
459 
460  if (nEnd < nStart)
461  std::swap(nEnd, nStart);
462 
463  m_aSelection.realloc(nEnd - nStart + 1);
464  Any* pSelection = m_aSelection.getArray();
465  for (sal_Int32 i = nStart; i <= nEnd; ++i, ++pSelection)
466  *pSelection <<= i;
467  } else if (m_xAllRB->get_active() )
468  m_aSelection.realloc(0); // Empty selection = insert all
469  else {
470  if(pImpl->xSelSupp.is()) {
471  //update selection
472  uno::Reference< XRowLocate > xRowLocate(GetResultSet(),UNO_QUERY);
473  uno::Reference< XResultSet > xRes(xRowLocate,UNO_QUERY);
474  pImpl->xSelSupp->getSelection() >>= m_aSelection;
475  if ( xRowLocate.is() ) {
476  for (Any& rRow : m_aSelection) {
477  if ( xRowLocate->moveToBookmark(rRow) )
478  rRow <<= xRes->getRow();
479  }
480  }
481  }
482  }
484  SwPrintData aPrtData( rIDDA.getPrintData() );
485  aPrtData.SetPrintSingleJobs(m_xSingleJobsCB->get_active());
486  rIDDA.setPrintData(aPrtData);
487 
488  pModOpt->SetSinglePrintJob(m_xSingleJobsCB->get_active());
489 
490  MailTextFormats nMailingMode = MailTextFormats::NONE;
491 
492  if (m_xFormatSwCB->get_active())
493  nMailingMode |= MailTextFormats::OFFICE;
494  if (m_xFormatHtmlCB->get_active())
495  nMailingMode |= MailTextFormats::HTML;
496  if (m_xFormatRtfCB->get_active())
497  nMailingMode |= MailTextFormats::RTF;
498  pModOpt->SetMailingFormats(nMailingMode);
499  return true;
500 }
501 
503 {
504  if( AskUserFilename() )
505  return m_sFilename;
506  OUString sPath( pModOpt->GetMailingPath() );
507  if( sPath.isEmpty() ) {
508  SvtPathOptions aPathOpt;
509  sPath = aPathOpt.GetWorkPath();
510  }
511  if( !sPath.endsWith("/") )
512  sPath += "/";
513  return sPath;
514 }
515 
517 {
518  uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
519  uno::Reference < XFolderPicker2 > xFP = FolderPicker::create(xContext);
520  xFP->setDisplayDirectory( GetURLfromPath() );
521  if( xFP->execute() == RET_OK ) {
522  INetURLObject aURL(xFP->getDirectory());
523  if(aURL.GetProtocol() == INetProtocol::File)
524  m_xPathED->set_text(aURL.PathToFileName());
525  else
526  m_xPathED->set_text(aURL.GetFull());
527  }
528 }
529 
530 uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const
531 {
532  uno::Reference< XResultSet > xResSetClone;
533  if ( pImpl->xFController.is() ) {
534  // we create a clone to do the task
535  uno::Reference< XResultSetAccess > xResultSetAccess( pImpl->xFController->getModel(),UNO_QUERY);
536  if ( xResultSetAccess.is() )
537  xResSetClone = xResultSetAccess->createResultSet();
538  }
539  return xResSetClone;
540 }
541 
543  : GenericDialogController(pParent, "modules/swriter/ui/mailmergedialog.ui", "MailMergeDialog")
544  , m_xThisDocRB(m_xBuilder->weld_radio_button("document"))
545 {
546 }
547 
549 {
550 }
551 
553  : GenericDialogController(pParent, "modules/swriter/ui/mergeconnectdialog.ui", "MergeConnectDialog")
554  , m_xUseExistingRB(m_xBuilder->weld_radio_button("existing"))
555 {
556 }
557 
559 {
560 }
561 
562 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL disposing(const EventObject &Source) override
Definition: mailmrge.cxx:116
SwMailMergeCreateFromDlg(weld::Window *pParent)
Definition: mailmrge.cxx:542
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:530
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:405
std::unique_ptr< weld::Entry > m_xPathED
Definition: mailmrge.hxx:83
uno::Reference< XSelectionChangeListener > xChgLstnr
Definition: mailmrge.cxx:78
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
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:99
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:548
IMPL_LINK_NOARG(SwMailMergeDlg, ButtonHdl, weld::Button &, void)
Definition: mailmrge.cxx:341
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
uno::Reference< XSelectionSupplier > xSelSupp
Definition: mailmrge.cxx:79
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:2593
virtual ~SwMailMergeFieldConnectionsDlg() override
Definition: mailmrge.cxx:558
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
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
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:410
virtual ~SwMailMergeDlg() override
Definition: mailmrge.cxx:333
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
std::unique_ptr< weld::RadioButton > m_xFromRB
Definition: mailmrge.hxx:64
OUString sName
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:388
SwDocShell * GetDocShell()
Definition: view.cxx:1128
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:502
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:121
OUString m_sSaveFilter
Definition: mailmrge.hxx:57
bool ExecQryShell()
Definition: mailmrge.cxx:425
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:77
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:95
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.
SwMailMergeFieldConnectionsDlg(weld::Window *pParent)
Definition: mailmrge.cxx:552
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:760
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