Coverage Report

Created: 2018-09-25 14:53

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