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