2007-03-22 10:30:00 -07:00
|
|
|
/* -*- 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
Author:
|
|
|
|
Eric D Vaughan
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef nsGridRowLayout_h___
|
|
|
|
#define nsGridRowLayout_h___
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSprocketLayout.h"
|
|
|
|
#include "nsIGridPart.h"
|
|
|
|
class nsGridRowGroupLayout;
|
|
|
|
class nsGridLayout2;
|
|
|
|
class nsBoxLayoutState;
|
|
|
|
class nsGrid;
|
|
|
|
|
|
|
|
/**
|
2011-07-11 07:05:10 -07:00
|
|
|
* A common base class for nsGridRowLeafLayout (the nsBoxLayout object
|
|
|
|
* for a grid row or column) and nsGridRowGroupLayout (the nsBoxLayout
|
2007-03-22 10:30:00 -07:00
|
|
|
* object for a grid row group or column group).
|
|
|
|
*/
|
|
|
|
// XXXldb This needs a name that indicates that it's a base class for
|
|
|
|
// both row and rows (row-group).
|
|
|
|
class nsGridRowLayout : public nsSprocketLayout,
|
|
|
|
public nsIGridPart
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2012-07-30 07:20:58 -07:00
|
|
|
virtual nsGridRowGroupLayout* CastToRowGroupLayout() { return nullptr; }
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual nsGridLayout2* CastToGridLayout() MOZ_OVERRIDE { return nullptr; }
|
|
|
|
virtual nsGrid* GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequestor=nullptr) MOZ_OVERRIDE;
|
|
|
|
virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) MOZ_OVERRIDE;
|
2012-08-05 20:00:57 -07:00
|
|
|
virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
|
|
|
|
nsIFrame* aPrevBox,
|
2009-07-30 10:23:32 -07:00
|
|
|
const nsFrameList::Slice& aNewChildren);
|
2012-08-05 20:00:57 -07:00
|
|
|
virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
|
2009-07-30 10:23:32 -07:00
|
|
|
const nsFrameList::Slice& aNewChildren);
|
2012-08-05 20:00:57 -07:00
|
|
|
virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList);
|
|
|
|
virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList);
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-07-04 07:39:10 -07:00
|
|
|
virtual nsIGridPart* AsGridPart() { return this; }
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
2012-08-05 20:00:57 -07:00
|
|
|
virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)=0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-01-19 10:31:33 -08:00
|
|
|
nsGridRowLayout();
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|