summaryrefslogtreecommitdiff
path: root/include/sfx2/devtools
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-02-08 22:41:36 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-02-11 12:54:47 +0100
commite44639f50056b843913573b4635517019e00431c (patch)
treefc1b161e07919e20693526676f24ece05eff887d /include/sfx2/devtools
parenta1ca311061b617b2e4731f6e4c8a5466e8a080f5 (diff)
devtools: move handling of object inspector tree to own class/files
To make handling of object inspector tree view easier, move the functionality to its own class and file. Change-Id: I47ae1bc06b582d0d146e7e97bc08a3b5f82ce794 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110734 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/sfx2/devtools')
-rw-r--r--include/sfx2/devtools/DevelopmentToolDockingWindow.hxx6
-rw-r--r--include/sfx2/devtools/ObjectInspectorTreeHandler.hxx44
2 files changed, 46 insertions, 4 deletions
diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index 1ed166239949..4721a424e66d 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -16,6 +16,7 @@
#include <vcl/weld.hxx>
#include <sfx2/devtools/DocumentModelTreeHandler.hxx>
+#include <sfx2/devtools/ObjectInspectorTreeHandler.hxx>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx>
@@ -37,18 +38,15 @@ private:
css::uno::Reference<css::view::XSelectionChangeListener> mxSelectionListener;
DocumentModelTreeHandler maDocumentModelTreeHandler;
+ ObjectInspectorTreeHandler maObjectInspectorTreeHandler;
DECL_LINK(DocumentModelTreeViewSelectionHandler, weld::TreeView&, void);
DECL_LINK(SelectionToggled, weld::ToggleButton&, void);
- DECL_LINK(ObjectInspectorExpandingHandler, const weld::TreeIter&, bool);
-
void inspectDocument();
void updateSelection();
void inspectSelectionOrRoot(css::uno::Reference<css::frame::XController> const& xController);
- void clearObjectInspectorChildren(weld::TreeIter const& rParent);
-
public:
DevelopmentToolDockingWindow(SfxBindings* pBindings, SfxChildWindow* pChildWindow,
vcl::Window* pParent);
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
new file mode 100644
index 000000000000..aa6e353e6549
--- /dev/null
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <sfx2/dllapi.h>
+#include <vcl/weld.hxx>
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+class ObjectInspectorTreeHandler
+{
+private:
+ std::unique_ptr<weld::TreeView>& mpObjectInspectorTree;
+ std::unique_ptr<weld::Label>& mpClassNameLabel;
+
+ void clearObjectInspectorChildren(weld::TreeIter const& rParent);
+
+public:
+ ObjectInspectorTreeHandler(std::unique_ptr<weld::TreeView>& pObjectInspectorTree,
+ std::unique_ptr<weld::Label>& pClassNameLabel)
+ : mpObjectInspectorTree(pObjectInspectorTree)
+ , mpClassNameLabel(pClassNameLabel)
+ {
+ mpObjectInspectorTree->connect_expanding(
+ LINK(this, ObjectInspectorTreeHandler, ExpandingHandler));
+ }
+
+ DECL_LINK(ExpandingHandler, const weld::TreeIter&, bool);
+
+ void introspect(css::uno::Reference<css::uno::XInterface> const& xInterface);
+
+ void dispose();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */