xref: /aoo41x/main/sw/source/ui/inc/mailmrge.hxx (revision cdf0e10c)
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 _MAILMRGE_HXX
28*cdf0e10cSrcweir #define _MAILMRGE_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <svx/stddlg.hxx>
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #ifndef _BUTTON_HXX //autogen
33*cdf0e10cSrcweir #include <vcl/button.hxx>
34*cdf0e10cSrcweir #endif
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #ifndef _FIELD_HXX //autogen
37*cdf0e10cSrcweir #include <vcl/field.hxx>
38*cdf0e10cSrcweir #endif
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
41*cdf0e10cSrcweir #include <vcl/fixed.hxx>
42*cdf0e10cSrcweir #endif
43*cdf0e10cSrcweir #ifndef _EDIT_HXX //autogen
44*cdf0e10cSrcweir #include <vcl/edit.hxx>
45*cdf0e10cSrcweir #endif
46*cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
49*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
50*cdf0e10cSrcweir #endif
51*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.h>
52*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir class SwWrtShell;
55*cdf0e10cSrcweir class SwModuleOptions;
56*cdf0e10cSrcweir class SwXSelChgLstnr_Impl;
57*cdf0e10cSrcweir struct SwMailMergeDlg_Impl;
58*cdf0e10cSrcweir namespace com{namespace sun{namespace star{
59*cdf0e10cSrcweir     namespace frame{
60*cdf0e10cSrcweir         class XFrame;
61*cdf0e10cSrcweir     }
62*cdf0e10cSrcweir     namespace sdbc{
63*cdf0e10cSrcweir         class XResultSet;
64*cdf0e10cSrcweir         class XConnection;
65*cdf0e10cSrcweir     }
66*cdf0e10cSrcweir }}}
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir class SwMailMergeDlg : public SvxStandardDialog
69*cdf0e10cSrcweir {
70*cdf0e10cSrcweir     friend class SwXSelChgLstnr_Impl;
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir     Window*         pBeamerWin;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir     RadioButton     aAllRB;
75*cdf0e10cSrcweir 	RadioButton		aMarkedRB;
76*cdf0e10cSrcweir 	RadioButton		aFromRB;
77*cdf0e10cSrcweir 	NumericField	aFromNF;
78*cdf0e10cSrcweir 	FixedText		aBisFT;
79*cdf0e10cSrcweir 	NumericField	aToNF;
80*cdf0e10cSrcweir     FixedLine       aRecordFL;
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir     FixedLine       aSeparatorFL;
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir     RadioButton     aPrinterRB;
85*cdf0e10cSrcweir 	RadioButton		aMailingRB;
86*cdf0e10cSrcweir 	RadioButton		aFileRB;
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 	CheckBox		aSingleJobsCB;
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir     FixedLine       aSaveMergedDocumentFL;
91*cdf0e10cSrcweir     RadioButton     aSaveSingleDocRB;
92*cdf0e10cSrcweir     RadioButton     aSaveIndividualRB;
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir     CheckBox        aGenerateFromDataBaseCB;
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir     FixedText       aColumnFT;
97*cdf0e10cSrcweir     ListBox         aColumnLB;
98*cdf0e10cSrcweir     FixedText       aPathFT;
99*cdf0e10cSrcweir 	Edit			aPathED;
100*cdf0e10cSrcweir 	PushButton		aPathPB;
101*cdf0e10cSrcweir     FixedText       aFilterFT;
102*cdf0e10cSrcweir     ListBox         aFilterLB;
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 	ListBox			aAddressFldLB;
105*cdf0e10cSrcweir 	FixedText		aSubjectFT;
106*cdf0e10cSrcweir 	Edit			aSubjectED;
107*cdf0e10cSrcweir 	FixedText		aFormatFT;
108*cdf0e10cSrcweir 	FixedText		aAttachFT;
109*cdf0e10cSrcweir 	Edit			aAttachED;
110*cdf0e10cSrcweir 	PushButton		aAttachPB;
111*cdf0e10cSrcweir 	CheckBox		aFormatHtmlCB;
112*cdf0e10cSrcweir 	CheckBox		aFormatRtfCB;
113*cdf0e10cSrcweir 	CheckBox		aFormatSwCB;
114*cdf0e10cSrcweir     FixedLine       aDestFL;
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir     FixedLine       aBottomSeparatorFL;
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     OKButton        aOkBTN;
119*cdf0e10cSrcweir 	CancelButton	aCancelBTN;
120*cdf0e10cSrcweir 	HelpButton		aHelpBTN;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     SwMailMergeDlg_Impl* pImpl;
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir     SwWrtShell&     rSh;
125*cdf0e10cSrcweir 	SwModuleOptions* pModOpt;
126*cdf0e10cSrcweir 	const String&	rDBName;
127*cdf0e10cSrcweir 	const String&	rTableName;
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 	sal_uInt16			nMergeType;
130*cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >		m_aSelection;
131*cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame;
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir     Size            m_aDialogSize;
134*cdf0e10cSrcweir     ::rtl::OUString m_sSaveFilter;
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 	DECL_LINK( ButtonHdl, Button* pBtn );
138*cdf0e10cSrcweir 	DECL_LINK( InsertPathHdl, PushButton * );
139*cdf0e10cSrcweir 	DECL_LINK( AttachFileHdl, PushButton * );
140*cdf0e10cSrcweir     DECL_LINK( OutputTypeHdl, RadioButton* pBtn );
141*cdf0e10cSrcweir     DECL_LINK( FilenameHdl, CheckBox* pBtn );
142*cdf0e10cSrcweir 	DECL_LINK( ModifyHdl, NumericField* pLB );
143*cdf0e10cSrcweir     DECL_LINK( SaveTypeHdl, RadioButton* pBtn );
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir 	virtual void 	Apply();
146*cdf0e10cSrcweir     virtual void    Resize();
147*cdf0e10cSrcweir     bool            ExecQryShell();
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir public:
150*cdf0e10cSrcweir 	 SwMailMergeDlg(Window* pParent, SwWrtShell& rSh,
151*cdf0e10cSrcweir 	 	const String& rSourceName,
152*cdf0e10cSrcweir 		const String& rTblName,
153*cdf0e10cSrcweir         sal_Int32 nCommandType,
154*cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection,
155*cdf0e10cSrcweir         ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0);
156*cdf0e10cSrcweir 	~SwMailMergeDlg();
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir 	inline sal_uInt16	GetMergeType() { return nMergeType; }
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir     bool IsSaveIndividualDocs() const { return aSaveIndividualRB.IsChecked(); }
161*cdf0e10cSrcweir     bool IsGenerateFromDataBase() const { return aGenerateFromDataBaseCB.IsChecked(); }
162*cdf0e10cSrcweir     String GetColumnName() const { return aColumnLB.GetSelectEntry();}
163*cdf0e10cSrcweir     String GetPath() const { return aPathED.GetText();}
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir     const ::rtl::OUString& GetSaveFilter() const {return m_sSaveFilter;}
166*cdf0e10cSrcweir 	inline const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const { return m_aSelection; }
167*cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const;
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir };
170*cdf0e10cSrcweir /* -----------------27.11.2002 12:05-----------------
171*cdf0e10cSrcweir  *
172*cdf0e10cSrcweir  * --------------------------------------------------*/
173*cdf0e10cSrcweir class SwMailMergeCreateFromDlg : public ModalDialog
174*cdf0e10cSrcweir {
175*cdf0e10cSrcweir     FixedLine       aCreateFromFL;
176*cdf0e10cSrcweir     RadioButton     aThisDocRB;
177*cdf0e10cSrcweir     RadioButton     aUseTemplateRB;
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir     OKButton        aOK;
180*cdf0e10cSrcweir     CancelButton    aCancel;
181*cdf0e10cSrcweir     HelpButton      aHelp;
182*cdf0e10cSrcweir public:
183*cdf0e10cSrcweir     SwMailMergeCreateFromDlg(Window* pParent);
184*cdf0e10cSrcweir     ~SwMailMergeCreateFromDlg();
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir     sal_Bool    IsThisDocument() const {return aThisDocRB.IsChecked();}
187*cdf0e10cSrcweir };
188*cdf0e10cSrcweir /* -----------------04.02.2003 13:41-----------------
189*cdf0e10cSrcweir  *
190*cdf0e10cSrcweir  * --------------------------------------------------*/
191*cdf0e10cSrcweir class SwMailMergeFieldConnectionsDlg : public ModalDialog
192*cdf0e10cSrcweir {
193*cdf0e10cSrcweir     FixedLine       aConnectionsFL;
194*cdf0e10cSrcweir     RadioButton     aUseExistingRB;
195*cdf0e10cSrcweir     RadioButton     aCreateNewRB;
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir     FixedInfo       aInfoFI;
198*cdf0e10cSrcweir 
199*cdf0e10cSrcweir     OKButton        aOK;
200*cdf0e10cSrcweir     CancelButton    aCancel;
201*cdf0e10cSrcweir     HelpButton      aHelp;
202*cdf0e10cSrcweir public:
203*cdf0e10cSrcweir     SwMailMergeFieldConnectionsDlg(Window* pParent);
204*cdf0e10cSrcweir     ~SwMailMergeFieldConnectionsDlg();
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir     sal_Bool    IsUseExistingConnections() const {return aUseExistingRB.IsChecked();}
207*cdf0e10cSrcweir };
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir #endif
210*cdf0e10cSrcweir 
211