kspread
KSpread::Region Class Reference
The one for all class for points and ranges. More...
#include <Region.h>

Classes | |
| class | Element |
| Base class for region elements, which can be points or ranges. More... | |
| class | Point |
| A point in a region. More... | |
| class | Range |
| A range in a region. More... | |
Public Types | |
| typedef QList< Element * > ::ConstIterator | ConstIterator |
| typedef QList< Element * > ::Iterator | Iterator |
Public Member Functions | |
| Region (int col, int row, int width, int height, Sheet *sheet=0) | |
| Region (int col, int row, Sheet *sheet=0) | |
| Region (const Region ®ion) | |
| Region (const QString &expression, const Map *map=0, Sheet *sheet=0) | |
| Region (const QRect &range, Sheet *sheet=0) | |
| Region (const QPoint &point, Sheet *sheet=0) | |
| Region () | |
| virtual | ~Region () |
| Element * | add (const Region ®ion, Sheet *sheet=0) |
| Element * | add (const QRect &range, Sheet *sheet=0) |
| Element * | add (const QPoint &point, Sheet *sheet=0) |
| QRect | boundingRect () const |
| virtual void | clear () |
| QSet< int > | columnsAffected () const |
| QSet< int > | columnsSelected () const |
| ConstIterator | constBegin () const |
| ConstIterator | constEnd () const |
| bool | contains (const QPoint &point, Sheet *sheet=0) const |
| virtual Element * | eor (const QPoint &point, Sheet *sheet=0) |
| Sheet * | filterSheetName (QString &sRegion) |
| QRect | firstRange () const |
| Sheet * | firstSheet () const |
| bool | isAllSelected () const |
| bool | isColumnOrRowSelected () const |
| bool | isColumnSelected (uint col=0) const |
| bool | isContiguous () const |
| bool | isEmpty () const |
| bool | isRowSelected (uint row=0) const |
| bool | isSingular () const |
| bool | isValid () const |
| QRect | lastRange () const |
| Sheet * | lastSheet () const |
| const Map * | map () const |
| QString | name (Sheet *originSheet=0) const |
| bool | operator!= (const Region ®ion) const |
| void | operator= (const Region ®ion) |
| bool | operator== (const Region ®ion) const |
| QVector< QRect > | rects () const |
| QSet< int > | rowsAffected () const |
| QSet< int > | rowsSelected () const |
| QString | saveOdf () const |
| void | setMap (const Map *) |
| void | sub (const Region ®ion) |
| void | sub (const QRect &range, Sheet *sheet) |
| void | sub (const QPoint &point, Sheet *sheet) |
Static Public Member Functions | |
| static bool | isValid (const QRect &rect) |
| static bool | isValid (const QPoint &point) |
| static QString | loadOdf (const QString &expression) |
| static QRect | normalized (const QRect &rect) |
| static QString | saveOdf (const QString &expression) |
Protected Member Functions | |
| QList< Element * > & | cells () const |
| virtual Point * | createPoint (const Point &) const |
| virtual Point * | createPoint (const QString &) const |
| virtual Point * | createPoint (const QPoint &) const |
| virtual Range * | createRange (const Range &) const |
| virtual Range * | createRange (const QString &) const |
| virtual Range * | createRange (const QRect &) const |
| Element * | insert (int index, const QRect &range, Sheet *sheet, bool multi=true) |
| Element * | insert (int index, const QPoint &point, Sheet *sheet, bool multi=true) |
Detailed Description
The one for all class for points and ranges.
- Since:
- 1.5
Definition at line 50 of file Region.h.
Member Typedef Documentation
| typedef QList<Element*>::ConstIterator KSpread::Region::ConstIterator |
| typedef QList<Element*>::Iterator KSpread::Region::Iterator |
Constructor & Destructor Documentation
| KSpread::Region::Region | ( | ) |
Constructor.
Creates a region consisting of a point.
- Parameters:
-
point the point's location sheet the sheet the point belongs to
Definition at line 154 of file Region.cpp.
Constructor.
Creates a region consisting of a range.
- Parameters:
-
range the range's location sheet the sheet the range belongs to
Definition at line 141 of file Region.cpp.
| KSpread::Region::Region | ( | const QString & | expression, | |
| const Map * | map = 0, |
|||
| Sheet * | sheet = 0 | |||
| ) | [explicit] |
Constructor.
Creates a region consisting of the region defined in expression .
- Parameters:
-
expression a string representing the region (e.g. "A1:B3") map used to determine the sheet, if it's named in the string sheet the fallback sheet, if expressiondoes not contain one
Definition at line 60 of file Region.cpp.
| KSpread::Region::Region | ( | const Region & | region | ) |
Copy Constructor.
Creates a copy of the region.
- Parameters:
-
region the region to copy
Definition at line 167 of file Region.cpp.
| KSpread::Region::Region | ( | int | col, | |
| int | row, | |||
| Sheet * | sheet = 0 | |||
| ) |
Constructor.
Creates a region consisting of a point.
- Parameters:
-
col the column of the point row the row of the point sheet the sheet the point belongs to
Definition at line 189 of file Region.cpp.
| KSpread::Region::Region | ( | int | col, | |
| int | row, | |||
| int | width, | |||
| int | height, | |||
| Sheet * | sheet = 0 | |||
| ) |
Constructor.
Creates a region consisting of a range at the location
- Parameters:
-
col the column of the range' starting point row the row of the range' starting point width the width of the range height the height of the range sheet the sheet the range belongs to
Definition at line 202 of file Region.cpp.
| KSpread::Region::~Region | ( | ) | [virtual] |
Destructor.
Definition at line 216 of file Region.cpp.
Member Function Documentation
| Region::Element * KSpread::Region::add | ( | const Region & | region, | |
| Sheet * | sheet = 0 | |||
| ) |
Adds the region region to this region.
- Parameters:
-
region the region to be added sheet the fallback sheet used, if an element has no sheet set
Definition at line 306 of file Region.cpp.
| Region::Element * KSpread::Region::add | ( | const QRect & | range, | |
| Sheet * | sheet = 0 | |||
| ) |
Adds the range range to this region.
- Parameters:
-
range the range's location sheet the sheet the range belongs to
Definition at line 292 of file Region.cpp.
| Region::Element * KSpread::Region::add | ( | const QPoint & | point, | |
| Sheet * | sheet = 0 | |||
| ) |
Adds the point point to this region.
- Parameters:
-
point the point's location sheet the sheet the point belongs to
Definition at line 283 of file Region.cpp.
| QRect KSpread::Region::boundingRect | ( | ) | const |
Definition at line 736 of file Region.cpp.
| QList< Region::Element * > & KSpread::Region::cells | ( | ) | const [protected] |
- Returns:
- the list of elements
Definition at line 966 of file Region.cpp.
| void KSpread::Region::clear | ( | ) | [virtual] |
Deletes all elements of the region.
The result is an empty region.
Reimplemented in KSpread::Selection.
Definition at line 700 of file Region.cpp.
| QSet< int > KSpread::Region::columnsAffected | ( | ) | const |
- Returns:
- a set of column numbers, for those columns, that have at least one cell selected
Definition at line 585 of file Region.cpp.
| QSet< int > KSpread::Region::columnsSelected | ( | ) | const |
- Returns:
- a set of column numbers, for those columns, that are selected
Definition at line 547 of file Region.cpp.
| Region::ConstIterator KSpread::Region::constBegin | ( | ) | const |
Definition at line 782 of file Region.cpp.
| Region::ConstIterator KSpread::Region::constEnd | ( | ) | const |
Definition at line 787 of file Region.cpp.
- Parameters:
-
point the point's location sheet the sheet the point belongs to
- Returns:
true, if the region contains the pointpoint
Definition at line 673 of file Region.cpp.
| Region::Point * KSpread::Region::createPoint | ( | const Point & | point | ) | const [protected, virtual] |
For internal use only.
used to create derived Points
Reimplemented in KSpread::Selection.
Definition at line 1038 of file Region.cpp.
| Region::Point * KSpread::Region::createPoint | ( | const QString & | string | ) | const [protected, virtual] |
For internal use only.
used to create derived Points
Reimplemented in KSpread::Selection.
Definition at line 1033 of file Region.cpp.
| Region::Point * KSpread::Region::createPoint | ( | const QPoint & | point | ) | const [protected, virtual] |
For internal use only.
used to create derived Points
Reimplemented in KSpread::Selection.
Definition at line 1028 of file Region.cpp.
| Region::Range * KSpread::Region::createRange | ( | const Range & | range | ) | const [protected, virtual] |
For internal use only.
used to create derived Ranges
Reimplemented in KSpread::Selection.
Definition at line 1053 of file Region.cpp.
| Region::Range * KSpread::Region::createRange | ( | const QString & | string | ) | const [protected, virtual] |
For internal use only.
used to create derived Ranges
Reimplemented in KSpread::Selection.
Definition at line 1048 of file Region.cpp.
| Region::Range * KSpread::Region::createRange | ( | const QRect & | rect | ) | const [protected, virtual] |
For internal use only.
used to create derived Ranges
Reimplemented in KSpread::Selection.
Definition at line 1043 of file Region.cpp.
| Region::Element * KSpread::Region::eor | ( | const QPoint & | point, | |
| Sheet * | sheet = 0 | |||
| ) | [virtual] |
- Parameters:
-
point the point's location sheet the sheet the point belongs to
Reimplemented in KSpread::Selection.
Definition at line 375 of file Region.cpp.
- Parameters:
-
sRegion will be modified, if a valid sheet was found. The sheetname will be removed
- Returns:
- sheet named in the
sRegionor null
Definition at line 1010 of file Region.cpp.
| QRect KSpread::Region::firstRange | ( | ) | const |
Definition at line 708 of file Region.cpp.
| Sheet * KSpread::Region::firstSheet | ( | ) | const |
Definition at line 722 of file Region.cpp.
| Region::Element * KSpread::Region::insert | ( | int | index, | |
| const QRect & | range, | |||
| Sheet * | sheet, | |||
| bool | multi = true | |||
| ) | [protected] |
- Parameters:
-
index the index of the element in whose front the new range is inserted range the location of the range to be inserted sheet the sheet the range belongs to multi trueto allow multiple occurrences of a range
- Returns:
- the added range, a null pointer, if
rangeis not valid or the element containingrange
Definition at line 498 of file Region.cpp.
| Region::Element * KSpread::Region::insert | ( | int | index, | |
| const QPoint & | point, | |||
| Sheet * | sheet, | |||
| bool | multi = true | |||
| ) | [protected] |
- Parameters:
-
index the index of the element in whose front the new point is inserted point the location of the point to be inserted sheet the sheet the point belongs to multi trueto allow multiple occurrences of a point
- Returns:
- the added point, a null pointer, if
pointis not valid or the element containingpoint
Definition at line 439 of file Region.cpp.
| bool KSpread::Region::isAllSelected | ( | ) | const |
- Returns:
true, if all cells in the sheet are selected
Definition at line 665 of file Region.cpp.
| bool KSpread::Region::isColumnOrRowSelected | ( | ) | const |
- Returns:
true, if at least one column or one row is selected
Definition at line 649 of file Region.cpp.
| bool KSpread::Region::isColumnSelected | ( | uint | col = 0 |
) | const |
- Parameters:
-
col The column to check
- Returns:
True, if the columncolis selected. If columncolis not given, it returns true, if at least one column is selected
- Note:
- If you want to check more than one column for selection, use columnsSelected(). It returns a set of all selected columns at once.
Definition at line 617 of file Region.cpp.
| bool KSpread::Region::isContiguous | ( | ) | const |
- Returns:
true, if this region is contiguous
Definition at line 262 of file Region.cpp.
| bool KSpread::Region::isEmpty | ( | ) | const |
- Returns:
true, if this region contains no elements
Definition at line 695 of file Region.cpp.
| bool KSpread::Region::isRowSelected | ( | uint | row = 0 |
) | const |
- Parameters:
-
row the row to check
- Returns:
true, if the rowrowis selected. If rowrowis not given, it returns true, if at least one row is selected
- Note:
- If you want to check more than one row for selection, use rowsSelected(). It returns a set of all selected rows at once.
Definition at line 633 of file Region.cpp.
| bool KSpread::Region::isSingular | ( | ) | const |
- Returns:
true, if this region contains only a single point
Reimplemented in KSpread::Selection.
Definition at line 253 of file Region.cpp.
| bool KSpread::Region::isValid | ( | const QRect & | rect | ) | [static] |
Definition at line 801 of file Region.cpp.
| bool KSpread::Region::isValid | ( | const QPoint & | point | ) | [static] |
Definition at line 792 of file Region.cpp.
| bool KSpread::Region::isValid | ( | ) | const |
- Returns:
true, if this region contains at least one valid point or one valid range
Definition at line 240 of file Region.cpp.
| QRect KSpread::Region::lastRange | ( | ) | const |
Definition at line 715 of file Region.cpp.
| Sheet * KSpread::Region::lastSheet | ( | ) | const |
Definition at line 729 of file Region.cpp.
Definition at line 811 of file Region.cpp.
| const Map * KSpread::Region::map | ( | ) | const |
- Returns:
- the map to which this region belongs.
Definition at line 229 of file Region.cpp.
- Parameters:
-
originSheet The name is created relative to this sheet.
- Returns:
- the name of the region (e.g. "A1:A2")
Reimplemented in KSpread::Selection.
Definition at line 271 of file Region.cpp.
Definition at line 766 of file Region.cpp.
| bool KSpread::Region::operator!= | ( | const Region & | region | ) | const [inline] |
| void KSpread::Region::operator= | ( | const Region & | region | ) |
- Parameters:
-
region the region to copy
Definition at line 989 of file Region.cpp.
| bool KSpread::Region::operator== | ( | const Region & | region | ) | const |
- Parameters:
-
region the region to compare
- Returns:
true, if this region equals regionregion
Definition at line 971 of file Region.cpp.
- Returns:
- a QRegion that unifies all contained ranges
Definition at line 221 of file Region.cpp.
| QSet< int > KSpread::Region::rowsAffected | ( | ) | const |
- Returns:
- a set of row numbers, for those rows, that have at least one cell selected
Definition at line 601 of file Region.cpp.
| QSet< int > KSpread::Region::rowsSelected | ( | ) | const |
- Returns:
- a set of row numbers, for those rows, that are selected
Definition at line 566 of file Region.cpp.
| QString KSpread::Region::saveOdf | ( | ) | const |
Definition at line 961 of file Region.cpp.
Definition at line 883 of file Region.cpp.
| void KSpread::Region::setMap | ( | const Map * | map | ) |
Sets the map to which this region belongs.
Definition at line 235 of file Region.cpp.
| void KSpread::Region::sub | ( | const Region & | region | ) |
Substracts the region region from this region.
- Parameters:
-
region the region to subtract
Definition at line 357 of file Region.cpp.
Substracts the range range from this region.
- Parameters:
-
range the range's location sheet the sheet the range belongs to
Definition at line 336 of file Region.cpp.
Substracts the point point from this region.
- Parameters:
-
point the point's location sheet the sheet the point belongs to
Definition at line 316 of file Region.cpp.
The documentation for this class was generated from the following files:
