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