/src/libreoffice/include/svx/ClassificationDialog.hxx
Line | Count | Source |
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 | | */ |
10 | | |
11 | | #ifndef INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX |
12 | | #define INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX |
13 | | |
14 | | #include <sal/config.h> |
15 | | #include <vcl/weld/ComboBox.hxx> |
16 | | #include <vcl/weld/DialogController.hxx> |
17 | | #include <vcl/weld/Entry.hxx> |
18 | | #include <vcl/weld/TreeView.hxx> |
19 | | #include <vcl/weld/weld.hxx> |
20 | | #include <svx/svxdllapi.h> |
21 | | #include <sfx2/classificationhelper.hxx> |
22 | | #include <svx/ClassificationField.hxx> |
23 | | |
24 | | namespace svx |
25 | | { |
26 | | class ClassificationEditView; |
27 | | } |
28 | | namespace weld |
29 | | { |
30 | | class CustomWeld; |
31 | | } |
32 | | |
33 | | struct ImplSVEvent; |
34 | | |
35 | | namespace svx |
36 | | { |
37 | | class SVX_DLLPUBLIC ClassificationDialog final : public weld::GenericDialogController |
38 | | { |
39 | | private: |
40 | | SfxClassificationHelper maHelper; |
41 | | SfxClassificationHelper maInternationalHelper; |
42 | | |
43 | | const bool m_bPerParagraph; |
44 | | const std::function<void()> m_aParagraphSignHandler; |
45 | | |
46 | | ImplSVEvent* m_nAsyncExpandEvent; |
47 | | sal_Int32 m_nCurrentSelectedCategory; |
48 | | |
49 | | std::vector<std::vector<ClassificationResult>> m_aRecentlyUsedValuesCollection; |
50 | | std::vector<ClassificationResult> m_aInitialValues; |
51 | | |
52 | | std::unique_ptr<weld::Button> m_xOkButton; |
53 | | std::unique_ptr<weld::Button> m_xSignButton; |
54 | | std::unique_ptr<weld::ToggleButton> m_xToolBox; |
55 | | std::unique_ptr<weld::ComboBox> m_xRecentlyUsedListBox; |
56 | | std::unique_ptr<weld::ComboBox> m_xClassificationListBox; |
57 | | std::unique_ptr<weld::ComboBox> m_xInternationalClassificationListBox; |
58 | | std::unique_ptr<weld::Label> m_xMarkingLabel; |
59 | | std::unique_ptr<weld::TreeView> m_xMarkingListBox; |
60 | | std::unique_ptr<weld::TreeView> m_xIntellectualPropertyPartListBox; |
61 | | std::unique_ptr<weld::TreeView> m_xIntellectualPropertyPartNumberListBox; |
62 | | std::unique_ptr<weld::Button> m_xIntellectualPropertyPartAddButton; |
63 | | std::unique_ptr<weld::Entry> m_xIntellectualPropertyPartEdit; |
64 | | std::unique_ptr<weld::Expander> m_xIntellectualPropertyExpander; |
65 | | std::unique_ptr<ClassificationEditView> m_xEditWindow; |
66 | | std::unique_ptr<weld::CustomWeld> m_xEditWindowWeld; |
67 | | |
68 | | DECL_DLLPRIVATE_LINK(ButtonClicked, weld::Button&, void); |
69 | | DECL_DLLPRIVATE_LINK(OkHdl, weld::Button&, void); |
70 | | DECL_DLLPRIVATE_LINK(SelectToolboxHdl, weld::Toggleable&, void); |
71 | | DECL_DLLPRIVATE_LINK(SelectClassificationHdl, weld::ComboBox&, void); |
72 | | DECL_DLLPRIVATE_LINK(SelectMarkingHdl, weld::TreeView&, bool); |
73 | | DECL_DLLPRIVATE_LINK(SelectIPPartNumbersHdl, weld::TreeView&, bool); |
74 | | DECL_DLLPRIVATE_LINK(SelectRecentlyUsedHdl, weld::ComboBox&, void); |
75 | | DECL_DLLPRIVATE_LINK(SelectIPPartHdl, weld::TreeView&, bool); |
76 | | DECL_DLLPRIVATE_LINK(EditWindowModifiedHdl, LinkParamNone*, void); |
77 | | DECL_DLLPRIVATE_STATIC_LINK(ClassificationDialog, ExpandedHdl, weld::Expander&, void); |
78 | | DECL_DLLPRIVATE_STATIC_LINK(ClassificationDialog, KeyInput, const KeyEvent&, bool); |
79 | | DECL_DLLPRIVATE_LINK(OnAsyncExpandHdl, void*, void); |
80 | | |
81 | | void insertField(ClassificationType eType, OUString const& rString, OUString const& rFullString, |
82 | | OUString const& rIdentifier = OUString()); |
83 | | void insertCategoryField(sal_Int32 nID); |
84 | | |
85 | | void readIn(std::vector<ClassificationResult> const& rInput); |
86 | | void readRecentlyUsed(); |
87 | | void writeRecentlyUsed(); |
88 | | void toggleWidgetsDependingOnCategory(); |
89 | | |
90 | | public: |
91 | | ClassificationDialog(weld::Window* pParent, |
92 | | const css::uno::Reference<css::document::XDocumentProperties>& rDocProps, |
93 | 0 | bool bPerParagraph, std::function<void()> aParagraphSignHandler = []() {}); |
94 | | ~ClassificationDialog() override; |
95 | | |
96 | | std::vector<ClassificationResult> getResult(); |
97 | | void setupValues(std::vector<ClassificationResult>&& rInput); |
98 | | }; |
99 | | |
100 | | } // end svx namespace |
101 | | |
102 | | #endif // INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX |
103 | | |
104 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |