diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-02-08 22:41:36 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-02-11 12:54:47 +0100 |
commit | e44639f50056b843913573b4635517019e00431c (patch) | |
tree | fc1b161e07919e20693526676f24ece05eff887d /include/sfx2/devtools/ObjectInspectorTreeHandler.hxx | |
parent | a1ca311061b617b2e4731f6e4c8a5466e8a080f5 (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/ObjectInspectorTreeHandler.hxx')
-rw-r--r-- | include/sfx2/devtools/ObjectInspectorTreeHandler.hxx | 44 |
1 files changed, 44 insertions, 0 deletions
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: */ |