Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / inc / DropDownFormFieldDialog.hxx
blobc6bcc9837304e671858ac98af9a8d2dd0a0d5d59
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
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/.
8 */
10 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_DROPDOWNFORMFIELDDIALOG_HXX
11 #define INCLUDED_SW_SOURCE_UIBASE_INC_DROPDOWNFORMFIELDDIALOG_HXX
13 #include <vcl/weld.hxx>
15 namespace sw::mark
17 class IFieldmark;
20 /// Dialog to specify the properties of drop-down form field
21 namespace sw
23 class DropDownFormFieldDialog final : public weld::GenericDialogController
25 private:
26 mark::IFieldmark* m_pDropDownField;
27 bool m_bListHasChanged;
29 std::unique_ptr<weld::Entry> m_xListItemEntry;
30 std::unique_ptr<weld::Button> m_xListAddButton;
32 std::unique_ptr<weld::TreeView> m_xListItemsTreeView;
34 std::unique_ptr<weld::Button> m_xListRemoveButton;
35 std::unique_ptr<weld::Button> m_xListUpButton;
36 std::unique_ptr<weld::Button> m_xListDownButton;
38 DECL_LINK(ListChangedHdl, weld::TreeView&, void);
39 DECL_LINK(KeyPressedHdl, const KeyEvent&, bool);
40 DECL_LINK(EntryChangedHdl, weld::Entry&, void);
41 DECL_LINK(ButtonPushedHdl, weld::Button&, void);
43 void InitControls();
44 void AppendItemToList();
45 void UpdateButtons();
46 void Apply();
48 public:
49 DropDownFormFieldDialog(weld::Widget* pParent, mark::IFieldmark* pDropDownField);
50 virtual ~DropDownFormFieldDialog() override;
52 virtual short run() override
54 short nRet = GenericDialogController::run();
55 if (nRet == RET_OK)
56 Apply();
57 return nRet;
61 } // namespace sw
63 #endif
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */