Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/xul/nsBoxLayout.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
#ifndef nsBoxLayout_h___
8
#define nsBoxLayout_h___
9
10
#include "nsISupports.h"
11
#include "nsCoord.h"
12
#include "nsFrameList.h"
13
14
class nsIFrame;
15
class nsBoxLayoutState;
16
struct nsSize;
17
struct nsMargin;
18
19
#define NS_BOX_LAYOUT_IID \
20
{ 0x09d522a7, 0x304c, 0x4137, \
21
 { 0xaf, 0xc9, 0xe0, 0x80, 0x2e, 0x89, 0xb7, 0xe8 } }
22
23
class nsIGridPart;
24
25
class nsBoxLayout : public nsISupports {
26
27
protected:
28
0
  virtual ~nsBoxLayout() {}
29
30
public:
31
32
0
  nsBoxLayout() {}
33
34
  NS_DECL_ISUPPORTS
35
36
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_BOX_LAYOUT_IID)
37
38
  NS_IMETHOD XULLayout(nsIFrame* aBox, nsBoxLayoutState& aState);
39
40
  virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
41
  virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
42
  virtual nsSize GetXULMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
43
  virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
44
  virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
45
                                nsIFrame* aPrevBox,
46
0
                                const nsFrameList::Slice& aNewChildren) {}
47
  virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
48
0
                                const nsFrameList::Slice& aNewChildren) {}
49
0
  virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {}
50
0
  virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {}
51
0
  virtual void IntrinsicISizesDirty(nsIFrame* aBox, nsBoxLayoutState& aState) {}
52
53
  virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize);
54
  virtual void AddMargin(nsIFrame* aChild, nsSize& aSize);
55
  virtual void AddMargin(nsSize& aSize, const nsMargin& aMargin);
56
57
0
  virtual nsIGridPart* AsGridPart() { return nullptr; }
58
59
  static void AddLargestSize(nsSize& aSize, const nsSize& aToAdd);
60
  static void AddSmallestSize(nsSize& aSize, const nsSize& aToAdd);
61
};
62
63
NS_DEFINE_STATIC_IID_ACCESSOR(nsBoxLayout, NS_BOX_LAYOUT_IID)
64
65
#endif
66