1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _MAILMRGE_HXX 28 #define _MAILMRGE_HXX 29 30 #include <svx/stddlg.hxx> 31 32 #ifndef _BUTTON_HXX //autogen 33 #include <vcl/button.hxx> 34 #endif 35 36 #ifndef _FIELD_HXX //autogen 37 #include <vcl/field.hxx> 38 #endif 39 40 #ifndef _FIXED_HXX //autogen 41 #include <vcl/fixed.hxx> 42 #endif 43 #ifndef _EDIT_HXX //autogen 44 #include <vcl/edit.hxx> 45 #endif 46 #include <svtools/stdctrl.hxx> 47 48 #ifndef _LSTBOX_HXX //autogen 49 #include <vcl/lstbox.hxx> 50 #endif 51 #include <com/sun/star/uno/Sequence.h> 52 #include <com/sun/star/uno/Reference.h> 53 54 class SwWrtShell; 55 class SwModuleOptions; 56 class SwXSelChgLstnr_Impl; 57 struct SwMailMergeDlg_Impl; 58 namespace com{namespace sun{namespace star{ 59 namespace frame{ 60 class XFrame; 61 } 62 namespace sdbc{ 63 class XResultSet; 64 class XConnection; 65 } 66 }}} 67 68 class SwMailMergeDlg : public SvxStandardDialog 69 { 70 friend class SwXSelChgLstnr_Impl; 71 72 Window* pBeamerWin; 73 74 RadioButton aAllRB; 75 RadioButton aMarkedRB; 76 RadioButton aFromRB; 77 NumericField aFromNF; 78 FixedText aBisFT; 79 NumericField aToNF; 80 FixedLine aRecordFL; 81 82 FixedLine aSeparatorFL; 83 84 RadioButton aPrinterRB; 85 RadioButton aMailingRB; 86 RadioButton aFileRB; 87 88 CheckBox aSingleJobsCB; 89 90 FixedLine aSaveMergedDocumentFL; 91 RadioButton aSaveSingleDocRB; 92 RadioButton aSaveIndividualRB; 93 94 CheckBox aGenerateFromDataBaseCB; 95 96 FixedText aColumnFT; 97 ListBox aColumnLB; 98 FixedText aPathFT; 99 Edit aPathED; 100 PushButton aPathPB; 101 FixedText aFilterFT; 102 ListBox aFilterLB; 103 104 ListBox aAddressFldLB; 105 FixedText aSubjectFT; 106 Edit aSubjectED; 107 FixedText aFormatFT; 108 FixedText aAttachFT; 109 Edit aAttachED; 110 PushButton aAttachPB; 111 CheckBox aFormatHtmlCB; 112 CheckBox aFormatRtfCB; 113 CheckBox aFormatSwCB; 114 FixedLine aDestFL; 115 116 FixedLine aBottomSeparatorFL; 117 118 OKButton aOkBTN; 119 CancelButton aCancelBTN; 120 HelpButton aHelpBTN; 121 122 SwMailMergeDlg_Impl* pImpl; 123 124 SwWrtShell& rSh; 125 SwModuleOptions* pModOpt; 126 const String& rDBName; 127 const String& rTableName; 128 129 sal_uInt16 nMergeType; 130 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_aSelection; 131 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame; 132 133 Size m_aDialogSize; 134 ::rtl::OUString m_sSaveFilter; 135 136 137 DECL_LINK( ButtonHdl, Button* pBtn ); 138 DECL_LINK( InsertPathHdl, PushButton * ); 139 DECL_LINK( AttachFileHdl, PushButton * ); 140 DECL_LINK( OutputTypeHdl, RadioButton* pBtn ); 141 DECL_LINK( FilenameHdl, CheckBox* pBtn ); 142 DECL_LINK( ModifyHdl, NumericField* pLB ); 143 DECL_LINK( SaveTypeHdl, RadioButton* pBtn ); 144 145 virtual void Apply(); 146 virtual void Resize(); 147 bool ExecQryShell(); 148 149 public: 150 SwMailMergeDlg(Window* pParent, SwWrtShell& rSh, 151 const String& rSourceName, 152 const String& rTblName, 153 sal_Int32 nCommandType, 154 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection, 155 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0); 156 ~SwMailMergeDlg(); 157 158 inline sal_uInt16 GetMergeType() { return nMergeType; } 159 160 bool IsSaveIndividualDocs() const { return aSaveIndividualRB.IsChecked(); } 161 bool IsGenerateFromDataBase() const { return aGenerateFromDataBaseCB.IsChecked(); } 162 String GetColumnName() const { return aColumnLB.GetSelectEntry();} 163 String GetPath() const { return aPathED.GetText();} 164 165 const ::rtl::OUString& GetSaveFilter() const {return m_sSaveFilter;} 166 inline const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const { return m_aSelection; } 167 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const; 168 169 }; 170 /* -----------------27.11.2002 12:05----------------- 171 * 172 * --------------------------------------------------*/ 173 class SwMailMergeCreateFromDlg : public ModalDialog 174 { 175 FixedLine aCreateFromFL; 176 RadioButton aThisDocRB; 177 RadioButton aUseTemplateRB; 178 179 OKButton aOK; 180 CancelButton aCancel; 181 HelpButton aHelp; 182 public: 183 SwMailMergeCreateFromDlg(Window* pParent); 184 ~SwMailMergeCreateFromDlg(); 185 186 sal_Bool IsThisDocument() const {return aThisDocRB.IsChecked();} 187 }; 188 /* -----------------04.02.2003 13:41----------------- 189 * 190 * --------------------------------------------------*/ 191 class SwMailMergeFieldConnectionsDlg : public ModalDialog 192 { 193 FixedLine aConnectionsFL; 194 RadioButton aUseExistingRB; 195 RadioButton aCreateNewRB; 196 197 FixedInfo aInfoFI; 198 199 OKButton aOK; 200 CancelButton aCancel; 201 HelpButton aHelp; 202 public: 203 SwMailMergeFieldConnectionsDlg(Window* pParent); 204 ~SwMailMergeFieldConnectionsDlg(); 205 206 sal_Bool IsUseExistingConnections() const {return aUseExistingRB.IsChecked();} 207 }; 208 209 #endif 210 211