okteta
#include <selection.h>
Public Member Functions | |
| Selection (Address index) | |
| Selection () | |
| ~Selection () | |
| void | adaptToReplacement (Address pos, Size removedLength, Size insertedLength) |
| void | adaptToSwap (Address firstOffset, Address secondOffset, Size secondLength) |
| Address | anchor () const |
| void | cancel () |
| Address | end () const |
| bool | isForward () const |
| bool | isValid () const |
| bool | justStarted () const |
| Address | nextBeforeStart () const |
| Address | nextBehindEnd () const |
| Selection & | operator= (const Selection &other) |
| Selection & | operator= (const AddressRange &range) |
| const AddressRange & | range () const |
| void | reverse () |
| void | setEnd (Address index) |
| void | setForward (bool forward=true) |
| void | setStart (Address index) |
| Address | start () const |
| bool | started () const |
Protected Attributes | |
| Address | mAnchor |
| AddressRange | mRange |
Detailed Description
This class describes a selected range of the buffer.
As it is used as selection controlled by mouse and keyboard commands it offers two ways to set its range:
- by giving the startposition (of the cursor) of an interactive selection and the subsequent end positions (until selection is finished)
- direct setting (as provided by AddressRange)
the interactive selection takes care that
Definition at line 44 of file selection.h.
Constructor & Destructor Documentation
|
inlineexplicit |
creates a selection with a given start.
- Parameters
-
index index in front of which the selection begins
Definition at line 127 of file selection.h.
|
inline |
creates an invalid selection
Definition at line 126 of file selection.h.
|
inline |
Definition at line 128 of file selection.h.
Member Function Documentation
|
inline |
Definition at line 195 of file selection.h.
|
inline |
Definition at line 201 of file selection.h.
|
inline |
- Returns
- anchor value
Definition at line 182 of file selection.h.
|
inline |
sets the selection to be invalid
Definition at line 188 of file selection.h.
|
inline |
Definition at line 184 of file selection.h.
|
inline |
- Returns
trueif the anchor is at the begin of the selection
Definition at line 193 of file selection.h.
|
inline |
Definition at line 190 of file selection.h.
|
inline |
- Returns
trueif the anchor has been set and the selection is empty, otherwisefalse.
Definition at line 192 of file selection.h.
|
inline |
Definition at line 185 of file selection.h.
|
inline |
Definition at line 186 of file selection.h.
Definition at line 130 of file selection.h.
|
inline |
Definition at line 137 of file selection.h.
|
inline |
- Returns
- range
Definition at line 181 of file selection.h.
|
inline |
swaps anchor from start to end or vice versa.
If the selection has not started the behaviour is undefined.
Definition at line 171 of file selection.h.
|
inline |
sets the end of the current selection.
If the end is before the start the selection will reach from the given index
- Parameters
-
index index in front of which the selection ends
Definition at line 152 of file selection.h.
|
inline |
sets the anchor to the start or the end.
- Parameters
-
forward true to the start, otherwise to the end If the selection has not started the behaviour is undefined.
Definition at line 176 of file selection.h.
|
inline |
starts the selection.
For this the anchor, start and end are set to the given index, so the initial selection is empty.
- Parameters
-
index index in front of which the selection begins
Definition at line 145 of file selection.h.
|
inline |
Definition at line 183 of file selection.h.
|
inline |
- Returns
trueif the anchor has been set, otherwisefalse.
Definition at line 191 of file selection.h.
Member Data Documentation
|
protected |
cursor index where the selection starts
Definition at line 122 of file selection.h.
|
protected |
mRange
Definition at line 120 of file selection.h.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
KDE API Reference