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