Line data Source code
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 0 : virtual nsGridRowGroupLayout* CastToRowGroupLayout() override { return nullptr; }
38 0 : virtual nsGridLayout2* CastToGridLayout() override { return nullptr; }
39 : virtual nsGrid* GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequestor=nullptr) override;
40 : virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) override;
41 : virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
42 : nsIFrame* aPrevBox,
43 : const nsFrameList::Slice& aNewChildren) override;
44 : virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
45 : const nsFrameList::Slice& aNewChildren) override;
46 : virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) override;
47 : virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) override;
48 : virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal) override;
49 :
50 0 : virtual nsIGridPart* AsGridPart() override { return this; }
51 :
52 : protected:
53 : virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)=0;
54 :
55 : nsGridRowLayout();
56 : virtual ~nsGridRowLayout();
57 : };
58 :
59 : #endif
60 :
|