Scribus
Open source desktop publishing at your fingertips
XtgScanner Class Reference

Class for scanning and parsing an XPress Tags Document. More...

#include <xtgscanner.h>

Public Member Functions

 XtgScanner (QString documentName, TextWriter *wr, QString &buffer, bool textOnly, bool prefix)
 
void initBasicHash ()
 initialise all hash functions with tokens and corresponding function pointers
 
void initTagMode ()
 
void initTextMode ()
 
void initNameMode ()
 
void initLanguages ()
 
void xtgParse ()
 parse function which will parse the inputBuffer and append it into the PageItem More...
 
QChar lookAhead ()
 This function will return the character in Buffer to which top is now pointing to.
 
QChar nextSymbol ()
 A function which returns the next symbol in the input stream as character. This function will increment the top by 1.
 
scannerMode currentState ()
 This function will return the current state of Scanner.
 
scannerMode previousState ()
 
void enterState (scannerMode Mode)
 This function will switch the state of Scanner into textMode or tagMode or styleMode.
 
QString getToken ()
 This function will return a token which is to be evaluated in parser. Each token will be available in the class member token as a QString. More...
 
QString sliceString ()
 Function to Slice the string so as to remove the inch character etc.
 

applyFeature

Function to applyFeature to a character Style

void(XtgScanner::* funPointer )(void)
 
void applyFeature (const QString &feature)
 
void flushText ()
 Function which will empty the textToAppend variable by writing into text frame.
 
bool styleStatus (QStringList &name, QString &sfcname)
 Function which returns the status of Style whether defined or not.
 
void showWarning (QString &name)
 Function which will show a message box if a Style "name" is not defined in the document.
 
void setPlain ()
 
void setBold ()
 
void setItalics ()
 
void setShadow ()
 
void setOutline ()
 
void setUnderline ()
 
void setWordUnder ()
 
void setStrikethrough ()
 
void setDoubleStrike ()
 
void setAllCaps ()
 
void setSmallCaps ()
 
void setSuperscript ()
 
void setSubscript ()
 
void setSuperior ()
 
void setFont ()
 
void setFontSize ()
 
void setColor ()
 
void setShade ()
 
void setHorizontalScale ()
 
void setKern ()
 
void setTrack ()
 
void setBaseLineShift ()
 
void setVerticalScale ()
 
void setLigatures ()
 
void csetOpacity ()
 
void setOpenType ()
 
void setCharAlignment ()
 
void setVertStories ()
 
void setEmphasisMarks ()
 
void setAsncjk ()
 
void setLanguages ()
 
void setXPresOwn ()
 
void setAlignLeft ()
 
void setAlignCenter ()
 
void setAlignRight ()
 
void setAlignJustify ()
 
void setAlignFJustify ()
 
void setTabStops ()
 
void setPAttributes ()
 
void setHyphenation ()
 
void setPRuleAbove ()
 
void setPRuleBelow ()
 
void setDropCap ()
 
void setKeepNextPar ()
 
void setKeepTogether ()
 
void setHangingCSet ()
 
void setGlyph ()
 
void setTranscodeSeq ()
 
void setUnencodedGlyph ()
 
void xFlag ()
 
void definePStyles ()
 
void defineCStyle ()
 
void applyCStyle1 ()
 
void applyCStyle2 ()
 
void applyCStyle3 ()
 
void applyCStyle4 ()
 
void applyCStyle5 ()
 
void applyCStyle6 ()
 
void setTypeStyle ()
 
void appendSpChar1 ()
 
void appendSpChar2 ()
 
void appendSpChar3 ()
 
void defNewLine ()
 
void defHardReturn ()
 
void defFontSet ()
 
void defColor ()
 
void defEquals ()
 
void defClose ()
 
void defOpen ()
 
void defAtRate ()
 
void defColon ()
 

Detailed Description

Class for scanning and parsing an XPress Tags Document.

Member Function Documentation

void XtgScanner::defClose ( )

Functions corresponding to tokens in nameMode

void XtgScanner::definePStyles ( )

Type 1 definition of Paragraph Stylesheet. Refer Documentation for details

Type 2 definition of Paragraph Stylesheet. Refer Documentation for details

Type 3 definition of Paragraph Stylesheet. Refer Documentation for details

s2 is the next paragraph style which is to be applied, but this cannot be done at moment in Scribus

void XtgScanner::defNewLine ( )

Functions used in textMode Hash

Functions corresponding to tokens in textMode

QString XtgScanner::getToken ( )

This function will return a token which is to be evaluated in parser. Each token will be available in the class member token as a QString.

This mode should return only '<' or '@' or newline. It also adds the text_to_be_appended to the QString textToAppend

An escape sequence is occurred, hence we will just append the next character in buffer to the text. This will automatically deal the occurrance of '@' or '\:' or any other relevant escapes

This mode should return attributes B|I|U|O|....|*L|*C|... and an inch character "

append the * character and the nextSymbol to token so as to form a paragraph attribute and '\' character to deal special characters that contain XPress Tags codes.

If inch character is found, the scanner should enter the string mode and enter the corresponding string as the token

This mode should return the name of stylesheet (or font set or color) or '=' or ':','[' etc. This mode works with the assumption that a character '@' have occurred prior to it.Hence inorder to obtain the tags like '$:' or '@:' ,we will append @ symbol initially to the token.

void XtgScanner::initLanguages ( )

Initialise a QHash which maps the values of n## to corresponding language strings

void XtgScanner::initNameMode ( )

Initialise the nameModeHash with tokens returned in nameMode and its corresponding function pointers

void XtgScanner::initTagMode ( )

Initialise the tagModeHash with the tokens returned in tagMode and its corresponding function pointers

void XtgScanner::initTextMode ( )

Initialise the textModeHash with tokens returned in textMode and its corresponding function pointers

void XtgScanner::setFont ( )

define/apply font

void XtgScanner::setPlain ( )

Set Functions for setting the styles

Function for each tokens in tagMode. Each token is hashed with corresponding function pointers

void XtgScanner::xtgParse ( )

parse function which will parse the inputBuffer and append it into the PageItem

Various character Style Applications <>. We cannot hash this since stylesheetname is not constant


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