layout/tables/nsITableLayoutStrategy.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/tables/nsITableLayoutStrategy.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +// vim:cindent:ts=4:et:sw=4:
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +/*
    1.11 + * interface for the set of algorithms that determine column and table
    1.12 + * widths
    1.13 + */
    1.14 +
    1.15 +#ifndef nsITableLayoutStrategy_h_
    1.16 +#define nsITableLayoutStrategy_h_
    1.17 +
    1.18 +#include "nscore.h"
    1.19 +#include "nsCoord.h"
    1.20 +
    1.21 +class nsRenderingContext;
    1.22 +struct nsHTMLReflowState;
    1.23 +
    1.24 +class nsITableLayoutStrategy
    1.25 +{
    1.26 +public:
    1.27 +    virtual ~nsITableLayoutStrategy() {}
    1.28 +
    1.29 +    /** Implement nsIFrame::GetMinWidth for the table */
    1.30 +    virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) = 0;
    1.31 +
    1.32 +    /** Implement nsIFrame::GetPrefWidth for the table */
    1.33 +    virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext,
    1.34 +                                 bool aComputingSize) = 0;
    1.35 +
    1.36 +    /** Implement nsIFrame::MarkIntrinsicWidthsDirty for the table */
    1.37 +    virtual void MarkIntrinsicWidthsDirty() = 0;
    1.38 +
    1.39 +    /**
    1.40 +     * Compute final column widths based on the intrinsic width data and
    1.41 +     * the available width.
    1.42 +     */
    1.43 +    virtual void ComputeColumnWidths(const nsHTMLReflowState& aReflowState) = 0;
    1.44 +
    1.45 +    /**
    1.46 +     * Return the type of table layout strategy, without the cost of
    1.47 +     * a virtual function call
    1.48 +     */
    1.49 +    enum Type { Auto, Fixed };
    1.50 +    Type GetType() const { return mType; }
    1.51 +
    1.52 +protected:
    1.53 +    nsITableLayoutStrategy(Type aType) : mType(aType) {}
    1.54 +private:
    1.55 +    Type mType;
    1.56 +};
    1.57 +
    1.58 +#endif /* !defined(nsITableLayoutStrategy_h_) */

mercurial