okteta
KHEUI::KDataCursor Class Reference
#include <kdatacursor.h>
Detailed Description
navigates through the buffer in an abstract way, based on the layoutThe cursor is allowed to access every coord that has content as described in the layout. It holds the coord of the actual position and the according index in the data array.
To enable the cursor to be placed behind the last position in a line (e.g, to mark all data in the line without placing the cursor to the beginning of the next line) there is a flag mBehind that should be read as that the real index the cursor is at is the current one + 1 (as returned by realIndex())
For appending new data to the buffer there is also the need to be able to place the cursor at a position behind the last byte. This can be enabled by calling setAppendPosEnabled(true). If the cursor is placed to this position it gets the (real) index of the last byte + 1. As this index does not point to an existing byte validIndex() returns -1. Check for atAppendPos() to see whether cursor is at this position.
If the buffer is empty there is no navigation possible, of course. The cursor will be placed to coord 0/0 with index 1, mBehind=false.
Definition at line 63 of file kdatacursor.h.
Public Member Functions | |
| void | adaptToChanges (const KHE::ArrayChangeMetricsList &changeList, int oldLength) |
| bool | appendPosEnabled () const |
| bool | atAppendPos () const |
| bool | atEnd () const |
| bool | atLineEnd () const |
| bool | atLineStart () const |
| bool | atStart () const |
| Coord | coord () const |
| void | gotoCCoord (const Coord &C) |
| void | gotoCIndex (int I) |
| void | gotoCoord (const Coord &C) |
| void | gotoDown () |
| void | gotoEnd () |
| void | gotoIndex (int I) |
| void | gotoLineEnd () |
| void | gotoLineStart () |
| void | gotoNextByte (int D) |
| void | gotoNextByte () |
| void | gotoNextByteInLine () |
| void | gotoPageDown () |
| void | gotoPageUp () |
| void | gotoPreviousByte (int D) |
| void | gotoPreviousByte () |
| void | gotoRealIndex () |
| void | gotoStart () |
| void | gotoUp () |
| int | index () const |
| int | indexAtLineEnd () const |
| int | indexAtLineStart () const |
| bool | isBehind () const |
| KDataCursor (const ByteArrayTableLayout *layout) | |
| int | line () const |
| bool | operator!= (const KDataCursor &other) const |
| bool | operator== (const KDataCursor &other) const |
| int | pos () const |
| int | realIndex () const |
| void | setAppendPosEnabled (bool appendPosEnabled=true) |
| void | stepBehind () |
| void | updateCoord () |
| int | validIndex () const |
| ~KDataCursor () | |
Protected Member Functions | |
| void | stepToEnd () |
Constructor & Destructor Documentation
| KHEUI::KDataCursor::KDataCursor | ( | const ByteArrayTableLayout * | layout | ) | [explicit] |
Definition at line 34 of file kdatacursor.cpp.
| KHEUI::KDataCursor::~KDataCursor | ( | ) |
Definition at line 426 of file kdatacursor.cpp.
Member Function Documentation
| void KHEUI::KDataCursor::adaptToChanges | ( | const KHE::ArrayChangeMetricsList & | changeList, | |
| int | oldLength | |||
| ) |
Definition at line 365 of file kdatacursor.cpp.
| bool KHEUI::KDataCursor::appendPosEnabled | ( | ) | const |
| bool KHEUI::KDataCursor::atAppendPos | ( | ) | const |
could only be true in InsertMode: Cursor is behind the last byte
Definition at line 358 of file kdatacursor.cpp.
| bool KHEUI::KDataCursor::atEnd | ( | ) | const |
Definition at line 357 of file kdatacursor.cpp.
| bool KHEUI::KDataCursor::atLineEnd | ( | ) | const |
Definition at line 362 of file kdatacursor.cpp.
| bool KHEUI::KDataCursor::atLineStart | ( | ) | const |
Definition at line 361 of file kdatacursor.cpp.
| bool KHEUI::KDataCursor::atStart | ( | ) | const |
Definition at line 356 of file kdatacursor.cpp.
| Coord KHEUI::KDataCursor::coord | ( | ) | const [inline] |
| void KHEUI::KDataCursor::gotoCCoord | ( | const Coord & | C | ) |
Definition at line 254 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoCIndex | ( | int | I | ) |
Definition at line 241 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoCoord | ( | const Coord & | C | ) |
Definition at line 302 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoDown | ( | ) |
Definition at line 182 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoEnd | ( | ) |
Definition at line 226 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoIndex | ( | int | I | ) |
Definition at line 283 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoLineEnd | ( | ) |
Definition at line 205 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoLineStart | ( | ) |
Definition at line 196 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoNextByte | ( | int | D | ) |
Definition at line 122 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoNextByte | ( | ) |
Definition at line 107 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoNextByteInLine | ( | ) |
Definition at line 138 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoPageDown | ( | ) |
Definition at line 337 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoPageUp | ( | ) |
Definition at line 317 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoPreviousByte | ( | int | D | ) |
Definition at line 88 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoPreviousByte | ( | ) |
Definition at line 76 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoRealIndex | ( | ) |
Definition at line 291 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoStart | ( | ) |
Definition at line 218 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::gotoUp | ( | ) |
Definition at line 156 of file kdatacursor.cpp.
| int KHEUI::KDataCursor::index | ( | ) | const [inline] |
| int KHEUI::KDataCursor::indexAtLineEnd | ( | ) | const |
| int KHEUI::KDataCursor::indexAtLineStart | ( | ) | const |
| bool KHEUI::KDataCursor::isBehind | ( | ) | const [inline] |
true if the cursor is located to the right of the actual coord but still shown at the coord
Definition at line 172 of file kdatacursor.h.
| int KHEUI::KDataCursor::line | ( | ) | const [inline] |
| bool KHEUI::KDataCursor::operator!= | ( | const KDataCursor & | other | ) | const [inline] |
Definition at line 72 of file kdatacursor.h.
| bool KHEUI::KDataCursor::operator== | ( | const KDataCursor & | other | ) | const |
Definition at line 44 of file kdatacursor.cpp.
| int KHEUI::KDataCursor::pos | ( | ) | const [inline] |
| int KHEUI::KDataCursor::realIndex | ( | ) | const [inline] |
returns the real index.
That is if the cursor is tagged as "behind" the current index it's real index is the next one. Attention: this could be outside the data's range if the cursor is behind the last byte!
Definition at line 173 of file kdatacursor.h.
| void KHEUI::KDataCursor::setAppendPosEnabled | ( | bool | appendPosEnabled = true |
) |
Definition at line 50 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::stepBehind | ( | ) | [inline] |
puts the cursor behind the actual position if it isn't already
Definition at line 175 of file kdatacursor.h.
| void KHEUI::KDataCursor::stepToEnd | ( | ) | [protected] |
if newpos allowed steps at a coord behind the last existing or, if that is at a line end, behind the line does not check for empty content!
Definition at line 270 of file kdatacursor.cpp.
| void KHEUI::KDataCursor::updateCoord | ( | ) |
Definition at line 310 of file kdatacursor.cpp.
| int KHEUI::KDataCursor::validIndex | ( | ) | const |
returns the true index if it is valid index that is it is inside the data's range.
Otherwise -1 is returned
Definition at line 351 of file kdatacursor.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference