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