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: /** michael@0: michael@0: Author: michael@0: Eric D Vaughan michael@0: michael@0: **/ michael@0: michael@0: #ifndef nsGridRowLeafLayout_h___ michael@0: #define nsGridRowLeafLayout_h___ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsGridRowLayout.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: /** michael@0: * The nsBoxLayout implementation for nsGridRowLeafFrame. michael@0: */ michael@0: // XXXldb This needs a better name that indicates that it's for any grid michael@0: // row. michael@0: class nsGridRowLeafLayout : public nsGridRowLayout michael@0: { michael@0: public: michael@0: michael@0: friend already_AddRefed NS_NewGridRowLeafLayout(); michael@0: michael@0: virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; michael@0: virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; michael@0: virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; michael@0: virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE; michael@0: NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; michael@0: virtual void CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount) MOZ_OVERRIDE; michael@0: virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE; michael@0: virtual int32_t BuildRows(nsIFrame* aBox, nsGridRow* aRows) MOZ_OVERRIDE; michael@0: virtual Type GetType() MOZ_OVERRIDE { return eRowLeaf; } michael@0: michael@0: protected: michael@0: michael@0: virtual void PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState, michael@0: nsBoxSize*& aBoxSizes, nscoord& aMinSize, michael@0: nscoord& aMaxSize, int32_t& aFlexes) MOZ_OVERRIDE; michael@0: virtual void ComputeChildSizes(nsIFrame* aBox, michael@0: nsBoxLayoutState& aState, michael@0: nscoord& aGivenSize, michael@0: nsBoxSize* aBoxSizes, michael@0: nsComputedBoxSize*& aComputedBoxSizes) MOZ_OVERRIDE; michael@0: michael@0: michael@0: nsGridRowLeafLayout(); michael@0: virtual ~nsGridRowLeafLayout(); michael@0: //virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize); michael@0: michael@0: private: michael@0: michael@0: }; // class nsGridRowLeafLayout michael@0: michael@0: #endif michael@0: