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 nsGridRowLayout_h___ michael@0: #define nsGridRowLayout_h___ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsSprocketLayout.h" michael@0: #include "nsIGridPart.h" michael@0: class nsGridRowGroupLayout; michael@0: class nsGridLayout2; michael@0: class nsBoxLayoutState; michael@0: class nsGrid; michael@0: michael@0: /** michael@0: * A common base class for nsGridRowLeafLayout (the nsBoxLayout object michael@0: * for a grid row or column) and nsGridRowGroupLayout (the nsBoxLayout michael@0: * object for a grid row group or column group). michael@0: */ michael@0: // XXXldb This needs a name that indicates that it's a base class for michael@0: // both row and rows (row-group). michael@0: class nsGridRowLayout : public nsSprocketLayout, michael@0: public nsIGridPart michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: michael@0: virtual nsGridRowGroupLayout* CastToRowGroupLayout() MOZ_OVERRIDE { return nullptr; } michael@0: virtual nsGridLayout2* CastToGridLayout() MOZ_OVERRIDE { return nullptr; } michael@0: virtual nsGrid* GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequestor=nullptr) MOZ_OVERRIDE; michael@0: virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) MOZ_OVERRIDE; michael@0: virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState, michael@0: nsIFrame* aPrevBox, michael@0: const nsFrameList::Slice& aNewChildren) MOZ_OVERRIDE; michael@0: virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState, michael@0: const nsFrameList::Slice& aNewChildren) MOZ_OVERRIDE; michael@0: virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) MOZ_OVERRIDE; michael@0: virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) MOZ_OVERRIDE; michael@0: virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal) MOZ_OVERRIDE; michael@0: michael@0: virtual nsIGridPart* AsGridPart() MOZ_OVERRIDE { return this; } michael@0: michael@0: protected: michael@0: virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)=0; michael@0: michael@0: nsGridRowLayout(); michael@0: }; michael@0: michael@0: #endif michael@0: