Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/sfx2/sidebar/PanelLayout.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 */
9
10
#pragma once
11
12
#include <sfx2/dllapi.h>
13
#include <vcl/weld/weld.hxx>
14
15
class DataChangedEvent;
16
class VclSimpleEvent;
17
namespace sfx2 { namespace sidebar { class Panel; } }
18
namespace tools { class JsonWriter; }
19
namespace weld { class Builder; }
20
21
/// This class is the base for the Widget Layout-based sidebar panels.
22
class SFX2_DLLPUBLIC PanelLayout
23
{
24
protected:
25
    std::unique_ptr<weld::Builder> m_xBuilder;
26
    std::unique_ptr<weld::Container> m_xContainer;
27
    sfx2::sidebar::Panel* m_pPanel;
28
29
    virtual void DataChanged(const DataChangedEvent& rEvent);
30
    virtual void DumpAsPropertyTree(tools::JsonWriter&);
31
32
    virtual weld::Window* GetFrameWeld() const;
33
34
private:
35
    DECL_DLLPRIVATE_LINK(DataChangedEventListener, VclSimpleEvent&, void);
36
    DECL_DLLPRIVATE_LINK(DumpAsPropertyTreeHdl, tools::JsonWriter&, void);
37
38
public:
39
    PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription);
40
41
    PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription,
42
                sal_uInt64 nWindowId);
43
44
    void SetPanel(sfx2::sidebar::Panel* pPanel);
45
46
    virtual ~PanelLayout();
47
48
    Size get_preferred_size() const
49
0
    {
50
0
        return m_xContainer->get_preferred_size();
51
0
    }
52
53
    void queue_resize();
54
};
55
56
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */