michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: // vim:cindent:ts=4:et:sw=4: michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * interface for the set of algorithms that determine column and table michael@0: * widths michael@0: */ michael@0: michael@0: #ifndef nsITableLayoutStrategy_h_ michael@0: #define nsITableLayoutStrategy_h_ michael@0: michael@0: #include "nscore.h" michael@0: #include "nsCoord.h" michael@0: michael@0: class nsRenderingContext; michael@0: struct nsHTMLReflowState; michael@0: michael@0: class nsITableLayoutStrategy michael@0: { michael@0: public: michael@0: virtual ~nsITableLayoutStrategy() {} michael@0: michael@0: /** Implement nsIFrame::GetMinWidth for the table */ michael@0: virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) = 0; michael@0: michael@0: /** Implement nsIFrame::GetPrefWidth for the table */ michael@0: virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext, michael@0: bool aComputingSize) = 0; michael@0: michael@0: /** Implement nsIFrame::MarkIntrinsicWidthsDirty for the table */ michael@0: virtual void MarkIntrinsicWidthsDirty() = 0; michael@0: michael@0: /** michael@0: * Compute final column widths based on the intrinsic width data and michael@0: * the available width. michael@0: */ michael@0: virtual void ComputeColumnWidths(const nsHTMLReflowState& aReflowState) = 0; michael@0: michael@0: /** michael@0: * Return the type of table layout strategy, without the cost of michael@0: * a virtual function call michael@0: */ michael@0: enum Type { Auto, Fixed }; michael@0: Type GetType() const { return mType; } michael@0: michael@0: protected: michael@0: nsITableLayoutStrategy(Type aType) : mType(aType) {} michael@0: private: michael@0: Type mType; michael@0: }; michael@0: michael@0: #endif /* !defined(nsITableLayoutStrategy_h_) */