Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/notebookbar/notebookbar.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 <vcl/syswin.hxx>
13
#include <vcl/ctrl.hxx>
14
#include <vcl/settings.hxx>
15
#include <vector>
16
17
class NotebookBarContextChangeEventListener;
18
class NotebookbarContextControl;
19
class SfxViewShell;
20
struct NotebookBarAddonsItem;
21
22
/// This implements Widget Layout-based notebook-like menu bar.
23
class UNLESS_MERGELIBS(VCL_DLLPUBLIC) NotebookBar final : public Control, public VclBuilderContainer
24
{
25
friend class NotebookBarContextChangeEventListener;
26
public:
27
    NotebookBar(Window* pParent, const OUString& rID, const OUString& rUIXMLDescription,
28
                const css::uno::Reference<css::frame::XFrame>& rFrame,
29
                std::unique_ptr<NotebookBarAddonsItem> pNotebookBarAddonsItem);
30
    virtual ~NotebookBar() override;
31
    virtual void dispose() override;
32
33
    virtual bool PreNotify( NotifyEvent& rNEvt ) override;
34
    virtual Size GetOptimalSize() const override;
35
    virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) override;
36
    virtual void Resize() override;
37
38
    void SetSystemWindow(SystemWindow* pSystemWindow);
39
40
    void StateChanged(const StateChangedType nStateChange ) override;
41
42
    void DataChanged(const DataChangedEvent& rDCEvt) override;
43
44
    void SetupListener(bool bListen);
45
46
0
    bool IsWelded() const { return m_bIsWelded; }
47
0
    VclPtr<vcl::Window>& GetMainContainer() { return m_xVclContentArea; }
48
0
    const OUString & GetUIFilePath() const { return m_sUIXMLDescription; }
49
    void SetDisposeCallback(const Link<const SfxViewShell*, void> rDisposeCallback, const SfxViewShell* pViewShell);
50
51
private:
52
    VclPtr<SystemWindow> m_pSystemWindow;
53
    rtl::Reference<NotebookBarContextChangeEventListener> m_pEventListener;
54
    std::vector<NotebookbarContextControl*> m_pContextContainers;
55
    const SfxViewShell* m_pViewShell;
56
57
    VclPtr<vcl::Window> m_xVclContentArea;
58
    bool m_bIsWelded;
59
    OUString m_sUIXMLDescription;
60
    Link<const SfxViewShell*, void> m_rDisposeLink;
61
62
    AllSettings DefaultSettings;
63
64
    void UpdateBackground();
65
66
    void UpdateDefaultSettings();
67
};
68
69
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */