LibreOffice Module sw (master)  1
customizeaddresslistdialog.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_CUSTOMIZEADDRESSLISTDIALOG_HXX
20 #define INCLUDED_SW_SOURCE_UI_DBUI_CUSTOMIZEADDRESSLISTDIALOG_HXX
21 
22 #include <sfx2/basedlgs.hxx>
23 #include <vcl/weld.hxx>
24 
25 struct SwCSVData;
26 
28 {
29  std::unique_ptr<SwCSVData> m_xNewData;
30  std::unique_ptr<weld::TreeView> m_xFieldsLB;
31  std::unique_ptr<weld::Button> m_xAddPB;
32  std::unique_ptr<weld::Button> m_xDeletePB;
33  std::unique_ptr<weld::Button> m_xRenamePB;
34  std::unique_ptr<weld::Button> m_xUpPB;
35  std::unique_ptr<weld::Button> m_xDownPB;
36 
37  DECL_LINK(AddRenameHdl_Impl, weld::Button&, void);
38  DECL_LINK(DeleteHdl_Impl, weld::Button&, void);
39  DECL_LINK(UpDownHdl_Impl, weld::Button&, void);
40  DECL_LINK(ListBoxSelectHdl_Impl, weld::TreeView&, void);
41 
42  void UpdateButtons();
43 public:
44  SwCustomizeAddressListDialog(weld::Window* pParent, const SwCSVData& rOldData);
45  virtual ~SwCustomizeAddressListDialog() override;
46 
47  std::unique_ptr<SwCSVData> ReleaseNewData() { return std::move(m_xNewData);}
48 };
49 
51 {
52  const std::vector< OUString >& m_rCSVHeader;
53  std::unique_ptr<weld::Entry> m_xFieldNameED;
54  std::unique_ptr<weld::Button> m_xOK;
55 
56  DECL_LINK(ModifyHdl_Impl, weld::Entry&, void);
57 protected:
58  SwAddRenameEntryDialog(weld::Window* pParent, const OUString& rUIXMLDescription,
59  const OString& rID, const std::vector< OUString >& rCSVHeader);
60 
61 public:
62  void SetFieldName(const OUString& rName) { m_xFieldNameED->set_text(rName); }
63  OUString GetFieldName() const { return m_xFieldNameED->get_text(); }
64 
65 };
66 
68 {
69 public:
70  SwAddEntryDialog(weld::Window* pParent, const std::vector< OUString >& rCSVHeader)
71  : SwAddRenameEntryDialog(pParent, "modules/swriter/ui/addentrydialog.ui",
72  "AddEntryDialog", rCSVHeader)
73  {
74  }
75 };
76 
78 {
79 public:
80  SwRenameEntryDialog(weld::Window* pParent, const std::vector< OUString >& rCSVHeader)
81  : SwAddRenameEntryDialog(pParent, "modules/swriter/ui/renameentrydialog.ui",
82  "RenameEntryDialog", rCSVHeader)
83  {
84  }
85 };
86 
87 #endif
88 
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< SwCSVData > ReleaseNewData()
void SetFieldName(const OUString &rName)
std::unique_ptr< weld::TreeView > m_xFieldsLB
std::unique_ptr< weld::Button > m_xRenamePB
DECL_LINK(AddRenameHdl_Impl, weld::Button &, void)
SwRenameEntryDialog(weld::Window *pParent, const std::vector< OUString > &rCSVHeader)
std::unique_ptr< weld::Button > m_xDeletePB
std::unique_ptr< weld::Button > m_xAddPB
std::unique_ptr< weld::Entry > m_xFieldNameED
SwCustomizeAddressListDialog(weld::Window *pParent, const SwCSVData &rOldData)
SwAddRenameEntryDialog(weld::Window *pParent, const OUString &rUIXMLDescription, const OString &rID, const std::vector< OUString > &rCSVHeader)
std::unique_ptr< SwCSVData > m_xNewData
SwAddEntryDialog(weld::Window *pParent, const std::vector< OUString > &rCSVHeader)
std::unique_ptr< weld::Button > m_xUpPB
DECL_LINK(ModifyHdl_Impl, weld::Entry &, void)
std::unique_ptr< weld::Button > m_xDownPB
std::unique_ptr< weld::Button > m_xOK
const std::vector< OUString > & m_rCSVHeader