kspread
KSpread::Selection Class Reference
Manages the selection of cells. More...
#include <Selection.h>

Classes | |
| class | Point |
| This Point is extended by an color attribute. More... | |
| class | Range |
| This Range is extended by an color attribute. More... | |
Public Types | |
| enum | Editor { EmbeddedEditor, ExternalEditor } |
| enum | Mode { SingleCell = 0, MultipleCells = 1 } |
Signals | |
| void | aboutToModify (const Region ®ion) |
| void | activeSheetChanged (Sheet *sheet) |
| void | changed (const Region ®ion) |
| void | closeEditor (bool saveChanges, bool expandMatrix) |
| void | documentReadWriteToggled (bool readWrite) |
| void | modified (const Region ®ion) |
| void | refreshSheetViews () |
| void | requestFocusEditor () |
| void | sheetProtectionToggled (bool protect) |
| void | visibleSheetRequested (Sheet *sheet) |
Public Member Functions | |
| Selection (const Selection &selection) | |
| Selection (KoCanvasBase *canvasBase) | |
| virtual | ~Selection () |
| Element * | activeElement () const |
| Sheet * | activeSheet () const |
| QString | activeSubRegionName () const |
| const QPoint & | anchor () const |
| KoCanvasBase * | canvas () const |
| virtual void | clear () |
| void | clearSubRegion () |
| const QList< QColor > & | colors () const |
| const QPoint & | cursor () const |
| void | emitAboutToModify () |
| void | emitCloseEditor (bool saveChanges, bool expandMatrix=false) |
| void | emitModified () |
| void | emitRefreshSheetViews () |
| void | emitRequestFocusEditor () |
| void | emitVisibleSheetRequested (Sheet *sheet) |
| void | endReferenceSelection () |
| virtual Element * | eor (const QPoint &point, Sheet *sheet=0) |
| void | extend (const Region ®ion) |
| void | extend (const QRect &range, Sheet *sheet=0) |
| void | extend (const QPoint &point, Sheet *sheet=0) |
| QRect | extendToMergedAreas (const QRect &area) const |
| void | fixSubRegionDimension () |
| void | initialize (const Region ®ion, Sheet *sheet=0) |
| void | initialize (const QRect &range, Sheet *sheet=0) |
| void | initialize (const QPoint &point, Sheet *sheet=0) |
| bool | isSingular () const |
| Editor | lastEditorWithFocus () const |
| const QPoint & | marker () const |
| QString | name (Sheet *originSheet=0) const |
| Sheet * | originSheet () const |
| bool | referenceSelection () const |
| bool | referenceSelectionMode () const |
| void | selectAll () |
| QRectF | selectionHandleArea (const KoViewConverter *viewConverter) const |
| void | setActiveElement (int number) |
| void | setActiveElement (const QPoint &point, CellEditor *cellEditor) |
| void | setActiveSheet (Sheet *sheet) |
| void | setActiveSubRegion (uint start, uint length) |
| void | setLastEditorWithFocus (Editor type) |
| void | setOriginSheet (Sheet *sheet) |
| void | setReferenceSelectionMode (bool enable) |
| void | setSelectionMode (Mode mode) |
| void | startReferenceSelection (const Region ®ion=Region()) |
| void | update (const QPoint &point) |
| void | update () |
Protected Member Functions | |
| virtual Region::Point * | createPoint (const Region::Point &) const |
| virtual Region::Point * | createPoint (const QString &) const |
| virtual Region::Point * | createPoint (const QPoint &) const |
| virtual Region::Range * | createRange (const Region::Range &) const |
| virtual Region::Range * | createRange (const QString &) const |
| virtual Region::Range * | createRange (const QRect &) const |
| void | dump () const |
| void | emitChanged (const Region &changedRegion) |
Detailed Description
Manages the selection of cells.
Represents cell selections for general operations and for cell references used in formulaes.
Definition at line 49 of file Selection.h.
Member Enumeration Documentation
The editor type.
- Enumerator:
EmbeddedEditor the embedded editor appearing in a cell
ExternalEditor the external editor located in the tool options
Definition at line 67 of file Selection.h.
The selection mode.
Definition at line 58 of file Selection.h.
Constructor & Destructor Documentation
| Selection::Selection | ( | KoCanvasBase * | canvasBase | ) | [explicit] |
Constructor.
Creates a new selection with (1,1) as initial location.
- Parameters:
-
canvasBase the canvas interface
Definition at line 101 of file Selection.cpp.
| Selection::Selection | ( | const Selection & | selection | ) |
Copy Constructor.
Creates a copy of selection
- Parameters:
-
selection the Selection to copy
Definition at line 111 of file Selection.cpp.
| Selection::~Selection | ( | ) | [virtual] |
Destructor.
Definition at line 123 of file Selection.cpp.
Member Function Documentation
| void KSpread::Selection::aboutToModify | ( | const Region & | region | ) | [signal] |
An operation on the selection is about to happen.
| KSpread::Region::Element * Selection::activeElement | ( | ) | const |
- Returns:
- the active element
Definition at line 799 of file Selection.cpp.
| Sheet * Selection::activeSheet | ( | ) | const |
- Returns:
- the selection's active sheet
Definition at line 749 of file Selection.cpp.
| void KSpread::Selection::activeSheetChanged | ( | Sheet * | sheet | ) | [signal] |
| QString Selection::activeSubRegionName | ( | ) | const |
Definition at line 852 of file Selection.cpp.
| const QPoint & Selection::anchor | ( | ) | const |
The anchor is the starting point of a range.
For points marker and anchor are the same
Definition at line 677 of file Selection.cpp.
| KoCanvasBase * Selection::canvas | ( | ) | const |
- Returns:
- the canvas this selection works for.
Definition at line 128 of file Selection.cpp.
| void KSpread::Selection::changed | ( | const Region & | region | ) | [signal] |
| void Selection::clear | ( | ) | [virtual] |
Deletes all elements of the region.
The result is an empty region.
Reimplemented from KSpread::Region.
Definition at line 804 of file Selection.cpp.
| void Selection::clearSubRegion | ( | ) |
Clears the elements of the subregion.
Definition at line 812 of file Selection.cpp.
| void KSpread::Selection::closeEditor | ( | bool | saveChanges, | |
| bool | expandMatrix | |||
| ) | [signal] |
Definition at line 868 of file Selection.cpp.
| KSpread::Region::Point * Selection::createPoint | ( | const Region::Point & | point | ) | const [protected, virtual] |
For internal use only.
used to create derived Points
Reimplemented from KSpread::Region.
Definition at line 1055 of file Selection.cpp.
| KSpread::Region::Point * Selection::createPoint | ( | const QString & | string | ) | const [protected, virtual] |
For internal use only.
used to create derived Points
Reimplemented from KSpread::Region.
Definition at line 1050 of file Selection.cpp.
| KSpread::Region::Point * Selection::createPoint | ( | const QPoint & | point | ) | const [protected, virtual] |
For internal use only.
used to create derived Points
Reimplemented from KSpread::Region.
Definition at line 1045 of file Selection.cpp.
| KSpread::Region::Range * Selection::createRange | ( | const Region::Range & | range | ) | const [protected, virtual] |
For internal use only.
used to create derived Ranges
Reimplemented from KSpread::Region.
Definition at line 1070 of file Selection.cpp.
| KSpread::Region::Range * Selection::createRange | ( | const QString & | string | ) | const [protected, virtual] |
For internal use only.
used to create derived Ranges
Reimplemented from KSpread::Region.
Definition at line 1065 of file Selection.cpp.
| KSpread::Region::Range * Selection::createRange | ( | const QRect & | rect | ) | const [protected, virtual] |
For internal use only.
used to create derived Ranges
Reimplemented from KSpread::Region.
Definition at line 1060 of file Selection.cpp.
| const QPoint & Selection::cursor | ( | ) | const |
The cursor represents the cursor position.
This is needed for merged cells
Definition at line 682 of file Selection.cpp.
| void KSpread::Selection::documentReadWriteToggled | ( | bool | readWrite | ) | [signal] |
| void Selection::dump | ( | ) | const [protected] |
| void Selection::emitAboutToModify | ( | ) |
Definition at line 961 of file Selection.cpp.
| void Selection::emitChanged | ( | const Region & | changedRegion | ) | [protected] |
Dilates the region and emits the changed() signal.
For internal use only.
Definition at line 1075 of file Selection.cpp.
| void Selection::emitCloseEditor | ( | bool | saveChanges, | |
| bool | expandMatrix = false | |||
| ) |
Definition at line 981 of file Selection.cpp.
| void Selection::emitModified | ( | ) |
Definition at line 966 of file Selection.cpp.
| void Selection::emitRefreshSheetViews | ( | ) |
Definition at line 971 of file Selection.cpp.
| void Selection::emitRequestFocusEditor | ( | ) |
Definition at line 986 of file Selection.cpp.
| void Selection::emitVisibleSheetRequested | ( | Sheet * | sheet | ) |
Definition at line 976 of file Selection.cpp.
| void Selection::endReferenceSelection | ( | ) |
End using reference selection.
Definition at line 921 of file Selection.cpp.
| Selection::Element * Selection::eor | ( | const QPoint & | point, | |
| Sheet * | sheet = 0 | |||
| ) | [virtual] |
- Parameters:
-
point the point's location sheet the sheet the point belongs to
Reimplemented from KSpread::Region.
Definition at line 668 of file Selection.cpp.
| void Selection::extend | ( | const Region & | region | ) |
Extends the current selection with the Region region.
- Parameters:
-
region the region's locations
Definition at line 641 of file Selection.cpp.
Extends the current selection with the Range range.
- Parameters:
-
range the range's location sheet the sheet the range belongs to
Definition at line 563 of file Selection.cpp.
Extends the current selection with the Point point.
- Parameters:
-
point the point's location sheet the sheet the point belongs to
Definition at line 499 of file Selection.cpp.
Extends area to include the merged cells, that are not fully covered, completely.
- Returns:
- the extended area
Definition at line 991 of file Selection.cpp.
| void Selection::fixSubRegionDimension | ( | ) |
fix subregion dimensions
Definition at line 826 of file Selection.cpp.
Sets the selection to region.
- Parameters:
-
region the region's locations sheet the sheet the region belongs to
Definition at line 285 of file Selection.cpp.
Sets the selection to range.
- Parameters:
-
range the range's location sheet the sheet the range belongs to
Definition at line 202 of file Selection.cpp.
Sets the selection to point.
- Parameters:
-
point the point's location sheet the sheet the point belongs to
Definition at line 133 of file Selection.cpp.
| bool Selection::isSingular | ( | ) | const |
Checks whether the region consists only of one point.
Reimplemented from KSpread::Region.
Definition at line 692 of file Selection.cpp.
| Selection::Editor Selection::lastEditorWithFocus | ( | ) | const |
Definition at line 890 of file Selection.cpp.
| const QPoint & Selection::marker | ( | ) | const |
The marker is the end point of a range.
For points marker and anchor are the same
Definition at line 687 of file Selection.cpp.
| void KSpread::Selection::modified | ( | const Region & | region | ) | [signal] |
Emitted when the content was modified.
- Returns:
- the name of the region (e.g. "A1:A2")
Reimplemented from KSpread::Region.
Definition at line 735 of file Selection.cpp.
| Sheet * Selection::originSheet | ( | ) | const |
- Returns:
- the selection's origin sheet
Definition at line 759 of file Selection.cpp.
| bool Selection::referenceSelection | ( | ) | const |
Are we currently using a reference selection ?
Definition at line 956 of file Selection.cpp.
| bool Selection::referenceSelectionMode | ( | ) | const |
Are we in reference choosing mode ?
Definition at line 951 of file Selection.cpp.
| void KSpread::Selection::refreshSheetViews | ( | ) | [signal] |
| void KSpread::Selection::requestFocusEditor | ( | ) | [signal] |
| void Selection::selectAll | ( | ) |
Definition at line 873 of file Selection.cpp.
| QRectF Selection::selectionHandleArea | ( | const KoViewConverter * | viewConverter | ) | const |
- Returns:
- the area that the 'handle' of the selection is located in painting coordinates
Definition at line 697 of file Selection.cpp.
| void Selection::setActiveElement | ( | int | number | ) |
Sets the number 'th element as active.
Definition at line 783 of file Selection.cpp.
| void Selection::setActiveElement | ( | const QPoint & | point, | |
| CellEditor * | cellEditor | |||
| ) |
Sets the element, which has point as anchor, as active.
Definition at line 764 of file Selection.cpp.
| void Selection::setActiveSheet | ( | Sheet * | sheet | ) |
Sets the selection's active sheet.
For usual selections this is always the origin sheet, but for cell choices used for formulaes it may differ.
- Parameters:
-
sheet the sheet which is currently active
Definition at line 740 of file Selection.cpp.
| void Selection::setActiveSubRegion | ( | uint | start, | |
| uint | length | |||
| ) |
Sets the starting position and the length of a subregion in a selection which allows multiple occurrences of elements.
Definition at line 843 of file Selection.cpp.
| void Selection::setLastEditorWithFocus | ( | Editor | type | ) |
Definition at line 885 of file Selection.cpp.
| void Selection::setOriginSheet | ( | Sheet * | sheet | ) |
Sets the selection's origin sheet.
- Parameters:
-
sheet the sheet from which the selection starts
Definition at line 754 of file Selection.cpp.
| void Selection::setReferenceSelectionMode | ( | bool | enable | ) |
Enable/disable reference choosing mode.
Definition at line 944 of file Selection.cpp.
| void Selection::setSelectionMode | ( | Mode | mode | ) |
- Parameters:
-
mode single cell or multiple cell selection
Definition at line 863 of file Selection.cpp.
| void KSpread::Selection::sheetProtectionToggled | ( | bool | protect | ) | [signal] |
Start using a reference selection instead of normal one.
Definition at line 895 of file Selection.cpp.
| void Selection::update | ( | const QPoint & | point | ) |
Update the marker of the selection to point .
Uses the anchor as starting point point the new marker location
Definition at line 367 of file Selection.cpp.
| void Selection::update | ( | ) |
Emits signal changed(const Region&).
Definition at line 362 of file Selection.cpp.
| void KSpread::Selection::visibleSheetRequested | ( | Sheet * | sheet | ) | [signal] |
The documentation for this class was generated from the following files:
