#include <KoVariable.h>
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 (TQPainter *p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const TQColorGroup &cg, bool selected, int offset, bool drawingShadow) |
| void | drawCustomItemHelper (TQPainter *p, int x, int y, int wpix, int hpix, int ascentpix, const TQColorGroup &cg, bool selected, int offset, KoTextFormat *fmt, const TQFont &font, TQColor textColor, bool drawingShadow) |
| void | setVariableFormat (KoVariableFormat *_varFormat) |
| KoVariableFormat * | variableFormat () const |
| KoVariableCollection * | variableColl () const |
| virtual TQString | text (bool realValue=false) |
| virtual TQString | fieldCode () |
| TQVariant | varValue () const |
| void | recalcAndRepaint () |
| virtual void | save (TQDomElement &parentElem) |
| virtual void | saveOasis (KoXmlWriter &writer, KoSavingContext &context) const |
| virtual void | load (TQDomElement &elem) |
| virtual void | loadOasis (const TQDomElement &elem, KoOasisContext &context) |
| virtual int | typeId () const |
| virtual TQStringList | subTypeList () |
| virtual void | setVariableSubType (short int) |
| virtual short int | variableSubType (short int menuNumber) |
| TQString | convertKlocaleToTQDateTimeFormat (const TQString &_format) |
| Public Member Functions inherited from KoTextCustomItem | |
| KoTextCustomItem (KoTextDocument *p) | |
| virtual void | draw (TQPainter *p, int x, int y, int cx, int cy, int cw, int ch, const TQColorGroup &cg, bool selected) |
| virtual void | finalize () |
| void | move (int x, int y) |
| int | x () const |
| int | y () const |
| virtual void | setFormat (KoTextFormat *) |
| bool | placeInline () |
| virtual bool | ownLine () const |
| virtual void | resize (int nwidth) |
| virtual void | invalidate () |
| virtual bool | isNested () const |
| virtual TQString | richText () const |
| TQRect | geometry () const |
| virtual bool | enter (KoTextCursor *, KoTextDocument *&doc, KoTextParag *¶g, int &idx, int &ox, int &oy, bool atEnd=false) |
| virtual bool | enterAt (KoTextCursor *, KoTextDocument *&doc, KoTextParag *¶g, int &idx, int &ox, int &oy, const TQPoint &) |
| virtual bool | next (KoTextCursor *, KoTextDocument *&doc, KoTextParag *¶g, int &idx, int &ox, int &oy) |
| virtual bool | prev (KoTextCursor *, KoTextDocument *&doc, KoTextParag *¶g, int &idx, int &ox, int &oy) |
| virtual bool | down (KoTextCursor *, KoTextDocument *&doc, KoTextParag *¶g, int &idx, int &ox, int &oy) |
| virtual bool | up (KoTextCursor *, KoTextDocument *&doc, KoTextParag *¶g, int &idx, int &ox, int &oy) |
| void | setParagraph (KoTextParag *p) |
| KoTextParag * | paragraph () const |
| virtual void | pageBreak (int, KoTextFlow *) |
| KoTextDocument * | textDocument () const |
| virtual void | setDeleted (bool b) |
| bool | isDeleted () const |
| virtual KCommand * | createCommand () |
| virtual KCommand * | deleteCommand () |
| virtual void | recalc () |
| int | index () const |
| KoTextFormat * | format () const |
Protected Member Functions | |
| virtual void | saveVariable (TQDomElement &parentElem)=0 |
| virtual int | correctValue () const |
Protected Attributes | |
| KoVariableFormat * | m_varFormat |
| KoVariableCollection * | m_varColl |
| TQVariant | m_varValue |
| int | m_ascent |
| Private * | d |
| Protected Attributes inherited from KoTextCustomItem | |
| bool | m_deleted |
| int | xpos |
| int | ypos |
Additional Inherited Members | |
| Public Types inherited from KoTextCustomItem | |
| enum | Placement { PlaceInline = 0 , PlaceLeft , PlaceRight } |
| Public Attributes inherited from KoTextCustomItem | |
| int | width |
| int | height |
| KoTextDocument * | parent |
Detailed Description
A KoVariable is a custom item, i.e.
considered as a single character. KoVariable is the abstract base class.
Definition at line 363 of file KoVariable.h.
Constructor & Destructor Documentation
◆ KoVariable()
| KoVariable::KoVariable | ( | KoTextDocument * | fs, |
| KoVariableFormat * | varFormat, | ||
| KoVariableCollection * | varColl ) |
Definition at line 850 of file KoVariable.cpp.
◆ ~KoVariable()
|
virtual |
Definition at line 860 of file KoVariable.cpp.
Member Function Documentation
◆ ascent()
|
inlinevirtual |
Reimplemented from KoTextCustomItem.
Definition at line 375 of file KoVariable.h.
◆ convertKlocaleToTQDateTimeFormat()
| TQString KoVariable::convertKlocaleToTQDateTimeFormat | ( | const TQString & | _format | ) |
Definition at line 1046 of file KoVariable.cpp.
◆ correctValue()
|
inlineprotectedvirtual |
Definition at line 442 of file KoVariable.h.
◆ drawCustomItem()
|
virtual |
All coordinates are in pixels.
Implements KoTextCustomItem.
Definition at line 921 of file KoVariable.cpp.
◆ drawCustomItemHelper()
| void KoVariable::drawCustomItemHelper | ( | TQPainter * | p, |
| int | x, | ||
| int | y, | ||
| int | wpix, | ||
| int | hpix, | ||
| int | ascentpix, | ||
| const TQColorGroup & | cg, | ||
| bool | selected, | ||
| int | offset, | ||
| KoTextFormat * | fmt, | ||
| const TQFont & | font, | ||
| TQColor | textColor, | ||
| bool | drawingShadow ) |
Called by drawCustomItem.
Some special variables can reimplement drawCustomItem to change the parameters passed to drawCustomItemHelper
Definition at line 929 of file KoVariable.cpp.
◆ fieldCode()
|
virtual |
Definition at line 904 of file KoVariable.cpp.
◆ load()
|
virtual |
Definition at line 1017 of file KoVariable.cpp.
◆ loadOasis()
|
virtual |
Definition at line 1022 of file KoVariable.cpp.
◆ minimumWidth()
|
inlinevirtual |
Reimplemented from KoTextCustomItem.
Definition at line 377 of file KoVariable.h.
◆ placement()
|
inlinevirtual |
Reimplemented from KoTextCustomItem.
Definition at line 373 of file KoVariable.h.
◆ recalcAndRepaint()
| void KoVariable::recalcAndRepaint | ( | ) |
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.
- See also
- KoVariableCollection::recalcVariables()
Definition at line 891 of file KoVariable.cpp.
◆ resize()
|
virtual |
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 872 of file KoVariable.cpp.
◆ save()
|
virtual |
Save the variable.
Public API, does the common job and then calls saveVariable.
Implements KoTextCustomItem.
Definition at line 999 of file KoVariable.cpp.
◆ saveOasis()
|
virtual |
Save to Oasis XML.
Implements KoTextCustomItem.
Reimplemented in KoCustomVariable, KoDateVariable, KoFieldVariable, KoPageVariable, and KoTimeVariable.
Definition at line 1027 of file KoVariable.cpp.
◆ saveVariable()
|
protectedpure virtual |
Variable should reimplement this to implement saving.
Implemented in KoCustomVariable, KoDateVariable, KoFieldVariable, KoPageVariable, and KoTimeVariable.
◆ setVariableFormat()
| void KoVariable::setVariableFormat | ( | KoVariableFormat * | _varFormat | ) |
Definition at line 1031 of file KoVariable.cpp.
◆ setVariableSubType()
|
inlinevirtual |
Set this variable's subtype.
Reimplemented in KoDateVariable, KoFieldVariable, KoPageVariable, and KoTimeVariable.
Definition at line 430 of file KoVariable.h.
◆ subType()
|
inlinevirtual |
Definition at line 370 of file KoVariable.h.
◆ subTypeList()
|
virtual |
List of available subtypes (translated). Use variableSubType() to map index to ID.
Reimplemented in KoDateVariable, KoFieldVariable, KoPageVariable, and KoTimeVariable.
Definition at line 867 of file KoVariable.cpp.
◆ text()
|
virtual |
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 909 of file KoVariable.cpp.
◆ typeId()
|
inlinevirtual |
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 424 of file KoVariable.h.
◆ variableColl()
|
inline |
Definition at line 392 of file KoVariable.h.
◆ variableFormat()
|
inline |
Definition at line 389 of file KoVariable.h.
◆ variableSubType()
|
inlinevirtual |
Converts the menuNumber to variable subtype number (VST_x).
Reimplemented in KoFieldVariable.
Definition at line 435 of file KoVariable.h.
◆ varValue()
|
inline |
Return the variable value, as a TQVariant, before format conversion.
Definition at line 405 of file KoVariable.h.
◆ widthHint()
|
inlinevirtual |
Reimplemented from KoTextCustomItem.
Definition at line 376 of file KoVariable.h.
Member Data Documentation
◆ d
|
protected |
Definition at line 452 of file KoVariable.h.
◆ m_ascent
|
protected |
Definition at line 447 of file KoVariable.h.
◆ m_varColl
|
protected |
Definition at line 445 of file KoVariable.h.
◆ m_varFormat
|
protected |
Definition at line 444 of file KoVariable.h.
◆ m_varValue
|
protected |
Definition at line 446 of file KoVariable.h.
The documentation for this class was generated from the following files:
