1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef _MMCONFIGITEM_HXX 28*cdf0e10cSrcweir #define _MMCONFIGITEM_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 31*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx> 32*cdf0e10cSrcweir #include <tools/resary.hxx> 33*cdf0e10cSrcweir #include <swdbdata.hxx> 34*cdf0e10cSrcweir #include "swdllapi.h" 35*cdf0e10cSrcweir #include "sharedconnection.hxx" 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir namespace com{namespace sun{namespace star{ 38*cdf0e10cSrcweir namespace sdbc{ 39*cdf0e10cSrcweir class XDataSource; 40*cdf0e10cSrcweir class XConnection; 41*cdf0e10cSrcweir class XResultSet; 42*cdf0e10cSrcweir } 43*cdf0e10cSrcweir namespace sdbcx{ 44*cdf0e10cSrcweir class XColumnsSupplier; 45*cdf0e10cSrcweir } 46*cdf0e10cSrcweir }}} 47*cdf0e10cSrcweir class SwMailMergeConfigItem_Impl; 48*cdf0e10cSrcweir class SwView; 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir /*-- 06.04.2004 10:43:35--------------------------------------------------- 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 53*cdf0e10cSrcweir struct SwDocMergeInfo 54*cdf0e10cSrcweir { 55*cdf0e10cSrcweir long nStartPageInTarget; 56*cdf0e10cSrcweir long nEndPageInTarget; 57*cdf0e10cSrcweir long nDBRow; 58*cdf0e10cSrcweir }; 59*cdf0e10cSrcweir class SW_DLLPUBLIC SwMailMergeConfigItem 60*cdf0e10cSrcweir { 61*cdf0e10cSrcweir // com::sun::star::uno::Sequence< ::rtl::OUString> m_aSavedDocuments; 62*cdf0e10cSrcweir SwMailMergeConfigItem_Impl* m_pImpl; 63*cdf0e10cSrcweir //session information - not stored in configuration 64*cdf0e10cSrcweir bool m_bAddressInserted; 65*cdf0e10cSrcweir bool m_bMergeDone; 66*cdf0e10cSrcweir bool m_bGreetingInserted; 67*cdf0e10cSrcweir sal_Int32 m_nGreetingMoves; 68*cdf0e10cSrcweir ::rtl::OUString m_rAddressBlockFrame; 69*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> m_aSelection; 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir sal_uInt16 m_nStartPrint; 72*cdf0e10cSrcweir sal_uInt16 m_nEndPrint; 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir ::rtl::OUString m_sSelectedPrinter; 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir SwView* m_pSourceView; 77*cdf0e10cSrcweir SwView* m_pTargetView; 78*cdf0e10cSrcweir public: 79*cdf0e10cSrcweir SwMailMergeConfigItem(); 80*cdf0e10cSrcweir ~SwMailMergeConfigItem(); 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir enum Gender 83*cdf0e10cSrcweir { 84*cdf0e10cSrcweir FEMALE, 85*cdf0e10cSrcweir MALE, 86*cdf0e10cSrcweir NEUTRAL 87*cdf0e10cSrcweir }; 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir void Commit(); 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir const ResStringArray& GetDefaultAddressHeaders() const; 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir void SetCurrentConnection( 94*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> xSource, 95*cdf0e10cSrcweir SharedConnection xConnection, 96*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> xColumnsSupplier, 97*cdf0e10cSrcweir const SwDBData& rDBData); 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> 100*cdf0e10cSrcweir GetSource(); 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir SharedConnection GetConnection(); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> 105*cdf0e10cSrcweir GetColumnsSupplier(); 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> 108*cdf0e10cSrcweir GetResultSet() const; 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir void DisposeResultSet(); 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir ::rtl::OUString& GetFilter() const; 113*cdf0e10cSrcweir void SetFilter(::rtl::OUString&); 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> 116*cdf0e10cSrcweir GetSelection()const; 117*cdf0e10cSrcweir void SetSelection(::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > rSelection); 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir void SetCurrentDBData( const SwDBData& rDBData); 120*cdf0e10cSrcweir const SwDBData& GetCurrentDBData() const; 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir // move absolute, nTarget == -1 -> goto last record 123*cdf0e10cSrcweir sal_Int32 MoveResultSet(sal_Int32 nTarget); 124*cdf0e10cSrcweir sal_Int32 GetResultSetPosition()const; 125*cdf0e10cSrcweir bool IsResultSetFirstLast(bool& bIsFirst, bool& bIsLast); 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir bool IsRecordExcluded(sal_Int32 nRecord); 128*cdf0e10cSrcweir void ExcludeRecord(sal_Int32 nRecord, bool bExclude); 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir const com::sun::star::uno::Sequence< ::rtl::OUString>& 131*cdf0e10cSrcweir GetSavedDocuments() const; 132*cdf0e10cSrcweir void AddSavedDocument(::rtl::OUString rName); 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir sal_Bool IsOutputToLetter()const; 135*cdf0e10cSrcweir void SetOutputToLetter(sal_Bool bSet); 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir sal_Bool IsAddressBlock()const; 138*cdf0e10cSrcweir void SetAddressBlock(sal_Bool bSet); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir sal_Bool IsHideEmptyParagraphs() const; 141*cdf0e10cSrcweir void SetHideEmptyParagraphs(sal_Bool bSet); 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir const com::sun::star::uno::Sequence< ::rtl::OUString> 144*cdf0e10cSrcweir GetAddressBlocks() const; 145*cdf0e10cSrcweir void SetAddressBlocks(const com::sun::star::uno::Sequence< ::rtl::OUString>& rBlocks); 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir void SetCurrentAddressBlockIndex( sal_Int32 nSet ); 148*cdf0e10cSrcweir sal_Int32 GetCurrentAddressBlockIndex() const; 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir sal_Bool IsIncludeCountry() const; 151*cdf0e10cSrcweir rtl::OUString& GetExcludeCountry() const; 152*cdf0e10cSrcweir void SetCountrySettings(sal_Bool bSet, const rtl::OUString& sCountry); 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir sal_Bool IsIndividualGreeting(sal_Bool bInEMail) const; 155*cdf0e10cSrcweir void SetIndividualGreeting(sal_Bool bSet, sal_Bool bInEMail); 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir sal_Bool IsGreetingLine(sal_Bool bInEMail) const; 158*cdf0e10cSrcweir void SetGreetingLine(sal_Bool bSet, sal_Bool bInEMail); 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir const com::sun::star::uno::Sequence< ::rtl::OUString> 161*cdf0e10cSrcweir GetGreetings(Gender eType) const; 162*cdf0e10cSrcweir void SetGreetings(Gender eType, const com::sun::star::uno::Sequence< ::rtl::OUString>& rBlocks); 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir sal_Int32 GetCurrentGreeting(Gender eType) const; 165*cdf0e10cSrcweir void SetCurrentGreeting(Gender eType, sal_Int32 nIndex); 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir //the content of the gender column that marks it as female 168*cdf0e10cSrcweir const ::rtl::OUString& GetFemaleGenderValue() const; 169*cdf0e10cSrcweir void SetFemaleGenderValue(const ::rtl::OUString rValue); 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir //returns the assignment in the order of the default headers (GetDefaultAddressHeaders()) 172*cdf0e10cSrcweir com::sun::star::uno::Sequence< ::rtl::OUString > 173*cdf0e10cSrcweir GetColumnAssignment( const SwDBData& rDBData ) const; 174*cdf0e10cSrcweir void SetColumnAssignment( 175*cdf0e10cSrcweir const SwDBData& rDBData, 176*cdf0e10cSrcweir const com::sun::star::uno::Sequence< ::rtl::OUString>& ); 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir bool IsAddressFieldsAssigned() const; 179*cdf0e10cSrcweir bool IsGreetingFieldsAssigned() const; 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir //e-Mail settings: 182*cdf0e10cSrcweir ::rtl::OUString GetMailDisplayName() const; 183*cdf0e10cSrcweir void SetMailDisplayName(const ::rtl::OUString& rName); 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir ::rtl::OUString GetMailAddress() const; 186*cdf0e10cSrcweir void SetMailAddress(const ::rtl::OUString& rAddress); 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir sal_Bool IsMailReplyTo() const; 189*cdf0e10cSrcweir void SetMailReplyTo(sal_Bool bSet); 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir ::rtl::OUString GetMailReplyTo() const; 192*cdf0e10cSrcweir void SetMailReplyTo(const ::rtl::OUString& rReplyTo); 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir ::rtl::OUString GetMailServer() const; 195*cdf0e10cSrcweir void SetMailServer(const ::rtl::OUString& rAddress); 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir sal_Int16 GetMailPort() const; 198*cdf0e10cSrcweir void SetMailPort(sal_Int16 nSet); 199*cdf0e10cSrcweir 200*cdf0e10cSrcweir sal_Bool IsSecureConnection() const; 201*cdf0e10cSrcweir void SetSecureConnection(sal_Bool bSet); 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir sal_Bool IsAuthentication() const; 204*cdf0e10cSrcweir void SetAuthentication(sal_Bool bSet); 205*cdf0e10cSrcweir 206*cdf0e10cSrcweir ::rtl::OUString GetMailUserName() const; 207*cdf0e10cSrcweir void SetMailUserName(const ::rtl::OUString& rName); 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir ::rtl::OUString GetMailPassword() const; 210*cdf0e10cSrcweir void SetMailPassword(const ::rtl::OUString& rPassword); 211*cdf0e10cSrcweir 212*cdf0e10cSrcweir sal_Bool IsSMTPAfterPOP() const; 213*cdf0e10cSrcweir void SetSMTPAfterPOP(sal_Bool bSet); 214*cdf0e10cSrcweir 215*cdf0e10cSrcweir ::rtl::OUString GetInServerName() const; 216*cdf0e10cSrcweir void SetInServerName(const ::rtl::OUString& rServer); 217*cdf0e10cSrcweir 218*cdf0e10cSrcweir sal_Int16 GetInServerPort() const; 219*cdf0e10cSrcweir void SetInServerPort(sal_Int16 nSet); 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir sal_Bool IsInServerPOP() const; 222*cdf0e10cSrcweir void SetInServerPOP(sal_Bool bSet); 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir ::rtl::OUString GetInServerUserName() const; 225*cdf0e10cSrcweir void SetInServerUserName(const ::rtl::OUString& rName); 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir ::rtl::OUString GetInServerPassword() const; 228*cdf0e10cSrcweir void SetInServerPassword(const ::rtl::OUString& rPassword); 229*cdf0e10cSrcweir 230*cdf0e10cSrcweir //session information 231*cdf0e10cSrcweir bool IsAddressInserted() const { return m_bAddressInserted; } 232*cdf0e10cSrcweir void SetAddressInserted(const ::rtl::OUString& rFrameName) 233*cdf0e10cSrcweir { m_bAddressInserted = true; 234*cdf0e10cSrcweir m_rAddressBlockFrame = rFrameName; 235*cdf0e10cSrcweir } 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir bool IsGreetingInserted() const { return m_bGreetingInserted; } 238*cdf0e10cSrcweir void SetGreetingInserted() 239*cdf0e10cSrcweir { m_bGreetingInserted = true; } 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir // counts the moves in the layout page 242*cdf0e10cSrcweir void MoveGreeting( sal_Int32 nMove) { m_nGreetingMoves += nMove;} 243*cdf0e10cSrcweir sal_Int32 GetGreetingMoves() const { return m_nGreetingMoves;} 244*cdf0e10cSrcweir 245*cdf0e10cSrcweir bool IsMergeDone() const { return m_bMergeDone;} 246*cdf0e10cSrcweir void SetMergeDone( ) { m_bMergeDone = true; } 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir // new source document - reset some flags 249*cdf0e10cSrcweir void DocumentReloaded(); 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir bool IsMailAvailable() const; 252*cdf0e10cSrcweir 253*cdf0e10cSrcweir // notify a completed merge, provid the appropriate e-Mail address if available 254*cdf0e10cSrcweir void AddMergedDocument(SwDocMergeInfo& rInfo); 255*cdf0e10cSrcweir //returns the page and database cursor information of each merged document 256*cdf0e10cSrcweir SwDocMergeInfo& GetDocumentMergeInfo(sal_uInt32 nDocument); 257*cdf0e10cSrcweir sal_uInt32 GetMergedDocumentCount() const; 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir void SetPrintRange( sal_uInt16 nStartDocument, sal_uInt16 nEndDocument) 260*cdf0e10cSrcweir {m_nStartPrint = nStartDocument; m_nEndPrint = nEndDocument;} 261*cdf0e10cSrcweir sal_uInt16 GetPrintRangeStart() const {return m_nStartPrint;} 262*cdf0e10cSrcweir sal_uInt16 GetPrintRangeEnd() const {return m_nEndPrint;} 263*cdf0e10cSrcweir 264*cdf0e10cSrcweir const ::rtl::OUString& GetSelectedPrinter() const {return m_sSelectedPrinter;} 265*cdf0e10cSrcweir void SetSelectedPrinter(const ::rtl::OUString& rSet ) 266*cdf0e10cSrcweir {m_sSelectedPrinter = rSet;} 267*cdf0e10cSrcweir 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir SwView* GetTargetView(); 270*cdf0e10cSrcweir void SetTargetView(SwView* pView); 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir SwView* GetSourceView(); 273*cdf0e10cSrcweir void SetSourceView(SwView* pView); 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir //helper methods 276*cdf0e10cSrcweir ::rtl::OUString GetAssignedColumn(sal_uInt32 nColumn)const; 277*cdf0e10cSrcweir }; 278*cdf0e10cSrcweir #endif 279*cdf0e10cSrcweir 280