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