1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/xul/grid/nsGridRowLayout.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/** 1.10 + 1.11 + Author: 1.12 + Eric D Vaughan 1.13 + 1.14 +**/ 1.15 + 1.16 +#ifndef nsGridRowLayout_h___ 1.17 +#define nsGridRowLayout_h___ 1.18 + 1.19 +#include "mozilla/Attributes.h" 1.20 +#include "nsSprocketLayout.h" 1.21 +#include "nsIGridPart.h" 1.22 +class nsGridRowGroupLayout; 1.23 +class nsGridLayout2; 1.24 +class nsBoxLayoutState; 1.25 +class nsGrid; 1.26 + 1.27 +/** 1.28 + * A common base class for nsGridRowLeafLayout (the nsBoxLayout object 1.29 + * for a grid row or column) and nsGridRowGroupLayout (the nsBoxLayout 1.30 + * object for a grid row group or column group). 1.31 + */ 1.32 +// XXXldb This needs a name that indicates that it's a base class for 1.33 +// both row and rows (row-group). 1.34 +class nsGridRowLayout : public nsSprocketLayout, 1.35 + public nsIGridPart 1.36 +{ 1.37 +public: 1.38 + NS_DECL_ISUPPORTS_INHERITED 1.39 + 1.40 + virtual nsGridRowGroupLayout* CastToRowGroupLayout() MOZ_OVERRIDE { return nullptr; } 1.41 + virtual nsGridLayout2* CastToGridLayout() MOZ_OVERRIDE { return nullptr; } 1.42 + virtual nsGrid* GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequestor=nullptr) MOZ_OVERRIDE; 1.43 + virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) MOZ_OVERRIDE; 1.44 + virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState, 1.45 + nsIFrame* aPrevBox, 1.46 + const nsFrameList::Slice& aNewChildren) MOZ_OVERRIDE; 1.47 + virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState, 1.48 + const nsFrameList::Slice& aNewChildren) MOZ_OVERRIDE; 1.49 + virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) MOZ_OVERRIDE; 1.50 + virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) MOZ_OVERRIDE; 1.51 + virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal) MOZ_OVERRIDE; 1.52 + 1.53 + virtual nsIGridPart* AsGridPart() MOZ_OVERRIDE { return this; } 1.54 + 1.55 +protected: 1.56 + virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)=0; 1.57 + 1.58 + nsGridRowLayout(); 1.59 +}; 1.60 + 1.61 +#endif 1.62 +