1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsNativeThemeWin_h
8 #define nsNativeThemeWin_h
13 #include "nsNativeTheme.h"
16 #include "mozilla/TimeStamp.h"
21 class nsNativeThemeWin
: private nsNativeTheme
,
23 virtual ~nsNativeThemeWin();
26 typedef mozilla::TimeStamp TimeStamp
;
27 typedef mozilla::TimeDuration TimeDuration
;
29 NS_DECL_ISUPPORTS_INHERITED
31 // The nsITheme interface.
32 NS_IMETHOD
DrawWidgetBackground(nsRenderingContext
* aContext
,
36 const nsRect
& aDirtyRect
);
38 NS_IMETHOD
GetWidgetBorder(nsDeviceContext
* aContext
,
41 nsIntMargin
* aResult
);
43 virtual bool GetWidgetPadding(nsDeviceContext
* aContext
,
46 nsIntMargin
* aResult
);
48 virtual bool GetWidgetOverflow(nsDeviceContext
* aContext
,
51 nsRect
* aOverflowRect
);
53 NS_IMETHOD
GetMinimumWidgetSize(nsPresContext
* aPresContext
, nsIFrame
* aFrame
,
56 bool* aIsOverridable
);
58 virtual Transparency
GetWidgetTransparency(nsIFrame
* aFrame
, uint8_t aWidgetType
);
60 NS_IMETHOD
WidgetStateChanged(nsIFrame
* aFrame
, uint8_t aWidgetType
,
61 nsIAtom
* aAttribute
, bool* aShouldRepaint
);
63 NS_IMETHOD
ThemeChanged();
65 bool ThemeSupportsWidget(nsPresContext
* aPresContext
,
69 bool WidgetIsContainer(uint8_t aWidgetType
);
71 bool ThemeDrawsFocusForWidget(uint8_t aWidgetType
) MOZ_OVERRIDE
;
73 bool ThemeNeedsComboboxDropmarker();
75 virtual bool WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType
) MOZ_OVERRIDE
;
77 virtual bool ShouldHideScrollbars() MOZ_OVERRIDE
;
82 HANDLE
GetTheme(uint8_t aWidgetType
);
83 nsresult
GetThemePartAndState(nsIFrame
* aFrame
, uint8_t aWidgetType
,
84 int32_t& aPart
, int32_t& aState
);
85 nsresult
ClassicGetThemePartAndState(nsIFrame
* aFrame
, uint8_t aWidgetType
,
86 int32_t& aPart
, int32_t& aState
, bool& aFocused
);
87 nsresult
ClassicDrawWidgetBackground(nsRenderingContext
* aContext
,
91 const nsRect
& aClipRect
);
92 nsresult
ClassicGetWidgetBorder(nsDeviceContext
* aContext
,
95 nsIntMargin
* aResult
);
96 bool ClassicGetWidgetPadding(nsDeviceContext
* aContext
,
99 nsIntMargin
* aResult
);
100 nsresult
ClassicGetMinimumWidgetSize(nsPresContext
* aPresContext
, nsIFrame
* aFrame
,
103 bool* aIsOverridable
);
104 bool ClassicThemeSupportsWidget(nsPresContext
* aPresContext
,
106 uint8_t aWidgetType
);
107 void DrawCheckedRect(HDC hdc
, const RECT
& rc
, int32_t fore
, int32_t back
,
109 uint32_t GetWidgetNativeDrawingFlags(uint8_t aWidgetType
);
110 int32_t StandardGetState(nsIFrame
* aFrame
, uint8_t aWidgetType
, bool wantFocused
);
111 bool IsMenuActive(nsIFrame
* aFrame
, uint8_t aWidgetType
);
112 RECT
CalculateProgressOverlayRect(nsIFrame
* aFrame
, RECT
* aWidgetRect
,
113 bool aIsVertical
, bool aIsIndeterminate
,
115 void DrawThemedProgressMeter(nsIFrame
* aFrame
, int aWidgetType
,
116 HANDLE aTheme
, HDC aHdc
,
117 int aPart
, int aState
,
118 RECT
* aWidgetRect
, RECT
* aClipRect
,
122 TimeStamp mProgressDeterminateTimeStamp
;
123 TimeStamp mProgressIndeterminateTimeStamp
;