Line data Source code
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 : * isizes
10 : */
11 :
12 : #ifndef nsITableLayoutStrategy_h_
13 : #define nsITableLayoutStrategy_h_
14 :
15 : #include "nscore.h"
16 : #include "nsCoord.h"
17 :
18 : class gfxContext;
19 : namespace mozilla {
20 : struct ReflowInput;
21 : } // namespace mozilla
22 :
23 : class nsITableLayoutStrategy
24 : {
25 : public:
26 : using ReflowInput = mozilla::ReflowInput;
27 :
28 0 : virtual ~nsITableLayoutStrategy() {}
29 :
30 : /** Implement nsIFrame::GetMinISize for the table */
31 : virtual nscoord GetMinISize(gfxContext* aRenderingContext) = 0;
32 :
33 : /** Implement nsIFrame::GetPrefISize for the table */
34 : virtual nscoord GetPrefISize(gfxContext* aRenderingContext,
35 : bool aComputingSize) = 0;
36 :
37 : /** Implement nsIFrame::MarkIntrinsicISizesDirty for the table */
38 : virtual void MarkIntrinsicISizesDirty() = 0;
39 :
40 : /**
41 : * Compute final column isizes based on the intrinsic isize data and
42 : * the available isize.
43 : */
44 : virtual void ComputeColumnISizes(const ReflowInput& aReflowInput) = 0;
45 :
46 : /**
47 : * Return the type of table layout strategy, without the cost of
48 : * a virtual function call
49 : */
50 : enum Type { Auto, Fixed };
51 0 : Type GetType() const { return mType; }
52 :
53 : protected:
54 0 : explicit nsITableLayoutStrategy(Type aType) : mType(aType) {}
55 : private:
56 : Type mType;
57 : };
58 :
59 : #endif /* !defined(nsITableLayoutStrategy_h_) */
|