Scribus
Open source desktop publishing at your fingertips
StoryText Class Reference

#include <storytext.h>

Inheritance diagram for StoryText:
Collaboration diagram for StoryText:

Public Slots

void invalidateAll ()
 call this if some logical style changes (redos shaping and layout)
 

Signals

void changed ()
 

Public Member Functions

 StoryText (ScribusDoc *doc)
 
 StoryText (const StoryText &other)
 
StoryTextoperator= (const StoryText &other)
 
void setDoc (ScribusDoc *docin)
 
virtual void saxx (SaxHandler &handler, const Xml_string &elemtag) const
 
virtual void saxx (SaxHandler &handler) const
 
int cursorPosition () const
 
void setCursorPosition (int pos, bool relative=false)
 
void normalizeCursorPosition ()
 
int normalizedCursorPosition ()
 
void clear ()
 
StoryText copy () const
 
int indexOf (const QString &str, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
 
int indexOf (QChar ch, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
 
void insert (const StoryText &other, bool onlySelection=false)
 
void insert (int pos, const StoryText &other, bool onlySelection=false)
 
void append (const StoryText &other)
 
void removeChars (int pos, uint len)
 
void trim ()
 
void insertChars (QString txt, bool applyNeighbourStyle=false)
 
void insertChars (int pos, QString txt, bool applyNeighbourStyle=false)
 
void insertObject (int obj)
 
void insertObject (int pos, int obj)
 
void insertMark (Mark *Mark, int pos=-1)
 
void replaceChar (int pos, QChar ch)
 
int replaceWord (int pos, QString newWord)
 
void replaceObject (int pos, int obj)
 
void hyphenateWord (int pos, uint len, char *hyphens)
 
int length () const
 
QString plainText () const
 
QChar text () const
 
QChar text (int pos) const
 
QString text (int pos, uint len) const
 
QString sentence (int pos, int &posn)
 
QString wordAt (int pos) const
 
bool hasObject (int pos) const
 
PageItemobject (int pos) const
 
bool hasMark (int pos, Mark *mrk=NULL) const
 
Markmark (int pos) const
 
void replaceMark (int pos, Mark *mrk)
 
const CharStylecharStyle () const
 
const CharStylecharStyle (int pos) const
 
const ParagraphStyleparagraphStyle () const
 
const ParagraphStyleparagraphStyle (int pos) const
 
const ParagraphStyledefaultStyle () const
 
void setDefaultStyle (const ParagraphStyle &style)
 
void setCharStyle (int pos, uint len, const CharStyle &style)
 
void setStyle (int pos, const ParagraphStyle &style)
 
void applyCharStyle (int pos, uint len, const CharStyle &style)
 
void applyStyle (int pos, const ParagraphStyle &style, bool rmDirectFormatting=false)
 
void eraseCharStyle (int pos, uint len, const CharStyle &style)
 
void eraseStyle (int pos, const ParagraphStyle &style)
 
void replaceStyles (QMap< QString, QString > newNameForOld)
 
void replaceCharStyles (QMap< QString, QString > newNameForOld)
 
void fixLegacyFormatting ()
 
void fixLegacyFormatting (int pos)
 
void getNamedResources (ResourceCollection &lists) const
 
void replaceNamedResources (ResourceCollection &newNames)
 
uint nrOfParagraphs () const
 
int startOfParagraph () const
 
int startOfParagraph (uint index) const
 
int endOfParagraph () const
 
int endOfParagraph (uint index) const
 
uint nrOfParagraph () const
 
uint nrOfParagraph (int pos) const
 
uint nrOfRuns () const
 
int startOfRun (uint index) const
 
int endOfRun (uint index) const
 
int nextChar (int pos)
 
int prevChar (int pos)
 
int firstWord ()
 
int nextWord (int pos)
 
int prevWord (int pos)
 
int endOfWord (int pos) const
 
int nextSentence (int pos)
 
int prevSentence (int pos)
 
int nextParagraph (int pos)
 
int prevParagraph (int pos)
 
void selectAll ()
 
void deselectAll ()
 
void removeSelection ()
 
void extendSelection (int oldPos, int newPos)
 
int selectWord (int pos)
 
void select (int pos, uint len, bool on=true)
 
bool selected (int pos) const
 
int startOfSelection () const
 
int endOfSelection () const
 
int lengthOfSelection () const
 
GlyphLayoutgetGlyphs (int pos)
 
const GlyphLayoutgetGlyphs (int pos) const
 
LayoutFlags flags (int pos) const
 
bool hasFlag (int pos, LayoutFlags flag) const
 
void setFlag (int pos, LayoutFlags flag)
 
void clearFlag (int pos, LayoutFlags flag)
 
void invalidateObject (const PageItem *embedded)
 call this if the shape of an embedded object changes (redos layout)
 
void invalidateLayout ()
 call this if the shape of the paragraph changes (redos layout)
 

Static Public Member Functions

static void desaxeRules (const Xml_string &prefixPattern, desaxe::Digester &ruleset, Xml_string elemtag=saxxDefaultElem)
 
- Static Public Member Functions inherited from SaxIO
static void desaxeRules (const Xml_string &, desaxe::Digester &, const Xml_string=saxxDefaultElem)
 

Static Public Attributes

static const Xml_string saxxDefaultElem
 
- Static Public Attributes inherited from SaxIO
static const Xml_string saxxDefaultElem
 

Detailed Description

This class holds the text of a Scribus textframe and pointers to its styles and embedded objects.

The logical view of the text consists of a sequence of Unicode chars. Partition objects keep track of the positions of style changes, paragraph ends and embedded objects.

The physical view consists of a sequence of ScriptItems. Each ScriptItem corresponds to a subsequence of Unicode chars in the original sequence and associates this with an array of glyph indices. Metrics information give the physical position of the ScriptItem in the textframe and its bounding box. For each glyph there's also its advance and the relative offsets to its basepoint. Other information in the ScriptItem is only used by the layouter.

Member Function Documentation

void StoryText::saxx ( SaxHandler ,
const Xml_string &   
) const
virtual

Writes an XML representation of this object

Implements SaxIO.

virtual void StoryText::saxx ( SaxHandler ) const
inlinevirtual

Writes an XML representation of this object using the default element tag, see below

Implements SaxIO.


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