okteta
KHEUI::Selection Class Reference
#include <selection.h>
Detailed Description
This class describes a selected section 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 KHE::KSection)
the interactive selection takes care that
Definition at line 44 of file selection.h.
Public Member Functions | |
| void | adaptToReplacement (int pos, int removedLength, int insertedLength) |
| void | adaptToSwap (int firstOffset, int secondOffset, int secondLength) |
| int | anchor () const |
| void | cancel () |
| int | end () const |
| bool | isForward () const |
| bool | isValid () const |
| bool | justStarted () const |
| int | nextBeforeStart () const |
| int | nextBehindEnd () const |
| Selection & | operator= (const KHE::KSection §ion) |
| Selection & | operator= (const Selection &other) |
| void | reverse () |
| const KHE::KSection & | section () const |
| Selection () | |
| Selection (int index) | |
| void | setEnd (int index) |
| void | setForward (bool forward=true) |
| void | setStart (int index) |
| int | start () const |
| bool | started () const |
| ~Selection () | |
Protected Attributes | |
| int | mAnchor |
| KHE::KSection | mSection |
Constructor & Destructor Documentation
| KHEUI::Selection::Selection | ( | int | index | ) | [inline, explicit] |
creates a selection with a given start.
- Parameters:
-
index index in front of which the selection begins
Definition at line 126 of file selection.h.
| KHEUI::Selection::Selection | ( | ) | [inline] |
| KHEUI::Selection::~Selection | ( | ) | [inline] |
Definition at line 127 of file selection.h.
Member Function Documentation
| void KHEUI::Selection::adaptToReplacement | ( | int | pos, | |
| int | removedLength, | |||
| int | insertedLength | |||
| ) | [inline] |
Definition at line 194 of file selection.h.
Definition at line 200 of file selection.h.
| int KHEUI::Selection::anchor | ( | ) | const [inline] |
| void KHEUI::Selection::cancel | ( | ) | [inline] |
| int KHEUI::Selection::end | ( | ) | const [inline] |
Definition at line 183 of file selection.h.
| bool KHEUI::Selection::isForward | ( | ) | const [inline] |
- Returns:
trueif the anchor is at the begin of the selection
Definition at line 192 of file selection.h.
| bool KHEUI::Selection::isValid | ( | ) | const [inline] |
Definition at line 189 of file selection.h.
| bool KHEUI::Selection::justStarted | ( | ) | const [inline] |
- Returns:
trueif the anchor has been set and the selection is empty, otherwisefalse.
Definition at line 191 of file selection.h.
| int KHEUI::Selection::nextBeforeStart | ( | ) | const [inline] |
Definition at line 184 of file selection.h.
| int KHEUI::Selection::nextBehindEnd | ( | ) | const [inline] |
Definition at line 185 of file selection.h.
| Selection & KHEUI::Selection::operator= | ( | const KHE::KSection & | section | ) | [inline] |
Definition at line 136 of file selection.h.
Definition at line 129 of file selection.h.
| void KHEUI::Selection::reverse | ( | ) | [inline] |
swaps anchor from start to end or vice versa.
If the selection has not started the behaviour is undefined.
Definition at line 170 of file selection.h.
| const KHE::KSection & KHEUI::Selection::section | ( | ) | const [inline] |
| void KHEUI::Selection::setEnd | ( | int | index | ) | [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 151 of file selection.h.
| void KHEUI::Selection::setForward | ( | bool | forward = true |
) | [inline] |
sets the anchor to the start or the end.
- Parameters:
-
if true to the start, otherwise to the end If the selection has not started the behaviour is undefined.
Definition at line 175 of file selection.h.
| void KHEUI::Selection::setStart | ( | int | index | ) | [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 144 of file selection.h.
| int KHEUI::Selection::start | ( | ) | const [inline] |
Definition at line 182 of file selection.h.
| bool KHEUI::Selection::started | ( | ) | const [inline] |
- Returns:
trueif the anchor has been set, otherwisefalse.
Definition at line 190 of file selection.h.
Member Data Documentation
int KHEUI::Selection::mAnchor [protected] |
KHE::KSection KHEUI::Selection::mSection [protected] |
The documentation for this class was generated from the following file:
KDE 4.2 API Reference