Cute Chess  0.1
Public Member Functions | Protected Member Functions | List of all members
PgnToken Class Referenceabstract

A text or HTML token in a PGN game. More...

#include <pgntoken.h>

Inheritance diagram for PgnToken:
MoveCommentToken MoveNumberToken MoveToken

Public Member Functions

void insert (QTextCursor &cursor)
 
bool isEmpty () const
 
int length () const
 
void mergeCharFormat (QTextCursor &cursor, const QTextCharFormat &format)
 
void move (int diff)
 
 PgnToken ()
 
void select (QTextCursor &cursor)
 
virtual QString toString () const =0
 
virtual ~PgnToken ()
 

Protected Member Functions

virtual void vInsert (QTextCursor &cursor)=0
 

Detailed Description

A text or HTML token in a PGN game.

Constructor & Destructor Documentation

PgnToken::PgnToken ( )

Creates a new PgnToken.

PgnToken::~PgnToken ( )
virtual

Destroys the PgnToken.

Member Function Documentation

void PgnToken::insert ( QTextCursor cursor)

Inserts the token into the document. This method calls the subclass' vInsert() method.

bool PgnToken::isEmpty ( ) const

Returns true if the token is empty; otherwise returns false.

int PgnToken::length ( ) const

Returns the token's length.

void PgnToken::mergeCharFormat ( QTextCursor cursor,
const QTextCharFormat &  format 
)

Merges the token's character format with format.

void PgnToken::move ( int  diff)

Moves the token's begin and end positions by diff.

void PgnToken::select ( QTextCursor cursor)

Selects the token with cursor.

virtual QString PgnToken::toString ( ) const
pure virtual

Returns the token as a string.

Implemented in MoveNumberToken, MoveCommentToken, and MoveToken.

virtual void PgnToken::vInsert ( QTextCursor cursor)
protectedpure virtual

Subclasses must implement this function to insert the token into the document using cursor.

Implemented in MoveCommentToken, MoveNumberToken, and MoveToken.


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