1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef nsNativeThemeAndroid_h_
6 #define nsNativeThemeAndroid_h_
7 
8 #include "nsITheme.h"
9 #include "nsNativeTheme.h"
10 
11 class nsNativeThemeAndroid final : private nsNativeTheme, public nsITheme {
12  public:
13   NS_DECL_ISUPPORTS_INHERITED
14 
15   // The nsITheme interface.
16   NS_IMETHOD DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
17                                   StyleAppearance aAppearance,
18                                   const nsRect& aRect,
19                                   const nsRect& aDirtyRect) override;
20 
21   [[nodiscard]] LayoutDeviceIntMargin GetWidgetBorder(
22       nsDeviceContext* aContext, nsIFrame* aFrame,
23       StyleAppearance aAppearance) override;
24 
25   bool GetWidgetPadding(nsDeviceContext* aContext, nsIFrame* aFrame,
26                         StyleAppearance aAppearance,
27                         LayoutDeviceIntMargin* aResult) override;
28 
29   bool GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFrame,
30                          StyleAppearance aAppearance,
31                          nsRect* aOverflowRect) override;
32 
33   NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
34                                   StyleAppearance aAppearance,
35                                   mozilla::LayoutDeviceIntSize* aResult,
36                                   bool* aIsOverridable) override;
37 
38   NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, StyleAppearance aAppearance,
39                                 nsAtom* aAttribute, bool* aShouldRepaint,
40                                 const nsAttrValue* aOldValue) override;
41 
42   NS_IMETHOD ThemeChanged() override;
43 
44   NS_IMETHOD_(bool)
45   ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame,
46                       StyleAppearance aAppearance) override;
47 
48   NS_IMETHOD_(bool) WidgetIsContainer(StyleAppearance aAppearance) override;
49 
50   NS_IMETHOD_(bool)
51   ThemeDrawsFocusForWidget(StyleAppearance aAppearance) override;
52 
53   bool ThemeNeedsComboboxDropmarker() override;
54 
55   Transparency GetWidgetTransparency(nsIFrame* aFrame,
56                                      StyleAppearance aAppearance) override;
57 
nsNativeThemeAndroid()58   nsNativeThemeAndroid() {}
59 
60  protected:
~nsNativeThemeAndroid()61   virtual ~nsNativeThemeAndroid() {}
62 };
63 
64 #endif  // nsNativeThemeAndroid_h_
65