Scribus
Open source desktop publishing at your fingertips
CellArea Class Reference

#include <cellarea.h>

Public Member Functions

 CellArea ()
 Constructs a new invalid area.
 
 CellArea (int row, int column, int width, int height)
 Constructs an area starting at row, column with the given width and height.
 
 CellArea (const CellArea &other)
 Constructs an area as a copy of the area other.
 
bool isValid () const
 Returns true if the area is valid.
 
int row () const
 Returns the start row of the area.
 
void setRow (int row)
 Sets the start row of the area to row.
 
int column () const
 Returns the start column of the area.
 
void setColumn (int column)
 Sets the start column of the area to column.
 
int width () const
 Returns the width of the area.
 
void setWidth (int width)
 Sets the width of the area to width.
 
int height () const
 Returns the height of the area.
 
void setHeight (int height)
 Sets the height of the area to height.
 
int bottom () const
 Returns the bottom row of the area.
 
int right () const
 Returns the right column of the area.
 
bool contains (int row, int column) const
 Returns true if this area contains the cell at row, column.
 
bool contains (const CellArea &area) const
 Returns true if this area contains area.
 
bool intersects (const CellArea &area)
 Returns true if this area and area intersects.
 
CellArea translated (int rows, int columns) const
 Returns a copy of this area that has been translated rows rows and columns columns.
 
void translate (int rows, int columns)
 Translates this area rows rows and columns columns.
 
CellArea adjusted (int rows, int columns, int width, int height) const
 Returns a copy of this area with rows, columns, width, height added.
 
void adjust (int rows, int columns, int width, int height)
 Adjusts this area by rows, columns, width, height.
 
CellArea united (CellArea &area) const
 Returns the bounding area of this area and area.
 
CellArea adjustedForRowInsertion (int index, int numRows)
 
CellArea adjustedForRowRemoval (int index, int numRows)
 
CellArea adjustedForColumnInsertion (int index, int numColumns)
 
CellArea adjustedForColumnRemoval (int index, int numColumns)
 

Detailed Description

The CellArea class is a simple representation of a rectangular area of table cells.

CellArea is similar to QRect, but its contains() and intersects() semantics are a bit different and it has a couple of methods that are specifically taylored for table layout purposes. The class is used during table layout when keeping track of areas of merged table cells.

Member Function Documentation

CellArea CellArea::adjustedForColumnInsertion ( int  index,
int  numColumns 
)

Returns a copy of this area adjusted for an insertion of numColumns columns before the column at index.

If columns are inserted left of the area, the adjusted area is moved right. If columns are inserted inside the area, the adjusted area is increased in width. If columns are inserted right of the area, the returned area is unaffected and a copy of this area.

CellArea CellArea::adjustedForColumnRemoval ( int  index,
int  numColumns 
)

Returns a copy of this area adjusted for a removal of numColumns columns starting with the column at index.

If columns are removed left of the area, the adjusted area is moved left. If columns are removed inside the area, the adjusted area is decreased in width. If columns are removed right of the area, the returned area is unaffected and a copy of this area.

CellArea CellArea::adjustedForRowInsertion ( int  index,
int  numRows 
)

Returns a copy of this area adjusted for an insertion of numRows rows before the row at index.

If rows are inserted above the area, the adjusted area is moved down. If rows are inserted inside the area, the adjusted area is increased in height. If rows are inserted below the area, the returned area is unaffected and a copy of this area.

CellArea CellArea::adjustedForRowRemoval ( int  index,
int  numRows 
)

Returns a copy of this area adjusted for a removal of numRows rows starting with the row at index.

If rows are removed above the area, the adjusted area is moved up. If rows are removed inside the area, the adjusted area is decreased in height. If rows are removed below the area, the returned area is unaffected and a copy of this area.


The documentation for this class was generated from the following files: