edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::TextCaretCache Class Reference

A special cache. For remembering the x-coordinates of the carets. More...

#include <textcaretcache.h>

+ Collaboration diagram for edbee::TextCaretCache:

Public Member Functions

 TextCaretCache (TextDocument *doc, TextRenderer *renderer)
 The text document cache.
 
void clear ()
 
void fill (TextRangeSet &selection)
 
void replaceAll (TextCaretCache &cache)
 This method replaces all cached content with the one given.
 
int xpos (int offset)
 
void add (int offset, int xpos)
 Adds an xposition for the given offset.
 
void add (int offset)
 Adds the given offset by calculating the position.
 
void caretMovedFromOldOffsetToNewOffset (int oldOffset, int newOffset)
 This method should be called if the caret moves.
 
bool isFilled ()
 This method checks if the cache is filled.
 
void dump ()
 

Detailed Description

A special cache. For remembering the x-coordinates of the carets.

Constructor & Destructor Documentation

◆ TextCaretCache()

edbee::TextCaretCache::TextCaretCache ( TextDocument * doc,
TextRenderer * renderer )

The text document cache.

Member Function Documentation

◆ add() [1/2]

void edbee::TextCaretCache::add ( int offset)

Adds the given offset by calculating the position.

◆ add() [2/2]

void edbee::TextCaretCache::add ( int offset,
int xpos )

Adds an xposition for the given offset.

◆ caretMovedFromOldOffsetToNewOffset()

void edbee::TextCaretCache::caretMovedFromOldOffsetToNewOffset ( int oldOffset,
int newOffset )

This method should be called if the caret moves.

◆ clear()

void edbee::TextCaretCache::clear ( )

◆ dump()

void edbee::TextCaretCache::dump ( )

◆ fill()

void edbee::TextCaretCache::fill ( TextRangeSet & selection)

◆ isFilled()

bool edbee::TextCaretCache::isFilled ( )

This method checks if the cache is filled.

◆ replaceAll()

void edbee::TextCaretCache::replaceAll ( TextCaretCache & cache)

This method replaces all cached content with the one given.

◆ xpos()

int edbee::TextCaretCache::xpos ( int offset)

The documentation for this class was generated from the following files: