C# Class LayoutFarm.HtmlBoxes.CssTableLayoutEngine

Layout engine for tables executing the complex layout of tables with rows/columns/headers/etc.
Show file Open project: prepare/HTML-Renderer Class Usage Examples

Public Methods

Method Description
PerformLayout ( CssBox tableBox, float hostAvailableWidth, LayoutVisitor lay ) : void

Private Methods

Method Description
ApplyCellVerticalAlignment ( CssBox cell, float tableBoxOffset ) : void

Applies special vertical alignment for table-cells

CalculateMinMaxContentWidths ( CssBox box, CssBox cbBox, IFonts iFonts, float &minWidth, float &maxWidth ) : void

Get the minWidth and maxWidth width of the box content.

CalculateMinMaxSumWords ( CssBox box, CssBox cbBox, IFonts iFonts, float &min, float &maxSum, float &paddingSum, float &marginSum ) : void

Get the min and maxSum of the box words content and paddingSum.

CalculateTableSpacing ( CssBox tableBox ) : float

Get the table cells spacing for all the cells in the table.
Used to calculate the spacing the table has in addition to regular padding and borders.

CalculateWidthSum ( ) : float

Gets the current sum of column widths

CssTableLayoutEngine ( CssBox tableBox, float hostAvaliableWidth ) : System

Init.

FindVerticalCellSpacingBoxInsertionPoint ( CssBox curRow, int cIndex, CssBox &insertAt ) : bool
GetAvailableTableWidth ( ) : float

Gets the available width for the whole table.

The table's width can be larger than the result of this method, because of the minimum size that individual boxes.

GetHorizontalSpacing ( CssBox tableBox ) : float

Gets the actual horizontal spacing of the table

GetMaxTableWidth ( ) : float

Gets the available width for the whole table. It also sets the value of WidthSpecified

The table's width can be larger than the result of this method, because of the minimum size that individual boxes.

GetVerticalSpacing ( CssBox tableBox ) : float

Gets the actual vertical spacing of the table

Layout ( LayoutVisitor lay ) : void

Analyzes the Table and assigns values to this CssTable object. To be called from the constructor

S1_RecursiveMeasureRunContentSize ( CssBox box, LayoutVisitor lay ) : void

Recursively measures run inside the box

S2_PrepareTableCellBoxes ( ) : List

Get the table boxes into the proper fields.

S3_CalculateCountAndWidth ( List userDefinedColumnBoxes ) : float

Determine Row and Column Count, and ColumnWidths

S4S7_CalculateColumnsMinMaxWidthByContent ( bool s4_onlyNonCalculated ) : void

Calculate the min and max width for each column of the table by the content in all rows.
the min width possible without clipping content
the max width the cell content can take without wrapping

S4_DetermineMissingColumnWidths ( float availableWidthForAllCells ) : void
S5_CalculateColumnMinWidths ( int layoutIdEpisode ) : void

Gets the minimum width of each column

S6_EnforceMinimumSize ( ) : void

Check for minimum sizes (increment widths if necessary)

S7_EnforceMaximumSize ( ) : void

While table width is larger than it should, and width is reductable.
If table max width is limited by we need to lower the columns width even if it will result in clipping

S8_LayoutCells ( LayoutVisitor lay ) : void

Layout the cells by the calculated table layout

Method Details

PerformLayout() public static method

public static PerformLayout ( CssBox tableBox, float hostAvailableWidth, LayoutVisitor lay ) : void
tableBox CssBox
hostAvailableWidth float
lay LayoutVisitor
return void