2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 04:12:37 -07:00
|
|
|
* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-12-15 16:00:54 -08:00
|
|
|
#ifndef nsNativeThemeWin_h
|
|
|
|
#define nsNativeThemeWin_h
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsITheme.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIAtom.h"
|
|
|
|
#include "nsNativeTheme.h"
|
2013-02-24 16:27:22 -08:00
|
|
|
#include "gfxTypes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include <windows.h>
|
2013-02-24 16:27:10 -08:00
|
|
|
#include "mozilla/TimeStamp.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-01-14 19:27:09 -08:00
|
|
|
struct nsIntRect;
|
|
|
|
struct nsIntSize;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsNativeThemeWin : private nsNativeTheme,
|
|
|
|
public nsITheme {
|
2014-07-15 13:37:58 -07:00
|
|
|
virtual ~nsNativeThemeWin();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
public:
|
2013-02-24 16:27:10 -08:00
|
|
|
typedef mozilla::TimeStamp TimeStamp;
|
|
|
|
typedef mozilla::TimeDuration TimeDuration;
|
|
|
|
|
2010-11-13 00:19:38 -08:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// The nsITheme interface.
|
2011-04-07 18:04:40 -07:00
|
|
|
NS_IMETHOD DrawWidgetBackground(nsRenderingContext* aContext,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aWidgetType,
|
2007-03-22 10:30:00 -07:00
|
|
|
const nsRect& aRect,
|
2014-03-17 01:42:48 -07:00
|
|
|
const nsRect& aDirtyRect);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-04-16 18:22:44 -07:00
|
|
|
NS_IMETHOD GetWidgetBorder(nsDeviceContext* aContext,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aWidgetType,
|
2009-01-14 19:27:09 -08:00
|
|
|
nsIntMargin* aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool GetWidgetPadding(nsDeviceContext* aContext,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aWidgetType,
|
2009-01-14 19:27:09 -08:00
|
|
|
nsIntMargin* aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool GetWidgetOverflow(nsDeviceContext* aContext,
|
2008-02-28 21:10:12 -08:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aWidgetType,
|
2008-04-01 16:34:20 -07:00
|
|
|
nsRect* aOverflowRect);
|
2008-02-28 21:10:12 -08:00
|
|
|
|
2014-06-27 02:19:00 -07:00
|
|
|
NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aWidgetType,
|
2009-01-14 19:27:09 -08:00
|
|
|
nsIntSize* aResult,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool* aIsOverridable);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Transparency GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType);
|
2008-12-11 06:37:38 -08:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
|
2011-09-28 23:19:26 -07:00
|
|
|
nsIAtom* aAttribute, bool* aShouldRepaint);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD ThemeChanged();
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool ThemeSupportsWidget(nsPresContext* aPresContext,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aWidgetType);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
bool WidgetIsContainer(uint8_t aWidgetType);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-05-13 16:47:03 -07:00
|
|
|
bool ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool ThemeNeedsComboboxDropmarker();
|
2007-05-17 20:04:04 -07:00
|
|
|
|
2013-09-27 08:24:32 -07:00
|
|
|
virtual bool WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType) MOZ_OVERRIDE;
|
|
|
|
|
2013-12-03 10:21:09 -08:00
|
|
|
virtual bool ShouldHideScrollbars() MOZ_OVERRIDE;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsNativeThemeWin();
|
|
|
|
|
|
|
|
protected:
|
2012-08-22 08:56:38 -07:00
|
|
|
HANDLE GetTheme(uint8_t aWidgetType);
|
|
|
|
nsresult GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
|
|
|
|
int32_t& aPart, int32_t& aState);
|
|
|
|
nsresult ClassicGetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
|
2013-02-24 16:27:10 -08:00
|
|
|
int32_t& aPart, int32_t& aState, bool& aFocused);
|
2011-04-07 18:04:40 -07:00
|
|
|
nsresult ClassicDrawWidgetBackground(nsRenderingContext* aContext,
|
2013-02-24 16:27:10 -08:00
|
|
|
nsIFrame* aFrame,
|
|
|
|
uint8_t aWidgetType,
|
|
|
|
const nsRect& aRect,
|
|
|
|
const nsRect& aClipRect);
|
|
|
|
nsresult ClassicGetWidgetBorder(nsDeviceContext* aContext,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t aWidgetType,
|
2013-02-24 16:27:10 -08:00
|
|
|
nsIntMargin* aResult);
|
2011-09-28 23:19:26 -07:00
|
|
|
bool ClassicGetWidgetPadding(nsDeviceContext* aContext,
|
2013-02-24 16:27:10 -08:00
|
|
|
nsIFrame* aFrame,
|
|
|
|
uint8_t aWidgetType,
|
|
|
|
nsIntMargin* aResult);
|
2014-06-27 02:19:00 -07:00
|
|
|
nsresult ClassicGetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
|
2013-02-24 16:27:10 -08:00
|
|
|
uint8_t aWidgetType,
|
|
|
|
nsIntSize* aResult,
|
|
|
|
bool* aIsOverridable);
|
2011-09-28 23:19:26 -07:00
|
|
|
bool ClassicThemeSupportsWidget(nsPresContext* aPresContext,
|
2013-02-24 16:27:10 -08:00
|
|
|
nsIFrame* aFrame,
|
|
|
|
uint8_t aWidgetType);
|
2012-08-22 08:56:38 -07:00
|
|
|
void DrawCheckedRect(HDC hdc, const RECT& rc, int32_t fore, int32_t back,
|
2007-03-22 10:30:00 -07:00
|
|
|
HBRUSH defaultBack);
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t GetWidgetNativeDrawingFlags(uint8_t aWidgetType);
|
|
|
|
int32_t StandardGetState(nsIFrame* aFrame, uint8_t aWidgetType, bool wantFocused);
|
|
|
|
bool IsMenuActive(nsIFrame* aFrame, uint8_t aWidgetType);
|
2013-02-24 16:27:10 -08:00
|
|
|
RECT CalculateProgressOverlayRect(nsIFrame* aFrame, RECT* aWidgetRect,
|
|
|
|
bool aIsVertical, bool aIsIndeterminate,
|
|
|
|
bool aIsClassic);
|
2013-02-24 16:27:22 -08:00
|
|
|
void DrawThemedProgressMeter(nsIFrame* aFrame, int aWidgetType,
|
|
|
|
HANDLE aTheme, HDC aHdc,
|
|
|
|
int aPart, int aState,
|
|
|
|
RECT* aWidgetRect, RECT* aClipRect,
|
|
|
|
gfxFloat aAppUnits);
|
2013-02-24 16:27:10 -08:00
|
|
|
|
|
|
|
private:
|
|
|
|
TimeStamp mProgressDeterminateTimeStamp;
|
|
|
|
TimeStamp mProgressIndeterminateTimeStamp;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
2013-12-15 16:00:54 -08:00
|
|
|
|
|
|
|
#endif
|