gecko/layout/xul/base/src/nsLeafBoxFrame.h

93 lines
3.0 KiB
C
Raw Normal View History

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