LibreOffice Module svtools (master) 1
scrolladaptor.hxx
Go to the documentation of this file.
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
25#include <vcl/scrollable.hxx>
26
28{
29protected:
30 std::unique_ptr<weld::Scrollbar> m_xScrollBar;
32 bool m_bHori;
33
34public:
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 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 virtual bool Inactive() const override { return !m_xScrollBar->get_sensitive(); }
69
70 bool HasGrab() const { return m_xScrollBar->has_grab(); }
71
72 void SetThickness(int nThickness);
73
74 ScrollAdaptor(vcl::Window* pParent, bool bHori);
75 virtual void dispose() override;
76};
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void EnableRTL(bool bEnable=true) override
virtual void dispose() override
Link< weld::Scrollbar &, void > m_aLink
bool IsHoriScroll() const
std::unique_ptr< weld::Scrollbar > m_xScrollBar
virtual bool Inactive() const override
bool HasGrab() const
virtual Range GetRange() const=0
virtual void SetRangeMin(tools::Long nNewRange)=0
virtual void SetLineSize(tools::Long nNewSize)=0
virtual void SetRange(const Range &rRange)=0
virtual tools::Long GetPageSize() const=0
virtual tools::Long GetThumbPos() const=0
virtual void SetPageSize(tools::Long nNewSize)=0
virtual void SetVisibleSize(tools::Long nNewSize)=0
virtual tools::Long GetLineSize() const=0
virtual void SetThumbPos(tools::Long nThumbPos)=0
virtual tools::Long GetVisibleSize() const=0
virtual tools::Long GetRangeMin() const=0
virtual tools::Long DoScroll(tools::Long nNewPos)=0
virtual void SetRangeMax(tools::Long nNewRange)=0
virtual tools::Long GetRangeMax() const=0
long Long
#define SVT_DLLPUBLIC
Definition: svtdllapi.h:27
ScrollType