michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef nsLeafBoxFrame_h___ michael@0: #define nsLeafBoxFrame_h___ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsLeafFrame.h" michael@0: #include "nsBox.h" michael@0: michael@0: class nsAccessKeyInfo; michael@0: michael@0: class nsLeafBoxFrame : public nsLeafFrame michael@0: { michael@0: public: michael@0: NS_DECL_FRAMEARENA_HELPERS michael@0: michael@0: friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); michael@0: michael@0: virtual nsSize GetPrefSize(nsBoxLayoutState& aState) MOZ_OVERRIDE; michael@0: virtual nsSize GetMinSize(nsBoxLayoutState& aState) MOZ_OVERRIDE; michael@0: virtual nsSize GetMaxSize(nsBoxLayoutState& aState) MOZ_OVERRIDE; michael@0: virtual nscoord GetFlex(nsBoxLayoutState& aState) MOZ_OVERRIDE; michael@0: virtual nscoord GetBoxAscent(nsBoxLayoutState& aState) MOZ_OVERRIDE; michael@0: michael@0: virtual nsIAtom* GetType() const MOZ_OVERRIDE; michael@0: virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE michael@0: { michael@0: // This is bogus, but it's what we've always done. michael@0: // Note that nsLeafFrame is also eReplacedContainsBlock. michael@0: return nsLeafFrame::IsFrameOfType(aFlags & michael@0: ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | nsIFrame::eXULBox)); michael@0: } michael@0: michael@0: #ifdef DEBUG_FRAME_DUMP michael@0: virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE; michael@0: #endif michael@0: michael@0: // nsIHTMLReflow overrides michael@0: michael@0: virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE; michael@0: virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; michael@0: virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; michael@0: michael@0: // Our auto size is that provided by nsFrame, not nsLeafFrame michael@0: virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext, michael@0: nsSize aCBSize, nscoord aAvailableWidth, michael@0: nsSize aMargin, nsSize aBorder, michael@0: nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult Reflow(nsPresContext* aPresContext, michael@0: nsHTMLReflowMetrics& aDesiredSize, michael@0: const nsHTMLReflowState& aReflowState, michael@0: nsReflowStatus& aStatus) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult CharacterDataChanged(CharacterDataChangeInfo* aInfo) MOZ_OVERRIDE; michael@0: michael@0: virtual void Init(nsIContent* aContent, michael@0: nsIFrame* aParent, michael@0: nsIFrame* asPrevInFlow) MOZ_OVERRIDE; michael@0: michael@0: virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, michael@0: const nsRect& aDirtyRect, michael@0: const nsDisplayListSet& aLists) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult AttributeChanged(int32_t aNameSpaceID, michael@0: nsIAtom* aAttribute, michael@0: int32_t aModType) MOZ_OVERRIDE; michael@0: michael@0: virtual bool ComputesOwnOverflowArea() MOZ_OVERRIDE { return false; } michael@0: michael@0: protected: michael@0: michael@0: NS_IMETHOD DoLayout(nsBoxLayoutState& aState) MOZ_OVERRIDE; michael@0: michael@0: #ifdef DEBUG_LAYOUT michael@0: virtual void GetBoxName(nsAutoString& aName) MOZ_OVERRIDE; michael@0: #endif michael@0: michael@0: virtual nscoord GetIntrinsicWidth() MOZ_OVERRIDE; michael@0: michael@0: nsLeafBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext); michael@0: michael@0: private: michael@0: michael@0: void UpdateMouseThrough(); michael@0: michael@0: michael@0: }; // class nsLeafBoxFrame michael@0: michael@0: #endif /* nsLeafBoxFrame_h___ */