layout/xul/nsLeafBoxFrame.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsLeafBoxFrame_h___
     6 #define nsLeafBoxFrame_h___
     8 #include "mozilla/Attributes.h"
     9 #include "nsLeafFrame.h"
    10 #include "nsBox.h"
    12 class nsAccessKeyInfo;
    14 class nsLeafBoxFrame : public nsLeafFrame
    15 {
    16 public:
    17   NS_DECL_FRAMEARENA_HELPERS
    19   friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
    21   virtual nsSize GetPrefSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
    22   virtual nsSize GetMinSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
    23   virtual nsSize GetMaxSize(nsBoxLayoutState& aState) MOZ_OVERRIDE;
    24   virtual nscoord GetFlex(nsBoxLayoutState& aState) MOZ_OVERRIDE;
    25   virtual nscoord GetBoxAscent(nsBoxLayoutState& aState) MOZ_OVERRIDE;
    27   virtual nsIAtom* GetType() const MOZ_OVERRIDE;
    28   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
    29   {
    30     // This is bogus, but it's what we've always done.
    31     // Note that nsLeafFrame is also eReplacedContainsBlock.
    32     return nsLeafFrame::IsFrameOfType(aFlags &
    33       ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | nsIFrame::eXULBox));
    34   }
    36 #ifdef DEBUG_FRAME_DUMP
    37   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
    38 #endif
    40   // nsIHTMLReflow overrides
    42   virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
    43   virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
    44   virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
    46   // Our auto size is that provided by nsFrame, not nsLeafFrame
    47   virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext,
    48                                  nsSize aCBSize, nscoord aAvailableWidth,
    49                                  nsSize aMargin, nsSize aBorder,
    50                                  nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE;
    52   virtual nsresult Reflow(nsPresContext*          aPresContext,
    53                           nsHTMLReflowMetrics&     aDesiredSize,
    54                           const nsHTMLReflowState& aReflowState,
    55                           nsReflowStatus&          aStatus) MOZ_OVERRIDE;
    57   virtual nsresult CharacterDataChanged(CharacterDataChangeInfo* aInfo) MOZ_OVERRIDE;
    59   virtual void Init(nsIContent*      aContent,
    60                     nsIFrame*        aParent,
    61                     nsIFrame*        asPrevInFlow) MOZ_OVERRIDE;
    63   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
    64                                 const nsRect&           aDirtyRect,
    65                                 const nsDisplayListSet& aLists) MOZ_OVERRIDE;
    67   virtual nsresult AttributeChanged(int32_t aNameSpaceID,
    68                                     nsIAtom* aAttribute,
    69                                     int32_t aModType) MOZ_OVERRIDE;
    71   virtual bool ComputesOwnOverflowArea() MOZ_OVERRIDE { return false; }
    73 protected:
    75   NS_IMETHOD DoLayout(nsBoxLayoutState& aState) MOZ_OVERRIDE;
    77 #ifdef DEBUG_LAYOUT
    78   virtual void GetBoxName(nsAutoString& aName) MOZ_OVERRIDE;
    79 #endif
    81   virtual nscoord GetIntrinsicWidth() MOZ_OVERRIDE;
    83  nsLeafBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext);
    85 private:
    87  void UpdateMouseThrough();
    90 }; // class nsLeafBoxFrame
    92 #endif /* nsLeafBoxFrame_h___ */

mercurial