|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 // vim:cindent:ts=4:et:sw=4: |
|
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 * interface for the set of algorithms that determine column and table |
|
9 * widths |
|
10 */ |
|
11 |
|
12 #ifndef nsITableLayoutStrategy_h_ |
|
13 #define nsITableLayoutStrategy_h_ |
|
14 |
|
15 #include "nscore.h" |
|
16 #include "nsCoord.h" |
|
17 |
|
18 class nsRenderingContext; |
|
19 struct nsHTMLReflowState; |
|
20 |
|
21 class nsITableLayoutStrategy |
|
22 { |
|
23 public: |
|
24 virtual ~nsITableLayoutStrategy() {} |
|
25 |
|
26 /** Implement nsIFrame::GetMinWidth for the table */ |
|
27 virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) = 0; |
|
28 |
|
29 /** Implement nsIFrame::GetPrefWidth for the table */ |
|
30 virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext, |
|
31 bool aComputingSize) = 0; |
|
32 |
|
33 /** Implement nsIFrame::MarkIntrinsicWidthsDirty for the table */ |
|
34 virtual void MarkIntrinsicWidthsDirty() = 0; |
|
35 |
|
36 /** |
|
37 * Compute final column widths based on the intrinsic width data and |
|
38 * the available width. |
|
39 */ |
|
40 virtual void ComputeColumnWidths(const nsHTMLReflowState& aReflowState) = 0; |
|
41 |
|
42 /** |
|
43 * Return the type of table layout strategy, without the cost of |
|
44 * a virtual function call |
|
45 */ |
|
46 enum Type { Auto, Fixed }; |
|
47 Type GetType() const { return mType; } |
|
48 |
|
49 protected: |
|
50 nsITableLayoutStrategy(Type aType) : mType(aType) {} |
|
51 private: |
|
52 Type mType; |
|
53 }; |
|
54 |
|
55 #endif /* !defined(nsITableLayoutStrategy_h_) */ |