54#include <rtl/tencinfo.h>
58#include <osl/file.hxx>
59#include <com/sun/star/frame/XStorable.hpp>
60#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
61#include <com/sun/star/sdb/XColumn.hpp>
62#include <com/sun/star/task/ErrorCodeIOException.hpp>
82#define MM_DOCTYPE_OOO 1
83#define MM_DOCTYPE_PDF 2
84#define MM_DOCTYPE_WORD 3
85#define MM_DOCTYPE_HTML 4
86#define MM_DOCTYPE_TEXT 5
102static OUString
lcl_GetColumnValueOf(
const OUString& rColumn, Reference < container::XNameAccess>
const & rxColAccess )
107 if (rxColAccess->hasByName(rColumn))
109 Any aCol = rxColAccess->getByName(rColumn);
110 Reference< sdb::XColumn >
xColumn;
116 catch (
const uno::Exception&)
157 SwSaveWarningBox_Impl(
weld::Window* pParent,
const OUString& rFileName);
159 OUString GetFileName()
const
161 return m_xEdit->get_text();
167 bool m_bIsEmptyAllowed;
170 SwSendQueryBox_Impl(
weld::Window* pParent,
const OUString& rID,
171 const OUString& rUIXMLDescription);
175 m_xEdit->set_text(rSet);
181 return m_xEdit->get_text();
184 void SetIsEmptyTextAllowed(
bool bSet)
186 m_bIsEmptyAllowed = bSet;
193SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(
weld::Window* pParent,
const OUString& rFileName)
195 "modules/swriter/ui/alreadyexistsdialog.ui")
197 m_xEdit->set_text(rFileName);
198 m_xEdit->connect_changed(
LINK(
this, SwSaveWarningBox_Impl, ModifyHdl));
201 m_xDialog->set_primary_text(
m_xDialog->get_primary_text().replaceAll(
"%1", aTmp.getName(
209 m_xOKPB->set_sensitive(!rEdit.get_text().isEmpty());
212SwSendQueryBox_Impl::SwSendQueryBox_Impl(
weld::Window* pParent,
const OUString& rID,
213 const OUString& rUIXMLDescription)
215 , m_bIsEmptyAllowed(true)
217 m_xEdit->connect_changed(
LINK(
this, SwSendQueryBox_Impl, ModifyHdl));
223 m_xOKPB->set_sensitive(m_bIsEmptyAllowed || !rEdit.get_text().isEmpty());
230 std::unique_ptr<weld::Entry> m_xCCED;
231 std::unique_ptr<weld::Entry> m_xBCCED;
236 , m_xCCED(m_xBuilder->weld_entry(
"cc"))
237 , m_xBCCED(m_xBuilder->weld_entry(
"bcc"))
241 OUString GetCC()
const {
return m_xCCED->get_text();}
242 void SetCC(
const OUString& rSet) {m_xCCED->set_text(rSet);}
244 OUString GetBCC()
const {
return m_xBCCED->get_text();}
245 void SetBCC(
const OUString& rSet) {m_xBCCED->set_text(rSet);}
251 :
SfxDialogController(pParent,
"modules/swriter/ui/mmresultsavedialog.ui",
"MMResultSaveDialog")
252 , m_bCancelSaving(false)
253 , m_xSaveAsOneRB(m_xBuilder->weld_radio_button(
"singlerb"))
254 , m_xSaveIndividualRB(m_xBuilder->weld_radio_button(
"individualrb"))
255 , m_xFromRB(m_xBuilder->weld_check_button(
"fromrb"))
256 , m_xFromNF(m_xBuilder->weld_spin_button(
"from"))
257 , m_xToFT(m_xBuilder->weld_label(
"toft"))
258 , m_xToNF(m_xBuilder->weld_spin_button(
"to"))
269 const std::shared_ptr<SwMailMergeConfigItem>& xConfigItem = pView->GetMailMergeConfigItem();
271 sal_Int32
nCount = xConfigItem->GetMergedDocumentCount();
285 :
SfxDialogController(pParent,
"modules/swriter/ui/mmresultprintdialog.ui",
"MMResultPrintDialog")
286 , m_xPrinterLB(m_xBuilder->weld_combo_box(
"printers"))
287 , m_xPrinterSettingsPB(m_xBuilder->weld_button(
"printersettings"))
288 , m_xPrintAllRB(m_xBuilder->weld_radio_button(
"printallrb"))
289 , m_xFromRB(m_xBuilder->weld_radio_button(
"fromrb"))
290 , m_xFromNF(m_xBuilder->weld_spin_button(
"from"))
291 , m_xToFT(m_xBuilder->weld_label(
"toft"))
292 , m_xToNF(m_xBuilder->weld_spin_button(
"to"))
316 :
SfxDialogController(pParent,
"modules/swriter/ui/mmresultemaildialog.ui",
"MMResultEmailDialog")
317 , m_sConfigureMail(
SwResId(ST_CONFIGUREMAIL))
318 , m_xMailToLB(m_xBuilder->weld_combo_box(
"mailto"))
319 , m_xCopyToPB(m_xBuilder->weld_button(
"copyto"))
320 , m_xSubjectED(m_xBuilder->weld_entry(
"subject"))
321 , m_xSendAsLB(m_xBuilder->weld_combo_box(
"sendas"))
322 , m_xSendAsPB(m_xBuilder->weld_button(
"sendassettings"))
323 , m_xAttachmentGroup(m_xBuilder->weld_widget(
"attachgroup"))
324 , m_xAttachmentED(m_xBuilder->weld_entry(
"attach"))
325 , m_xPasswordFT(m_xBuilder->weld_label(
"passwordft"))
326 , m_xPasswordLB(m_xBuilder->weld_combo_box(
"password"))
327 , m_xPasswordCB(m_xBuilder->weld_check_button(
"passwordcb"))
328 , m_xSendAllRB(m_xBuilder->weld_radio_button(
"sendallrb"))
329 , m_xFromRB(m_xBuilder->weld_radio_button(
"fromrb"))
330 , m_xFromNF(m_xBuilder->weld_spin_button(
"from"))
331 , m_xToFT(m_xBuilder->weld_label(
"toft"))
332 , m_xToNF(m_xBuilder->weld_spin_button(
"to"))
367 unsigned int nCount = rPrinters.size();
368 bool bMergePrinterExists =
false;
370 for (
unsigned int i = 0;
i <
nCount; ++
i)
373 if( !bMergePrinterExists && rPrinters[
i] == xConfigItem->GetSelectedPrinter() )
374 bMergePrinterExists =
true;
378 if(!bMergePrinterExists)
385 m_xPrinterLB->set_active_text(xConfigItem->GetSelectedPrinter());
389 sal_Int32
count = xConfigItem->GetMergedDocumentCount();
403 SwView* pSourceView = xConfigItem->GetSourceView();
404 OSL_ENSURE(pSourceView,
"no source view exists");
424 uno::Reference< sdbcx::XColumnsSupplier > xColsSupp(xConfigItem->GetResultSet(), uno::UNO_QUERY);
426 uno::Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() :
nullptr;
427 uno::Sequence< OUString > aFields;
429 aFields = xColAccess->getElementNames();
434 for (
const OUString& rField : std::as_const(aFields))
444 const std::vector<std::pair<OUString, int>>& rHeaders = xConfigItem->GetDefaultAddressHeaders();
445 OUString sEMailColumn = rHeaders[MM_PART_E_MAIL].first;
446 Sequence< OUString> aAssignment = xConfigItem->GetColumnAssignment(xConfigItem->GetCurrentDBData());
447 if (aAssignment.getLength() > MM_PART_E_MAIL && !aAssignment[MM_PART_E_MAIL].isEmpty())
448 sEMailColumn = aAssignment[MM_PART_E_MAIL];
456 const sal_Int32
nCount = xConfigItem->GetMergedDocumentCount();
464 bool bEnableFromTo = m_xFromRB->get_active();
465 m_xFromNF->set_sensitive(bEnableFromTo);
466 m_xToFT->set_sensitive(bEnableFromTo);
467 m_xToNF->set_sensitive(bEnableFromTo);
472 bool bEnable = m_xPasswordCB->get_active();
474 m_xPasswordFT->set_sensitive(bEnable);
475 m_xPasswordLB->set_sensitive(bEnable);
480 bool bEnableFromTo = m_xFromRB->get_active();
481 m_xFromNF->set_sensitive(bEnableFromTo);
482 m_xToFT->set_sensitive(bEnableFromTo);
483 m_xToNF->set_sensitive(bEnableFromTo);
488 bool bEnableFromTo = m_xFromRB->get_active();
489 m_xFromNF->set_sensitive(bEnableFromTo);
490 m_xToFT->set_sensitive(bEnableFromTo);
491 m_xToNF->set_sensitive(bEnableFromTo);
501 m_sCC = aDlg.GetCC() ;
502 m_sBCC = aDlg.GetBCC();
511 assert( pTargetView );
520 page =
shell.GetPageNumSeqNonEmpty();
528 assert( pTargetView );
540 shell.SttEndDoc(
false );
546 page =
shell.GetPageNumSeqNonEmpty();
561 const sal_uInt32 nDocumentCount = xConfigItem->GetMergedDocumentCount();
562 sal_uInt32 nBegin = 0;
563 sal_uInt32 nEnd = nDocumentCount;
565 if (m_xFromRB->get_active())
567 nBegin =
static_cast<sal_Int32
>(m_xFromNF->get_value() - 1);
568 nEnd =
static_cast<sal_Int32
>(m_xToNF->get_value());
569 if (nEnd > nDocumentCount)
570 nEnd = nDocumentCount;
573 xConfigItem->SetBeginEnd(nBegin, nEnd);
575 if (!xConfigItem->GetTargetView())
578 SwView* pTargetView = xConfigItem->GetTargetView();
589 if (m_xSaveAsOneRB->get_active())
593 uno::Reference< frame::XStorable > xStore( pTargetView->
GetDocShell()->
GetModel(), uno::UNO_QUERY);
597 xStore->storeToURL( sPath, aValues );
599 catch (
const task::ErrorCodeIOException& rErrorEx)
601 nErrorCode =
ErrCode(rErrorEx.ErrCode);
620 SwDocShell::Factory().GetFilterContainer() );
622 uno::Sequence< beans::PropertyValue > aValues(1);
623 beans::PropertyValue*
pValues = aValues.getArray();
624 pValues[0].Name =
"FilterName";
625 pValues[0].Value <<= pSfxFlt->GetFilterName();
627 uno::Reference< frame::XStorable > xStore( pTargetView->
GetDocShell()->
GetModel(), uno::UNO_QUERY);
631 xStore->storeToURL( sTargetTempURL, aValues );
633 catch (
const task::ErrorCodeIOException& rErrorEx)
635 nErrorCode =
ErrCode(rErrorEx.ErrCode);
647 SwView* pSourceView = xConfigItem->GetSourceView();
648 auto xSaveMonitor = std::make_shared<SaveMonitor>(
m_xDialog.get());
650 xSaveMonitor->m_xPrinter->set_label(
INetURLObject( sPath ).getFSysPath( FSysStyle::Detect ) );
651 m_bCancelSaving =
false;
654 m_bCancelSaving =
true;
655 xSaveMonitor.reset();
658 for(sal_uInt32 nDoc = 0; nDoc < nEnd - nBegin && !m_bCancelSaving; ++nDoc)
661 OUString sExtension =
aURL.getExtension();
662 if (sExtension.isEmpty())
664 sExtension = pSfxFlt->GetWildcard().getGlob().getToken(1,
'.');
665 sPath +=
"." + sExtension;
667 OUString sStat =
SwResId(STR_STATSTR_LETTER) +
" " + OUString::number(nDoc + 1);
668 xSaveMonitor->m_xPrintInfo->set_label(sStat);
684 sTargetTempURL, aOpt,
true );
689 uno::Reference<beans::XPropertySet>
const xThisSet(
691 uno::Reference<beans::XPropertySet>
const xRetSet(
693 uno::Sequence<beans::PropertyValue> aInteropGrabBag;
694 xThisSet->getPropertyValue(
"InteropGrabBag") >>= aInteropGrabBag;
695 xRetSet->setPropertyValue(
"InteropGrabBag",
uno::Any(aInteropGrabBag));
698 pTempView->
GetWrtShell(), documentStartPageNumber(xConfigItem.get(), nDoc,
false),
699 documentEndPageNumber(xConfigItem.get(), nDoc,
false));
703 OUString sCounter =
"_" + OUString::number(nDoc + 1);
704 sOutPath = sOutPath.replaceAt( sOutPath.getLength() - sExtension.getLength() - 1, 0, sCounter);
711 bool bFailed =
false;
715 uno::Reference< frame::XStorable > xTempStore( xTempDocShell->
GetModel(), uno::UNO_QUERY);
716 xTempStore->storeToURL( sOutPath, aValues );
718 catch (
const uno::Exception&)
725 std::unique_ptr<SwSaveWarningBox_Impl> xWarning(
new SwSaveWarningBox_Impl(
m_xDialog.get(), sOutPath));
726 if (
RET_OK == xWarning->run())
727 sOutPath = xWarning->GetFileName();
744 xSaveMonitor->response(
RET_OK);
745 ::osl::File::remove( sTargetTempURL );
758 if (rBox.get_active() != -1)
764 if ( !m_pTempPrinter )
771 (m_pTempPrinter->GetDriverName() != pInfo->
GetDriver()) )
773 m_pTempPrinter.disposeAndClear();
778 else if( ! m_pTempPrinter )
781 m_xPrinterSettingsPB->set_sensitive(m_pTempPrinter->HasSupport(PrinterSupport::SetupDialog));
784 m_xPrinterSettingsPB->set_sensitive(
false);
786 xConfigItem->SetSelectedPrinter(rBox.get_active_text());
797 const sal_uInt32 nDocumentCount = xConfigItem->GetMergedDocumentCount();
798 sal_uInt32 nBegin = 0;
799 sal_uInt32 nEnd = nDocumentCount;
801 if (m_xFromRB->get_active())
803 nBegin =
static_cast<sal_Int32
>(m_xFromNF->get_value() - 1);
804 nEnd =
static_cast<sal_Int32
>(m_xToNF->get_value());
805 if (nEnd > nDocumentCount)
806 nEnd = nDocumentCount;
809 xConfigItem->SetBeginEnd(nBegin, nEnd);
811 if(!xConfigItem->GetTargetView())
814 SwView* pTargetView = xConfigItem->GetTargetView();
819 const bool bIgnoreEmptyPages =
821 const int nStartPage = documentStartPageNumber(xConfigItem.get(), 0, bIgnoreEmptyPages);
822 const int nEndPage = documentEndPageNumber(xConfigItem.get(), nEnd - nBegin - 1, bIgnoreEmptyPages);
824 const OUString sPages(OUString::number(nStartPage) +
"-" + OUString::number(nEndPage));
831 pDocumentPrinter->SetPrinterProps(m_pTempPrinter);
842 pTargetView->
ExecPrint( aProps,
false,
true );
856 auto nDocType = rBox.get_active_id().toUInt32();
859 m_xSendAsPB->set_sensitive(bEnable);
860 m_xAttachmentGroup->set_sensitive(bEnable);
864 OUString sAttach(m_xAttachmentED->get_text());
866 if (!sAttach.isEmpty())
875 m_xAttachmentED->set_text(sAttach);
881 m_xPasswordCB->set_sensitive(
true);
882 m_xPasswordFT->set_sensitive(
true);
883 m_xPasswordLB->set_sensitive(
true);
884 CheckHdl(*m_xPasswordCB);
888 m_xPasswordCB->set_sensitive(
false);
889 m_xPasswordFT->set_sensitive(
false);
890 m_xPasswordLB->set_sensitive(
false);
899 SAL_WARN(
"sw",
"ignoring SendAs button click, because no active view");
919 const sal_uInt32 nDocumentCount = xConfigItem->GetMergedDocumentCount();
920 sal_uInt32 nBegin = 0;
921 sal_uInt32 nEnd = nDocumentCount;
923 if (m_xFromRB->get_active())
925 nBegin =
static_cast<sal_Int32
>(m_xFromNF->get_value() - 1);
926 nEnd =
static_cast<sal_Int32
>(m_xToNF->get_value());
927 if (nEnd > nDocumentCount)
928 nEnd = nDocumentCount;
931 xConfigItem->SetBeginEnd(nBegin, nEnd);
933 if (!xConfigItem->GetTargetView())
937 SwView* pTargetView = xConfigItem->GetTargetView();
938 SAL_WARN_IF(!pTargetView,
"sw.ui",
"No TargetView in SwMailMergeConfigItem");
940 if (xConfigItem->GetMailServer().isEmpty() ||
944 VclMessageType::Question, VclButtonsType::YesNo,
947 sal_uInt16 nRet = xQueryBox->run();
950 SwView* pConfigView = pTargetView ? pTargetView : pView;
964 bool bAsBody =
false;
965 rtl_TextEncoding eEncoding = ::osl_getThreadTextEncoding();
967 std::shared_ptr<const SfxFilter> pSfxFlt;
968 auto nDocType = m_xSendAsLB->get_active_id().toUInt32();
978 SfxFilterFlags::EXPORT);
985 SfxFilterFlags::EXPORT);
994 std::shared_ptr<const SfxFilter> pFilter = aIter.
First();
997 if( pFilter->GetUserData() ==
FILTER_WW8 && pFilter->CanExport() )
1002 pFilter = aIter.
Next();
1010 eEncoding = RTL_TEXTENCODING_UTF8;
1017 "Text (encoded)", SfxFilterFlags::EXPORT);
1029 OUString sMimeType = pSfxFlt->GetMimeType();
1031 if (m_xSubjectED->get_text().isEmpty())
1033 std::unique_ptr<SwSendQueryBox_Impl> xQuery(
new SwSendQueryBox_Impl(
m_xDialog.get(),
"SubjectDialog",
1034 "modules/swriter/ui/subjectdialog.ui"));
1035 xQuery->SetIsEmptyTextAllowed(
true);
1036 xQuery->SetValue(
"");
1037 if(
RET_OK == xQuery->run())
1039 if (!xQuery->GetValue().isEmpty())
1040 m_xSubjectED->set_text(xQuery->GetValue());
1045 if(!bAsBody && m_xAttachmentED->get_text().isEmpty())
1047 std::unique_ptr<SwSendQueryBox_Impl> xQuery(
new SwSendQueryBox_Impl(
m_xDialog.get(),
"AttachNameDialog",
1048 "modules/swriter/ui/attachnamedialog.ui"));
1049 xQuery->SetIsEmptyTextAllowed(
false);
1050 if (
RET_OK == xQuery->run())
1052 OUString sAttach(xQuery->GetValue());
1054 if (2 > nTokenCount)
1060 m_xSendAsLB->get_active_id().toUInt32()));
1061 m_xAttachmentED->set_text(sAttach);
1067 OUString sEMailColumn = m_xMailToLB->get_active_text();
1068 OSL_ENSURE( !sEMailColumn.isEmpty(),
"No email column selected");
1069 Reference< sdbcx::XColumnsSupplier > xColsSupp( xConfigItem->GetResultSet(), UNO_QUERY);
1070 Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() :
nullptr;
1071 if(sEMailColumn.isEmpty() || !xColAccess.is() || !xColAccess->hasByName(sEMailColumn))
1077 OUString sPasswordColumn = m_xPasswordLB->get_active_text();
1078 OSL_ENSURE( !sPasswordColumn.isEmpty(),
"No password column selected");
1079 if(sPasswordColumn.isEmpty() || !xColAccess.is() || !xColAccess->hasByName(sPasswordColumn))
1085 OUString sFilterOptions;
1098 sFilterOptions =
"EmbedImages";
1105 SwDocShell::Factory().GetFilterContainer() );
1109 uno::Reference< frame::XStorable > xStore( pTargetView->
GetDocShell()->
GetModel(), uno::UNO_QUERY);
1110 xStore->storeToURL( sTargetTempURL, aValues );
1115 xDlg->StartSend(nEnd - nBegin);
1123 for(sal_uInt32 nDoc = 0; nDoc < nEnd - nBegin; ++nDoc)
1141 sTargetTempURL, aOpt,
true );
1146 pTempView->
GetWrtShell(), documentStartPageNumber(xConfigItem.get(), nDoc,
false),
1147 documentEndPageNumber(xConfigItem.get(), nDoc,
false));
1158 bool withPasswordOptions = m_xPasswordCB->get_active();
1160 sal_Int32 nTarget = xConfigItem->MoveResultSet(rInfo.
nDBRow);
1161 OSL_ENSURE( nTarget == rInfo.
nDBRow,
"row of current document could not be selected");
1164 sal_Int32 nOptionCount = (withFilterOptions && withPasswordOptions) ? 4 : withPasswordOptions ? 3 : withFilterOptions ? 2 : 1;
1166 uno::Sequence< beans::PropertyValue > aFilterValues(nOptionCount);
1167 beans::PropertyValue* pFilterValues = aFilterValues.getArray();
1169 pFilterValues[nOpt].Name =
"FilterName";
1170 pFilterValues[nOpt].Value <<= pSfxFlt->GetFilterName();
1172 if(withFilterOptions)
1175 pFilterValues[nOpt].Name =
"FilterOptions";
1176 pFilterValues[nOpt].Value <<= sFilterOptions;
1179 if(withPasswordOptions)
1182 pFilterValues[nOpt].Name =
"EncryptFile";
1183 pFilterValues[nOpt].Value <<=
true;
1185 pFilterValues[nOpt].Name =
"DocumentOpenPassword";
1186 pFilterValues[nOpt].Value <<= sPassword;
1189 uno::Reference< frame::XStorable > xTempStore( pTempView->
GetDocShell()->
GetModel(), uno::UNO_QUERY);
1190 xTempStore->storeToURL(
aName.GetValue(), aFilterValues );
1194 sal_Int32 nTarget = xConfigItem->MoveResultSet(rInfo.
nDBRow);
1195 OSL_ENSURE( nTarget == rInfo.
nDBRow,
"row of current document could not be selected");
1196 OSL_ENSURE( !sEMailColumn.isEmpty(),
"No email column selected");
1200 OUStringBuffer sBody;
1211 OSL_FAIL(
"no output file created?");
1214 OStringBuffer sLine;
1215 bool bDone = pInStream->
ReadLine( sLine );
1218 sBody.append( OStringToOUString(sLine, eEncoding) +
"\n");
1219 bDone = pInStream->
ReadLine( sLine );
1229 OUString sAttachment(m_xAttachmentED->get_text());
1231 if (2 > nTokenCount)
1236 else if (
o3tl::getToken(sAttachment, nTokenCount - 1,
'.') != sExtension)
1237 sAttachment += sExtension;
1241 if (xConfigItem->IsGreetingLine(
true))
1243 OUString sNameColumn = xConfigItem->GetAssignedColumn(MM_PART_LASTNAME);
1246 if(!
sName.isEmpty() && xConfigItem->IsIndividualGreeting(
true))
1248 OUString sGenderColumn = xConfigItem->GetAssignedColumn(MM_PART_GENDER);
1249 const OUString& sFemaleValue = xConfigItem->GetFemaleGenderValue();
1256 xConfigItem->GetGreetings(eGenderType)
1257 [xConfigItem->GetCurrentGreeting(eGenderType)],
1268 sBody.insert(0, sGreeting);
1275 OUString::createFromAscii(rtl_getBestMimeCharsetFromTextEncoding( eEncoding ));
1278 aDesc.
sBodyMimeType =
"text/plain; charset=UTF-8; format=flowed";
1280 aDesc.
sSubject = m_xSubjectED->get_text();
1282 aDesc.
sBCC = m_sBCC;
1283 xDlg->AddDocument( aDesc );
1287 if (!xDlg->getDialog()->get_visible())
1292 xDlg->EnableDestruction();
1293 ::osl::File::remove( sTargetTempURL );
const PropertyValue * pValues
SfxApplication * SfxGetpApp()
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static bool Reschedule(bool bHandleAllCurrentEvents=false)
static weld::Window * GetDefDialogParent()
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
OUString getName(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
static const std::vector< OUString > & GetPrinterQueues()
static const QueueInfo * GetQueueInfo(const OUString &rPrinterName, bool bStatusUpdate)
const OUString & GetDriver() const
const OUString & GetPrinterName() const
static void ProcessEventsToIdle()
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
OUString const & GetName() const
std::shared_ptr< const SfxFilter > GetFilter4Extension(const OUString &rExt, SfxFilterFlags nMust=SfxFilterFlags::IMPORT, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
std::shared_ptr< const SfxFilter > First()
std::shared_ptr< const SfxFilter > Next()
const OUString & GetName() const
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
OUString GetTitle(sal_uInt16 nMaxLen=0) const
css::uno::Reference< css::frame::XModel3 > GetBaseModel() const
SfxItemPool & GetPool() const
SfxViewShell * GetViewShell() const
virtual SfxObjectShell * GetObjectShell() override
static SfxViewFrame * LoadHiddenDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
SfxViewFrame & GetViewFrame() const
void ExecPrint(const css::uno::Sequence< css::beans::PropertyValue > &, bool, bool)
bool ReadLine(OStringBuffer &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
void SetStreamCharSet(rtl_TextEncoding eCharSet)
static OUString FillData(const OUString &rAddress, SwMailMergeConfigItem const &rConfigItem, const css::uno::Sequence< OUString > *pAssignments=nullptr)
void WriteUserData(OUString &) const
void SetLanguage(LanguageType nVal)
void SetParaFlags(LineEnd eVal)
void EndAction(const bool bIdleEnd=false)
static std::shared_ptr< SwMailMergeConfigItem > PerformMailMerge(SwView const *pView)
ErrCode LoadStylesFromFile(const OUString &rURL, SwgReaderOption &rOpt, bool bUnoCall)
static OUString GetEventName(sal_Int32 nId)
SwDoc * GetDoc()
returns Doc. But be careful!
void ReplaceDefaults(const SwDoc &rSource)
void ReplaceCompatibilityOptions(const SwDoc &rSource)
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
void ReplaceDocumentProperties(const SwDoc &rSource, bool mailMerge=false)
Replace document properties with those from rSource.
void PastePages(SwFEShell &rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage)
Paste some pages into another doc - used in mailmerge.
static SW_DLLPUBLIC std::shared_ptr< const SfxFilter > GetFilterOfFormat(std::u16string_view rFormat, const SfxFilterContainer *pCnt=nullptr)
find for an internal format name the corresponding filter entry
Dialog implementing the sending as email of the result document.
std::unique_ptr< weld::Entry > m_xAttachmentED
std::unique_ptr< weld::SpinButton > m_xFromNF
std::unique_ptr< weld::RadioButton > m_xFromRB
std::unique_ptr< weld::Label > m_xPasswordFT
std::unique_ptr< weld::Button > m_xSendAsPB
std::unique_ptr< weld::CheckButton > m_xPasswordCB
std::unique_ptr< weld::Button > m_xCopyToPB
std::unique_ptr< weld::RadioButton > m_xSendAllRB
SwMMResultEmailDialog(weld::Window *pParent)
std::unique_ptr< weld::ComboBox > m_xSendAsLB
void FillInEmailSettings()
virtual ~SwMMResultEmailDialog() override
std::unique_ptr< weld::SpinButton > m_xToNF
std::unique_ptr< weld::Button > m_xOKButton
std::unique_ptr< weld::ComboBox > m_xPasswordLB
std::unique_ptr< weld::ComboBox > m_xMailToLB
Dialog implementing the printing of the result document.
std::unique_ptr< weld::Button > m_xPrinterSettingsPB
virtual ~SwMMResultPrintDialog() override
std::unique_ptr< weld::SpinButton > m_xFromNF
std::unique_ptr< weld::ComboBox > m_xPrinterLB
SwMMResultPrintDialog(weld::Window *pParent)
std::unique_ptr< weld::RadioButton > m_xFromRB
std::unique_ptr< weld::RadioButton > m_xPrintAllRB
void FillInPrinterSettings()
std::unique_ptr< weld::SpinButton > m_xToNF
std::unique_ptr< weld::Button > m_xOKButton
Dialog implementing the saving as of the result document.
std::unique_ptr< weld::SpinButton > m_xToNF
std::unique_ptr< weld::CheckButton > m_xFromRB
std::unique_ptr< weld::SpinButton > m_xFromNF
std::unique_ptr< weld::RadioButton > m_xSaveIndividualRB
SwMMResultSaveDialog(weld::Window *pParent)
std::unique_ptr< weld::RadioButton > m_xSaveAsOneRB
virtual ~SwMMResultSaveDialog() override
std::unique_ptr< weld::Button > m_xOKButton
void SetBody(const OUString &rBody)
void SetMailReplyTo(bool bSet)
void SetAuthentication(bool bSet)
SwDocMergeInfo & GetDocumentMergeInfo(sal_uInt32 nDocument)
OUString const & GetInServerUserName() const
bool IsAuthentication() const
OUString const & GetInServerName() const
OUString const & GetMailServer() const
OUString const & GetMailUserName() const
OUString const & GetMailAddress() const
void SetMailUserName(const OUString &rName)
OUString const & GetMailDisplayName() const
sal_uInt32 GetMergedDocumentCount()
bool IsSecureConnection() const
sal_Int16 GetInServerPort() const
void SetInServerName(const OUString &rServer)
bool IsMailReplyTo() const
void SetMailServer(const OUString &rAddress)
sal_Int16 GetMailPort() const
void SetInServerUserName(const OUString &rName)
void SetInServerPOP(bool bSet)
bool IsSMTPAfterPOP() const
void SetMailPort(sal_Int16 nSet)
void SetInServerPort(sal_Int16 nSet)
void SetSecureConnection(bool bSet)
OUString const & GetInServerPassword() const
void SetMailDisplayName(const OUString &rName)
void SetMailPassword(const OUString &rPassword)
void SetSMTPAfterPOP(bool bSet)
bool IsInServerPOP() const
OUString const & GetMailPassword() const
OUString const & GetMailReplyTo() const
void SetInServerPassword(const OUString &rPassword)
void SetMailAddress(const OUString &rAddress)
bool IsPrintEmptyPages() const
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
SwWrtShell & GetWrtShell() const
virtual sal_uInt16 SetPrinter(SfxPrinter *pNew, SfxPrinterChangeFlags nDiff=SFX_PRINTER_ALL) override
std::shared_ptr< SwMailMergeConfigItem > const & GetMailMergeConfigItem() const
SwDocShell * GetDocShell()
void SetMailMergeConfigItem(std::shared_ptr< SwMailMergeConfigItem > const &rConfigItem)
Used by the UI to modify the document model.
void SetNumRules(const bool bNew)
void SetTextFormats(const bool bNew)
void SetMerge(const bool bNew)
void SetPageDescs(const bool bNew)
void SetFrameFormats(const bool bNew)
static VclPtr< reference_type > Create(Arg &&... arg)
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
virtual void SetValue(tools::Long nNew) override
#define ERRCODE_IO_GENERAL
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
std::unique_ptr< weld::Button > m_xOKButton
LanguageType GetAppLanguage()
constexpr OUStringLiteral FILTER_WW8
WinWord 97 filter.
constexpr OUStringLiteral FILTER_XML
XML filter.
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
IMPL_LINK(SwSaveWarningBox_Impl, ModifyHdl, weld::Entry &, rEdit, void)
static void lcl_UpdateEmailSettingsFromGlobalConfig(SwMailMergeConfigItem &rConfigItem)
Replace email server settings in rConfigItem with those set in Writer's global mail merge config sett...
static OUString lcl_GetColumnValueOf(const OUString &rColumn, Reference< container::XNameAccess > const &rxColAccess)
IMPL_LINK_NOARG(SwMMResultSaveDialog, DocumentSelectionHdl_Impl, weld::Toggleable &, void)
static OUString lcl_GetExtensionForDocType(sal_uLong nDocType)
bool UCB_DeleteFile(const OUString &rURL)
sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
OUString CallSaveAsDialog(weld::Window *pParent, OUString &rFilter)
bool CheckMailAddress(std::u16string_view aMailAddress)
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
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)
OUString setToken(const OUString &rIn, sal_Int32 nToken, sal_Unicode cTok, std::u16string_view rNewToken)
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr T & temporary(T &&x)
OUString CreateTempName()
#define ERRCTX_SFX_SAVEASDOC
constexpr auto SFX_INTERFACE_NONE
OUString VCL_DLLPUBLIC GetStandardText(StandardButtonType eButton)
sw::mark::IMark * startPageInTarget
#define STR_SW_EVENT_MAIL_MERGE
#define STR_SW_EVENT_MAIL_MERGE_END
OUString SwResId(TranslateId aId)