layout/xul/grid/nsGridRowLayout.h

branch
TOR_BUG_9701
changeset 10
ac0c01689b40
equal deleted inserted replaced
-1:000000000000 0:ed52772915ff
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 /**
7
8 Author:
9 Eric D Vaughan
10
11 **/
12
13 #ifndef nsGridRowLayout_h___
14 #define nsGridRowLayout_h___
15
16 #include "mozilla/Attributes.h"
17 #include "nsSprocketLayout.h"
18 #include "nsIGridPart.h"
19 class nsGridRowGroupLayout;
20 class nsGridLayout2;
21 class nsBoxLayoutState;
22 class nsGrid;
23
24 /**
25 * A common base class for nsGridRowLeafLayout (the nsBoxLayout object
26 * for a grid row or column) and nsGridRowGroupLayout (the nsBoxLayout
27 * object for a grid row group or column group).
28 */
29 // XXXldb This needs a name that indicates that it's a base class for
30 // both row and rows (row-group).
31 class nsGridRowLayout : public nsSprocketLayout,
32 public nsIGridPart
33 {
34 public:
35 NS_DECL_ISUPPORTS_INHERITED
36
37 virtual nsGridRowGroupLayout* CastToRowGroupLayout() MOZ_OVERRIDE { return nullptr; }
38 virtual nsGridLayout2* CastToGridLayout() MOZ_OVERRIDE { return nullptr; }
39 virtual nsGrid* GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequestor=nullptr) MOZ_OVERRIDE;
40 virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) MOZ_OVERRIDE;
41 virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
42 nsIFrame* aPrevBox,
43 const nsFrameList::Slice& aNewChildren) MOZ_OVERRIDE;
44 virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
45 const nsFrameList::Slice& aNewChildren) MOZ_OVERRIDE;
46 virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) MOZ_OVERRIDE;
47 virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) MOZ_OVERRIDE;
48 virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal) MOZ_OVERRIDE;
49
50 virtual nsIGridPart* AsGridPart() MOZ_OVERRIDE { return this; }
51
52 protected:
53 virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)=0;
54
55 nsGridRowLayout();
56 };
57
58 #endif
59

mercurial