diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-03 12:02:13 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-04-04 10:31:58 +0200 |
commit | b9c10ee923308f336a694bbc0212396ed5317b6a (patch) | |
tree | 72bf09a9eb69802a8e09227934bdb0b6c3150023 /include/svx/ClassificationDialog.hxx | |
parent | c8c0292c2152df8c353aeff32896f0cfa8a53a64 (diff) |
weld ClassificationDialog
with the extra problem of hosting an EditView/EditEngine within a
weld::DrawingArea
Change-Id: Id48a57ed0dfd2d92217209c43f752edd9cf8e1bd
Reviewed-on: https://gerrit.libreoffice.org/70219
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svx/ClassificationDialog.hxx')
-rw-r--r-- | include/svx/ClassificationDialog.hxx | 79 |
1 files changed, 33 insertions, 46 deletions
diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx index 3efa8fbc7a8b..2aaed9d16fca 100644 --- a/include/svx/ClassificationDialog.hxx +++ b/include/svx/ClassificationDialog.hxx @@ -12,13 +12,8 @@ #define INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX #include <sal/config.h> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/fixed.hxx> -#include <vcl/edit.hxx> -#include <vcl/layout.hxx> +#include <vcl/customweld.hxx> +#include <vcl/weld.hxx> #include <svx/svxdllapi.h> #include <svx/ClassificationEditView.hxx> #include <sfx2/classificationhelper.hxx> @@ -26,33 +21,9 @@ namespace svx { -class IntellectualPropertyPartEdit : public Edit -{ -public: - IntellectualPropertyPartEdit(vcl::Window* pParent); - -protected: - virtual void KeyInput(const KeyEvent &rKEvt) override; -}; - -class SVX_DLLPUBLIC ClassificationDialog : public ModalDialog +class SVX_DLLPUBLIC ClassificationDialog : public weld::GenericDialogController { private: - VclPtr<PushButton> m_pOkButton; - VclPtr<ClassificationEditView> m_pEditWindow; - VclPtr<PushButton> m_pSignButton; - VclPtr<ToolBox> m_pToolBox; - VclPtr<ListBox> m_pClassificationListBox; - VclPtr<ListBox> m_pRecentlyUsedListBox; - VclPtr<ListBox> m_pInternationalClassificationListBox; - VclPtr<FixedText> m_pMarkingLabel; - VclPtr<ListBox> m_pMarkingListBox; - VclPtr<ListBox> m_pIntellectualPropertyPartListBox; - VclPtr<ListBox> m_pIntellectualPropertyPartNumberListBox; - VclPtr<PushButton> m_pIntellectualPropertyPartAddButton; - VclPtr<IntellectualPropertyPartEdit> m_pIntellectualPropertyPartEdit; - VclPtr<VclExpander> m_pIntellectualPropertyExpander; - SfxClassificationHelper maHelper; SfxClassificationHelper maInternationalHelper; @@ -61,33 +32,49 @@ private: sal_Int32 m_nCurrentSelectedCategory; - DECL_LINK(ButtonClicked, Button*, void); - DECL_LINK(SelectToolboxHdl, ToolBox*, void); - DECL_LINK(SelectClassificationHdl, ListBox&, void); - DECL_LINK(SelectMarkingHdl, ListBox&, void); - DECL_LINK(SelectIPPartNumbersHdl, ListBox&, void); - DECL_LINK(SelectRecentlyUsedHdl, ListBox&, void); - DECL_LINK(SelectIPPartHdl, ListBox&, void); + std::vector<std::vector<ClassificationResult>> m_aRecentlyUsedValuesCollection; + std::vector<ClassificationResult> m_aInitialValues; + + std::unique_ptr<weld::Button> m_xOkButton; + std::unique_ptr<weld::Button> m_xSignButton; + std::unique_ptr<weld::ToggleButton> m_xToolBox; + std::unique_ptr<weld::ComboBox> m_xRecentlyUsedListBox; + std::unique_ptr<weld::ComboBox> m_xClassificationListBox; + std::unique_ptr<weld::ComboBox> m_xInternationalClassificationListBox; + std::unique_ptr<weld::Label> m_xMarkingLabel; + std::unique_ptr<weld::TreeView> m_xMarkingListBox; + std::unique_ptr<weld::TreeView> m_xIntellectualPropertyPartListBox; + std::unique_ptr<weld::TreeView> m_xIntellectualPropertyPartNumberListBox; + std::unique_ptr<weld::Button> m_xIntellectualPropertyPartAddButton; + std::unique_ptr<weld::Entry> m_xIntellectualPropertyPartEdit; + std::unique_ptr<weld::Expander> m_xIntellectualPropertyExpander; + std::unique_ptr<ClassificationEditView> m_xEditWindow; + std::unique_ptr<weld::CustomWeld> m_xEditWindowWeld; + + DECL_LINK(ButtonClicked, weld::Button&, void); + DECL_LINK(SelectToolboxHdl, weld::ToggleButton&, void); + DECL_LINK(SelectClassificationHdl, weld::ComboBox&, void); + DECL_LINK(SelectMarkingHdl, weld::TreeView&, void); + DECL_LINK(SelectIPPartNumbersHdl, weld::TreeView&, void); + DECL_LINK(SelectRecentlyUsedHdl, weld::ComboBox&, void); + DECL_LINK(SelectIPPartHdl, weld::TreeView&, void); DECL_LINK(EditWindowModifiedHdl, LinkParamNone*, void); - DECL_STATIC_LINK(ClassificationDialog, ExpandedHdl, VclExpander&, void); + DECL_STATIC_LINK(ClassificationDialog, ExpandedHdl, weld::Expander&, void); + DECL_STATIC_LINK(ClassificationDialog, KeyInput, const KeyEvent&, bool); void insertField(ClassificationType eType, OUString const & rString, OUString const & rFullString, OUString const & rIdentifier = OUString()); void insertCategoryField(sal_Int32 nID); - std::vector<std::vector<ClassificationResult>> m_aRecentlyUsedValuesCollection; - std::vector<ClassificationResult> m_aInitialValues; - void readIn(std::vector<ClassificationResult> const & rInput); void readRecentlyUsed(); void writeRecentlyUsed(); void toggleWidgetsDependingOnCategory(); public: - ClassificationDialog(vcl::Window* pParent, bool bPerParagraph, const std::function<void()>& rParagraphSignHandler = [](){}); + ClassificationDialog(weld::Window* pParent, bool bPerParagraph, const std::function<void()>& rParagraphSignHandler = [](){}); ~ClassificationDialog() override; - void dispose() override; - short Execute() override; + short run() override; std::vector<ClassificationResult> getResult(); void setupValues(std::vector<ClassificationResult> const & rInput); |