lib
KoVariable Class Reference
#include <KoVariable.h>
Inheritance diagram for KoVariable:

Detailed Description
A KoVariable is a custom item, i.e.considered as a single character. KoVariable is the abstract base class.
Definition at line 362 of file KoVariable.h.
Public Member Functions | |
KoVariable (KoTextDocument *fs, KoVariableFormat *varFormat, KoVariableCollection *varColl) | |
virtual | ~KoVariable () |
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 |
Member Function Documentation
|
All coordinates are in pixels.
Implements KoTextCustomItem. Reimplemented in KoLinkVariable, and KoNoteVariable. Definition at line 920 of file KoVariable.cpp. |
|
Called by drawCustomItem. Some special variables can reimplement drawCustomItem to change the parameters passed to drawCustomItemHelper Definition at line 928 of file KoVariable.cpp. |
|
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 890 of file KoVariable.cpp. |
|
Reimplement this to calculate the item width It is important to start with "if ( m_deleted ) return;".
Reimplemented from KoTextCustomItem. Reimplemented in KoDateVariable, and KoTimeVariable. Definition at line 871 of file KoVariable.cpp. |
|
Save the variable. Public API, does the common job and then calls saveVariable. Implements KoTextCustomItem. Definition at line 998 of file KoVariable.cpp. |
|
Save to Oasis XML.
Implements KoTextCustomItem. Reimplemented in KoDateVariable, KoTimeVariable, KoCustomVariable, KoFieldVariable, KoMailMergeVariable, KoPageVariable, KoLinkVariable, KoNoteVariable, and KoStatisticVariable. Definition at line 1026 of file KoVariable.cpp. |
|
Variable should reimplement this to implement saving.
Implemented in KoDateVariable, KoTimeVariable, KoCustomVariable, KoFieldVariable, KoMailMergeVariable, KoPageVariable, KoLinkVariable, KoNoteVariable, and KoStatisticVariable. |
|
Set this variable's subtype.
Reimplemented in KoDateVariable, KoTimeVariable, KoFieldVariable, KoPageVariable, and KoStatisticVariable. Definition at line 429 of file KoVariable.h. |
|
List of available subtypes (translated). Use variableSubType() to map index to ID.
Reimplemented in KoDateVariable, KoTimeVariable, KoFieldVariable, KoPageVariable, and KoStatisticVariable. Definition at line 866 of file KoVariable.cpp. |
|
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, KoFieldVariable, KoMailMergeVariable, KoLinkVariable, and KoNoteVariable. Definition at line 908 of file KoVariable.cpp. |
|
Part of the KoTextCustomItem interface. Returns the code for a variable, see DTD. Do NOT reimplement in koVariable-derived classes. Implements KoTextCustomItem. Definition at line 423 of file KoVariable.h. |
|
Converts the
Reimplemented in KoFieldVariable. Definition at line 434 of file KoVariable.h. |
|
Return the variable value, as a QVariant, before format conversion.
Definition at line 404 of file KoVariable.h. |
The documentation for this class was generated from the following files: