Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sfx2/inc/sidebar/TitleBar.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
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
#pragma once
20
21
#include <sfx2/sidebar/Theme.hxx>
22
#include <vcl/weld/Builder.hxx>
23
#include <vcl/weld/Toolbar.hxx>
24
#include <vcl/weld/weld.hxx>
25
26
namespace sfx2::sidebar {
27
28
class TitleBar
29
{
30
public:
31
    TitleBar(weld::Builder& rBuilder, Theme::ThemeItem eThemeItem);
32
    virtual ~TitleBar();
33
34
    virtual void SetTitle (const OUString& rsTitle) = 0;
35
    virtual OUString GetTitle() const = 0;
36
37
    virtual void DataChanged();
38
39
    void Show(bool bShow);
40
    bool GetVisible() const;
41
42
    Size get_preferred_size() const;
43
44
    void SetIcon(const css::uno::Reference<css::graphic::XGraphic>& rIcon);
45
46
    weld::Toolbar& GetToolBox()
47
0
    {
48
0
        return *mxToolBox;
49
0
    }
50
    const weld::Toolbar& GetToolBox() const
51
0
    {
52
0
        return *mxToolBox;
53
0
    }
54
55
protected:
56
    weld::Builder& mrBuilder;
57
    std::unique_ptr<weld::Box> mxTitlebar;
58
    std::unique_ptr<weld::Image> mxAddonImage;
59
    std::unique_ptr<weld::Toolbar> mxToolBox;
60
    Theme::ThemeItem meThemeItem;
61
    OUString msToolBoxRId;
62
63
    virtual void HandleToolBoxItemClick() = 0;
64
65
    DECL_LINK(SelectionHandler, const OUString&, void);
66
    static void ShowHelp(const OUString& rHelpId);
67
68
private:
69
    void SetBackground();
70
};
71
72
} // end of namespace sfx2::sidebar
73
74
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */