2001-09-28 20:14:13 +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/. */
|
1999-04-20 21:39:52 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// nsScrollbarFrame
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef nsScrollbarFrame_h__
|
|
|
|
#define nsScrollbarFrame_h__
|
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
1999-06-15 04:02:43 +00:00
|
|
|
#include "nsBoxFrame.h"
|
1999-06-30 22:17:43 +00:00
|
|
|
|
2000-06-06 23:13:05 +00:00
|
|
|
class nsIScrollbarMediator;
|
1999-04-20 21:39:52 +00:00
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
nsIFrame* NS_NewScrollbarFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-04-20 21:39:52 +00:00
|
|
|
|
2011-07-11 14:05:09 +00:00
|
|
|
class nsScrollbarFrame : public nsBoxFrame
|
1999-04-20 21:39:52 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-03-26 21:30:36 +00:00
|
|
|
nsScrollbarFrame(nsIPresShell* aShell, nsStyleContext* aContext):
|
2012-07-30 14:20:58 +00:00
|
|
|
nsBoxFrame(aShell, aContext), mScrollbarMediator(nullptr) {}
|
1999-04-20 21:39:52 +00:00
|
|
|
|
2011-07-11 14:05:09 +00:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsScrollbarFrame)
|
|
|
|
|
2014-01-05 23:31:14 +00:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2013-05-14 16:33:23 +00:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
|
2001-11-14 01:33:42 +00:00
|
|
|
return MakeFrameName(NS_LITERAL_STRING("ScrollbarFrame"), aResult);
|
1999-04-20 21:39:52 +00:00
|
|
|
}
|
1999-11-01 22:12:45 +00:00
|
|
|
#endif
|
1999-06-15 04:02:43 +00:00
|
|
|
|
1999-11-01 22:12:45 +00:00
|
|
|
// nsIFrame overrides
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD AttributeChanged(int32_t aNameSpaceID,
|
1999-06-15 04:02:43 +00:00
|
|
|
nsIAtom* aAttribute,
|
2012-09-14 16:10:08 +00:00
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
1999-06-15 04:02:43 +00:00
|
|
|
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
1999-04-20 21:39:52 +00:00
|
|
|
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_IMETHOD HandlePress(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
1999-08-19 22:16:23 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus,
|
2012-09-14 16:10:08 +00:00
|
|
|
bool aControlHeld) MOZ_OVERRIDE;
|
1999-08-19 22:16:23 +00:00
|
|
|
|
2011-08-03 03:39:02 +00:00
|
|
|
NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
2011-08-03 03:39:02 +00:00
|
|
|
|
|
|
|
NS_IMETHOD HandleRelease(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
2011-08-03 03:39:02 +00:00
|
|
|
|
2013-03-20 01:47:48 +00:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
1999-08-19 22:16:23 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
2004-01-09 19:21:20 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2004-01-09 19:21:20 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2007-04-11 00:25:11 +00:00
|
|
|
|
2011-07-11 14:05:09 +00:00
|
|
|
void SetScrollbarMediatorContent(nsIContent* aMediator);
|
|
|
|
nsIScrollbarMediator* GetScrollbarMediator();
|
2000-06-06 23:13:05 +00:00
|
|
|
|
2004-07-16 16:56:21 +00:00
|
|
|
// nsBox methods
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Treat scrollbars as clipping their children; overflowing children
|
2009-04-06 00:31:50 +00:00
|
|
|
* will not be allowed to set an overflow rect on this
|
2004-07-16 16:56:21 +00: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 16:10:08 +00:00
|
|
|
virtual bool DoesClipChildren() MOZ_OVERRIDE { return true; }
|
2006-12-07 19:53:41 +00:00
|
|
|
|
2013-06-27 04:00:41 +00:00
|
|
|
NS_IMETHOD GetMargin(nsMargin& aMargin) MOZ_OVERRIDE;
|
|
|
|
|
2000-06-06 23:13:05 +00:00
|
|
|
private:
|
2006-12-07 19:53:41 +00:00
|
|
|
nsCOMPtr<nsIContent> mScrollbarMediator;
|
1999-04-20 21:39:52 +00:00
|
|
|
}; // class nsScrollbarFrame
|
|
|
|
|
|
|
|
#endif
|