1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: mailmrge.hxx,v $
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 ************************************************************************/
33 #include <svx/stddlg.hxx>
35 #ifndef _BUTTON_HXX //autogen
36 #include <vcl/button.hxx>
39 #ifndef _FIELD_HXX //autogen
40 #include <vcl/field.hxx>
43 #ifndef _FIXED_HXX //autogen
44 #include <vcl/fixed.hxx>
46 #ifndef _EDIT_HXX //autogen
47 #include <vcl/edit.hxx>
49 #include <svtools/stdctrl.hxx>
51 #ifndef _LSTBOX_HXX //autogen
52 #include <vcl/lstbox.hxx>
54 #include <com/sun/star/uno/Sequence.h>
55 #include <com/sun/star/uno/Reference.h>
58 class SwModuleOptions
;
59 class SwXSelChgLstnr_Impl
;
60 struct SwMailMergeDlg_Impl
;
61 namespace com
{namespace sun
{namespace star
{
71 class SwMailMergeDlg
: public SvxStandardDialog
73 friend class SwXSelChgLstnr_Impl
;
78 RadioButton aMarkedRB
;
85 FixedLine aSeparatorFL
;
87 RadioButton aPrinterRB
;
88 RadioButton aMailingRB
;
91 CheckBox aSingleJobsCB
;
93 FixedLine aSaveMergedDocumentFL
;
94 RadioButton aSaveSingleDocRB
;
95 RadioButton aSaveIndividualRB
;
97 CheckBox aGenerateFromDataBaseCB
;
107 ListBox aAddressFldLB
;
108 FixedText aSubjectFT
;
113 PushButton aAttachPB
;
114 CheckBox aFormatHtmlCB
;
115 CheckBox aFormatRtfCB
;
116 CheckBox aFormatSwCB
;
119 FixedLine aBottomSeparatorFL
;
122 CancelButton aCancelBTN
;
125 SwMailMergeDlg_Impl
* pImpl
;
128 SwModuleOptions
* pModOpt
;
129 const String
& rDBName
;
130 const String
& rTableName
;
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
;
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();
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);
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
;
177 CancelButton aCancel
;
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
;
197 CancelButton aCancel
;
200 SwMailMergeFieldConnectionsDlg(Window
* pParent
);
201 ~SwMailMergeFieldConnectionsDlg();
203 BOOL
IsUseExistingConnections() const {return aUseExistingRB
.IsChecked();}