Bug 1869043 allow a device to be specified with MediaTrackGraph::NotifyWhenDeviceStar...
[gecko.git] / layout / tables / nsITableLayoutStrategy.h
blobe7e4d0e2801941695852eb8a3ec4e98027c93e78
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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/. */
7 /*
8 * interface for the set of algorithms that determine column and table
9 * isizes
12 #ifndef nsITableLayoutStrategy_h_
13 #define nsITableLayoutStrategy_h_
15 #include "nscore.h"
16 #include "nsCoord.h"
18 class gfxContext;
19 namespace mozilla {
20 struct ReflowInput;
21 } // namespace mozilla
23 class nsITableLayoutStrategy {
24 public:
25 using ReflowInput = mozilla::ReflowInput;
27 virtual ~nsITableLayoutStrategy() = default;
29 /** Implement nsIFrame::GetMinISize for the table */
30 virtual nscoord GetMinISize(gfxContext* aRenderingContext) = 0;
32 /** Implement nsIFrame::GetPrefISize for the table */
33 virtual nscoord GetPrefISize(gfxContext* aRenderingContext,
34 bool aComputingSize) = 0;
36 /** Implement nsIFrame::MarkIntrinsicISizesDirty for the table */
37 virtual void MarkIntrinsicISizesDirty() = 0;
39 /**
40 * Compute final column isizes based on the intrinsic isize data and
41 * the available isize.
43 virtual void ComputeColumnISizes(const ReflowInput& aReflowInput) = 0;
45 /**
46 * Return the type of table layout strategy, without the cost of
47 * a virtual function call
49 enum Type { Auto, Fixed };
50 Type GetType() const { return mType; }
52 protected:
53 explicit nsITableLayoutStrategy(Type aType) : mType(aType) {}
55 private:
56 Type mType;
59 #endif /* !defined(nsITableLayoutStrategy_h_) */