KoVariable Class Reference
A KoVariable is a custom item, i.e. More...
#include <kovariable.h>
Inheritance diagram for KoVariable:


Public Member Functions | |
| KoVariable (KoTextDocument *fs, KoVariableFormat *varFormat, KoVariableCollection *varColl) | |
| virtual VariableType | type () const =0 |
| virtual short int | subType () const |
| virtual Placement | placement () const |
| virtual void | resize () |
| virtual int | ascent () const |
| virtual int | widthHint () const |
| virtual int | minimumWidth () const |
| virtual void | drawCustomItem (QPainter *p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const QColorGroup &cg, bool selected, int offset, bool drawingShadow) |
| void | drawCustomItemHelper (QPainter *p, int x, int y, int wpix, int hpix, int ascentpix, const QColorGroup &cg, bool selected, int offset, KoTextFormat *fmt, const QFont &font, QColor textColor, bool drawingShadow) |
| void | setVariableFormat (KoVariableFormat *_varFormat) |
| KoVariableFormat * | variableFormat () const |
| KoVariableCollection * | variableColl () const |
| virtual QString | text (bool realValue=false) |
| virtual QString | fieldCode () |
| QVariant | varValue () const |
| void | recalcAndRepaint () |
| virtual void | save (QDomElement &parentElem) |
| virtual void | saveOasis (KoXmlWriter &writer, KoSavingContext &context) const |
| virtual void | load (QDomElement &elem) |
| virtual void | loadOasis (const QDomElement &elem, KoOasisContext &context) |
| virtual int | typeId () const |
| virtual QStringList | subTypeList () |
| virtual void | setVariableSubType (short int) |
| virtual short int | variableSubType (short int menuNumber) |
| QString | convertKlocaleToQDateTimeFormat (const QString &_format) |
Protected Member Functions | |
| virtual void | saveVariable (QDomElement &parentElem)=0 |
| virtual int | correctValue () const |
Protected Attributes | |
| KoVariableFormat * | m_varFormat |
| KoVariableCollection * | m_varColl |
| QVariant | m_varValue |
| int | m_ascent |
| Private * | d |
Detailed Description
A KoVariable is a custom item, i.e.considered as a single character. KoVariable is the abstract base class.
Definition at line 348 of file kovariable.h.
Member Function Documentation
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Called by drawCustomItem. Some special variables can reimplement drawCustomItem to change the parameters passed to drawCustomItemHelper Definition at line 935 of file kovariable.cc. References KoTextFormat::defaultTextColor(), KoTextFormat::offsetFromBaseLine(), KoTextFormat::shadowColor(), text(), KoTextFormat::textBackgroundColor(), and KoTextFormat::vAlign(). |
|
|
Returns the text to be displayed for this variable It doesn't need to be cached, convert() is fast, and it's the actual value (date, time etc. ) that is cached in the variable already. Reimplemented in KoCustomVariable, and KoFieldVariable. Definition at line 915 of file kovariable.cc. References KoVariableFormat::convert(), and KoTextFormat::displayedString(). Referenced by drawCustomItemHelper(), and save(). |
|
|
Return the variable value, as a QVariant, before format conversion.
Definition at line 388 of file kovariable.h. |
|
|
Ask this variable to recalculate and to repaint itself Only use this if you're working on a single variable (e.g. popupmenu). Otherwise, better do the repainting all at once.
Definition at line 897 of file kovariable.cc. |
|
|
Save the variable. Public API, does the common job and then calls saveVariable. Definition at line 987 of file kovariable.cc. References KoVariableFormat::key(), saveVariable(), and text(). |
|
|
Part of the KoTextCustomItem interface. Returns the code for a variable, see DTD. Do NOT reimplement in koVariable-derived classes. Definition at line 407 of file kovariable.h. |
|
|
List of available subtypes (translated). Use variableSubType() to map index to ID.
Reimplemented in KoDateVariable, KoTimeVariable, KoFieldVariable, and KoPageVariable. Definition at line 874 of file kovariable.cc. |
|
|
Set this variable's subtype.
Reimplemented in KoDateVariable, KoTimeVariable, KoFieldVariable, and KoPageVariable. Definition at line 413 of file kovariable.h. |
|
|
Converts the
Reimplemented in KoFieldVariable. Definition at line 418 of file kovariable.h. |
|
|
Variable should reimplement this to implement saving.
Implemented in KoDateVariable, KoTimeVariable, KoCustomVariable, KoFieldVariable, and KoPageVariable. Referenced by save(). |
The documentation for this class was generated from the following files:
