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