Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

CharStyle Class Reference

#include <charstyle.h>

Inheritance diagram for CharStyle:

Inheritance graph
[legend]
Collaboration diagram for CharStyle:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CharStyle ()
 CharStyle (const ScFace &font, int size, StyleFlag style=ScStyle_Default)
 CharStyle (const CharStyle &other)
CharStyleoperator= (const CharStyle &other)
virtual void saxx (SaxHandler &handler, const Xml_string &elemtag) const
virtual void saxx (SaxHandler &handler) const
void getNamedResources (ResourceCollection &lists) const
void replaceNamedResources (ResourceCollection &newNames)
QString displayName () const
void update (const StyleContext *b)
void updateFeatures ()
bool equiv (const Style &other) const
void applyCharStyle (const CharStyle &other)
void eraseCharStyle (const CharStyle &other)
void setStyle (const CharStyle &other)
void erase ()
QString asString () const
const StyleFlag effects () const
void setEffects (StyleFlag flags)
 ATTRDEF (ScFace, font, Font, ScFace::none()) ATTRDEF(QStringList
 QStringList (CharStyle::INHERIT)) ATTRDEF(ScFace
 ScFace::none ()) ATTRDEF(QStringList
 QStringList (CharStyle::INHERIT)) ATTRDEF(ScFace
 ScFace::none ()) ATTRDEF(QStringList
 QStringList (CharStyle::INHERIT)) ATTRDEF(ScFace
 ScFace::none ()) ATTRDEF(QStringList
 QStringList (CharStyle::INHERIT)) ATTRDEF(ScFace
 ScFace::none ()) ATTRDEF(QStringList
 ATTRDEF (ScFace, font, Font, ScFace::none()) ATTRDEF(QStringList

Static Public Member Functions

static void desaxeRules (const Xml_string &prefixPattern, desaxe::Digester &ruleset, Xml_string elemtag=saxxDefaultElem)

Public Attributes

 features
 Features
 font
 Font
QStringList(CharStyle::INHERIT))
private StyleFlag 
m_Effects

Static Public Attributes

static const QString INHERIT = "inherit"
static const QString BOLD = "bold"
static const QString ITALIC = "italic"
static const QString UNDERLINE = "underline"
static const QString UNDERLINEWORDS = "underlinewords"
static const QString STRIKETHROUGH = "strike"
static const QString SUPERSCRIPT = "superscript"
static const QString SUBSCRIPT = "subscript"
static const QString OUTLINE = "outline"
static const QString SHADOWED = "shadowed"
static const QString ALLCAPS = "allcaps"
static const QString SMALLCAPS = "smallcaps"
static const Xml_string saxxDefaultElem


Detailed Description

Definition at line 76 of file charstyle.h.


Constructor & Destructor Documentation

CharStyle::CharStyle (  )  [inline]

Definition at line 92 of file charstyle.h.

CharStyle::CharStyle ( const ScFace font,
int  size,
StyleFlag  style = ScStyle_Default 
) [inline]

Definition at line 138 of file charstyle.h.

CharStyle::CharStyle ( const CharStyle other  )  [inline]

Definition at line 215 of file charstyle.h.


Member Function Documentation

CharStyle & CharStyle::operator= ( const CharStyle other  )  [inline]

Definition at line 201 of file charstyle.h.

References Style::m_contextversion, and m_Effects.

void CharStyle::desaxeRules ( const Xml_string ,
desaxe::Digester ,
Xml_string  Xml_string = saxxDefaultElem 
) [static]

Fills the digester with rules wich ensure that an object which was saved via saxx() will be reconstructed on top of the digester stack. The prefix pattern shall be used to create patterns which constrain the added rules to this context. Unfortunately there are no virtual static functions, so this is just a dummy serving as a template.

Reimplemented from Style.

Definition at line 502 of file charstyle.cpp.

References desaxe::Digester::addRule().

Referenced by StoryText::desaxeRules(), ParagraphStyle::desaxeRules(), and Serializer::Serializer().

void CharStyle::saxx ( SaxHandler ,
const Xml_string  
) const [virtual]

Writes an XML representation of this object

Implements SaxIO.

Definition at line 464 of file charstyle.cpp.

References SaxHandler::begin(), SaxHandler::end(), mkXMLName(), Style::name(), and Style::saxxAttributes().

Referenced by StoryText::saxx(), ParagraphStyle::saxx(), and Serializer::serializeObjects().

virtual void CharStyle::saxx ( SaxHandler  )  const [inline, virtual]

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

Implements SaxIO.

Definition at line 195 of file charstyle.h.

void CharStyle::getNamedResources ( ResourceCollection lists  )  const

void CharStyle::replaceNamedResources ( ResourceCollection newNames  ) 

QString CharStyle::displayName (  )  const [virtual]

void CharStyle::update ( const StyleContext b  )  [virtual]

sets a new StyleContext if b is not NULL and then uses the StyleContext to set all inherited attributes to their valid value.

Reimplemented from Style.

Definition at line 187 of file charstyle.cpp.

References Style::parentStyle(), Style::update(), and updateFeatures().

void CharStyle::updateFeatures (  ) 

This method may alter any of the attributes depending on the value of 'features'. Used for font effects

Definition at line 246 of file charstyle.cpp.

References m_Effects, Style::parentStyle(), and ScStyle_UserStyles.

Referenced by applyCharStyle(), eraseCharStyle(), replaceNamedResources(), setStyle(), and update().

bool CharStyle::equiv ( const Style other  )  const [virtual]

returns true if both Styles are of the same type, inherit the same attributes, have the same parent, and agree on all attributes which are not inherited. The StyleContext, the name and any inherited attrinutes may be different.

Implements Style.

Definition at line 129 of file charstyle.cpp.

References Style::parent(), and Style::validate().

Referenced by ParagraphStyle::equiv().

void CharStyle::applyCharStyle ( const CharStyle other  ) 

void CharStyle::eraseCharStyle ( const CharStyle other  ) 

void CharStyle::setStyle ( const CharStyle other  ) 

void CharStyle::erase (  )  [inline, virtual]

resets all attributes to their defaults and makes them inherited. name and parent are not affected.

Implements Style.

Definition at line 214 of file charstyle.h.

QString CharStyle::asString (  )  const

const StyleFlag CharStyle::effects (  )  const [inline]

void CharStyle::setEffects ( StyleFlag  flags  )  [inline]

CharStyle::ATTRDEF ( ScFace  ,
font  ,
Font  ,
ScFace::  none() 
)

CharStyle::QStringList ( CharStyle::INHERIT   ) 

setter: sets the attribute's value and clears inherited flag

Type constraints

CharStyle::ScFace::none (  ) 

Type constraints

CharStyle::QStringList ( CharStyle::INHERIT   ) 

setter: resets the attribute's value and sets inherited flag

Type constraints

CharStyle::ScFace::none (  ) 

Type constraints

CharStyle::QStringList ( CharStyle::INHERIT   ) 

isInherited: returns true if the attribute is inherited

Type constraints

CharStyle::ScFace::none (  ) 

Type constraints

CharStyle::QStringList ( CharStyle::INHERIT   ) 

isDefined: returns true if the attribute is defined in this style or any parent

Type constraints

CharStyle::ScFace::none (  ) 

Type constraints

CharStyle::ATTRDEF ( ScFace  ,
font  ,
Font  ,
ScFace::  none() 
)


Member Data Documentation

const QString CharStyle::INHERIT = "inherit" [static]

const QString CharStyle::BOLD = "bold" [static]

Definition at line 80 of file charstyle.h.

const QString CharStyle::ITALIC = "italic" [static]

Definition at line 81 of file charstyle.h.

const QString CharStyle::UNDERLINE = "underline" [static]

Definition at line 82 of file charstyle.h.

Referenced by StyleFlag::featureList().

const QString CharStyle::UNDERLINEWORDS = "underlinewords" [static]

Definition at line 83 of file charstyle.h.

Referenced by StyleFlag::featureList().

const QString CharStyle::STRIKETHROUGH = "strike" [static]

Definition at line 84 of file charstyle.h.

Referenced by StyleFlag::featureList().

const QString CharStyle::SUPERSCRIPT = "superscript" [static]

Definition at line 85 of file charstyle.h.

Referenced by StyleFlag::featureList().

const QString CharStyle::SUBSCRIPT = "subscript" [static]

Definition at line 86 of file charstyle.h.

Referenced by StyleFlag::featureList().

const QString CharStyle::OUTLINE = "outline" [static]

Definition at line 87 of file charstyle.h.

Referenced by StyleFlag::featureList().

const QString CharStyle::SHADOWED = "shadowed" [static]

Definition at line 88 of file charstyle.h.

Referenced by StyleFlag::featureList().

const QString CharStyle::ALLCAPS = "allcaps" [static]

Definition at line 89 of file charstyle.h.

Referenced by StyleFlag::featureList().

const QString CharStyle::SMALLCAPS = "smallcaps" [static]

Definition at line 90 of file charstyle.h.

Referenced by StyleFlag::featureList().

Element tag which is usually used to serialize this object. "" means no elem is created by saxx()

Reimplemented from SaxIO.

Definition at line 191 of file charstyle.h.

Referenced by StoryText::desaxeRules(), ParagraphStyle::desaxeRules(), and SpanAction_body::end().

Definition at line 265 of file charstyle.h.

Definition at line 309 of file charstyle.h.

Definition at line 448 of file charstyle.h.

Referenced by operator=(), and updateFeatures().


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.