Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/include/svtools/scrolladaptor.hxx
Line
Count
Source (jump to first uncovered line)
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
20
#pragma once
21
22
#include <svtools/svtdllapi.h>
23
24
#include <vcl/InterimItemWindow.hxx>
25
#include <vcl/scrollable.hxx>
26
27
class SVT_DLLPUBLIC ScrollAdaptor : public InterimItemWindow, public Scrollable
28
{
29
protected:
30
    std::unique_ptr<weld::Scrollbar> m_xScrollBar;
31
    Link<weld::Scrollbar&, void> m_aLink;
32
    bool m_bHori;
33
34
public:
35
    virtual void SetRange(const Range& rRange) override;
36
    virtual Range GetRange() const override;
37
38
    virtual void SetRangeMin(tools::Long nNewRange) override;
39
    virtual tools::Long GetRangeMin() const override;
40
41
    virtual void SetRangeMax(tools::Long nNewRange) override;
42
    virtual tools::Long GetRangeMax() const override;
43
44
    virtual void SetLineSize(tools::Long nNewSize) override;
45
    virtual tools::Long GetLineSize() const override;
46
47
    virtual void SetPageSize(tools::Long nNewSize) override;
48
    virtual tools::Long GetPageSize() const override;
49
50
    virtual void SetVisibleSize(tools::Long nNewSize) override;
51
    virtual tools::Long GetVisibleSize() const override;
52
53
    virtual void SetThumbPos(tools::Long nThumbPos) override;
54
    virtual tools::Long GetThumbPos() const override;
55
56
    void SetScrollHdl(const Link<weld::Scrollbar&, void>& rLink);
57
    void SetMouseReleaseHdl(const Link<const MouseEvent&, bool>& rLink);
58
59
    // what is it
60
0
    bool IsHoriScroll() const { return m_bHori; }
61
62
    ScrollType GetScrollType() const;
63
64
    virtual void EnableRTL(bool bEnable = true) override;
65
66
    virtual tools::Long DoScroll(tools::Long nNewPos) override;
67
68
0
    virtual bool Inactive() const override { return !m_xScrollBar->get_sensitive(); }
69
70
0
    bool HasGrab() const { return m_xScrollBar->has_mouse_grab(); }
71
72
    void SetThickness(int nThickness);
73
74
    void SetSwapArrows(bool bSwap = true);
75
76
    ScrollAdaptor(vcl::Window* pParent, bool bHori);
77
    virtual void dispose() override;
78
};
79
80
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */