1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _MAILMERGEGREETINGSPAGE_HXX
20 #define _MAILMERGEGREETINGSPAGE_HXX
22 #include <svtools/wizardmachine.hxx>
23 #include <sfx2/basedlgs.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/lstbox.hxx>
26 #include <vcl/combobox.hxx>
27 #include <svtools/stdctrl.hxx>
28 #include <mailmergehelper.hxx>
29 #include <svtools/svmedit.hxx>
31 class SwMailMergeWizard
;
33 class SwGreetingsHandler
36 CheckBox
* m_pGreetingLineCB
;
38 CheckBox
* m_pPersonalizedCB
;
40 FixedText
* m_pFemaleFT
;
42 PushButton
* m_pFemalePB
;
46 PushButton
* m_pMalePB
;
48 FixedInfo
* m_pFemaleFI
;
49 FixedText
* m_pFemaleColumnFT
;
50 ListBox
* m_pFemaleColumnLB
;
51 FixedText
* m_pFemaleFieldFT
;
52 ComboBox
* m_pFemaleFieldCB
;
54 FixedText
* m_pNeutralFT
;
55 ComboBox
* m_pNeutralCB
;
59 SwMailMergeWizard
* m_pWizard
;
61 ~SwGreetingsHandler() {}
63 DECL_LINK(IndividualHdl_Impl
, void *);
64 DECL_LINK(GreetingHdl_Impl
, PushButton
*);
66 void Contains(sal_Bool bContainsGreeting
);
67 virtual void UpdatePreview();
70 class SwMailMergeGreetingsPage
: public svt::OWizardPage
,
71 public SwGreetingsHandler
73 SwBoldFixedInfo m_aHeaderFI
;
75 CheckBox m_aGreetingLineCB
;
77 CheckBox m_aPersonalizedCB
;
79 FixedText m_aFemaleFT
;
81 PushButton m_aFemalePB
;
87 FixedInfo m_aFemaleFI
;
88 FixedText m_aFemaleColumnFT
;
89 ListBox m_aFemaleColumnLB
;
90 FixedText m_aFemaleFieldFT
;
91 ComboBox m_aFemaleFieldCB
;
93 FixedText m_aNeutralFT
;
94 ComboBox m_aNeutralCB
;
96 FixedInfo m_aPreviewFI
;
97 SwAddressPreview m_aPreviewWIN
;
98 PushButton m_aAssignPB
;
99 FixedInfo m_aDocumentIndexFI
;
100 ImageButton m_aPrevSetIB
;
101 ImageButton m_aNextSetIB
;
105 DECL_LINK(ContainsHdl_Impl
, CheckBox
*);
106 DECL_LINK(InsertDataHdl_Impl
, ImageButton
*);
107 DECL_LINK(GreetingSelectHdl_Impl
, void *);
108 DECL_LINK(AssignHdl_Impl
, PushButton
*);
110 virtual void UpdatePreview();
111 virtual void ActivatePage();
112 virtual sal_Bool
commitPage( ::svt::WizardTypes::CommitPageReason _eReason
);
114 SwMailMergeGreetingsPage( SwMailMergeWizard
* _pParent
);
115 ~SwMailMergeGreetingsPage();
119 class SwMailBodyDialog
: public SfxModalDialog
, public SwGreetingsHandler
121 CheckBox m_aGreetingLineCB
;
123 CheckBox m_aPersonalizedCB
;
125 FixedText m_aFemaleFT
;
127 PushButton m_aFemalePB
;
131 PushButton m_aMalePB
;
133 FixedInfo m_aFemaleFI
;
134 FixedText m_aFemaleColumnFT
;
135 ListBox m_aFemaleColumnLB
;
136 FixedText m_aFemaleFieldFT
;
137 ComboBox m_aFemaleFieldCB
;
139 FixedText m_aNeutralFT
;
140 ComboBox m_aNeutralCB
;
143 MultiLineEdit m_aBodyMLE
;
144 FixedLine m_aSeparatorFL
;
147 CancelButton m_aCancel
;
150 DECL_LINK(ContainsHdl_Impl
, CheckBox
*);
151 DECL_LINK(OKHdl
, void *);
153 SwMailBodyDialog(Window
* pParent
, SwMailMergeWizard
* pWizard
);
156 void SetBody(const String
& rBody
) {m_aBodyMLE
.SetText(rBody
);}
157 String
GetBody() const {return m_aBodyMLE
.GetText();}
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */