summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-02-25 20:58:42 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-02-28 01:13:30 +0100
commiteb3789bd35e9dc62e92008467bfaa0650cd8d6be (patch)
tree12091af502f5ec252195faff365be6e764ef95e6 /include
parent3b5764227b78a81cf043d7fa4b1c3a7ae95799ab (diff)
devtools: object inspector toolbar and object stack
This change adds a toolbar to the object inspector with buttons for inspect (which just links to the same action added to the context menu) and back. Back uses the newly added object stack to return to the previously inspected object. Only the objects which we used the "inspect" command in the object inspector tree are added to the object stack. Change-Id: Icb5b6e841200d6e0e41e260092a195fc84729d0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111532 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/devtools/DevelopmentToolDockingWindow.hxx1
-rw-r--r--include/sfx2/devtools/ObjectInspectorTreeHandler.hxx21
2 files changed, 20 insertions, 2 deletions
diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index f3633189c9b6..97b0c8e06e68 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -36,6 +36,7 @@ private:
std::unique_ptr<weld::TreeView> mpMethodsTreeView;
std::unique_ptr<weld::TreeView> mpDocumentModelTreeView;
std::unique_ptr<weld::ToggleButton> mpSelectionToggle;
+ std::unique_ptr<weld::Toolbar> mpObjectInspectorToolbar;
css::uno::Reference<css::uno::XInterface> mxRoot;
css::uno::Reference<css::uno::XInterface> mxCurrentSelection;
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 7008a398df5a..c61da73aa6e4 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -18,6 +18,9 @@
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx>
+#include <memory>
+#include <deque>
+
class ObjectInspectorTreeHandler
{
private:
@@ -25,8 +28,10 @@ private:
std::unique_ptr<weld::TreeView>& mpServicesTreeView;
std::unique_ptr<weld::TreeView>& mpPropertiesTreeView;
std::unique_ptr<weld::TreeView>& mpMethodsTreeView;
-
std::unique_ptr<weld::Label>& mpClassNameLabel;
+ std::unique_ptr<weld::Toolbar>& mpObjectInspectorToolbar;
+
+ std::deque<css::uno::Any> maInspectionStack;
static void clearObjectInspectorChildren(std::unique_ptr<weld::TreeView>& pTreeView,
weld::TreeIter const& rParent);
@@ -39,18 +44,30 @@ private:
void appendProperties(css::uno::Reference<css::uno::XInterface> const& xInterface);
void appendMethods(css::uno::Reference<css::uno::XInterface> const& xInterface);
+ void inspectObject(css::uno::Reference<css::uno::XInterface> const& xInterface);
+
+ void clearStack();
+ void addToStack(css::uno::Any const& rAny);
+ css::uno::Any popFromStack();
+
+ void updateBackButtonState();
+
public:
ObjectInspectorTreeHandler(std::unique_ptr<weld::TreeView>& pInterfacesTreeView,
std::unique_ptr<weld::TreeView>& pServicesTreeView,
std::unique_ptr<weld::TreeView>& pPropertiesTreeView,
std::unique_ptr<weld::TreeView>& pMethodsTreeView,
- std::unique_ptr<weld::Label>& pClassNameLabel);
+ std::unique_ptr<weld::Label>& pClassNameLabel,
+ std::unique_ptr<weld::Toolbar>& pObjectInspectorToolbar);
DECL_LINK(ExpandingHandlerInterfaces, const weld::TreeIter&, bool);
DECL_LINK(ExpandingHandlerServices, const weld::TreeIter&, bool);
DECL_LINK(ExpandingHandlerProperties, const weld::TreeIter&, bool);
DECL_LINK(ExpandingHandlerMethods, const weld::TreeIter&, bool);
+ DECL_LINK(SelectionChanged, weld::TreeView&, void);
+
DECL_LINK(PopupMenuHandler, const CommandEvent&, bool);
+ DECL_LINK(ToolbarButtonClicked, const OString&, void);
void introspect(css::uno::Reference<css::uno::XInterface> const& xInterface);