kspread

KSpread::Range Class Reference

#include <kspread_util.h>

List of all members.


Detailed Description

Represents a region within a workbook.

The region has an area (the columns and rows that it includes) and optionally an associated KSpread::Sheet A range is defined by four coordinates: Its left column, top row, right column and bottom row. Each of these coordinates may be set as fixed, to represent absolute coordinates in formulae.

Definition at line 130 of file kspread_util.h.


Public Member Functions

 Range (const QString &)
 Range (const QString &, Map *, Sheet *default_sheet=0)
 Range (const Range &r)
 Range (const Point &ul, const Point &lr)
bool isValid () const
bool isSheetKnown () const
void getStartPoint (Point *pt)
void getEndPoint (Point *pt)
int startRow () const
int startCol () const
int endRow () const
int endCol () const
virtual void setRange (const QRect &newRange)
void setRange (int newStartCol, int newStartRow, int newEndCol, int newEndRow)
QRect range () const
bool contains (const Point &cell) const
bool intersects (const Range &r) const
QString toString () const
void setLeftFixed (bool fixed)
bool leftFixed () const
void setRightFixed (bool fixed)
bool rightFixed () const
void setTopFixed (bool fixed)
bool topFixed () const
void setBottomFixed (bool fixed)
bool bottomFixed () const
void setSheet (Sheet *sheet)
Sheet * sheet () const
void setSheetName (QString sheetName)
QString sheetName () const
QString namedArea () const
bool operator== (const Range &range) const

Member Function Documentation

bool Range::isValid (  )  const

Returns true if this Range represents a valid region of a spreadsheet.

A range is valid if:

  • It has an associated Sheet
  • The area is non-negative (ie.
  • The left-most column is non-negative
  • The top-most row is non-negative

Definition at line 670 of file kspread_util.cc.

bool KSpread::Range::isSheetKnown (  )  const [inline]

Returns true if this range has an associated Sheet or false otherwise.

Definition at line 151 of file kspread_util.h.

void Range::getStartPoint ( Point pt  ) 

Fills a Point with info (row,column,sheet) about the first point in the range.

Definition at line 636 of file kspread_util.cc.

void Range::getEndPoint ( Point pt  ) 

Fills a Point with info (row,column,sheet) about the last point the range.

Definition at line 648 of file kspread_util.cc.

virtual void KSpread::Range::setRange ( const QRect &  newRange  )  [inline, virtual]

Changes the area on the spreadsheet represented by this range.

Parameters:
newRange The new area for this range.

Definition at line 167 of file kspread_util.h.

QRect Range::range (  )  const

Returns the area on the spreadsheet occupied by this range.

Definition at line 678 of file kspread_util.cc.

bool Range::contains ( const Point cell  )  const

Returns true if this range includes the specified cell.

Definition at line 660 of file kspread_util.cc.

bool Range::intersects ( const Range r  )  const

Returns true if this range intersects Range r (ie.

there is at least one cell which is common to both Ranges )

Definition at line 665 of file kspread_util.cc.

QString Range::toString (  )  const

Returns a string representation of this range as it would appear in a formula.

ie. In the format " SheetName! [StartCell] : [EndCell] " The string representation uses $ characters to mark fixed parts of the range, eg. Sheet1!$A1:$A20

Definition at line 591 of file kspread_util.cc.

void Range::setLeftFixed ( bool  fixed  ) 

Sets whether or not the left column is fixed .

Definition at line 683 of file kspread_util.cc.

void Range::setRightFixed ( bool  fixed  ) 

Sets whether or not the right column is fixed.

Definition at line 691 of file kspread_util.cc.

void Range::setTopFixed ( bool  fixed  ) 

Sets whether or not the top row is fixed.

Definition at line 699 of file kspread_util.cc.

void Range::setBottomFixed ( bool  fixed  ) 

Sets whether or not the bottom row is fixed.

Definition at line 707 of file kspread_util.cc.

void Range::setSheet ( Sheet *  sheet  ) 

Sets the Sheet object associated with this range.

The range can only span a single sheet.

Definition at line 715 of file kspread_util.cc.

void Range::setSheetName ( QString  sheetName  ) 

Sets the name of the sheet associated with this range.

Definition at line 723 of file kspread_util.cc.

QString Range::namedArea (  )  const

Returns the named area represented by this range or an empty string otherwise.

This is the name of the area which was passed as a QString to the Range constructor

Definition at line 731 of file kspread_util.cc.

bool Range::operator== ( const Range range  )  const

Returns true if the other range occupies the same area on the same sheet as this range.

Definition at line 439 of file kspread_util.cc.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys