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 INCLUDED_SW_SOURCE_UI_DBUI_CUSTOMIZEADDRESSLISTDIALOG_HXX
20 #define INCLUDED_SW_SOURCE_UI_DBUI_CUSTOMIZEADDRESSLISTDIALOG_HXX
22 #include <sfx2/basedlgs.hxx>
23 #include <vcl/weld.hxx>
25 #include "createaddresslistdialog.hxx"
29 class SwCustomizeAddressListDialog
: public SfxDialogController
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
;
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);
46 SwCustomizeAddressListDialog(weld::Window
* pParent
, const SwCSVData
& rOldData
);
47 virtual ~SwCustomizeAddressListDialog() override
;
49 std::unique_ptr
<SwCSVData
> ReleaseNewData() { return std::move(m_xNewData
);}
52 class SwAddRenameEntryDialog
: public SfxDialogController
54 const std::vector
< OUString
>& m_rCSVHeader
;
55 std::unique_ptr
<weld::Entry
> m_xFieldNameED
;
56 std::unique_ptr
<weld::Button
> m_xOK
;
58 DECL_LINK(ModifyHdl_Impl
, weld::Entry
&, void);
60 SwAddRenameEntryDialog(weld::Window
* pParent
, const OUString
& rUIXMLDescription
,
61 const OUString
& rID
, const std::vector
< OUString
>& rCSVHeader
);
64 void SetFieldName(const OUString
& rName
) { m_xFieldNameED
->set_text(rName
); }
65 OUString
GetFieldName() const { return m_xFieldNameED
->get_text(); }
69 class SwAddEntryDialog
: public SwAddRenameEntryDialog
72 SwAddEntryDialog(weld::Window
* pParent
, const std::vector
< OUString
>& rCSVHeader
)
73 : SwAddRenameEntryDialog(pParent
, "modules/swriter/ui/addentrydialog.ui",
74 "AddEntryDialog", rCSVHeader
)
79 class SwRenameEntryDialog
: public SwAddRenameEntryDialog
82 SwRenameEntryDialog(weld::Window
* pParent
, const std::vector
< OUString
>& rCSVHeader
)
83 : SwAddRenameEntryDialog(pParent
, "modules/swriter/ui/renameentrydialog.ui",
84 "RenameEntryDialog", rCSVHeader
)
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */