layout/tables/nsITableLayoutStrategy.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 // vim:cindent:ts=4:et:sw=4:
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 /*
michael@0 8 * interface for the set of algorithms that determine column and table
michael@0 9 * widths
michael@0 10 */
michael@0 11
michael@0 12 #ifndef nsITableLayoutStrategy_h_
michael@0 13 #define nsITableLayoutStrategy_h_
michael@0 14
michael@0 15 #include "nscore.h"
michael@0 16 #include "nsCoord.h"
michael@0 17
michael@0 18 class nsRenderingContext;
michael@0 19 struct nsHTMLReflowState;
michael@0 20
michael@0 21 class nsITableLayoutStrategy
michael@0 22 {
michael@0 23 public:
michael@0 24 virtual ~nsITableLayoutStrategy() {}
michael@0 25
michael@0 26 /** Implement nsIFrame::GetMinWidth for the table */
michael@0 27 virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) = 0;
michael@0 28
michael@0 29 /** Implement nsIFrame::GetPrefWidth for the table */
michael@0 30 virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext,
michael@0 31 bool aComputingSize) = 0;
michael@0 32
michael@0 33 /** Implement nsIFrame::MarkIntrinsicWidthsDirty for the table */
michael@0 34 virtual void MarkIntrinsicWidthsDirty() = 0;
michael@0 35
michael@0 36 /**
michael@0 37 * Compute final column widths based on the intrinsic width data and
michael@0 38 * the available width.
michael@0 39 */
michael@0 40 virtual void ComputeColumnWidths(const nsHTMLReflowState& aReflowState) = 0;
michael@0 41
michael@0 42 /**
michael@0 43 * Return the type of table layout strategy, without the cost of
michael@0 44 * a virtual function call
michael@0 45 */
michael@0 46 enum Type { Auto, Fixed };
michael@0 47 Type GetType() const { return mType; }
michael@0 48
michael@0 49 protected:
michael@0 50 nsITableLayoutStrategy(Type aType) : mType(aType) {}
michael@0 51 private:
michael@0 52 Type mType;
michael@0 53 };
michael@0 54
michael@0 55 #endif /* !defined(nsITableLayoutStrategy_h_) */

mercurial