25#include <com/sun/star/uno/Any.hxx>
26#include <com/sun/star/beans/PropertyValue.hpp>
27#include <com/sun/star/frame/XDispatch.hpp>
28#include <com/sun/star/sdbc/XDataSource.hpp>
29#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
30#include <com/sun/star/lang/XMultiServiceFactory.hpp>
31#include <com/sun/star/beans/XPropertySet.hpp>
32#include <com/sun/star/sdbc/XRowSet.hpp>
33#include <com/sun/star/view/XSelectionSupplier.hpp>
36#include <com/sun/star/sdb/CommandType.hpp>
38#include <rtl/ustrbuf.hxx>
65#define SECURE_PORT 587
66#define DEFAULT_PORT 25
68#define POP_SECURE_PORT 995
70#define IMAP_SECURE_PORT 993
74struct DBAddressDataAssignment
77 Sequence< OUString> aDBColumnAssignments;
79 OUString sConfigNodeName;
81 bool bColumnAssignmentsChanged;
83 DBAddressDataAssignment() :
84 bColumnAssignmentsChanged(
false)
166 virtual void Notify(
const css::uno::Sequence< OUString >& aPropertyNames )
override;
169 const Sequence< OUString>& rBlocks,
170 bool bConvertFromConfig =
false);
171 uno::Sequence< OUString>
173 bool bConvertToConfig =
false)
const;
175 const uno::Sequence< OUString>& rBlocks,
176 bool bConvertFromConfig =
false);
188 m_nResultSetCursorPos(-1),
189 m_nCurrentAddressBlock(0),
190 m_bIsAddressBlock(true),
191 m_bIsHideEmptyParagraphs(false),
192 m_bIsOutputToLetter(true),
193 m_bIncludeCountry(false),
194 m_bIsGreetingLine(true),
195 m_bIsIndividualGreetingLine(false),
196 m_nCurrentFemaleGreeting(0),
197 m_nCurrentMaleGreeting(0),
198 m_nCurrentNeutralGreeting(0),
199 m_bIsGreetingLineInMail(false),
200 m_bIsIndividualGreetingLineInMail(false),
201 m_bIsSMPTAfterPOP(false),
203 m_bInServerPOP( true ),
205 m_bIsMailReplyTo(false),
206 m_bIsSecureConnection(true),
207 m_bIsAuthentication(false),
209 m_bIsEMailSupported(false),
210 m_bUserSettingWereOverwritten(false),
211 m_bIsAddressBlock_LastUserSetting(false),
212 m_bIsGreetingLineInMail_LastUserSetting(false),
213 m_bIsGreetingLine_LastUserSetting(false)
215 for (
auto const& [
aName, aID] : SA_ADDRESS_HEADER)
223 assert(aValues.getLength() == rNames.getLength());
224 if(aValues.getLength() == rNames.getLength())
226 for(
int nProp = 0; nProp < rNames.getLength(); nProp++)
235 Sequence< OUString> aBlocks;
247 Sequence< OUString> aGreetings;
298 if(aAssignments.hasElements())
301 const OUString* pAssignments = aAssignments.getConstArray();
302 Sequence< OUString > aAssignProperties(4 * aAssignments.getLength());
303 OUString* pAssignProperties = aAssignProperties.getArray();
305 for(nAssign = 0; nAssign < aAssignProperties.getLength(); nAssign += 4)
309 pAssignments[nAssign / 4] +
311 pAssignProperties[nAssign] = sAssignPath;
313 pAssignProperties[nAssign + 1] = sAssignPath;
315 pAssignProperties[nAssign + 2] = sAssignPath;
317 pAssignProperties[nAssign + 3] = sAssignPath;
320 Sequence<Any> aAssignValues =
GetProperties(aAssignProperties);
321 const Any* pAssignValues = aAssignValues.getConstArray();
322 for(nAssign = 0; nAssign < aAssignValues.getLength(); nAssign += 4 )
324 DBAddressDataAssignment aAssignment;
325 pAssignValues[nAssign] >>= aAssignment.aDBData.sDataSource;
326 pAssignValues[nAssign + 1] >>= aAssignment.aDBData.sCommand;
327 pAssignValues[nAssign + 2] >>= aAssignment.aDBData.nCommandType;
328 pAssignValues[nAssign + 3] >>= aAssignment.aDBColumnAssignments;
329 aAssignment.sConfigNodeName = pAssignments[nAssign / 4];
338 auto begin = aTempDocuments.getArray();
341 sal_Int32
nIndex =
static_cast<sal_Int32
>(std::distance(
begin, pTempDocuments));
351 if(
m_aAddressBlocks.size() >= sal::static_int_cast<sal_uInt32, sal_Int32>(nSet))
360 sal_Int32 nStart = rAssignments.getLength();
365 sNewName =
"_" + OUString::number(nStart++);
370 rAssignments.realloc(rAssignments.getLength() + 1);
371 rAssignments.getArray()[rAssignments.getLength() - 1] = sNewName;
378 OUString sBlock(rBlock.replaceAll(
"\n",
"\\n"));
379 for (
size_t i = 0;
i < rHeaders.size(); ++
i)
381 OUString sHeader =
"<" + rHeaders[
i].first +
">";
382 OUString sReplace =
"<" + OUStringChar(
sal_Unicode(
'0' +
i)) +
">";
383 sBlock = sBlock.replaceAll(sHeader, sReplace);
393 OUStringBuffer sBlock;
401 if(cChar >=
'0' && cChar <=
'c')
404 sal_uInt16 nHeader = cChar -
'0';
405 if(nHeader < rHeaders.size())
406 sBlock.append(rHeaders[nHeader].
first);
411 SAL_WARN(
"sw.ui",
"parse error in address block or greeting line");
415 sBlock.append(aNext.
sText);
417 rBlock = sBlock.makeStringAndClear();
422 static Sequence<OUString> aNames {
426 "AddressBlockSettings",
429 "IsIndividualGreetingLine",
430 "FemaleGreetingLines",
432 "NeutralGreetingLines",
433 "CurrentFemaleGreeting",
434 "CurrentMaleGreeting",
435 "CurrentNeutralGreeting",
443 "IsSecureConnection",
447 "DataSource/DataSourceName",
448 "DataSource/DataTableName",
449 "DataSource/DataCommandType",
453 "IsEMailGreetingLine",
454 "IsEMailIndividualGreetingLine",
461 "IsHideEmptyParagraphs",
462 "CurrentAddressBlock"
472 Sequence<Any> aValues(aNames.getLength());
475 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
554 if(rAssignment.bColumnAssignmentsChanged)
557 OUString sNewNode = !rAssignment.sConfigNodeName.isEmpty() ?
558 rAssignment.sConfigNodeName :
560 OUString sSlash =
"/";
563 Sequence< PropertyValue > aNewValues
578 bool bConvertToConfig)
const
582 [
this, bConvertToConfig](
const OUString& rBlock) -> OUString {
583 OUString sBlock = rBlock;
585 lcl_ConvertToNumbers(sBlock, m_AddressHeaderSA);
592 const Sequence< OUString>& rBlocks,
593 bool bConvertFromConfig)
596 std::transform(rBlocks.begin(), rBlocks.end(), std::back_inserter(
m_aAddressBlocks),
597 [
this, bConvertFromConfig](
const OUString& rBlock) -> OUString {
598 OUString sBlock = rBlock;
599 if(bConvertFromConfig)
600 lcl_ConvertFromNumbers(sBlock, m_AddressHeaderSA);
610 const std::vector< OUString>& rGreetings =
614 Sequence< OUString> aRet(rGreetings.size());
615 std::transform(rGreetings.begin(), rGreetings.end(), aRet.getArray(),
616 [
this, bConvertToConfig](
const OUString& rGreeting) -> OUString {
617 OUString sGreeting = rGreeting;
619 lcl_ConvertToNumbers(sGreeting, m_AddressHeaderSA);
627 const Sequence< OUString>& rSetGreetings,
628 bool bConvertFromConfig)
630 std::vector< OUString>& rGreetings =
636 std::transform(rSetGreetings.begin(), rSetGreetings.end(), std::back_inserter(rGreetings),
637 [
this, bConvertFromConfig](
const OUString& rGreeting) -> OUString {
638 OUString sGreeting = rGreeting;
639 if(bConvertFromConfig)
640 lcl_ConvertFromNumbers(sGreeting, m_AddressHeaderSA);
662 bool bChanged =
false;
722 return m_pImpl->m_AddressHeaderSA;
726 const Sequence< OUString>& rBlocks)
728 m_pImpl->SetAddressBlocks(rBlocks);
733 return m_pImpl->GetAddressBlocks();
743 m_pImpl->m_bUserSettingWereOverwritten =
false;
744 if(
m_pImpl->m_bIsAddressBlock != bSet)
746 m_pImpl->m_bIsAddressBlock = bSet;
753 return m_pImpl->m_bIsHideEmptyParagraphs;
758 if(
m_pImpl->m_bIsHideEmptyParagraphs != bSet)
760 m_pImpl->m_bIsHideEmptyParagraphs = bSet;
767 return m_pImpl->m_bIncludeCountry;
772 return m_pImpl->m_sExcludeCountry;
777 if(
m_pImpl->m_sExcludeCountry != rCountry ||
778 m_pImpl->m_bIncludeCountry != bSet)
780 m_pImpl->m_bIncludeCountry = bSet;
781 m_pImpl->m_sExcludeCountry = bSet ? rCountry : OUString();
787 Reference< XDataSource>
const & xSource,
789 Reference< XColumnsSupplier>
const & xColumnsSupplier,
793 m_pImpl->m_xConnection = rConnection ;
794 m_pImpl->m_xColumnsSupplier = xColumnsSupplier;
796 m_pImpl->m_xResultSet =
nullptr;
797 m_pImpl->m_nResultSetCursorPos = 0;
813 if(!
m_pImpl->m_xColumnsSupplier.is() &&
m_pImpl->m_xConnection.is())
817 m_pImpl->m_aDBData.nCommandType == CommandType::TABLE ?
820 return m_pImpl->m_xColumnsSupplier;
830 if(
m_pImpl->m_aDBData != rDBData)
833 m_pImpl->m_xConnection.clear();
835 m_pImpl->m_xResultSet =
nullptr;
836 m_pImpl->m_xColumnsSupplier =
nullptr;
843 if(!
m_pImpl->m_xConnection.is() && !
m_pImpl->m_aDBData.sDataSource.isEmpty())
854 Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
856 Reference<XRowSet> xRowSet( xMgr->createInstance(
"com.sun.star.sdb.RowSet"), UNO_QUERY );
857 Reference<XPropertySet> xRowProperties(xRowSet, UNO_QUERY);
858 xRowProperties->setPropertyValue(
"DataSourceName",
Any(
m_pImpl->m_aDBData.sDataSource));
859 xRowProperties->setPropertyValue(
"Command",
Any(
m_pImpl->m_aDBData.sCommand));
860 xRowProperties->setPropertyValue(
"CommandType",
Any(
m_pImpl->m_aDBData.nCommandType));
861 xRowProperties->setPropertyValue(
"FetchSize",
Any(sal_Int32(10)));
862 xRowProperties->setPropertyValue(
"ActiveConnection",
Any(
m_pImpl->m_xConnection.getTyped()));
865 xRowProperties->setPropertyValue(
"ApplyFilter",
Any(!
m_pImpl->m_sFilter.isEmpty()));
866 xRowProperties->setPropertyValue(
"Filter",
Any(
m_pImpl->m_sFilter));
873 m_pImpl->m_xResultSet = xRowSet.get();
874 m_pImpl->m_xResultSet->first();
875 m_pImpl->m_nResultSetCursorPos = 1;
887 m_pImpl->m_xConnection.clear();
890 ::comphelper::disposeComponent(
m_pImpl->m_xResultSet );
901 if(
m_pImpl->m_sFilter == rFilter)
906 Reference<XPropertySet> xRowProperties(
m_pImpl->m_xResultSet, UNO_QUERY);
907 if(!xRowProperties.is())
912 xRowProperties->setPropertyValue(
"ApplyFilter",
Any(!
m_pImpl->m_sFilter.isEmpty()));
913 xRowProperties->setPropertyValue(
"Filter",
Any(
m_pImpl->m_sFilter));
914 uno::Reference<XRowSet> xRowSet(
m_pImpl->m_xResultSet, UNO_QUERY_THROW );
925 if(!
m_pImpl->m_xResultSet.is())
932 if(
m_pImpl->m_xResultSet->getRow() != nTarget)
936 bool bMoved =
m_pImpl->m_xResultSet->absolute(nTarget);
941 else if(nTarget == 1)
942 m_pImpl->m_xResultSet->first();
945 else if(nTarget == -1)
954 return m_pImpl->m_nResultSetCursorPos;
960 if(!
m_pImpl->m_xResultSet.is())
966 bIsFirst =
m_pImpl->m_xResultSet->isFirst();
967 bIsLast =
m_pImpl->m_xResultSet->isLast();
979 return m_pImpl->m_nResultSetCursorPos;
998 if(!
m_pImpl->m_xResultSet.is())
1000 if(!
m_pImpl->m_xResultSet.is())
1002 m_pImpl->m_xResultSet->last();
1003 sal_uInt32 nResultSetSize =
m_pImpl->m_xResultSet->getRow()+1;
1004 std::vector<uno::Any> vResult;
1005 for(sal_uInt32 nIdx=1; nIdx<nResultSetSize;++nIdx)
1007 vResult.push_back(
uno::Any(sal_uInt32(nIdx)));
1012const uno::Sequence< OUString>&
1015 return m_pImpl->m_aSavedDocuments;
1025 if(
m_pImpl->m_bIsOutputToLetter != bSet)
1027 m_pImpl->m_bIsOutputToLetter = bSet;
1035 m_pImpl->m_bIsIndividualGreetingLineInMail :
1036 m_pImpl->m_bIsIndividualGreetingLine;
1040 bool bSet,
bool bInEMail)
1044 if(
m_pImpl->m_bIsIndividualGreetingLineInMail != bSet)
1046 m_pImpl->m_bIsIndividualGreetingLineInMail = bSet;
1052 if(
m_pImpl->m_bIsIndividualGreetingLine != bSet)
1054 m_pImpl->m_bIsIndividualGreetingLine = bSet;
1062 return bInEMail ?
m_pImpl->m_bIsGreetingLineInMail :
m_pImpl->m_bIsGreetingLine;
1067 m_pImpl->m_bUserSettingWereOverwritten =
false;
1070 if(
m_pImpl->m_bIsGreetingLineInMail != bSet)
1072 m_pImpl->m_bIsGreetingLineInMail = bSet;
1078 if(
m_pImpl->m_bIsGreetingLine != bSet)
1080 m_pImpl->m_bIsGreetingLine = bSet;
1093 Gender eType,
const Sequence< OUString>& rSetGreetings)
1111 return m_pImpl->m_sFemaleGenderValue;
1116 if(
m_pImpl->m_sFemaleGenderValue != rValue )
1118 m_pImpl->m_sFemaleGenderValue = rValue;
1126 Sequence< OUString> aRet;
1127 auto aAssignIter = std::find_if(
m_pImpl->m_aAddressDataAssignments.begin(),
m_pImpl->m_aAddressDataAssignments.end(),
1128 [&rDBData](
const DBAddressDataAssignment& rAssignment) { return rAssignment.aDBData == rDBData; });
1129 if (aAssignIter !=
m_pImpl->m_aAddressDataAssignments.end())
1131 aRet = aAssignIter->aDBColumnAssignments;
1141 if(aAssignment.getLength() > sal::static_int_cast< sal_Int32, sal_uInt32>(nColumn) && !aAssignment[nColumn].isEmpty())
1142 sRet = aAssignment[nColumn];
1143 else if(nColumn < m_pImpl->m_AddressHeaderSA.size())
1144 sRet =
m_pImpl->m_AddressHeaderSA[nColumn].first;
1149 const Sequence< OUString>& rList)
1151 auto aAssignIter = std::find_if(
m_pImpl->m_aAddressDataAssignments.begin(),
m_pImpl->m_aAddressDataAssignments.end(),
1152 [&rDBData](
const DBAddressDataAssignment& rAssignment) { return rAssignment.aDBData == rDBData; });
1153 if (aAssignIter !=
m_pImpl->m_aAddressDataAssignments.end())
1155 if(aAssignIter->aDBColumnAssignments != rList)
1157 aAssignIter->aDBColumnAssignments = rList;
1158 aAssignIter->bColumnAssignmentsChanged =
true;
1163 DBAddressDataAssignment aAssignment;
1164 aAssignment.aDBData = rDBData;
1165 aAssignment.aDBColumnAssignments = rList;
1166 aAssignment.bColumnAssignmentsChanged =
true;
1167 m_pImpl->m_aAddressDataAssignments.push_back(aAssignment);
1174 bool bResult =
true;
1176 uno::Reference< XColumnsSupplier > xColsSupp( xResultSet, UNO_QUERY );
1179 uno::Reference<container::XNameAccess> xCols = xColsSupp->getColumns();
1182 Sequence< OUString> aAssignment =
1184 const OUString* pAssignment = aAssignment.getConstArray();
1187 if(aBlocks.getLength() <=
m_pImpl->GetCurrentAddressBlockIndex())
1195 OUString sConvertedColumn = aItem.
sText;
1196 auto nSize =
std::min(sal_uInt32(rHeaders.size()), sal_uInt32(aAssignment.getLength()));
1197 for(sal_uInt32 nColumn = 0; nColumn < nSize; ++nColumn)
1199 if (rHeaders[nColumn].
first == aItem.
sText &&
1200 !pAssignment[nColumn].isEmpty())
1202 sConvertedColumn = pAssignment[nColumn];
1207 if(!xCols->hasByName(sConvertedColumn))
1219 bool bResult =
true;
1225 uno::Reference< XColumnsSupplier > xColsSupp( xResultSet, UNO_QUERY );
1229 uno::Reference<container::XNameAccess> xCols = xColsSupp->getColumns();
1231 Sequence< OUString> aAssignment =
1233 const OUString* pAssignment = aAssignment.getConstArray();
1239 OUString sMale, sFemale;
1240 if(rFemaleEntries.getLength() > nCurrentFemale)
1241 sFemale = rFemaleEntries[nCurrentFemale];
1242 if(rMaleEntries.getLength() > nCurrentMale)
1243 sMale = rMaleEntries[nCurrentMale];
1245 OUString sAddress = sFemale + sMale;
1252 OUString sConvertedColumn = aItem.
sText;
1253 auto nSize =
std::min(sal_uInt32(rHeaders.size()), sal_uInt32(aAssignment.getLength()));
1254 for(sal_uInt32 nColumn = 0; nColumn < nSize; ++nColumn)
1256 if (rHeaders[nColumn].
first == aItem.
sText &&
1257 !pAssignment[nColumn].isEmpty())
1259 sConvertedColumn = pAssignment[nColumn];
1264 if(!xCols->hasByName(sConvertedColumn))
1276 return m_pImpl->m_sMailDisplayName;
1281 if(
m_pImpl->m_sMailDisplayName != rName)
1283 m_pImpl->m_sMailDisplayName = rName;
1290 return m_pImpl->m_sMailAddress;
1295 if(
m_pImpl->m_sMailAddress != rAddress )
1297 m_pImpl->m_sMailAddress = rAddress;
1304 return m_pImpl->m_bIsMailReplyTo;
1309 if(
m_pImpl->m_bIsMailReplyTo != bSet)
1311 m_pImpl->m_bIsMailReplyTo = bSet;
1318 return m_pImpl->m_sMailReplyTo;
1323 if(
m_pImpl->m_sMailReplyTo != rReplyTo)
1325 m_pImpl->m_sMailReplyTo = rReplyTo;
1332 return m_pImpl->m_sMailServer;
1337 if(
m_pImpl->m_sMailServer != rAddress)
1339 m_pImpl->m_sMailServer = rAddress;
1359 if(
m_pImpl->m_nMailPort != nSet)
1368 return m_pImpl->m_bIsSecureConnection;
1373 if(
m_pImpl->m_bIsSecureConnection != bSet)
1375 m_pImpl->m_bIsSecureConnection = bSet;
1382 return m_pImpl->m_bIsAuthentication;
1387 if(
m_pImpl->m_bIsAuthentication != bSet)
1389 m_pImpl->m_bIsAuthentication = bSet;
1396 return m_pImpl->m_sMailUserName;
1401 if(
m_pImpl->m_sMailUserName != rName)
1403 m_pImpl->m_sMailUserName = rName;
1410 return m_pImpl->m_sMailPassword;
1415 if(
m_pImpl->m_sMailPassword != rPassword)
1417 m_pImpl->m_sMailPassword = rPassword;
1424 return m_pImpl->m_bIsSMPTAfterPOP;
1429 if(
m_pImpl->m_bIsSMPTAfterPOP != bSet)
1431 m_pImpl->m_bIsSMPTAfterPOP = bSet;
1438 return m_pImpl->m_sInServerName;
1443 if(
m_pImpl->m_sInServerName != rServer)
1445 m_pImpl->m_sInServerName = rServer;
1453 switch (
m_pImpl->m_nInServerPort)
1459 if (
m_pImpl->m_bInServerPOP )
1464 return m_pImpl->m_nInServerPort;
1470 if(
m_pImpl->m_nInServerPort != nSet)
1472 m_pImpl->m_nInServerPort = nSet;
1479 return m_pImpl->m_bInServerPOP;
1484 if(
m_pImpl->m_bInServerPOP != bSet)
1486 m_pImpl->m_bInServerPOP = bSet;
1493 return m_pImpl->m_sInServerUserName;
1498 if(
m_pImpl->m_sInServerUserName != rName)
1500 m_pImpl->m_sInServerUserName = rName;
1507 return m_pImpl->m_sInServerPassword;
1512 if(
m_pImpl->m_sInServerPassword != rPassword)
1514 m_pImpl->m_sInServerPassword = rPassword;
1527 return m_pImpl->m_bIsEMailSupported;
1532 m_pImpl->m_aMergeInfos.push_back(rInfo);
1537 assert(nDocument < m_pImpl->m_aMergeInfos.size());
1538 return m_pImpl->m_aMergeInfos[nDocument];
1545 return m_pImpl->m_aMergeInfos.size();
1553 return nRet >= 0 ? nRet : 0;
1562 if(pViewShell == pView)
1586 m_pImpl->m_aMergeInfos.clear();
1603class DBChangeListener :
public cppu::WeakImplHelper<css::view::XSelectionChangeListener, css::frame::XDispatch>
1616 virtual void SAL_CALL disposing(
const EventObject&)
override
1621 virtual void SAL_CALL dispatch(
const css::util::URL& rURL,
const css::uno::Sequence< css::beans::PropertyValue >& )
override
1624 m_rParent.updateCurrentDBDataFromDocument();
1627 virtual void SAL_CALL addStatusListener(
const css::uno::Reference< css::frame::XStatusListener >&,
const css::util::URL&)
override
1631 virtual void SAL_CALL removeStatusListener(
const css::uno::Reference< css::frame::XStatusListener >&,
const css::util::URL&)
override
1652 std::vector<OUString> aDBNameList;
1653 std::vector<OUString> aAllDBNames;
1655 if(!aDBNameList.empty())
1658 if(!
m_pImpl->m_bUserSettingWereOverwritten)
1660 if(
m_pImpl->m_bIsAddressBlock
1661 ||
m_pImpl->m_bIsGreetingLineInMail
1662 ||
m_pImpl->m_bIsGreetingLine )
1665 m_pImpl->m_bUserSettingWereOverwritten =
true;
1666 m_pImpl->m_bIsAddressBlock_LastUserSetting =
m_pImpl->m_bIsAddressBlock;
1667 m_pImpl->m_bIsGreetingLineInMail_LastUserSetting =
m_pImpl->m_bIsGreetingLineInMail;
1668 m_pImpl->m_bIsGreetingLine_LastUserSetting =
m_pImpl->m_bIsGreetingLine;
1671 m_pImpl->m_bIsAddressBlock =
false;
1672 m_pImpl->m_bIsGreetingLineInMail =
false;
1673 m_pImpl->m_bIsGreetingLine =
false;
1679 else if(
m_pImpl->m_bUserSettingWereOverwritten )
1682 m_pImpl->m_bIsAddressBlock =
m_pImpl->m_bIsAddressBlock_LastUserSetting;
1683 m_pImpl->m_bIsGreetingLineInMail =
m_pImpl->m_bIsGreetingLineInMail_LastUserSetting;
1684 m_pImpl->m_bIsGreetingLine =
m_pImpl->m_bIsGreetingLine_LastUserSetting;
1686 m_pImpl->m_bUserSettingWereOverwritten =
false;
1700 m_pImpl->SetCurrentAddressBlockIndex( nSet );
1705 return m_pImpl->GetCurrentAddressBlockIndex();
const PropertyValue * pValues
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
SwMergeAddressItem Next()
static css::uno::Reference< css::sdbc::XConnection > GetConnection(const OUString &rDataSource, css::uno::Reference< css::sdbc::XDataSource > &rxSource, const SwView *pView)
static css::uno::Reference< css::sdbcx::XColumnsSupplier > GetColumnSupplier(css::uno::Reference< css::sdbc::XConnection > const &xConnection, const OUString &rTableOrQuery, SwDBSelect eTableOrQuery=SwDBSelect::UNKNOWN)
SwDBData const & GetDBData() const
Database information.
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
Sequence< OUString > GetAddressBlocks(bool bConvertToConfig=false) const
void SetAddressBlocks(const Sequence< OUString > &rBlocks, bool bConvertFromConfig=false)
static const Sequence< OUString > & GetPropertyNames()
bool m_bIsIndividualGreetingLineInMail
sal_Int32 GetCurrentGreeting(SwMailMergeConfigItem::Gender eType) const
OUString m_sExcludeCountry
OUString m_sMailDisplayName
bool m_bIsAddressBlock_LastUserSetting
std::vector< OUString > m_aAddressBlocks
OUString m_sInServerUserName
uno::Sequence< OUString > GetGreetings(SwMailMergeConfigItem::Gender eType, bool bConvertToConfig=false) const
void SetCurrentGreeting(SwMailMergeConfigItem::Gender eType, sal_Int32 nIndex)
std::vector< OUString > m_aMaleGreetingLines
uno::Sequence< OUString > m_aSavedDocuments
bool m_bIsHideEmptyParagraphs
sal_Int32 m_nCurrentFemaleGreeting
sal_Int32 m_nResultSetCursorPos
bool m_bUserSettingWereOverwritten
sal_Int32 GetCurrentAddressBlockIndex() const
bool m_bIsGreetingLine_LastUserSetting
SharedConnection m_xConnection
std::vector< SwDocMergeInfo > m_aMergeInfos
bool m_bIsGreetingLineInMail
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
sal_Int32 m_nCurrentAddressBlock
SwMailMergeConfigItem_Impl()
std::vector< OUString > m_aFemaleGreetingLines
void SetCurrentAddressBlockIndex(sal_Int32 nSet)
OUString m_sFemaleGenderValue
std::vector< OUString > m_aNeutralGreetingLines
bool m_bIsSecureConnection
bool m_bIsIndividualGreetingLine
sal_Int16 m_nInServerPort
std::vector< DBAddressDataAssignment > m_aAddressDataAssignments
std::vector< std::pair< OUString, int > > m_AddressHeaderSA
Reference< XColumnsSupplier > m_xColumnsSupplier
sal_Int32 m_nCurrentMaleGreeting
Reference< XDataSource > m_xSource
bool m_bIsGreetingLineInMail_LastUserSetting
virtual void ImplCommit() override
OUString m_sInServerPassword
Reference< XResultSet > m_xResultSet
sal_Int32 m_nCurrentNeutralGreeting
void SetGreetings(SwMailMergeConfigItem::Gender eType, const uno::Sequence< OUString > &rBlocks, bool bConvertFromConfig=false)
void AddMergedDocument(SwDocMergeInfo const &rInfo)
void SetIndividualGreeting(bool bSet, bool bInEMail)
const SwDBData & GetCurrentDBData() const
sal_Int32 GetResultSetPosition() const
void updateCurrentDBDataFromDocument()
void SetMailReplyTo(bool bSet)
void SetAuthentication(bool bSet)
sal_Int32 MoveResultSet(sal_Int32 nTarget)
css::uno::Sequence< OUString > GetAddressBlocks() const
css::uno::Sequence< OUString > GetGreetings(Gender eType) const
void SetFilter(OUString const &)
void SetGreetingLine(bool bSet, bool bInEMail)
SwDocMergeInfo & GetDocumentMergeInfo(sal_uInt32 nDocument)
std::unique_ptr< SwMailMergeConfigItem_Impl > m_pImpl
OUString const & GetInServerUserName() const
bool IsHideEmptyParagraphs() const
bool IsAuthentication() const
SharedConnection const & GetConnection() const
OUString const & GetInServerName() const
OUString const & GetMailServer() const
void SetCountrySettings(bool bSet, const OUString &sCountry)
void SetCurrentConnection(css::uno::Reference< css::sdbc::XDataSource > const &xSource, const SharedConnection &rConnection, css::uno::Reference< css::sdbcx::XColumnsSupplier > const &xColumnsSupplier, const SwDBData &rDBData)
OUString const & GetMailUserName() const
OUString const & GetMailAddress() const
void SetMailUserName(const OUString &rName)
std::set< sal_Int32 > m_aExcludedRecords
bool IsIncludeCountry() const
OUString const & GetMailDisplayName() const
void SetCurrentAddressBlockIndex(sal_Int32 nSet)
OUString & GetFilter() const
sal_uInt32 GetMergedDocumentCount()
void SetSourceView(SwView *pView)
void SetOutputToLetter(bool bSet)
bool IsSecureConnection() const
void stopDBChangeListening()
sal_Int16 GetInServerPort() const
bool IsAddressFieldsAssigned() const
bool IsRecordIncluded(sal_uInt32 nRecord) const
css::uno::Sequence< css::uno::Any > GetSelection() const
void SetInServerName(const OUString &rServer)
sal_Int32 GetCurrentAddressBlockIndex() const
void SetTargetView(SwView *pView)
OUString & GetExcludeCountry() const
bool IsMailReplyTo() const
void SetMailServer(const OUString &rAddress)
sal_Int16 GetMailPort() const
void SetInServerUserName(const OUString &rName)
void SetGreetings(Gender eType, const css::uno::Sequence< OUString > &rBlocks)
void SetInServerPOP(bool bSet)
bool IsMailAvailable() const
bool IsSMTPAfterPOP() const
void ExcludeRecord(sal_Int32 nRecord, bool bExclude)
bool IsAddressBlock() const
void SetMailPort(sal_Int16 nSet)
const std::vector< std::pair< OUString, int > > & GetDefaultAddressHeaders() const
bool IsRecordExcluded(sal_uInt32 nRecord) const
void SetInServerPort(sal_Int16 nSet)
const css::uno::Sequence< OUString > & GetSavedDocuments() const
css::uno::Reference< css::sdbcx::XColumnsSupplier > const & GetColumnsSupplier()
void SetSecureConnection(bool bSet)
css::uno::Reference< css::view::XSelectionChangeListener > m_xDBChangedListener
OUString const & GetInServerPassword() const
void SetMailDisplayName(const OUString &rName)
void SetFemaleGenderValue(const OUString &rValue)
void SetMailPassword(const OUString &rPassword)
bool IsGreetingLine(bool bInEMail) const
void SetCurrentDBData(const SwDBData &rDBData)
bool IsGreetingFieldsAssigned() const
sal_Int32 m_nGreetingMoves
void SetAddressBlocks(const css::uno::Sequence< OUString > &rBlocks)
void SetSMTPAfterPOP(bool bSet)
bool IsInServerPOP() const
bool IsIndividualGreeting(bool bInEMail) const
bool IsResultSetFirstLast(bool &bIsFirst, bool &bIsLast)
OUString const & GetMailPassword() const
css::uno::Sequence< OUString > GetColumnAssignment(const SwDBData &rDBData) const
sal_Int32 GetCurrentGreeting(Gender eType) const
css::uno::Reference< css::sdbc::XResultSet > const & GetResultSet() const
OUString const & GetMailReplyTo() const
css::uno::Reference< css::sdbc::XDataSource > const & GetSource() const
bool IsOutputToLetter() const
void SetAddressBlock(bool bSet)
void SetColumnAssignment(const SwDBData &rDBData, const css::uno::Sequence< OUString > &)
void SetInServerPassword(const OUString &rPassword)
void SetHideEmptyParagraphs(bool bSet)
const OUString & GetFemaleGenderValue() const
void SetMailAddress(const OUString &rAddress)
void SetCurrentGreeting(Gender eType, sal_Int32 nIndex)
OUString GetAssignedColumn(sal_uInt32 nColumn) const
SwWrtShell & GetWrtShell() const
css::view::XSelectionSupplier * GetUNOObject()
static const char * GetDBChangeURL()
static bool PutProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues, bool bAllLocales)
static bool SetSetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
static css::uno::Sequence< css::uno::Any > GetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, bool bAllLocales)
static css::uno::Sequence< OUString > GetNodeNames(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, ConfigNameFormat eFormat)
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual DECL_LISTENERMULTIPLEXER_END void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
#define SAL_WARN(area, stream)
const char cDataSourceName[]
static OUString lcl_CreateNodeName(Sequence< OUString > &rAssignments)
static void lcl_ConvertToNumbers(OUString &rBlock, const std::vector< std::pair< OUString, int > > &rHeaders)
const char cDBColumnAssignments[]
constexpr OUStringLiteral cAddressDataAssignments
static void lcl_ConvertFromNumbers(OUString &rBlock, const std::vector< std::pair< OUString, int > > &rHeaders)
static SwView * lcl_ExistsView(SwView *pView)
const char cDataTableName[]
const char cDataCommandType[]
bool UCB_IsFile(const OUString &rURL)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
constexpr OUStringLiteral first
enumrange< T >::Iterator begin(enumrange< T >)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
OUString SwResId(TranslateId aId)