1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/xul/nsScrollbarFrame.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,90 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +// 1.10 +// nsScrollbarFrame 1.11 +// 1.12 + 1.13 +#ifndef nsScrollbarFrame_h__ 1.14 +#define nsScrollbarFrame_h__ 1.15 + 1.16 +#include "mozilla/Attributes.h" 1.17 +#include "nsBoxFrame.h" 1.18 + 1.19 +class nsIScrollbarMediator; 1.20 + 1.21 +nsIFrame* NS_NewScrollbarFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.22 + 1.23 +class nsScrollbarFrame : public nsBoxFrame 1.24 +{ 1.25 +public: 1.26 + nsScrollbarFrame(nsIPresShell* aShell, nsStyleContext* aContext): 1.27 + nsBoxFrame(aShell, aContext), mScrollbarMediator(nullptr) {} 1.28 + 1.29 + NS_DECL_QUERYFRAME_TARGET(nsScrollbarFrame) 1.30 + 1.31 +#ifdef DEBUG_FRAME_DUMP 1.32 + virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE { 1.33 + return MakeFrameName(NS_LITERAL_STRING("ScrollbarFrame"), aResult); 1.34 + } 1.35 +#endif 1.36 + 1.37 + // nsIFrame overrides 1.38 + virtual nsresult AttributeChanged(int32_t aNameSpaceID, 1.39 + nsIAtom* aAttribute, 1.40 + int32_t aModType) MOZ_OVERRIDE; 1.41 + 1.42 + NS_DECL_QUERYFRAME 1.43 + NS_DECL_FRAMEARENA_HELPERS 1.44 + 1.45 + NS_IMETHOD HandlePress(nsPresContext* aPresContext, 1.46 + mozilla::WidgetGUIEvent* aEvent, 1.47 + nsEventStatus* aEventStatus) MOZ_OVERRIDE; 1.48 + 1.49 + NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext, 1.50 + mozilla::WidgetGUIEvent* aEvent, 1.51 + nsEventStatus* aEventStatus, 1.52 + bool aControlHeld) MOZ_OVERRIDE; 1.53 + 1.54 + NS_IMETHOD HandleDrag(nsPresContext* aPresContext, 1.55 + mozilla::WidgetGUIEvent* aEvent, 1.56 + nsEventStatus* aEventStatus) MOZ_OVERRIDE; 1.57 + 1.58 + NS_IMETHOD HandleRelease(nsPresContext* aPresContext, 1.59 + mozilla::WidgetGUIEvent* aEvent, 1.60 + nsEventStatus* aEventStatus) MOZ_OVERRIDE; 1.61 + 1.62 + virtual void Init(nsIContent* aContent, 1.63 + nsIFrame* aParent, 1.64 + nsIFrame* aPrevInFlow) MOZ_OVERRIDE; 1.65 + 1.66 + virtual nsresult Reflow(nsPresContext* aPresContext, 1.67 + nsHTMLReflowMetrics& aDesiredSize, 1.68 + const nsHTMLReflowState& aReflowState, 1.69 + nsReflowStatus& aStatus) MOZ_OVERRIDE; 1.70 + 1.71 + virtual nsIAtom* GetType() const MOZ_OVERRIDE; 1.72 + 1.73 + void SetScrollbarMediatorContent(nsIContent* aMediator); 1.74 + nsIScrollbarMediator* GetScrollbarMediator(); 1.75 + 1.76 + // nsBox methods 1.77 + 1.78 + /** 1.79 + * Treat scrollbars as clipping their children; overflowing children 1.80 + * will not be allowed to set an overflow rect on this 1.81 + * frame. This means that when the scroll code decides to hide a 1.82 + * scrollframe by setting its height or width to zero, that will 1.83 + * hide the children too. 1.84 + */ 1.85 + virtual bool DoesClipChildren() MOZ_OVERRIDE { return true; } 1.86 + 1.87 + virtual nsresult GetMargin(nsMargin& aMargin) MOZ_OVERRIDE; 1.88 + 1.89 +private: 1.90 + nsCOMPtr<nsIContent> mScrollbarMediator; 1.91 +}; // class nsScrollbarFrame 1.92 + 1.93 +#endif