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

okteta

  • Okteta
  • Coord
Public Member Functions | Static Public Member Functions | List of all members
Okteta::Coord Class Reference

#include <coord.h>

Public Member Functions

 Coord ()
 
 Coord (LinePosition pos, Line line)
 
 Coord (const Coord &other)
 
 ~Coord ()
 
void goCLeft (LinePosition maxPos)
 
void goCRight (LinePosition maxPos)
 
void goDown ()
 
void goDown (LineSize lines)
 
void goLeft ()
 
void goLeft (LinePositionSize positions)
 
void goLineEnd (LinePosition lastPos, const Coord &other)
 
void goLineStart (const Coord &other)
 
void goRight ()
 
void goRight (LinePositionSize positions)
 
void gotoEndOfPreviousLine (LinePosition lastPos)
 
void gotoStart ()
 
void gotoStartOfNextLine ()
 
void goUp ()
 
void goUp (LineSize lines)
 
Address indexByLineWidth (LinePositionSize lineWidth) const
 
bool isAbove (Line line) const
 
bool isAtStart () const
 
bool isBeforeLineEnd (LinePosition maxPos) const
 
bool isBehindLineStart () const
 
bool isBelow (Line line) const
 
bool isLaterInLineThan (const Coord &other) const
 
bool isPriorInLineThan (const Coord &other) const
 
bool isValid () const
 
Line line () const
 
bool operator!= (const Coord &other) const
 
bool operator< (const Coord &other) const
 
bool operator<= (const Coord &other) const
 
Coord & operator= (const Coord &other)
 
bool operator== (const Coord &other) const
 
bool operator> (const Coord &other) const
 
bool operator>= (const Coord &other) const
 
LinePosition pos () const
 
void set (LinePosition pos, Line line)
 
void setByIndexNWidth (Address index, LinePositionSize lineWidth)
 
void setLine (Line line)
 
void setPos (LinePosition pos)
 

Static Public Member Functions

static Coord fromIndex (Address index, LinePositionSize lineWidth)
 

Detailed Description

a class which represents a coord in a 2-dim.

system

It consists of a line number and a position in the line. The coord starts at (0,0). Line numbers increase downwards, positions to the right. With any of both at a negative number the coord is invalid. The index at coord(0,0) is 0.

Author
Friedrich W. H. Kossebau

Definition at line 47 of file coord.h.

Constructor & Destructor Documentation

Okteta::Coord::Coord ( )
inline

creates a coord with 0,0

Definition at line 187 of file coord.h.

Okteta::Coord::Coord ( LinePosition  pos,
Line  line 
)
inline

Definition at line 188 of file coord.h.

Okteta::Coord::Coord ( const Coord &  other)
inline

Definition at line 197 of file coord.h.

Okteta::Coord::~Coord ( )
inline

Definition at line 199 of file coord.h.

Member Function Documentation

Coord Okteta::Coord::fromIndex ( Address  index,
LinePositionSize  lineWidth 
)
inlinestatic

constructs a section by width

Parameters
indexstarting index
lineWidthwidth of the section

Definition at line 190 of file coord.h.

void Okteta::Coord::goCLeft ( LinePosition  maxPos)
inline

moves the coord one position to the left, or if the position is already at the line start to the given position in the previous line.

If the coord is invalid the result is undefined.

Parameters
maxPosmaximal allowed position

Definition at line 238 of file coord.h.

void Okteta::Coord::goCRight ( LinePosition  maxPos)
inline

moves the coord one position to the right, or if the position has already reached or passed maxPos to the first position in the next line.

If the coord is invalid the result is undefined.

Parameters
maxPosmaximal allowed position

Definition at line 231 of file coord.h.

void Okteta::Coord::goDown ( )
inline

moves the coord lines lines downwards.

Definition at line 277 of file coord.h.

void Okteta::Coord::goDown ( LineSize  lines)
inline

moves the coord lines lines downwards.

Parameters
linesnumber of lines

Definition at line 279 of file coord.h.

void Okteta::Coord::goLeft ( )
inline

moves the coord one position to the left.

If the coord is invalid the result is undefined.

Definition at line 247 of file coord.h.

void Okteta::Coord::goLeft ( LinePositionSize  positions)
inline

moves the coord a given number of positions to the left.

If the coord is invalid the result is undefined or the position smaller than the given number the behaviour is undefined.

Parameters
positionsnumber of positions

Definition at line 249 of file coord.h.

void Okteta::Coord::goLineEnd ( LinePosition  lastPos,
const Coord &  other 
)
inline

sets the position to the given pos or if the line is the same as that of the given coord to the position of that.

If one or more of the coords is invalid the behaviour is undefined.

Parameters
lastPoslast position in normal line
othera possible line end coord

Definition at line 271 of file coord.h.

void Okteta::Coord::goLineStart ( const Coord &  other)
inline

sets the position to the start of the line or if the line is the same as that of the given coord to the position of it.

If one or more of the coords is invalid the behaviour is undefined.

Parameters
othera possible line start coord

Definition at line 266 of file coord.h.

void Okteta::Coord::goRight ( )
inline

moves the coord one position to the right.

If the coord is invalid the result is undefined.

Definition at line 246 of file coord.h.

void Okteta::Coord::goRight ( LinePositionSize  positions)
inline

moves the coord a given number of positions to the right.

If the coord is invalid the result is undefined.

Parameters
positionsnumber of positions

Definition at line 248 of file coord.h.

void Okteta::Coord::gotoEndOfPreviousLine ( LinePosition  lastPos)
inline

Definition at line 253 of file coord.h.

void Okteta::Coord::gotoStart ( )
inline

sets coord to (0,0)

Definition at line 251 of file coord.h.

void Okteta::Coord::gotoStartOfNextLine ( )
inline

sets the coord to the start of the next line.

If the coord is invalid the behaviour is undefined.

Definition at line 259 of file coord.h.

void Okteta::Coord::goUp ( )
inline

moves the coord 1 lines upwards.

There is no check whether the first line is overstepped.

Definition at line 276 of file coord.h.

void Okteta::Coord::goUp ( LineSize  lines)
inline

moves the coord lines lines upwards.

There is no check whether the first line is overstepped.

Parameters
linesnumber of lines

Definition at line 278 of file coord.h.

Address Okteta::Coord::indexByLineWidth ( LinePositionSize  lineWidth) const
inline

calculates the index the coord is at with a given line width If the coord is invalid the result is undefined.

Parameters
lineWidthgiven width of line
Returns
index the coord is at

Definition at line 282 of file coord.h.

bool Okteta::Coord::isAbove ( Line  line) const
inline
Returns
true if the line is above lines, otherwise false

Definition at line 299 of file coord.h.

bool Okteta::Coord::isAtStart ( ) const
inline
Returns
true if the coord is at (0,0)

Definition at line 304 of file coord.h.

bool Okteta::Coord::isBeforeLineEnd ( LinePosition  maxPos) const
inline
Returns
true if the pos is smaller than maxPos, otherwise false

Definition at line 302 of file coord.h.

bool Okteta::Coord::isBehindLineStart ( ) const
inline
Returns
true if the pos is greater than 0, otherwise false

Definition at line 301 of file coord.h.

bool Okteta::Coord::isBelow ( Line  line) const
inline
Returns
true if the line is below lines, otherwise false

Definition at line 298 of file coord.h.

bool Okteta::Coord::isLaterInLineThan ( const Coord &  other) const
inline

tests if the coord is later in the same line than the given coord.

If at least one of both is invalid the result is undefined.

Returns
true if the pos is right to the pos of other and both are in the same line, otherwise false

Definition at line 293 of file coord.h.

bool Okteta::Coord::isPriorInLineThan ( const Coord &  other) const
inline

tests if the coord is prior in the same line than the given coord.

If at least one of both is invalid the result is undefined.

Returns
true if the pos is left to the pos of other and both are in the same line, otherwise false.

Definition at line 288 of file coord.h.

bool Okteta::Coord::isValid ( ) const
inline
Returns
true if the coord is valid

Definition at line 215 of file coord.h.

Line Okteta::Coord::line ( ) const
inline
Returns
the line number

Definition at line 214 of file coord.h.

bool Okteta::Coord::operator!= ( const Coord &  other) const
inline

Definition at line 202 of file coord.h.

bool Okteta::Coord::operator< ( const Coord &  other) const
inline

Definition at line 204 of file coord.h.

bool Okteta::Coord::operator<= ( const Coord &  other) const
inline

Definition at line 206 of file coord.h.

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

Definition at line 198 of file coord.h.

bool Okteta::Coord::operator== ( const Coord &  other) const
inline

Definition at line 201 of file coord.h.

bool Okteta::Coord::operator> ( const Coord &  other) const
inline

Definition at line 208 of file coord.h.

bool Okteta::Coord::operator>= ( const Coord &  other) const
inline

Definition at line 210 of file coord.h.

LinePosition Okteta::Coord::pos ( ) const
inline
Returns
the pos in the line

Definition at line 213 of file coord.h.

void Okteta::Coord::set ( LinePosition  pos,
Line  line 
)
inline

sets both position and line

Definition at line 223 of file coord.h.

void Okteta::Coord::setByIndexNWidth ( Address  index,
LinePositionSize  lineWidth 
)
inline

set the coord by calculating it for an index with a given line width

Parameters
indexindex in the buffer
lineWidthgiven line width

Definition at line 217 of file coord.h.

void Okteta::Coord::setLine ( Line  line)
inline

sets the line

Definition at line 229 of file coord.h.

void Okteta::Coord::setPos ( LinePosition  pos)
inline

sets the position

Definition at line 228 of file coord.h.


The documentation for this class was generated from the following file:
  • coord.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