layout/forms/nsFieldSetFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/forms/nsFieldSetFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,102 @@
     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 +#ifndef nsFieldSetFrame_h___
    1.10 +#define nsFieldSetFrame_h___
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +#include "nsContainerFrame.h"
    1.14 +
    1.15 +class nsFieldSetFrame MOZ_FINAL : public nsContainerFrame
    1.16 +{
    1.17 +public:
    1.18 +  NS_DECL_FRAMEARENA_HELPERS
    1.19 +
    1.20 +  nsFieldSetFrame(nsStyleContext* aContext);
    1.21 +
    1.22 +  NS_HIDDEN_(nscoord)
    1.23 +    GetIntrinsicWidth(nsRenderingContext* aRenderingContext,
    1.24 +                      nsLayoutUtils::IntrinsicWidthType);
    1.25 +  virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE;
    1.26 +  virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE;
    1.27 +  virtual nsSize ComputeSize(nsRenderingContext *aRenderingContext,
    1.28 +                             nsSize aCBSize, nscoord aAvailableWidth,
    1.29 +                             nsSize aMargin, nsSize aBorder, nsSize aPadding,
    1.30 +                             uint32_t aFlags) MOZ_OVERRIDE;
    1.31 +  virtual nscoord GetBaseline() const MOZ_OVERRIDE;
    1.32 +
    1.33 +  /**
    1.34 +   * The area to paint box-shadows around.  It's the border rect except
    1.35 +   * when there's a <legend> we offset the y-position to the center of it.
    1.36 +   */
    1.37 +  virtual nsRect VisualBorderRectRelativeToSelf() const MOZ_OVERRIDE;
    1.38 +
    1.39 +  virtual nsresult Reflow(nsPresContext*           aPresContext,
    1.40 +                          nsHTMLReflowMetrics&     aDesiredSize,
    1.41 +                          const nsHTMLReflowState& aReflowState,
    1.42 +                          nsReflowStatus&          aStatus) MOZ_OVERRIDE;
    1.43 +                               
    1.44 +  virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
    1.45 +                                const nsRect&           aDirtyRect,
    1.46 +                                const nsDisplayListSet& aLists) MOZ_OVERRIDE;
    1.47 +
    1.48 +  void PaintBorderBackground(nsRenderingContext& aRenderingContext,
    1.49 +    nsPoint aPt, const nsRect& aDirtyRect, uint32_t aBGFlags);
    1.50 +
    1.51 +  virtual nsresult AppendFrames(ChildListID    aListID,
    1.52 +                                nsFrameList&   aFrameList) MOZ_OVERRIDE;
    1.53 +  virtual nsresult InsertFrames(ChildListID    aListID,
    1.54 +                                nsIFrame*      aPrevFrame,
    1.55 +                                nsFrameList&   aFrameList) MOZ_OVERRIDE;
    1.56 +  virtual nsresult RemoveFrame(ChildListID    aListID,
    1.57 +                               nsIFrame*      aOldFrame) MOZ_OVERRIDE;
    1.58 +
    1.59 +  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
    1.60 +  virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
    1.61 +  {
    1.62 +    return nsContainerFrame::IsFrameOfType(aFlags &
    1.63 +             ~nsIFrame::eCanContainOverflowContainers);
    1.64 +  }
    1.65 +  virtual nsIScrollableFrame* GetScrollTargetFrame() MOZ_OVERRIDE
    1.66 +  {
    1.67 +    return do_QueryFrame(GetInner());
    1.68 +  }
    1.69 +
    1.70 +#ifdef ACCESSIBILITY  
    1.71 +  virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
    1.72 +#endif
    1.73 +
    1.74 +#ifdef DEBUG
    1.75 +  virtual nsresult SetInitialChildList(ChildListID    aListID,
    1.76 +                                       nsFrameList&   aChildList) MOZ_OVERRIDE;
    1.77 +#endif
    1.78 +
    1.79 +#ifdef DEBUG_FRAME_DUMP
    1.80 +  virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
    1.81 +    return MakeFrameName(NS_LITERAL_STRING("FieldSet"), aResult);
    1.82 +  }
    1.83 +#endif
    1.84 +
    1.85 +  /**
    1.86 +   * Return the anonymous frame that contains all descendants except
    1.87 +   * the legend frame.  This is currently always a block frame with
    1.88 +   * pseudo nsCSSAnonBoxes::fieldsetContent -- this may change in the
    1.89 +   * future when we add support for CSS overflow for <fieldset>.
    1.90 +   */
    1.91 +  nsIFrame* GetInner() const;
    1.92 +
    1.93 +  /**
    1.94 +   * Return the frame that represents the legend if any.  This may be
    1.95 +   * a nsLegendFrame or a nsHTMLScrollFrame with the nsLegendFrame as the
    1.96 +   * scrolled frame (aka content insertion frame).
    1.97 +   */
    1.98 +  nsIFrame* GetLegend() const;
    1.99 +
   1.100 +protected:
   1.101 +  nsRect    mLegendRect;
   1.102 +  nscoord   mLegendSpace;
   1.103 +};
   1.104 +
   1.105 +#endif // nsFieldSetFrame_h___

mercurial