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: michael@0: #ifndef nsFieldSetFrame_h___ michael@0: #define nsFieldSetFrame_h___ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsContainerFrame.h" michael@0: michael@0: class nsFieldSetFrame MOZ_FINAL : public nsContainerFrame michael@0: { michael@0: public: michael@0: NS_DECL_FRAMEARENA_HELPERS michael@0: michael@0: nsFieldSetFrame(nsStyleContext* aContext); michael@0: michael@0: NS_HIDDEN_(nscoord) michael@0: GetIntrinsicWidth(nsRenderingContext* aRenderingContext, michael@0: nsLayoutUtils::IntrinsicWidthType); michael@0: virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE; michael@0: virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE; michael@0: virtual nsSize ComputeSize(nsRenderingContext *aRenderingContext, michael@0: nsSize aCBSize, nscoord aAvailableWidth, michael@0: nsSize aMargin, nsSize aBorder, nsSize aPadding, michael@0: uint32_t aFlags) MOZ_OVERRIDE; michael@0: virtual nscoord GetBaseline() const MOZ_OVERRIDE; michael@0: michael@0: /** michael@0: * The area to paint box-shadows around. It's the border rect except michael@0: * when there's a we offset the y-position to the center of it. michael@0: */ michael@0: virtual nsRect VisualBorderRectRelativeToSelf() const 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 void BuildDisplayList(nsDisplayListBuilder* aBuilder, michael@0: const nsRect& aDirtyRect, michael@0: const nsDisplayListSet& aLists) MOZ_OVERRIDE; michael@0: michael@0: void PaintBorderBackground(nsRenderingContext& aRenderingContext, michael@0: nsPoint aPt, const nsRect& aDirtyRect, uint32_t aBGFlags); michael@0: michael@0: virtual nsresult AppendFrames(ChildListID aListID, michael@0: nsFrameList& aFrameList) MOZ_OVERRIDE; michael@0: virtual nsresult InsertFrames(ChildListID aListID, michael@0: nsIFrame* aPrevFrame, michael@0: nsFrameList& aFrameList) MOZ_OVERRIDE; michael@0: virtual nsresult RemoveFrame(ChildListID aListID, michael@0: nsIFrame* aOldFrame) 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: return nsContainerFrame::IsFrameOfType(aFlags & michael@0: ~nsIFrame::eCanContainOverflowContainers); michael@0: } michael@0: virtual nsIScrollableFrame* GetScrollTargetFrame() MOZ_OVERRIDE michael@0: { michael@0: return do_QueryFrame(GetInner()); michael@0: } michael@0: michael@0: #ifdef ACCESSIBILITY michael@0: virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE; michael@0: #endif michael@0: michael@0: #ifdef DEBUG michael@0: virtual nsresult SetInitialChildList(ChildListID aListID, michael@0: nsFrameList& aChildList) MOZ_OVERRIDE; michael@0: #endif michael@0: michael@0: #ifdef DEBUG_FRAME_DUMP michael@0: virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE { michael@0: return MakeFrameName(NS_LITERAL_STRING("FieldSet"), aResult); michael@0: } michael@0: #endif michael@0: michael@0: /** michael@0: * Return the anonymous frame that contains all descendants except michael@0: * the legend frame. This is currently always a block frame with michael@0: * pseudo nsCSSAnonBoxes::fieldsetContent -- this may change in the michael@0: * future when we add support for CSS overflow for
. michael@0: */ michael@0: nsIFrame* GetInner() const; michael@0: michael@0: /** michael@0: * Return the frame that represents the legend if any. This may be michael@0: * a nsLegendFrame or a nsHTMLScrollFrame with the nsLegendFrame as the michael@0: * scrolled frame (aka content insertion frame). michael@0: */ michael@0: nsIFrame* GetLegend() const; michael@0: michael@0: protected: michael@0: nsRect mLegendRect; michael@0: nscoord mLegendSpace; michael@0: }; michael@0: michael@0: #endif // nsFieldSetFrame_h___