• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

okteta

KHEUI::Selection

KHEUI::Selection Class Reference

#include <selection.h>

List of all members.


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

Author:
Friedrich W. H. Kossebau

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 &section)
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]

creates an invalid selection

Definition at line 125 of file selection.h.

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.

void KHEUI::Selection::adaptToSwap ( int  firstOffset,
int  secondOffset,
int  secondLength 
) [inline]

Definition at line 200 of file selection.h.

int KHEUI::Selection::anchor (  )  const [inline]

Returns:
anchor value

Definition at line 181 of file selection.h.

void KHEUI::Selection::cancel (  )  [inline]

sets the selection to be invalid

Definition at line 187 of file selection.h.

int KHEUI::Selection::end (  )  const [inline]

Definition at line 183 of file selection.h.

bool KHEUI::Selection::isForward (  )  const [inline]

Returns:
true if 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:
true if the anchor has been set and the selection is empty, otherwise false.

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.

Selection & KHEUI::Selection::operator= ( const Selection &  other  )  [inline]

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]

Returns:
section

Definition at line 180 of file selection.h.

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:
true if the anchor has been set, otherwise false.

Definition at line 190 of file selection.h.


Member Data Documentation

int KHEUI::Selection::mAnchor [protected]

cursor index where the selection starts

Definition at line 121 of file selection.h.

KHE::KSection KHEUI::Selection::mSection [protected]

mSection

Definition at line 119 of file selection.h.


The documentation for this class was generated from the following file:
  • selection.h

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • okteta
  • printer-applet
  • superkaramba
  • sweeper
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal