LibreOffice Module sw (master)  1
mmgreetingspage.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SW_SOURCE_UI_DBUI_MMGREETINGSPAGE_HXX
20 #define INCLUDED_SW_SOURCE_UI_DBUI_MMGREETINGSPAGE_HXX
21 
22 #include <vcl/wizardmachine.hxx>
23 #include <sfx2/basedlgs.hxx>
24 #include <mailmergehelper.hxx>
25 #include <vcl/weld.hxx>
26 
27 #include <mailmergewizard.hxx>
28 
29 class SwMailMergeWizard;
30 
32 {
33 protected:
38 
39  std::unique_ptr<weld::CheckButton> m_xGreetingLineCB;
40  std::unique_ptr<weld::CheckButton> m_xPersonalizedCB;
41  std::unique_ptr<weld::Label> m_xFemaleFT;
42  std::unique_ptr<weld::ComboBox> m_xFemaleLB;
43  std::unique_ptr<weld::Button> m_xFemalePB;
44  std::unique_ptr<weld::Label> m_xMaleFT;
45  std::unique_ptr<weld::ComboBox> m_xMaleLB;
46  std::unique_ptr<weld::Button> m_xMalePB;
47  std::unique_ptr<weld::Label> m_xFemaleFI;
48  std::unique_ptr<weld::Label> m_xFemaleColumnFT;
49  std::unique_ptr<weld::ComboBox> m_xFemaleColumnLB;
50  std::unique_ptr<weld::Label> m_xFemaleFieldFT;
51  std::unique_ptr<weld::ComboBox> m_xFemaleFieldCB;
52  std::unique_ptr<weld::Label> m_xNeutralFT;
53  std::unique_ptr<weld::ComboBox> m_xNeutralCB;
54 
56  : m_pWizard(nullptr)
57  , m_rConfigItem(rConfigItem)
58  , m_bIsTabPage(false)
59  , m_xGreetingLineCB(rBuilder.weld_check_button("greeting"))
60  , m_xPersonalizedCB(rBuilder.weld_check_button("personalized"))
61  , m_xFemaleFT(rBuilder.weld_label("femaleft"))
62  , m_xFemaleLB(rBuilder.weld_combo_box("female"))
63  , m_xFemalePB(rBuilder.weld_button("newfemale"))
64  , m_xMaleFT(rBuilder.weld_label("maleft"))
65  , m_xMaleLB(rBuilder.weld_combo_box("male"))
66  , m_xMalePB(rBuilder.weld_button("newmale"))
67  , m_xFemaleFI(rBuilder.weld_label("femalefi"))
68  , m_xFemaleColumnFT(rBuilder.weld_label("femalecolft"))
69  , m_xFemaleColumnLB(rBuilder.weld_combo_box("femalecol"))
70  , m_xFemaleFieldFT(rBuilder.weld_label("femalefieldft"))
71  , m_xFemaleFieldCB(rBuilder.weld_combo_box("femalefield"))
72  , m_xNeutralFT(rBuilder.weld_label("generalft"))
73  , m_xNeutralCB(rBuilder.weld_combo_box("general"))
74  {
75  }
76 
78 
79  DECL_LINK(IndividualHdl_Impl, weld::ToggleButton&, void);
80  DECL_LINK(GreetingHdl_Impl, weld::Button&, void);
81 
82  void Contains(bool bContainsGreeting);
83  virtual void UpdatePreview();
84 };
85 
87  , public SwGreetingsHandler
88 {
89  std::unique_ptr<SwAddressPreview> m_xPreview;
90  std::unique_ptr<weld::Label> m_xPreviewFI;
91  std::unique_ptr<weld::Button> m_xAssignPB;
92  std::unique_ptr<weld::Label> m_xDocumentIndexFI;
93  std::unique_ptr<weld::Button> m_xPrevSetIB;
94  std::unique_ptr<weld::Button> m_xNextSetIB;
95  std::unique_ptr<weld::CustomWeld> m_xPreviewWIN;
96 
97  OUString m_sDocument;
98 
99  DECL_LINK(ContainsHdl_Impl, weld::ToggleButton&, void);
100  DECL_LINK(InsertDataHdl_Impl, weld::Button&, void);
101  DECL_LINK(GreetingSelectComboBoxHdl_Impl, weld::ComboBox&, void);
102  DECL_LINK(GreetingSelectListBoxHdl_Impl, weld::ComboBox&, void);
103  DECL_LINK(AssignHdl_Impl, weld::Button&, void);
104 
105  virtual void UpdatePreview() override;
106  virtual void Activate() override;
107  virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
108 public:
110  virtual ~SwMailMergeGreetingsPage() override;
111 };
112 
114 {
115  std::unique_ptr<weld::Label> m_xBodyFT;
116  std::unique_ptr<weld::TextView> m_xBodyMLE;
117  std::unique_ptr<weld::Button> m_xOK;
118 
119  DECL_LINK(ContainsHdl_Impl, weld::ToggleButton&, void);
120  DECL_LINK(OKHdl, weld::Button&, void);
121 public:
122  SwMailBodyDialog(weld::Window* pParent);
123  virtual ~SwMailBodyDialog() override;
124 
125  void SetBody(const OUString& rBody ) { m_xBodyMLE->set_text(rBody); }
126  OUString GetBody() const { return m_xBodyMLE->get_text(); }
127 };
128 #endif
129 
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xFemaleFI
std::unique_ptr< weld::CheckButton > m_xGreetingLineCB
virtual ~SwMailBodyDialog() override
std::unique_ptr< weld::Label > m_xNeutralFT
std::unique_ptr< weld::Button > m_xPrevSetIB
std::unique_ptr< weld::Label > m_xBodyFT
std::unique_ptr< weld::Label > m_xPreviewFI
std::unique_ptr< weld::Button > m_xMalePB
std::unique_ptr< weld::ComboBox > m_xMaleLB
virtual void Activate() override
virtual ~SwMailMergeGreetingsPage() override
std::unique_ptr< weld::Button > m_xFemalePB
SwMailMergeWizard * m_pWizard
void Contains(bool bContainsGreeting)
DECL_LINK(IndividualHdl_Impl, weld::ToggleButton &, void)
std::unique_ptr< weld::ComboBox > m_xNeutralCB
std::unique_ptr< weld::TextView > m_xBodyMLE
std::unique_ptr< weld::Label > m_xFemaleFT
std::unique_ptr< weld::Label > m_xFemaleFieldFT
std::unique_ptr< weld::ComboBox > m_xFemaleFieldCB
std::unique_ptr< weld::Button > m_xNextSetIB
SwMailMergeGreetingsPage(weld::Container *pPage, SwMailMergeWizard *pWizard)
std::unique_ptr< weld::Label > m_xDocumentIndexFI
SwGreetingsHandler(SwMailMergeConfigItem &rConfigItem, weld::Builder &rBuilder)
DECL_LINK(ContainsHdl_Impl, weld::ToggleButton &, void)
OUString GetBody() const
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
std::unique_ptr< weld::ComboBox > m_xFemaleLB
void SetBody(const OUString &rBody)
std::unique_ptr< weld::ComboBox > m_xFemaleColumnLB
std::unique_ptr< weld::Button > m_xAssignPB
std::unique_ptr< weld::Button > m_xOK
DECL_LINK(ContainsHdl_Impl, weld::ToggleButton &, void)
std::unique_ptr< weld::CheckButton > m_xPersonalizedCB
virtual void UpdatePreview()
SwMailBodyDialog(weld::Window *pParent)
std::unique_ptr< SwAddressPreview > m_xPreview
virtual void UpdatePreview() override
std::unique_ptr< weld::CustomWeld > m_xPreviewWIN
std::unique_ptr< weld::Label > m_xMaleFT
SwMailMergeConfigItem & m_rConfigItem
The mail merge state, available even when m_pWizard is nullptr.
std::unique_ptr< weld::Label > m_xFemaleColumnFT