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
|
|
|
|
|
|
|
//
|
|
|
|
// nsScrollbarFrame
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef nsScrollbarFrame_h__
|
|
|
|
#define nsScrollbarFrame_h__
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsBoxFrame.h"
|
|
|
|
|
|
|
|
class nsIScrollbarMediator;
|
|
|
|
|
|
|
|
nsIFrame* NS_NewScrollbarFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
2011-07-11 07:05:09 -07:00
|
|
|
class nsScrollbarFrame : public nsBoxFrame
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsScrollbarFrame(nsIPresShell* aShell, nsStyleContext* aContext):
|
2012-07-30 07:20:58 -07:00
|
|
|
nsBoxFrame(aShell, aContext), mScrollbarMediator(nullptr) {}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-07-11 07:05:09 -07:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsScrollbarFrame)
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef DEBUG
|
2013-05-14 09:33:23 -07:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
|
2007-03-22 10:30:00 -07:00
|
|
|
return MakeFrameName(NS_LITERAL_STRING("ScrollbarFrame"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// nsIFrame overrides
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD AttributeChanged(int32_t aNameSpaceID,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIAtom* aAttribute,
|
2012-09-14 09:10:08 -07:00
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-01-12 11:20:59 -08:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-01-12 11:20:59 -08:00
|
|
|
NS_IMETHOD HandlePress(nsPresContext* aPresContext,
|
2013-10-01 20:46:03 -07:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
|
2013-10-01 20:46:03 -07:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus,
|
2012-09-14 09:10:08 -07:00
|
|
|
bool aControlHeld) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-08-02 20:39:02 -07:00
|
|
|
NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
|
2013-10-01 20:46:03 -07:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
2011-08-02 20:39:02 -07:00
|
|
|
|
|
|
|
NS_IMETHOD HandleRelease(nsPresContext* aPresContext,
|
2013-10-01 20:46:03 -07:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
2011-08-02 20:39:02 -07:00
|
|
|
|
2013-03-19 18:47:48 -07:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2007-04-10 17:25:11 -07:00
|
|
|
|
2011-07-11 07:05:09 -07:00
|
|
|
void SetScrollbarMediatorContent(nsIContent* aMediator);
|
|
|
|
nsIScrollbarMediator* GetScrollbarMediator();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// nsBox methods
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Treat scrollbars as clipping their children; overflowing children
|
2009-04-05 17:31:50 -07:00
|
|
|
* will not be allowed to set an overflow rect on this
|
2007-03-22 10:30:00 -07:00
|
|
|
* frame. This means that when the scroll code decides to hide a
|
|
|
|
* scrollframe by setting its height or width to zero, that will
|
|
|
|
* hide the children too.
|
|
|
|
*/
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual bool DoesClipChildren() MOZ_OVERRIDE { return true; }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-06-26 21:00:41 -07:00
|
|
|
NS_IMETHOD GetMargin(nsMargin& aMargin) MOZ_OVERRIDE;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
|
|
|
nsCOMPtr<nsIContent> mScrollbarMediator;
|
|
|
|
}; // class nsScrollbarFrame
|
|
|
|
|
|
|
|
#endif
|