Files
loongoffice/include/svx/devtools/DocumentModelTreeHandler.hxx
Tomaž Vajngerl 650b1718b2 devtools: change "Current Selection" tree item to a toggle button
It is a bit awkward that the selection is a tree item so this
changes it to be a toogle button, which when enabled, shows the
object in the right-hand side object inspector and disables the
left-hand side DOM object tree view in this case.

Change-Id: I4ebd03a39c72109f0545206354aa7dbe85e9649a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110119
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-05 10:36:39 +01:00

49 lines
1.4 KiB
C++

/* -*- 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 <svx/svxdllapi.h>
#include <vcl/weld.hxx>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <unordered_map>
class DocumentModelTreeHandler
{
private:
std::unique_ptr<weld::TreeView>& mpDocumentModelTree;
css::uno::Reference<css::uno::XInterface> mxDocument;
void clearChildren(weld::TreeIter const& rParent);
public:
DocumentModelTreeHandler(std::unique_ptr<weld::TreeView>& pDocumentModelTree,
css::uno::Reference<css::uno::XInterface> const& xDocument)
: mpDocumentModelTree(pDocumentModelTree)
, mxDocument(xDocument)
{
mpDocumentModelTree->connect_expanding(
LINK(this, DocumentModelTreeHandler, ExpandingHandler));
}
DECL_LINK(ExpandingHandler, const weld::TreeIter&, bool);
void inspectDocument();
static css::uno::Reference<css::uno::XInterface> getObjectByID(OUString const& rID);
void dispose();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */