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 |
| Region | intersected (const Region ®ion) |
| 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 137 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 125 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 59 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 149 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 167 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 179 of file Region.cpp.
| KSpread::Region::~Region | ( | ) | [virtual] |
Destructor.
Definition at line 192 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 273 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 261 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 256 of file Region.cpp.
| QRect KSpread::Region::boundingRect | ( | ) | const |
Definition at line 674 of file Region.cpp.
| QList< Region::Element * > & KSpread::Region::cells | ( | ) | const [protected] |
- Returns:
- the list of elements
Definition at line 875 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 639 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 538 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 506 of file Region.cpp.
| Region::ConstIterator KSpread::Region::constBegin | ( | ) | const |
Definition at line 719 of file Region.cpp.
| Region::ConstIterator KSpread::Region::constEnd | ( | ) | const |
Definition at line 724 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 616 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 943 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 938 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 933 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 958 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 953 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 948 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 355 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 914 of file Region.cpp.
| QRect KSpread::Region::firstRange | ( | ) | const |
Definition at line 646 of file Region.cpp.
| Sheet * KSpread::Region::firstSheet | ( | ) | const |
Definition at line 660 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 465 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 412 of file Region.cpp.
Intersects the region region and this region and returns the result of the intersection as a new Region.
Definition at line 331 of file Region.cpp.
| bool KSpread::Region::isAllSelected | ( | ) | const |
- Returns:
true, if all cells in the sheet are selected
Definition at line 608 of file Region.cpp.
| bool KSpread::Region::isColumnOrRowSelected | ( | ) | const |
- Returns:
true, if at least one column or one row is selected
Definition at line 594 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 566 of file Region.cpp.
| bool KSpread::Region::isContiguous | ( | ) | const |
- Returns:
true, if this region is contiguous
Definition at line 237 of file Region.cpp.
| bool KSpread::Region::isEmpty | ( | ) | const |
- Returns:
true, if this region contains no elements
Definition at line 634 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 580 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 229 of file Region.cpp.
| bool KSpread::Region::isValid | ( | const QRect & | rect | ) | [static] |
Definition at line 738 of file Region.cpp.
| bool KSpread::Region::isValid | ( | const QPoint & | point | ) | [static] |
Definition at line 729 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 217 of file Region.cpp.
| QRect KSpread::Region::lastRange | ( | ) | const |
Definition at line 653 of file Region.cpp.
| Sheet * KSpread::Region::lastSheet | ( | ) | const |
Definition at line 667 of file Region.cpp.
Definition at line 748 of file Region.cpp.
| const Map * KSpread::Region::map | ( | ) | const |
- Returns:
- the map to which this region belongs.
Definition at line 206 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 245 of file Region.cpp.
Definition at line 699 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 897 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 880 of file Region.cpp.
- Returns:
- a QRegion that unifies all contained ranges
Definition at line 197 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 552 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 522 of file Region.cpp.
| QString KSpread::Region::saveOdf | ( | ) | const |
Definition at line 870 of file Region.cpp.
Definition at line 806 of file Region.cpp.
| void KSpread::Region::setMap | ( | const Map * | map | ) |
Sets the map to which this region belongs.
Definition at line 212 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 317 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 299 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 282 of file Region.cpp.
The documentation for this class was generated from the following files:
