CharStyle Class Reference
#include <charstyle.h>


Public Member Functions | |
| CharStyle () | |
| CharStyle (const ScFace &font, int size, StyleFlag style=ScStyle_Default) | |
| CharStyle (const CharStyle &other) | |
| CharStyle & | operator= (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.
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
| 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 |
Definition at line 391 of file charstyle.cpp.
References ResourceCollection::collectCharStyle(), ResourceCollection::collectColor(), ResourceCollection::collectFont(), font, and Style::parentStyle().
Referenced by StoryText::getNamedResources(), and ParagraphStyle::getNamedResources().
| void CharStyle::replaceNamedResources | ( | ResourceCollection & | newNames | ) |
Definition at line 401 of file charstyle.cpp.
References ResourceCollection::availableFonts, ResourceCollection::charStyles(), ResourceCollection::colors(), SCFonts::findFont(), font, ResourceCollection::fonts(), Style::hasParent(), Style::parent(), Style::setParent(), and updateFeatures().
Referenced by StoryText::replaceNamedResources(), and ParagraphStyle::replaceNamedResources().
| QString CharStyle::displayName | ( | ) | const [virtual] |
Reimplemented from Style.
Definition at line 144 of file charstyle.cpp.
References Style::displayName(), Style::hasName(), Style::hasParent(), Style::m_context, Style::name(), and Style::parentStyle().
| 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 | ) |
Definition at line 105 of file charstyle.cpp.
References Style::applyStyle(), and updateFeatures().
Referenced by StoryText::applyCharStyle(), ParagraphStyle::applyStyle(), and StoryText::insertChars().
| void CharStyle::eraseCharStyle | ( | const CharStyle & | other | ) |
Definition at line 117 of file charstyle.cpp.
References Style::eraseStyle(), updateFeatures(), and Style::validate().
Referenced by StoryText::eraseCharStyle(), and ParagraphStyle::eraseStyle().
| void CharStyle::setStyle | ( | const CharStyle & | other | ) |
Definition at line 378 of file charstyle.cpp.
References Style::m_contextversion, Style::parent(), Style::setParent(), updateFeatures(), and Style::validate().
Referenced by StoryEditor::changeStyle(), StoryEditor::changeStyleSB(), StoryEditor::newTxStyle(), StoryText::setCharStyle(), and ParagraphStyle::setStyle().
| 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 |
Definition at line 156 of file charstyle.cpp.
References font, Style::hasParent(), Style::parent(), and tr().
Referenced by ScribusDoc::itemSelection_ApplyCharStyle(), and ScribusDoc::itemSelection_SetCharStyle().
| const StyleFlag CharStyle::effects | ( | ) | const [inline] |
This property will be evaluated at runtime and is not stored. See 'updateFeatures()'
Definition at line 219 of file charstyle.h.
Referenced by LineControl::breakLine(), StoryEditor::changeStyle(), StoryEditor::changeStyleSB(), DocumentChecker::checkDocument(), ScribusDoc::checkItemForFonts(), ScPreview::createPreview(), ScPageOutput::DrawGlyphs(), ScPageOutput::DrawItem_TextFrame(), Scribus134Format::GetItemText(), PageItem_TextFrame::handleModeEditKey(), ScribusMainWindow::HaveNewSel(), ScribusDoc::itemSelection_SetEffects(), justifyLine(), PageItem_TextFrame::layout(), opticalLeftMargin(), opticalRightMargin(), ScriXmlDoc::SetItemProps(), ScribusMainWindow::setTBvals(), PSLib::setTextCh(), PDFLibCore::setTextCh(), SVGExPlug::SetTextProps(), PSLib::setTextSt(), SMCStyleWidget::show(), SearchReplace::slotDoReplace(), SearchReplace::slotDoSearch(), ScribusView::slotSetCurs(), ScribusMainWindow::specialActionKeyEvent(), textWithSmartHyphens(), SEditor::updateAll(), and SEditor::updateFromChars().
| void CharStyle::setEffects | ( | StyleFlag | flags | ) | [inline] |
Definition at line 220 of file charstyle.h.
Referenced by Scribus134Format::GetItemText(), StoryText::insertChars(), PageItem_TextFrame::layout(), and ScribusMainWindow::specialActionKeyEvent().
| 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
-
Member Data Documentation
const QString CharStyle::INHERIT = "inherit" [static] |
Definition at line 79 of file charstyle.h.
Referenced by ScPreview::createPreview(), StyleFlag::featureList(), ScribusDoc::init(), and SampleItem::SampleItem().
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] |
const QString CharStyle::UNDERLINEWORDS = "underlinewords" [static] |
const QString CharStyle::STRIKETHROUGH = "strike" [static] |
const QString CharStyle::SUPERSCRIPT = "superscript" [static] |
const QString CharStyle::SUBSCRIPT = "subscript" [static] |
const QString CharStyle::OUTLINE = "outline" [static] |
const QString CharStyle::SHADOWED = "shadowed" [static] |
const QString CharStyle::ALLCAPS = "allcaps" [static] |
const QString CharStyle::SMALLCAPS = "smallcaps" [static] |
const Xml_string CharStyle::saxxDefaultElem [static] |
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.
Referenced by Scribus134Format::putCStyle(), SearchReplace::slotDoReplace(), and gtAction::write().
Definition at line 265 of file charstyle.h.
Definition at line 309 of file charstyle.h.
Referenced by asString(), StoryEditor::changeStyle(), StoryEditor::changeStyleSB(), DocumentChecker::checkDocument(), ScribusDoc::checkItemForFonts(), SearchReplace::clear(), ScPreview::createPreview(), ScPageOutput::DrawGlyphs(), ScPageOutput::DrawItem_TextFrame(), fixLegacyCharStyle(), FontPreview::FontPreview(), LineControl::getLineAscent(), LineControl::getLineHeight(), getNamedResources(), SampleItem::getSample(), PageItem_TextFrame::handleModeEditKey(), ScribusMainWindow::HaveNewSel(), ScribusDoc::itemSelection_SetFontSize(), PageItem_TextFrame::layout(), opticalLeftMargin(), opticalRightMargin(), PDFLibCore::PDF_Annotation(), PDFLibCore::PDF_Begin_Doc(), AIPlug::processData(), Scribus134Format::putCStyle(), SearchReplace::readPrefs(), ScribusDoc::reorganiseFonts(), replaceNamedResources(), TabPDFOptions::restoreDefaults(), scribus_getfont(), SearchReplace::SearchReplace(), ScribusMainWindow::setAppMode(), CharSelect::setDoc(), ScriXmlDoc::SetItemProps(), Scribus134Format::SetItemProps(), ScribusMainWindow::SetNewFont(), ScribusMainWindow::setTBvals(), PSLib::setTextCh(), PDFLibCore::setTextCh(), SVGExPlug::SetTextProps(), SMCStyleWidget::show(), SearchReplace::slotDoReplace(), SearchReplace::slotDoSearch(), ScribusView::slotSetCurs(), gtAction::validateFont(), and gtAction::write().
Definition at line 309 of file charstyle.h.
| QStringList (CharStyle::INHERIT)) private StyleFlag CharStyle::m_Effects |
The documentation for this class was generated from the following files:
