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