|
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 nsGridCell_h___ |
|
14 #define nsGridCell_h___ |
|
15 |
|
16 class nsBoxLayoutState; |
|
17 struct nsSize; |
|
18 class nsIFrame; |
|
19 |
|
20 /* |
|
21 * Grid cell is what makes up the cellmap in the grid. Each GridCell contains |
|
22 * 2 pointers. One to the matching box in the columns and one to the matching box |
|
23 * in the rows. Remember that you can put content in both rows and columns. |
|
24 * When asked for preferred/min/max sizes it works like a stack and takes the |
|
25 * biggest sizes. |
|
26 */ |
|
27 |
|
28 class nsGridCell |
|
29 { |
|
30 public: |
|
31 nsGridCell(); |
|
32 virtual ~nsGridCell(); |
|
33 |
|
34 nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState); |
|
35 nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState); |
|
36 nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState); |
|
37 bool IsCollapsed(); |
|
38 |
|
39 // accessors |
|
40 nsIFrame* GetBoxInColumn() { return mBoxInColumn; } |
|
41 nsIFrame* GetBoxInRow() { return mBoxInRow; } |
|
42 void SetBoxInRow(nsIFrame* aBox) { mBoxInRow = aBox; } |
|
43 void SetBoxInColumn(nsIFrame* aBox) { mBoxInColumn = aBox; } |
|
44 |
|
45 private: |
|
46 nsIFrame* mBoxInColumn; |
|
47 nsIFrame* mBoxInRow; |
|
48 }; |
|
49 |
|
50 #endif |
|
51 |