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 
23 #include <sfx2/basedlgs.hxx>
24 #include <mailmergehelper.hxx>
25 #include <vcl/weld.hxx>
26 
27 class SwMailMergeWizard;
28 
30 {
31 protected:
36 
37  std::unique_ptr<weld::CheckButton> m_xGreetingLineCB;
38  std::unique_ptr<weld::CheckButton> m_xPersonalizedCB;
39  std::unique_ptr<weld::Label> m_xFemaleFT;
40  std::unique_ptr<weld::ComboBox> m_xFemaleLB;
41  std::unique_ptr<weld::Button> m_xFemalePB;
42  std::unique_ptr<weld::Label> m_xMaleFT;
43  std::unique_ptr<weld::ComboBox> m_xMaleLB;
44  std::unique_ptr<weld::Button> m_xMalePB;
45  std::unique_ptr<weld::Label> m_xFemaleFI;
46  std::unique_ptr<weld::Label> m_xFemaleColumnFT;
47  std::unique_ptr<weld::ComboBox> m_xFemaleColumnLB;
48  std::unique_ptr<weld::Label> m_xFemaleFieldFT;
49  std::unique_ptr<weld::ComboBox> m_xFemaleFieldCB;
50  std::unique_ptr<weld::Label> m_xNeutralFT;
51  std::unique_ptr<weld::ComboBox> m_xNeutralCB;
52 
54  : m_rConfigItem(rConfigItem)
55  , m_bIsTabPage(false)
56  , m_xGreetingLineCB(rBuilder.weld_check_button("greeting"))
57  , m_xPersonalizedCB(rBuilder.weld_check_button("personalized"))
58  , m_xFemaleFT(rBuilder.weld_label("femaleft"))
59  , m_xFemaleLB(rBuilder.weld_combo_box("female"))
60  , m_xFemalePB(rBuilder.weld_button("newfemale"))
61  , m_xMaleFT(rBuilder.weld_label("maleft"))
62  , m_xMaleLB(rBuilder.weld_combo_box("male"))
63  , m_xMalePB(rBuilder.weld_button("newmale"))
64  , m_xFemaleFI(rBuilder.weld_label("femalefi"))
65  , m_xFemaleColumnFT(rBuilder.weld_label("femalecolft"))
66  , m_xFemaleColumnLB(rBuilder.weld_combo_box("femalecol"))
67  , m_xFemaleFieldFT(rBuilder.weld_label("femalefieldft"))
68  , m_xFemaleFieldCB(rBuilder.weld_combo_box("femalefield"))
69  , m_xNeutralFT(rBuilder.weld_label("generalft"))
70  , m_xNeutralCB(rBuilder.weld_combo_box("general"))
71  {
72  }
73 
75 
76  DECL_LINK(IndividualHdl_Impl, weld::ToggleButton&, void);
77  DECL_LINK(GreetingHdl_Impl, weld::Button&, void);
78 
79  void Contains(bool bContainsGreeting);
80  virtual void UpdatePreview();
81 };
82 
84  , public SwGreetingsHandler
85 {
86  std::unique_ptr<AddressPreview> m_xPreview;
87  std::unique_ptr<weld::Label> m_xPreviewFI;
88  std::unique_ptr<weld::Button> m_xAssignPB;
89  std::unique_ptr<weld::Label> m_xDocumentIndexFI;
90  std::unique_ptr<weld::Button> m_xPrevSetIB;
91  std::unique_ptr<weld::Button> m_xNextSetIB;
92  std::unique_ptr<weld::CustomWeld> m_xPreviewWIN;
93 
94  OUString m_sDocument;
95 
96  DECL_LINK(ContainsHdl_Impl, weld::ToggleButton&, void);
97  DECL_LINK(InsertDataHdl_Impl, weld::Button&, void);
98  DECL_LINK(GreetingSelectComboBoxHdl_Impl, weld::ComboBox&, void);
99  DECL_LINK(GreetingSelectListBoxHdl_Impl, weld::ComboBox&, void);
100  DECL_LINK(AssignHdl_Impl, weld::Button&, void);
101 
102  virtual void UpdatePreview() override;
103  virtual void ActivatePage() override;
104  virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) override;
105 public:
107  virtual ~SwMailMergeGreetingsPage() override;
108  virtual void dispose() override;
109 };
110 
112 {
113  std::unique_ptr<weld::Label> m_xBodyFT;
114  std::unique_ptr<weld::TextView> m_xBodyMLE;
115  std::unique_ptr<weld::Button> m_xOK;
116 
117  DECL_LINK(ContainsHdl_Impl, weld::ToggleButton&, void);
118  DECL_LINK(OKHdl, weld::Button&, void);
119 public:
120  SwMailBodyDialog(weld::Window* pParent);
121  virtual ~SwMailBodyDialog() override;
122 
123  void SetBody(const OUString& rBody ) { m_xBodyMLE->set_text(rBody); }
124  OUString GetBody() const { return m_xBodyMLE->get_text(); }
125 };
126 #endif
127 
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xFemaleFI
std::unique_ptr< weld::CheckButton > m_xGreetingLineCB
virtual void dispose() override
virtual ~SwMailBodyDialog() override
std::unique_ptr< weld::Label > m_xNeutralFT
std::unique_ptr< weld::Button > m_xPrevSetIB
virtual bool commitPage(::svt::WizardTypes::CommitPageReason _eReason) override
std::unique_ptr< weld::Label > m_xBodyFT
std::unique_ptr< weld::Label > m_xPreviewFI
std::unique_ptr< weld::Button > m_xMalePB
virtual void ActivatePage() override
std::unique_ptr< weld::ComboBox > m_xMaleLB
VclPtr< SwMailMergeWizard > m_pWizard
virtual ~SwMailMergeGreetingsPage() override
std::unique_ptr< weld::Button > m_xFemalePB
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
SwMailMergeGreetingsPage(SwMailMergeWizard *pWizard, TabPageParent pParent)
std::unique_ptr< weld::ComboBox > m_xFemaleFieldCB
std::unique_ptr< weld::Button > m_xNextSetIB
std::unique_ptr< weld::Label > m_xDocumentIndexFI
SwGreetingsHandler(SwMailMergeConfigItem &rConfigItem, weld::Builder &rBuilder)
DECL_LINK(ContainsHdl_Impl, weld::ToggleButton &, void)
OUString GetBody() const
std::unique_ptr< AddressPreview > m_xPreview
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)
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