• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • Okteta
  • Selection
Public Member Functions | Protected Attributes | List of all members
Okteta::Selection Class Reference

#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

Author
Friedrich W. H. Kossebau

Definition at line 44 of file selection.h.

Constructor & Destructor Documentation

Okteta::Selection::Selection ( Address  index)
inlineexplicit

creates a selection with a given start.

Parameters
indexindex in front of which the selection begins

Definition at line 127 of file selection.h.

Okteta::Selection::Selection ( )
inline

creates an invalid selection

Definition at line 126 of file selection.h.

Okteta::Selection::~Selection ( )
inline

Definition at line 128 of file selection.h.

Member Function Documentation

void Okteta::Selection::adaptToReplacement ( Address  pos,
Size  removedLength,
Size  insertedLength 
)
inline

Definition at line 195 of file selection.h.

void Okteta::Selection::adaptToSwap ( Address  firstOffset,
Address  secondOffset,
Size  secondLength 
)
inline

Definition at line 201 of file selection.h.

Address Okteta::Selection::anchor ( ) const
inline
Returns
anchor value

Definition at line 182 of file selection.h.

void Okteta::Selection::cancel ( )
inline

sets the selection to be invalid

Definition at line 188 of file selection.h.

Address Okteta::Selection::end ( ) const
inline

Definition at line 184 of file selection.h.

bool Okteta::Selection::isForward ( ) const
inline
Returns
true if the anchor is at the begin of the selection

Definition at line 193 of file selection.h.

bool Okteta::Selection::isValid ( ) const
inline

Definition at line 190 of file selection.h.

bool Okteta::Selection::justStarted ( ) const
inline
Returns
true if the anchor has been set and the selection is empty, otherwise false.

Definition at line 192 of file selection.h.

Address Okteta::Selection::nextBeforeStart ( ) const
inline

Definition at line 185 of file selection.h.

Address Okteta::Selection::nextBehindEnd ( ) const
inline

Definition at line 186 of file selection.h.

Selection & Okteta::Selection::operator= ( const Selection &  other)
inline

Definition at line 130 of file selection.h.

Selection & Okteta::Selection::operator= ( const AddressRange &  range)
inline

Definition at line 137 of file selection.h.

const AddressRange & Okteta::Selection::range ( ) const
inline
Returns
range

Definition at line 181 of file selection.h.

void Okteta::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 171 of file selection.h.

void Okteta::Selection::setEnd ( Address  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
indexindex in front of which the selection ends

Definition at line 152 of file selection.h.

void Okteta::Selection::setForward ( bool  forward = true)
inline

sets the anchor to the start or the end.

Parameters
forwardtrue 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.

void Okteta::Selection::setStart ( Address  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
indexindex in front of which the selection begins

Definition at line 145 of file selection.h.

Address Okteta::Selection::start ( ) const
inline

Definition at line 183 of file selection.h.

bool Okteta::Selection::started ( ) const
inline
Returns
true if the anchor has been set, otherwise false.

Definition at line 191 of file selection.h.

Member Data Documentation

Address Okteta::Selection::mAnchor
protected

cursor index where the selection starts

Definition at line 122 of file selection.h.

AddressRange Okteta::Selection::mRange
protected

mRange

Definition at line 120 of file selection.h.


The documentation for this class was generated from the following file:
  • selection.h
This file is part of the KDE documentation.
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.

okteta

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

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal