summaryrefslogtreecommitdiffstats
path: root/widget/ScrollbarDrawingAndroid.h
blob: 926aa76a80b3ec85965e4c59b0cb552f7160c64f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_widget_ScrollbarDrawingAndroid_h
#define mozilla_widget_ScrollbarDrawingAndroid_h

#include "nsITheme.h"
#include "ScrollbarDrawing.h"

namespace mozilla::widget {

class ScrollbarDrawingAndroid final : public ScrollbarDrawing {
 public:
  ScrollbarDrawingAndroid() : ScrollbarDrawing(Kind::Android) {}
  virtual ~ScrollbarDrawingAndroid() = default;

  LayoutDeviceIntSize GetMinimumWidgetSize(nsPresContext*,
                                           StyleAppearance aAppearance,
                                           nsIFrame* aFrame) override;

  ScrollbarSizes GetScrollbarSizes(nsPresContext*, StyleScrollbarWidth,
                                   Overlay) override;

  template <typename PaintBackendData>
  void DoPaintScrollbarThumb(PaintBackendData&, const LayoutDeviceRect& aRect,
                             ScrollbarKind, nsIFrame* aFrame,
                             const ComputedStyle& aStyle,
                             const ElementState& aElementState,
                             const DocumentState& aDocumentState, const Colors&,
                             const DPIRatio&);
  bool PaintScrollbarThumb(DrawTarget&, const LayoutDeviceRect& aRect,
                           ScrollbarKind, nsIFrame* aFrame,
                           const ComputedStyle& aStyle,
                           const ElementState& aElementState,
                           const DocumentState& aDocumentState, const Colors&,
                           const DPIRatio&) override;
  bool PaintScrollbarThumb(WebRenderBackendData&, const LayoutDeviceRect& aRect,
                           ScrollbarKind, nsIFrame* aFrame,
                           const ComputedStyle& aStyle,
                           const ElementState& aElementState,
                           const DocumentState& aDocumentState, const Colors&,
                           const DPIRatio&) override;

  void RecomputeScrollbarParams() override;

  bool ShouldDrawScrollbarButtons() override { return false; }
};

}  // namespace mozilla::widget

#endif