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