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

okteta

KHEUI::ByteArrayTableLayout

KHEUI::ByteArrayTableLayout Class Reference

#include <bytearraytablelayout.h>

List of all members.


Detailed Description

the logical layout of a byte array table for a view

Given the values for * number of bytes per line, * a possible offset of the first line displayed, * a possible offset of the displayed bytearray, and * length of the byte array * the number of lines per page jump the following values are calculated: * starting line of display, * starting position in this line, * final line of display, * final position in this line, and * the total number of lines (is final line +1 or 0)

This layout sees the buffer as a continuous stream of byte, thus uses each line after the start from the begin to the end.

If the buffer is empty the end coord will be set one pos left to the start coord to easen the cursor handling.

Author:
Friedrich W. H. Kossebau

Definition at line 59 of file bytearraytablelayout.h.


Public Member Functions

bool atFirstLinePosition (const Coord &coord) const
bool atLastLinePosition (const Coord &coord) const
 ByteArrayTableLayout (int noOfBytesPerLine, int firstLineOffset, int startOffset, int length)
Coord coordOfCIndex (int index) const
Coord coordOfIndex (int index) const
CoordRange coordRangeOfIndizes (const KHE::KSection &indizes) const
Coord correctCoord (const Coord &coord) const
int correctIndex (int index) const
Coord finalCoord () const
int finalLine () const
int finalLinePosition () const
int firstLineOffset () const
int firstLinePosition (const Coord &coord) const
int firstLinePosition (int line) const
bool hasContent (int line) const
int indexAtCCoord (const Coord &coord) const
int indexAtCFirstLinePosition (int line) const
int indexAtCLastLinePosition (int line) const
int indexAtCoord (const Coord &coord) const
int indexAtFirstLinePosition (int line) const
int indexAtLastLinePosition (int line) const
int lastLinePosition (const Coord &coord) const
int lastLinePosition (int line) const
int length () const
int lineAtCIndex (int index) const
int lineAtIndex (int index) const
KHE::KSection linePositions (int line) const
int noOfBytesPerLine () const
int noOfLines () const
int noOfLinesPerPage () const
bool setFirstLineOffset (int firstLineOffset)
bool setLength (int length)
bool setNoOfBytesPerLine (int noOfBytesPerLine)
void setNoOfLinesPerPage (int noOfLinesPerPage)
bool setStartOffset (int startOffset)
Coord startCoord () const
int startLine () const
int startLinePosition () const
int startOffset () const
 ~ByteArrayTableLayout ()

Protected Member Functions

void calcEnd ()
void calcStart ()

Protected Attributes

CoordRange mCoordRange
int mFirstLineOffset
int mLength
int mNoOfBytesPerLine
int mNoOfLinesPerPage
int mRelativeStartOffset
int mStartOffset

Constructor & Destructor Documentation

KHEUI::ByteArrayTableLayout::ByteArrayTableLayout ( int  noOfBytesPerLine,
int  firstLineOffset,
int  startOffset,
int  length 
)

Definition at line 31 of file bytearraytablelayout.cpp.

KHEUI::ByteArrayTableLayout::~ByteArrayTableLayout (  ) 

Definition at line 272 of file bytearraytablelayout.cpp.


Member Function Documentation

bool KHEUI::ByteArrayTableLayout::atFirstLinePosition ( const Coord &  coord  )  const

returns true if the coord is the first in it's line.

if coord is invalid the behaviour is undefinded

Definition at line 228 of file bytearraytablelayout.cpp.

bool KHEUI::ByteArrayTableLayout::atLastLinePosition ( const Coord &  coord  )  const

returns true if the coord is the last in it's line.

if coord is invalid the behaviour is undefinded

Definition at line 234 of file bytearraytablelayout.cpp.

void KHEUI::ByteArrayTableLayout::calcEnd (  )  [protected]

calculates the final coord by startoffset, length, and number of bytes per line

Definition at line 126 of file bytearraytablelayout.cpp.

void KHEUI::ByteArrayTableLayout::calcStart (  )  [protected]

calculates the start coord by startoffset and number of bytes per line

Definition at line 120 of file bytearraytablelayout.cpp.

Coord KHEUI::ByteArrayTableLayout::coordOfCIndex ( int  index  )  const

calculates the coord in which index is found If the index is below the first index the first coord is returned, if the index is above the last index the last coord is returned

Definition at line 167 of file bytearraytablelayout.cpp.

Coord KHEUI::ByteArrayTableLayout::coordOfIndex ( int  index  )  const

calculates the coord in which index is found.

if index is invalid the behaviour is undefinded

Definition at line 197 of file bytearraytablelayout.cpp.

CoordRange KHEUI::ByteArrayTableLayout::coordRangeOfIndizes ( const KHE::KSection &  indizes  )  const

calculates the range of coords in which the indizes are found.

if indizes are invalid the behaviour is undefinded

Definition at line 202 of file bytearraytablelayout.cpp.

Coord KHEUI::ByteArrayTableLayout::correctCoord ( const Coord &  coord  )  const

returns the coord if valid or the nearest valid coord

Definition at line 219 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::correctIndex ( int  index  )  const

returns the index if valid or the nearest valid index

Definition at line 211 of file bytearraytablelayout.cpp.

Coord KHEUI::ByteArrayTableLayout::finalCoord (  )  const [inline]

returns the coord of the end

Definition at line 202 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::finalLine (  )  const [inline]

Definition at line 207 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::finalLinePosition (  )  const [inline]

Definition at line 205 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::firstLineOffset (  )  const [inline]

Definition at line 198 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::firstLinePosition ( const Coord &  coord  )  const

returns the valid Pos or the first Pos in line.

if coord is invalid the behaviour is undefinded

Definition at line 247 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::firstLinePosition ( int  line  )  const

returns the first Pos in line.

if line is invalid the behaviour is undefinded

Definition at line 257 of file bytearraytablelayout.cpp.

bool KHEUI::ByteArrayTableLayout::hasContent ( int  line  )  const

returns true if the line has content

Definition at line 267 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::indexAtCCoord ( const Coord &  coord  )  const

calculates the index of the coord If the coord is before the first coord the first index is returned, if the coord is behind the last coord the last index is returned

Definition at line 149 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::indexAtCFirstLinePosition ( int  line  )  const

calculates the index of the first pos in line.

If the line is below the first line the first index is returned, if the line is above the last line the last index is returned

Definition at line 133 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::indexAtCLastLinePosition ( int  line  )  const

calculates the index of last pos in line If the line is below the first line the first index is returned, if the line is above the last line the last index is returned

Definition at line 141 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::indexAtCoord ( const Coord &  coord  )  const

calculates the index of coord.

if coord is invalid the behaviour is undefinded

Definition at line 187 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::indexAtFirstLinePosition ( int  line  )  const

calculates the index of the first pos in line.

if line is invalid the behaviour is undefinded

Definition at line 175 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::indexAtLastLinePosition ( int  line  )  const

calculates the index of last pos in line.

if line is invalid the behaviour is undefinded

Definition at line 181 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::lastLinePosition ( const Coord &  coord  )  const

returns the valid Pos or the last Pos in line.

if coord is invalid the behaviour is undefinded

Definition at line 252 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::lastLinePosition ( int  line  )  const

returns the last Pos in line.

if line is invalid the behaviour is undefinded

Definition at line 262 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::length (  )  const [inline]

returns the length of the displayed byte array section

Definition at line 200 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::lineAtCIndex ( int  index  )  const

calculates the line in which index is found If the index is below the first index the first line is returned, if the index is above the last index the last line is returned

Definition at line 159 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::lineAtIndex ( int  index  )  const

calculates the line in which index is found.

if index is invalid the behaviour is undefinded

Definition at line 192 of file bytearraytablelayout.cpp.

KHE::KSection KHEUI::ByteArrayTableLayout::linePositions ( int  line  )  const

returns the used positions in line

Definition at line 241 of file bytearraytablelayout.cpp.

int KHEUI::ByteArrayTableLayout::noOfBytesPerLine (  )  const [inline]

returns number of bytes per line

Definition at line 199 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::noOfLines (  )  const [inline]

tells how much lines this layout needs (incl.

blank leading lines due to mStartOffset and mFirstLineOffset)

Definition at line 209 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::noOfLinesPerPage (  )  const [inline]

returns number of lines per visual page

Definition at line 208 of file bytearraytablelayout.h.

bool KHEUI::ByteArrayTableLayout::setFirstLineOffset ( int  firstLineOffset  ) 

sets mStartOffset, returns true if changed

Definition at line 61 of file bytearraytablelayout.cpp.

bool KHEUI::ByteArrayTableLayout::setLength ( int  length  ) 

sets length of data to display, returns true if changed

Definition at line 97 of file bytearraytablelayout.cpp.

bool KHEUI::ByteArrayTableLayout::setNoOfBytesPerLine ( int  noOfBytesPerLine  ) 

sets number of bytes per line, returns true if changed

Definition at line 79 of file bytearraytablelayout.cpp.

void KHEUI::ByteArrayTableLayout::setNoOfLinesPerPage ( int  noOfLinesPerPage  ) 

sets number of lines per page, 1 as default

Definition at line 114 of file bytearraytablelayout.cpp.

bool KHEUI::ByteArrayTableLayout::setStartOffset ( int  startOffset  ) 

sets mStartOffset, returns true if changed

Definition at line 44 of file bytearraytablelayout.cpp.

Coord KHEUI::ByteArrayTableLayout::startCoord (  )  const [inline]

returns the coord of the start

Definition at line 203 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::startLine (  )  const [inline]

Definition at line 206 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::startLinePosition (  )  const [inline]

Definition at line 204 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::startOffset (  )  const [inline]

Definition at line 197 of file bytearraytablelayout.h.


Member Data Documentation

CoordRange KHEUI::ByteArrayTableLayout::mCoordRange [protected]

Definition at line 193 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::mFirstLineOffset [protected]

starting offset of the first displayed line

Definition at line 181 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::mLength [protected]

length of the displayed bytearray

Definition at line 187 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::mNoOfBytesPerLine [protected]

how many chars per line

Definition at line 179 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::mNoOfLinesPerPage [protected]

number of lines that are moved by page up/down

Definition at line 189 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::mRelativeStartOffset [protected]

Definition at line 185 of file bytearraytablelayout.h.

int KHEUI::ByteArrayTableLayout::mStartOffset [protected]

starting offset of the displayed bytearray

Definition at line 183 of file bytearraytablelayout.h.


The documentation for this class was generated from the following files:
  • bytearraytablelayout.h
  • bytearraytablelayout.cpp

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