okteta
KHEUI::ByteArrayTableCursor Class Reference
navigates through the buffer in an abstract way, based on the layout More...
#include <bytearraytablecursor.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 |
| ByteArrayTableCursor (const ByteArrayTableLayout *layout) | |
| Coord | coord () const |
| void | gotoCCoord (const Coord &coord) |
| void | gotoCIndex (int index) |
| void | gotoCoord (const Coord &coord) |
| void | gotoDown () |
| void | gotoEnd () |
| void | gotoIndex (int index) |
| void | gotoLineEnd () |
| void | gotoLineStart () |
| void | gotoNextByte (int indexSteps) |
| void | gotoNextByte () |
| void | gotoPageDown () |
| void | gotoPageUp () |
| void | gotoPreviousByte (int indexSteps) |
| void | gotoPreviousByte () |
| void | gotoRealIndex () |
| void | gotoStart () |
| void | gotoUp () |
| int | index () const |
| int | indexAtLineEnd () const |
| int | indexAtLineStart () const |
| bool | isBehind () const |
| int | line () const |
| int | pos () const |
| int | realIndex () const |
| void | setAppendPosEnabled (bool appendPosEnabled=true) |
| void | stepBehind () |
| void | updateCoord () |
| int | validIndex () const |
| ~ByteArrayTableCursor () | |
Protected Member Functions | |
| void | stepToEnd () |
Detailed Description
navigates through the buffer in an abstract way, based on the layout
The 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 bytearraytablecursor.h.
Constructor & Destructor Documentation
| KHEUI::ByteArrayTableCursor::ByteArrayTableCursor | ( | const ByteArrayTableLayout * | layout | ) | [explicit] |
Definition at line 34 of file bytearraytablecursor.cpp.
| KHEUI::ByteArrayTableCursor::~ByteArrayTableCursor | ( | ) |
Definition at line 405 of file bytearraytablecursor.cpp.
Member Function Documentation
| void KHEUI::ByteArrayTableCursor::adaptToChanges | ( | const KHE::ArrayChangeMetricsList & | changeList, | |
| int | oldLength | |||
| ) |
Definition at line 345 of file bytearraytablecursor.cpp.
| bool KHEUI::ByteArrayTableCursor::appendPosEnabled | ( | ) | const [inline] |
Default is false.
Definition at line 179 of file bytearraytablecursor.h.
| bool KHEUI::ByteArrayTableCursor::atAppendPos | ( | ) | const |
could only be true in InsertMode: Cursor is behind the last byte
Definition at line 338 of file bytearraytablecursor.cpp.
| bool KHEUI::ByteArrayTableCursor::atEnd | ( | ) | const |
Definition at line 337 of file bytearraytablecursor.cpp.
| bool KHEUI::ByteArrayTableCursor::atLineEnd | ( | ) | const |
Definition at line 342 of file bytearraytablecursor.cpp.
| bool KHEUI::ByteArrayTableCursor::atLineStart | ( | ) | const |
Definition at line 341 of file bytearraytablecursor.cpp.
| bool KHEUI::ByteArrayTableCursor::atStart | ( | ) | const |
Definition at line 336 of file bytearraytablecursor.cpp.
| Coord KHEUI::ByteArrayTableCursor::coord | ( | ) | const [inline] |
the actual coord
Definition at line 176 of file bytearraytablecursor.h.
| void KHEUI::ByteArrayTableCursor::gotoCCoord | ( | const Coord & | coord | ) |
Definition at line 229 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoCIndex | ( | int | index | ) |
Definition at line 216 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoCoord | ( | const Coord & | coord | ) |
Definition at line 278 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoDown | ( | ) |
Definition at line 157 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoEnd | ( | ) |
sets the index behind the last index.
If appendPosEnabled is true, this will be the last index + 1, otherwise it will be the last index and the flag behind.
Definition at line 201 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoIndex | ( | int | index | ) |
Definition at line 258 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoLineEnd | ( | ) |
Definition at line 180 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoLineStart | ( | ) |
Definition at line 171 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoNextByte | ( | int | indexSteps | ) |
Definition at line 115 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoNextByte | ( | ) |
Definition at line 100 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoPageDown | ( | ) |
Definition at line 313 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoPageUp | ( | ) |
Definition at line 293 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoPreviousByte | ( | int | indexSteps | ) |
Definition at line 81 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoPreviousByte | ( | ) |
Definition at line 69 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoRealIndex | ( | ) |
sets the index to the real index, i.e.
if "behind" one index, sets it to the next. Undefined if the real index is invalid, or on the append pos if not allowed.
Definition at line 266 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoStart | ( | ) |
Definition at line 193 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::gotoUp | ( | ) |
Definition at line 131 of file bytearraytablecursor.cpp.
| int KHEUI::ByteArrayTableCursor::index | ( | ) | const [inline] |
the index that is drawn at the actual coord
Definition at line 173 of file bytearraytablecursor.h.
| int KHEUI::ByteArrayTableCursor::indexAtLineEnd | ( | ) | const |
returns the index at the end of the cursor's line
Definition at line 333 of file bytearraytablecursor.cpp.
| int KHEUI::ByteArrayTableCursor::indexAtLineStart | ( | ) | const |
returns the index at the start of the cursor's line
Definition at line 332 of file bytearraytablecursor.cpp.
| bool KHEUI::ByteArrayTableCursor::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 177 of file bytearraytablecursor.h.
| int KHEUI::ByteArrayTableCursor::line | ( | ) | const [inline] |
the line of the actual coord
Definition at line 175 of file bytearraytablecursor.h.
| int KHEUI::ByteArrayTableCursor::pos | ( | ) | const [inline] |
the pos of the actual coord
Definition at line 174 of file bytearraytablecursor.h.
| int KHEUI::ByteArrayTableCursor::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 178 of file bytearraytablecursor.h.
| void KHEUI::ByteArrayTableCursor::setAppendPosEnabled | ( | bool | appendPosEnabled = true |
) |
Definition at line 43 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::stepBehind | ( | ) | [inline] |
puts the cursor behind the actual position if it isn't already
Definition at line 181 of file bytearraytablecursor.h.
| void KHEUI::ByteArrayTableCursor::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 245 of file bytearraytablecursor.cpp.
| void KHEUI::ByteArrayTableCursor::updateCoord | ( | ) |
Definition at line 286 of file bytearraytablecursor.cpp.
| int KHEUI::ByteArrayTableCursor::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 327 of file bytearraytablecursor.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference