layout/tables/nsITableLayoutStrategy.h

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     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/. */
     7 /*
     8  * interface for the set of algorithms that determine column and table
     9  * widths
    10  */
    12 #ifndef nsITableLayoutStrategy_h_
    13 #define nsITableLayoutStrategy_h_
    15 #include "nscore.h"
    16 #include "nsCoord.h"
    18 class nsRenderingContext;
    19 struct nsHTMLReflowState;
    21 class nsITableLayoutStrategy
    22 {
    23 public:
    24     virtual ~nsITableLayoutStrategy() {}
    26     /** Implement nsIFrame::GetMinWidth for the table */
    27     virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) = 0;
    29     /** Implement nsIFrame::GetPrefWidth for the table */
    30     virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext,
    31                                  bool aComputingSize) = 0;
    33     /** Implement nsIFrame::MarkIntrinsicWidthsDirty for the table */
    34     virtual void MarkIntrinsicWidthsDirty() = 0;
    36     /**
    37      * Compute final column widths based on the intrinsic width data and
    38      * the available width.
    39      */
    40     virtual void ComputeColumnWidths(const nsHTMLReflowState& aReflowState) = 0;
    42     /**
    43      * Return the type of table layout strategy, without the cost of
    44      * a virtual function call
    45      */
    46     enum Type { Auto, Fixed };
    47     Type GetType() const { return mType; }
    49 protected:
    50     nsITableLayoutStrategy(Type aType) : mType(aType) {}
    51 private:
    52     Type mType;
    53 };
    55 #endif /* !defined(nsITableLayoutStrategy_h_) */

mercurial