lib

#include <KoVariable.h>

Inheritance diagram for KoDateVariable:
KoVariable KoTextCustomItem

Public Types

enum  {
  VST_DATE_FIX = 0 , VST_DATE_CURRENT = 1 , VST_DATE_LAST_PRINTING = 2 , VST_DATE_CREATE_FILE = 3 ,
  VST_DATE_MODIFY_FILE =4
}
 
- Public Types inherited from KoTextCustomItem
enum  Placement { PlaceInline = 0 , PlaceLeft , PlaceRight }
 

Public Member Functions

 KoDateVariable (KoTextDocument *textdoc, short int subtype, KoVariableFormat *_varFormat, KoVariableCollection *_varColl, int _correctDate=0)
 
virtual VariableType type () const
 
virtual void recalc ()
 
virtual TQString fieldCode ()
 
virtual void resize ()
 
void setDate (const TQDate &_date)
 
virtual void saveVariable (TQDomElement &parentElem)
 
virtual int correctValue () const
 
virtual void load (TQDomElement &elem)
 
virtual void loadOasis (const TQDomElement &elem, KoOasisContext &context)
 
virtual void saveOasis (KoXmlWriter &writer, KoSavingContext &context) const
 
virtual TQStringList subTypeList ()
 
virtual void setVariableSubType (short int subtype)
 
virtual short int subType () const
 
- Public Member Functions inherited from KoVariable
 KoVariable (KoTextDocument *fs, KoVariableFormat *varFormat, KoVariableCollection *varColl)
 
virtual Placement placement () const
 
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)
 
TQVariant varValue () const
 
void recalcAndRepaint ()
 
virtual void save (TQDomElement &parentElem)
 
virtual int typeId () const
 
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 *&parag, int &idx, int &ox, int &oy, bool atEnd=false)
 
virtual bool enterAt (KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, const TQPoint &)
 
virtual bool next (KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy)
 
virtual bool prev (KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy)
 
virtual bool down (KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy)
 
virtual bool up (KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, 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 ()
 
int index () const
 
KoTextFormat * format () const
 

Static Public Member Functions

static TQStringList actionTexts ()
 
static TQCString formatStr (int &correct)
 
static TQCString defaultFormat ()
 

Protected Attributes

short int m_subtype
 
int m_correctDate
 
- Protected Attributes inherited from KoVariable
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 Attributes inherited from KoTextCustomItem
int width
 
int height
 
KoTextDocument * parent
 

Detailed Description

Date-related variables.

Definition at line 459 of file KoVariable.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 467 of file KoVariable.h.

Constructor & Destructor Documentation

◆ KoDateVariable()

KoDateVariable::KoDateVariable ( KoTextDocument *  textdoc,
short int  subtype,
KoVariableFormat *  _varFormat,
KoVariableCollection *  _varColl,
int  _correctDate = 0 
)

Definition at line 1174 of file KoVariable.cpp.

Member Function Documentation

◆ actionTexts()

TQStringList KoDateVariable::actionTexts ( )
static

Definition at line 1364 of file KoVariable.cpp.

◆ correctValue()

virtual int KoDateVariable::correctValue ( ) const
inlinevirtual

Reimplemented from KoVariable.

Definition at line 476 of file KoVariable.h.

◆ defaultFormat()

TQCString KoDateVariable::defaultFormat ( )
static

Return the default date format for old file.

Definition at line 1380 of file KoVariable.cpp.

◆ fieldCode()

TQString KoDateVariable::fieldCode ( )
virtual

Reimplemented from KoVariable.

Definition at line 1179 of file KoVariable.cpp.

◆ formatStr()

TQCString KoDateVariable::formatStr ( int &  correct)
static

Ask the user and return the date format string with prefix "DATE".

Definition at line 1385 of file KoVariable.cpp.

◆ load()

void KoDateVariable::load ( TQDomElement &  elem)
virtual

Reimplemented from KoVariable.

Definition at line 1252 of file KoVariable.cpp.

◆ loadOasis()

void KoDateVariable::loadOasis ( const TQDomElement &  elem,
KoOasisContext &  context 
)
virtual

Reimplemented from KoVariable.

Definition at line 1334 of file KoVariable.cpp.

◆ recalc()

void KoDateVariable::recalc ( )
virtual

Reimplemented by KoVariable to recalculate the value.

It exists at the KoTextCustomItem level so that KoTextParag::setCustomItem can call it to set the initial value. This should call always resize().

Reimplemented from KoTextCustomItem.

Definition at line 1211 of file KoVariable.cpp.

◆ resize()

void KoDateVariable::resize ( )
virtual

Reimplement this to calculate the item width It is important to start with "if ( m_deleted ) return;".

Reimplemented from KoVariable.

Definition at line 1195 of file KoVariable.cpp.

◆ saveOasis()

void KoDateVariable::saveOasis ( KoXmlWriter &  writer,
KoSavingContext &  context 
) const
virtual

Save to Oasis XML.

Reimplemented from KoVariable.

Definition at line 1286 of file KoVariable.cpp.

◆ saveVariable()

void KoDateVariable::saveVariable ( TQDomElement &  parentElem)
virtual

Variable should reimplement this to implement saving.

Implements KoVariable.

Definition at line 1230 of file KoVariable.cpp.

◆ setDate()

void KoDateVariable::setDate ( const TQDate &  _date)
inline

Definition at line 473 of file KoVariable.h.

◆ setVariableSubType()

virtual void KoDateVariable::setVariableSubType ( short int  subtype)
inlinevirtual

Set this variable's subtype.

Reimplemented from KoVariable.

Definition at line 483 of file KoVariable.h.

◆ subType()

virtual short int KoDateVariable::subType ( ) const
inlinevirtual

Reimplemented from KoVariable.

Definition at line 485 of file KoVariable.h.

◆ subTypeList()

TQStringList KoDateVariable::subTypeList ( )
virtual

List of available subtypes (translated). Use variableSubType() to map index to ID.

Reimplemented from KoVariable.

Definition at line 1375 of file KoVariable.cpp.

◆ type()

virtual VariableType KoDateVariable::type ( ) const
inlinevirtual

Implements KoVariable.

Definition at line 464 of file KoVariable.h.

Member Data Documentation

◆ m_correctDate

int KoDateVariable::m_correctDate
protected

Definition at line 497 of file KoVariable.h.

◆ m_subtype

short int KoDateVariable::m_subtype
protected

Definition at line 496 of file KoVariable.h.


The documentation for this class was generated from the following files: