|
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 nsGridRowLeafLayout_h___ |
|
14 #define nsGridRowLeafLayout_h___ |
|
15 |
|
16 #include "mozilla/Attributes.h" |
|
17 #include "nsGridRowLayout.h" |
|
18 #include "nsCOMPtr.h" |
|
19 |
|
20 /** |
|
21 * The nsBoxLayout implementation for nsGridRowLeafFrame. |
|
22 */ |
|
23 // XXXldb This needs a better name that indicates that it's for any grid |
|
24 // row. |
|
25 class nsGridRowLeafLayout : public nsGridRowLayout |
|
26 { |
|
27 public: |
|
28 |
|
29 friend already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout(); |
|
30 |
|
31 virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; |
|
32 virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; |
|
33 virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; |
|
34 virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE; |
|
35 NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; |
|
36 virtual void CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount) MOZ_OVERRIDE; |
|
37 virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE; |
|
38 virtual int32_t BuildRows(nsIFrame* aBox, nsGridRow* aRows) MOZ_OVERRIDE; |
|
39 virtual Type GetType() MOZ_OVERRIDE { return eRowLeaf; } |
|
40 |
|
41 protected: |
|
42 |
|
43 virtual void PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState, |
|
44 nsBoxSize*& aBoxSizes, nscoord& aMinSize, |
|
45 nscoord& aMaxSize, int32_t& aFlexes) MOZ_OVERRIDE; |
|
46 virtual void ComputeChildSizes(nsIFrame* aBox, |
|
47 nsBoxLayoutState& aState, |
|
48 nscoord& aGivenSize, |
|
49 nsBoxSize* aBoxSizes, |
|
50 nsComputedBoxSize*& aComputedBoxSizes) MOZ_OVERRIDE; |
|
51 |
|
52 |
|
53 nsGridRowLeafLayout(); |
|
54 virtual ~nsGridRowLeafLayout(); |
|
55 //virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize); |
|
56 |
|
57 private: |
|
58 |
|
59 }; // class nsGridRowLeafLayout |
|
60 |
|
61 #endif |
|
62 |