xref: /trunk/main/sw/source/ui/inc/mailmrge.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _MAILMRGE_HXX
24 #define _MAILMRGE_HXX
25 
26 #include <svx/stddlg.hxx>
27 
28 #ifndef _BUTTON_HXX //autogen
29 #include <vcl/button.hxx>
30 #endif
31 
32 #ifndef _FIELD_HXX //autogen
33 #include <vcl/field.hxx>
34 #endif
35 
36 #ifndef _FIXED_HXX //autogen
37 #include <vcl/fixed.hxx>
38 #endif
39 #ifndef _EDIT_HXX //autogen
40 #include <vcl/edit.hxx>
41 #endif
42 #include <svtools/stdctrl.hxx>
43 
44 #ifndef _LSTBOX_HXX //autogen
45 #include <vcl/lstbox.hxx>
46 #endif
47 #include <com/sun/star/uno/Sequence.h>
48 #include <com/sun/star/uno/Reference.h>
49 
50 class SwWrtShell;
51 class SwModuleOptions;
52 class SwXSelChgLstnr_Impl;
53 struct SwMailMergeDlg_Impl;
54 namespace com{namespace sun{namespace star{
55     namespace frame{
56         class XFrame;
57     }
58     namespace sdbc{
59         class XResultSet;
60         class XConnection;
61     }
62 }}}
63 
64 class SwMailMergeDlg : public SvxStandardDialog
65 {
66     friend class SwXSelChgLstnr_Impl;
67 
68     Window*         pBeamerWin;
69 
70     RadioButton     aAllRB;
71 	RadioButton		aMarkedRB;
72 	RadioButton		aFromRB;
73 	NumericField	aFromNF;
74 	FixedText		aBisFT;
75 	NumericField	aToNF;
76     FixedLine       aRecordFL;
77 
78     FixedLine       aSeparatorFL;
79 
80     RadioButton     aPrinterRB;
81 	RadioButton		aMailingRB;
82 	RadioButton		aFileRB;
83 
84 	CheckBox		aSingleJobsCB;
85 
86     FixedLine       aSaveMergedDocumentFL;
87     RadioButton     aSaveSingleDocRB;
88     RadioButton     aSaveIndividualRB;
89 
90     CheckBox        aGenerateFromDataBaseCB;
91 
92     FixedText       aColumnFT;
93     ListBox         aColumnLB;
94     FixedText       aPathFT;
95 	Edit			aPathED;
96 	PushButton		aPathPB;
97     FixedText       aFilterFT;
98     ListBox         aFilterLB;
99 
100 	ListBox			aAddressFldLB;
101 	FixedText		aSubjectFT;
102 	Edit			aSubjectED;
103 	FixedText		aFormatFT;
104 	FixedText		aAttachFT;
105 	Edit			aAttachED;
106 	PushButton		aAttachPB;
107 	CheckBox		aFormatHtmlCB;
108 	CheckBox		aFormatRtfCB;
109 	CheckBox		aFormatSwCB;
110     FixedLine       aDestFL;
111 
112     FixedLine       aBottomSeparatorFL;
113 
114     OKButton        aOkBTN;
115 	CancelButton	aCancelBTN;
116 	HelpButton		aHelpBTN;
117 
118     SwMailMergeDlg_Impl* pImpl;
119 
120     SwWrtShell&     rSh;
121 	SwModuleOptions* pModOpt;
122 	const String&	rDBName;
123 	const String&	rTableName;
124 
125 	sal_uInt16			nMergeType;
126 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >		m_aSelection;
127     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame;
128 
129     Size            m_aDialogSize;
130     ::rtl::OUString m_sSaveFilter;
131 
132 
133 	DECL_LINK( ButtonHdl, Button* pBtn );
134 	DECL_LINK( InsertPathHdl, PushButton * );
135 	DECL_LINK( AttachFileHdl, PushButton * );
136     DECL_LINK( OutputTypeHdl, RadioButton* pBtn );
137     DECL_LINK( FilenameHdl, CheckBox* pBtn );
138 	DECL_LINK( ModifyHdl, NumericField* pLB );
139     DECL_LINK( SaveTypeHdl, RadioButton* pBtn );
140 
141 	virtual void 	Apply();
142     virtual void    Resize();
143     bool            ExecQryShell();
144 
145 public:
146 	 SwMailMergeDlg(Window* pParent, SwWrtShell& rSh,
147 	 	const String& rSourceName,
148 		const String& rTblName,
149         sal_Int32 nCommandType,
150         const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection,
151         ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0);
152 	~SwMailMergeDlg();
153 
GetMergeType()154 	inline sal_uInt16	GetMergeType() { return nMergeType; }
155 
IsSaveIndividualDocs() const156     bool IsSaveIndividualDocs() const { return aSaveIndividualRB.IsChecked(); }
IsGenerateFromDataBase() const157     bool IsGenerateFromDataBase() const { return aGenerateFromDataBaseCB.IsChecked(); }
GetColumnName() const158     String GetColumnName() const { return aColumnLB.GetSelectEntry();}
GetPath() const159     String GetPath() const { return aPathED.GetText();}
160 
GetSaveFilter() const161     const ::rtl::OUString& GetSaveFilter() const {return m_sSaveFilter;}
GetSelection() const162 	inline const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const { return m_aSelection; }
163     ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const;
164 
165 };
166 /* -----------------27.11.2002 12:05-----------------
167  *
168  * --------------------------------------------------*/
169 class SwMailMergeCreateFromDlg : public ModalDialog
170 {
171     FixedLine       aCreateFromFL;
172     RadioButton     aThisDocRB;
173     RadioButton     aUseTemplateRB;
174 
175     OKButton        aOK;
176     CancelButton    aCancel;
177     HelpButton      aHelp;
178 public:
179     SwMailMergeCreateFromDlg(Window* pParent);
180     ~SwMailMergeCreateFromDlg();
181 
IsThisDocument() const182     sal_Bool    IsThisDocument() const {return aThisDocRB.IsChecked();}
183 };
184 /* -----------------04.02.2003 13:41-----------------
185  *
186  * --------------------------------------------------*/
187 class SwMailMergeFieldConnectionsDlg : public ModalDialog
188 {
189     FixedLine       aConnectionsFL;
190     RadioButton     aUseExistingRB;
191     RadioButton     aCreateNewRB;
192 
193     FixedInfo       aInfoFI;
194 
195     OKButton        aOK;
196     CancelButton    aCancel;
197     HelpButton      aHelp;
198 public:
199     SwMailMergeFieldConnectionsDlg(Window* pParent);
200     ~SwMailMergeFieldConnectionsDlg();
201 
IsUseExistingConnections() const202     sal_Bool    IsUseExistingConnections() const {return aUseExistingRB.IsChecked();}
203 };
204 
205 #endif
206 
207