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/.
11 #ifndef INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX
12 #define INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX
14 #include <sal/config.h>
15 #include <vcl/weld.hxx>
16 #include <svx/svxdllapi.h>
17 #include <sfx2/classificationhelper.hxx>
18 #include <svx/ClassificationField.hxx>
20 namespace svx
{ class ClassificationEditView
; }
21 namespace weld
{ class CustomWeld
; }
25 class SVX_DLLPUBLIC ClassificationDialog
: public weld::GenericDialogController
28 SfxClassificationHelper maHelper
;
29 SfxClassificationHelper maInternationalHelper
;
31 const bool m_bPerParagraph
;
32 const std::function
<void()> m_aParagraphSignHandler
;
34 ImplSVEvent
* m_nAsyncExpandEvent
;
35 sal_Int32 m_nCurrentSelectedCategory
;
37 std::vector
<std::vector
<ClassificationResult
>> m_aRecentlyUsedValuesCollection
;
38 std::vector
<ClassificationResult
> m_aInitialValues
;
40 std::unique_ptr
<weld::Button
> m_xOkButton
;
41 std::unique_ptr
<weld::Button
> m_xSignButton
;
42 std::unique_ptr
<weld::ToggleButton
> m_xToolBox
;
43 std::unique_ptr
<weld::ComboBox
> m_xRecentlyUsedListBox
;
44 std::unique_ptr
<weld::ComboBox
> m_xClassificationListBox
;
45 std::unique_ptr
<weld::ComboBox
> m_xInternationalClassificationListBox
;
46 std::unique_ptr
<weld::Label
> m_xMarkingLabel
;
47 std::unique_ptr
<weld::TreeView
> m_xMarkingListBox
;
48 std::unique_ptr
<weld::TreeView
> m_xIntellectualPropertyPartListBox
;
49 std::unique_ptr
<weld::TreeView
> m_xIntellectualPropertyPartNumberListBox
;
50 std::unique_ptr
<weld::Button
> m_xIntellectualPropertyPartAddButton
;
51 std::unique_ptr
<weld::Entry
> m_xIntellectualPropertyPartEdit
;
52 std::unique_ptr
<weld::Expander
> m_xIntellectualPropertyExpander
;
53 std::unique_ptr
<ClassificationEditView
> m_xEditWindow
;
54 std::unique_ptr
<weld::CustomWeld
> m_xEditWindowWeld
;
56 DECL_LINK(ButtonClicked
, weld::Button
&, void);
57 DECL_LINK(SelectToolboxHdl
, weld::ToggleButton
&, void);
58 DECL_LINK(SelectClassificationHdl
, weld::ComboBox
&, void);
59 DECL_LINK(SelectMarkingHdl
, weld::TreeView
&, void);
60 DECL_LINK(SelectIPPartNumbersHdl
, weld::TreeView
&, void);
61 DECL_LINK(SelectRecentlyUsedHdl
, weld::ComboBox
&, void);
62 DECL_LINK(SelectIPPartHdl
, weld::TreeView
&, void);
63 DECL_LINK(EditWindowModifiedHdl
, LinkParamNone
*, void);
64 DECL_STATIC_LINK(ClassificationDialog
, ExpandedHdl
, weld::Expander
&, void);
65 DECL_STATIC_LINK(ClassificationDialog
, KeyInput
, const KeyEvent
&, bool);
66 DECL_LINK(OnAsyncExpandHdl
, void*, void);
68 void insertField(ClassificationType eType
, OUString
const & rString
, OUString
const & rFullString
, OUString
const & rIdentifier
= OUString());
69 void insertCategoryField(sal_Int32 nID
);
71 void readIn(std::vector
<ClassificationResult
> const & rInput
);
72 void readRecentlyUsed();
73 void writeRecentlyUsed();
74 void toggleWidgetsDependingOnCategory();
77 ClassificationDialog(weld::Window
* pParent
, bool bPerParagraph
, const std::function
<void()>& rParagraphSignHandler
= [](){});
78 ~ClassificationDialog() override
;
82 std::vector
<ClassificationResult
> getResult();
83 void setupValues(std::vector
<ClassificationResult
> const & rInput
);
86 } // end svx namespace
88 #endif // INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */