diff options
Diffstat (limited to 'lib/kotext/KoVariable.h')
-rw-r--r-- | lib/kotext/KoVariable.h | 351 |
1 files changed, 176 insertions, 175 deletions
diff --git a/lib/kotext/KoVariable.h b/lib/kotext/KoVariable.h index 0129bbc2..d00dcb5c 100644 --- a/lib/kotext/KoVariable.h +++ b/lib/kotext/KoVariable.h @@ -20,18 +20,18 @@ #ifndef kovariable_h #define kovariable_h -#include <qstring.h> -#include <qdatetime.h> -#include <qasciidict.h> -#include <qptrlist.h> -#include <qmap.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqasciidict.h> +#include <tqptrlist.h> +#include <tqmap.h> +#include <tqobject.h> #include <kaction.h> #include "KoRichText.h" -#include <qvariant.h> +#include <tqvariant.h> #include <koffice_export.h> -class QDomElement; +class TQDomElement; // Always add new types at the _end_ of this list (but before VT_ALL of course). // (and update KWView::setupActions) enum VariableType { @@ -85,17 +85,17 @@ class KOTEXT_EXPORT KoVariableSettings bool displayFieldCode() const { return m_displayFieldCode; } void setDisplayFieldCode( bool b) { m_displayFieldCode=b; } - virtual void save( QDomElement &parentElem ); - virtual void load( QDomElement &elem ); + virtual void save( TQDomElement &tqparentElem ); + virtual void load( TQDomElement &elem ); - QDateTime lastPrintingDate() const; - void setLastPrintingDate( const QDateTime & _date); + TQDateTime lastPrintingDate() const; + void setLastPrintingDate( const TQDateTime & _date); - QDateTime creationDate() const; - void setCreationDate( const QDateTime & _date); + TQDateTime creationDate() const; + void setCreationDate( const TQDateTime & _date); - QDateTime modificationDate() const; - void setModificationDate( const QDateTime & _date); + TQDateTime modificationDate() const; + void setModificationDate( const TQDateTime & _date); virtual void saveOasis( KoXmlWriter &settingsWriter ) const; virtual void loadOasis(const KoOasisSettings&settingsDoc); @@ -127,72 +127,72 @@ public: * Return a key describing this format. * Used for the flyweight pattern in KoVariableFormatCollection */ - virtual QCString key() const = 0; + virtual TQCString key() const = 0; /** * @return the key for a given set of properties. * Use this key to lookup the format in the "variable format" collection. * @param props properties of this format, e.g. DD/MM/YYYY for a date format. */ - virtual QCString getKey( const QString& props ) const = 0; + virtual TQCString getKey( const TQString& props ) const = 0; /** * Create a format from this key. */ - virtual void load( const QCString &key ) = 0; + virtual void load( const TQCString &key ) = 0; /** * Use this format to convert a piece of data into a string. */ - virtual QString convert(const QVariant& data ) const = 0; + virtual TQString convert(const TQVariant& data ) const = 0; /** * Set the properties of this format, e.g. DD/MM/YYYY for a date format. * WARNING: if you call this, you might be modifying a format that * other variables use as well. Don't do it, use getKey. */ - virtual void setFormatProperties( const QString& ) {} + virtual void setFormatProperties( const TQString& ) {} /** * @return the properties of this format, e.g. DD/MM/YYYY for a date format. */ - virtual QString formatProperties() const { return QString::null; } + virtual TQString formatProperties() const { return TQString(); } /** * @return the list of available properties strings (e.g. hh:mm:ss) */ - virtual QStringList formatPropsList() const { return QStringList(); } + virtual TQStringList formatPropsList() const { return TQStringList(); } /** * @return the translated version of the list of format properties */ - virtual QStringList translatedFormatPropsList() const { return QStringList(); } + virtual TQStringList translatedFormatPropsList() const { return TQStringList(); } }; /** * Implementation of the "date" formats - * TODO: merge with KoVariableTimeFormat, for a single QDateTime-based class. + * TODO: merge with KoVariableTimeFormat, for a single TQDateTime-based class. */ class KOTEXT_EXPORT KoVariableDateFormat : public KoVariableFormat { public: KoVariableDateFormat(); - virtual QString convert(const QVariant& data ) const; - virtual QCString key() const; - virtual QCString getKey( const QString& props ) const; - virtual void load( const QCString &key ); + virtual TQString convert(const TQVariant& data ) const; + virtual TQCString key() const; + virtual TQCString getKey( const TQString& props ) const; + virtual void load( const TQCString &key ); /// Set the format string (e.g. DDMMYYYY) - virtual void setFormatProperties( const QString& props ) { + virtual void setFormatProperties( const TQString& props ) { m_strFormat = props; } /// @return the format string (e.g. DDMMYYYY) - virtual QString formatProperties() const { return m_strFormat; } + virtual TQString formatProperties() const { return m_strFormat; } /// @return the list of available format strings - virtual QStringList formatPropsList() const { return staticFormatPropsList(); } + virtual TQStringList formatPropsList() const { return staticFormatPropsList(); } /// @return the translated version of the list of formats - virtual QStringList translatedFormatPropsList() const { return staticTranslatedFormatPropsList(); } + virtual TQStringList translatedFormatPropsList() const { return staticTranslatedFormatPropsList(); } - static QStringList staticFormatPropsList(); - static QStringList staticTranslatedFormatPropsList(); + static TQStringList staticFormatPropsList(); + static TQStringList staticTranslatedFormatPropsList(); private: - QString m_strFormat; + TQString m_strFormat; }; /** @@ -202,29 +202,29 @@ class KOTEXT_EXPORT KoVariableTimeFormat : public KoVariableFormat { public: KoVariableTimeFormat(); - virtual QString convert(const QVariant& data ) const; - virtual QCString key() const; - virtual QCString getKey( const QString& props ) const; - virtual void load( const QCString & /*key*/ ); + virtual TQString convert(const TQVariant& data ) const; + virtual TQCString key() const; + virtual TQCString getKey( const TQString& props ) const; + virtual void load( const TQCString & /*key*/ ); /// Set the format string (e.g. hh:mm:ss) - virtual void setFormatProperties( const QString& props ) { + virtual void setFormatProperties( const TQString& props ) { m_strFormat = props; } /// @return the format string (e.g. hh:mm:ss) - virtual QString formatProperties() const { return m_strFormat; } + virtual TQString formatProperties() const { return m_strFormat; } /// @return the list of available properties strings (e.g. hh:mm:ss) - virtual QStringList formatPropsList() const { return staticFormatPropsList(); } + virtual TQStringList formatPropsList() const { return staticFormatPropsList(); } /// @return the translated version of the list of format properties - virtual QStringList translatedFormatPropsList() const { return staticTranslatedFormatPropsList(); } + virtual TQStringList translatedFormatPropsList() const { return staticTranslatedFormatPropsList(); } - static QStringList staticFormatPropsList(); - static QStringList staticTranslatedFormatPropsList(); + static TQStringList staticFormatPropsList(); + static TQStringList staticTranslatedFormatPropsList(); private: - QString m_strFormat; + TQString m_strFormat; }; @@ -235,10 +235,10 @@ class KoVariableStringFormat : public KoVariableFormat { public: KoVariableStringFormat() : KoVariableFormat() {} - virtual QString convert(const QVariant& data ) const; - virtual QCString key() const; - virtual QCString getKey( const QString& props ) const; - virtual void load( const QCString & /*key*/ ) {} + virtual TQString convert(const TQVariant& data ) const; + virtual TQCString key() const; + virtual TQCString getKey( const TQString& props ) const; + virtual void load( const TQCString & /*key*/ ) {} }; @@ -246,10 +246,10 @@ class KOTEXT_EXPORT KoVariableNumberFormat : public KoVariableFormat { public: KoVariableNumberFormat() : KoVariableFormat() {} - virtual QString convert(const QVariant& data ) const; - virtual QCString key() const; - virtual QCString getKey( const QString& props ) const; - virtual void load( const QCString & /*key*/ ) {} + virtual TQString convert(const TQVariant& data ) const; + virtual TQCString key() const; + virtual TQCString getKey( const TQString& props ) const; + virtual void load( const TQCString & /*key*/ ) {} }; @@ -272,15 +272,15 @@ public: /** * Find or create the format for the given @p key */ - KoVariableFormat *format( const QCString &key ); + KoVariableFormat *format( const TQCString &key ); // TODO Refcounting and removing unused formats // Not critical, that we don't delete unused formats until closing the doc... protected: - KoVariableFormat *createFormat( const QCString &key ); + KoVariableFormat *createFormat( const TQCString &key ); private: - QAsciiDict<KoVariableFormat> m_dict; + TQAsciiDict<KoVariableFormat> m_dict; }; class KoVariable; @@ -289,9 +289,10 @@ class KoDocument; class KoVariableFormatCollection; class KoTextDocument; class KoVariableCollection; -class KOTEXT_EXPORT KoVariableCollection : public QObject +class KOTEXT_EXPORT KoVariableCollection : public TQObject { Q_OBJECT + TQ_OBJECT public: // Note that the KoVariableSettings becomes owned by the collection; // we take it as argument so that it can be subclassed though. @@ -299,24 +300,24 @@ public: ~KoVariableCollection(); void registerVariable( KoVariable *var ); void unregisterVariable( KoVariable *var ); - QValueList<KoVariable *> recalcVariables(int type); + TQValueList<KoVariable *> recalcVariables(int type); // For custom variables - void setVariableValue( const QString &name, const QString &value ); - QString getVariableValue( const QString &name ) const; + void setVariableValue( const TQString &name, const TQString &value ); + TQString getVariableValue( const TQString &name ) const; - const QPtrList<KoVariable>& getVariables() const { + const TQPtrList<KoVariable>& getVariables() const { return variables; } void clear(); - bool customVariableExist(const QString &varname)const ; + bool customVariableExist(const TQString &varname)const ; virtual KoVariable *createVariable( int type, short int subtype, KoVariableFormatCollection * coll, KoVariableFormat *varFormat,KoTextDocument *textdoc, KoDocument * doc, int _correct , bool _forceDefaultFormat=false, bool loadFootNote= true ); /// Load variable from OASIS file format (called "field" in the OASIS format) - virtual KoVariable* loadOasisField( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context ); - virtual KoVariable* loadOasisFieldCreateVariable( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context, const QString &key, int type ); + virtual KoVariable* loadOasisField( KoTextDocument* textdoc, const TQDomElement& tag, KoOasisContext& context ); + virtual KoVariable* loadOasisFieldCreateVariable( KoTextDocument* textdoc, const TQDomElement& tag, KoOasisContext& context, const TQString &key, int type ); KoVariableSettings *variableSetting() const { return m_variableSettings; } KoVariableFormatCollection *formatCollection() const { return m_formatCollection; } @@ -326,19 +327,19 @@ public: KoVariable *selectedVariable()const {return m_varSelected;} /// List of KActions to put into the popupmenu on a variable - QPtrList<KAction> popupActionList() const; + TQPtrList<KAction> popupActionList() const; protected slots: - // This is here because variables and formats are not QObjects + // This is here because variables and formats are not TQObjects void slotChangeSubType(); void slotChangeFormat(); private: - //typedef QMap<KAction *, int> VariableSubTextMap; + //typedef TQMap<KAction *, int> VariableSubTextMap; //VariableSubTextMap m_variableSubTextMap; - QPtrList<KoVariable> variables; - QMap< QString, QString > varValues; // for custom variables + TQPtrList<KoVariable> variables; + TQMap< TQString, TQString > varValues; // for custom variables KoVariableSettings *m_variableSettings; KoVariable *m_varSelected; KoVariableFormatCollection *m_formatCollection; @@ -351,7 +352,7 @@ public: class KoDocument; class KoVariable; -class QDomElement; +class TQDomElement; class KoTextFormat; @@ -374,14 +375,14 @@ public: virtual int ascent() const { return m_ascent; } // for text, ascent != height! virtual int widthHint() const { return width; } virtual int minimumWidth() const { return width; } - 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); + 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); /** * Called by drawCustomItem. Some special variables can * reimplement drawCustomItem to change the parameters passed to * drawCustomItemHelper */ - 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 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 ); @@ -396,26 +397,26 @@ public: * 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. */ - virtual QString text(bool realValue=false); + virtual TQString text(bool realValue=false); - virtual QString fieldCode(); + virtual TQString fieldCode(); - /// Return the variable value, as a QVariant, before format conversion - QVariant varValue() const { return m_varValue; } + /// Return the variable value, as a TQVariant, before format conversion + TQVariant varValue() const { return m_varValue; } /** - * Ask this variable to recalculate and to repaint itself + * Ask this variable to recalculate and to tqrepaint itself * Only use this if you're working on a single variable (e.g. popupmenu). - * Otherwise, better do the repainting all at once. + * Otherwise, better do the tqrepainting all at once. * @see KoVariableCollection::recalcVariables() */ void recalcAndRepaint(); /** Save the variable. Public API, does the common job and then calls saveVariable. */ - virtual void save( QDomElement &parentElem ); + virtual void save( TQDomElement &tqparentElem ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); /** Part of the KoTextCustomItem interface. Returns the code for a variable, see DTD. * Do NOT reimplement in koVariable-derived classes. @@ -423,7 +424,7 @@ public: virtual int typeId() const { return 4; } /// List of available subtypes (translated). Use variableSubType() to map index to ID - virtual QStringList subTypeList(); + virtual TQStringList subTypeList(); /// Set this variable's subtype. virtual void setVariableSubType( short int /*subtype*/ ) {} @@ -433,19 +434,19 @@ public: */ virtual short int variableSubType(short int menuNumber){ return menuNumber; } - QString convertKlocaleToQDateTimeFormat( const QString & _format ); + TQString convertKlocaleToTQDateTimeFormat( const TQString & _format ); protected: /** Variable should reimplement this to implement saving. */ - virtual void saveVariable( QDomElement &parentElem ) = 0; + virtual void saveVariable( TQDomElement &tqparentElem ) = 0; virtual int correctValue() const { return 0;} KoVariableFormat *m_varFormat; KoVariableCollection *m_varColl; - QVariant m_varValue; + TQVariant m_varValue; int m_ascent; - //typedef QMap<KAction *, int> SubTextMap; + //typedef TQMap<KAction *, int> SubTextMap; //SubTextMap m_subTextMap; class Private; Private *d; @@ -464,20 +465,20 @@ public: { return VT_DATE; } enum { VST_DATE_FIX = 0, VST_DATE_CURRENT = 1, VST_DATE_LAST_PRINTING = 2, VST_DATE_CREATE_FILE = 3, VST_DATE_MODIFY_FILE =4 }; - static QStringList actionTexts(); + static TQStringList actionTexts(); virtual void recalc(); - virtual QString fieldCode(); + virtual TQString fieldCode(); virtual void resize(); - void setDate( const QDate & _date ) { m_varValue = QVariant(_date); } + void setDate( const TQDate & _date ) { m_varValue = TQVariant(_date); } - virtual void saveVariable( QDomElement &parentElem ); + virtual void saveVariable( TQDomElement &tqparentElem ); virtual int correctValue() const { return m_correctDate;} - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; - virtual QStringList subTypeList(); + virtual TQStringList subTypeList(); /// Set this variable's subtype. virtual void setVariableSubType( short int subtype ) { m_subtype = subtype; } @@ -485,11 +486,11 @@ public: /** * Ask the user and return the date format string with prefix "DATE" */ - static QCString formatStr( int & correct ); + static TQCString formatStr( int & correct ); /** * Return the default date format for old file. */ - static QCString defaultFormat(); + static TQCString defaultFormat(); protected: short int m_subtype; @@ -509,32 +510,32 @@ public: { return VT_TIME; } enum { VST_TIME_FIX = 0, VST_TIME_CURRENT = 1 }; - static QStringList actionTexts(); + static TQStringList actionTexts(); virtual void recalc(); virtual void resize(); - virtual QString fieldCode(); + virtual TQString fieldCode(); - void setTime( const QTime & _time ) { m_varValue = QVariant(_time); } + void setTime( const TQTime & _time ) { m_varValue = TQVariant(_time); } - virtual void saveVariable( QDomElement &parentElem ); + virtual void saveVariable( TQDomElement &tqparentElem ); virtual int correctValue() const { return m_correctTime;} - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; - virtual QStringList subTypeList(); + virtual TQStringList subTypeList(); virtual void setVariableSubType( short int subtype ) { m_subtype = subtype; } virtual short int subType() const { return m_subtype; } /** * Returns the time format string with prefix "TIME" */ - static QCString formatStr(int & _correct); + static TQCString formatStr(int & _correct); /** * Return the default date format for old file. */ - static QCString defaultFormat(); + static TQCString defaultFormat(); protected: short int m_subtype; @@ -550,25 +551,25 @@ protected: class KOTEXT_EXPORT KoCustomVariable : public KoVariable { public: - KoCustomVariable(KoTextDocument *textdoc , const QString &name, KoVariableFormat *varFormat,KoVariableCollection *_varcoll ); + KoCustomVariable(KoTextDocument *textdoc , const TQString &name, KoVariableFormat *varFormat,KoVariableCollection *_varcoll ); virtual VariableType type() const { return VT_CUSTOM; } - static QStringList actionTexts(); + static TQStringList actionTexts(); - virtual void saveVariable( QDomElement &parentElem ); - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void saveVariable( TQDomElement &tqparentElem ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; - QString name() const { return m_varValue.toString(); } + TQString name() const { return m_varValue.toString(); } virtual void recalc(); - virtual QString fieldCode(); + virtual TQString fieldCode(); - virtual QString text(bool realValue=false); + virtual TQString text(bool realValue=false); - QString value() const; - void setValue( const QString &v ); + TQString value() const; + void setValue( const TQString &v ); protected: }; @@ -597,18 +598,18 @@ public: virtual VariableType type() const { return VT_FIELD; } - virtual void saveVariable( QDomElement &parentElem ); - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void saveVariable( TQDomElement &tqparentElem ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; - virtual QString fieldCode(); + virtual TQString fieldCode(); virtual void recalc(); - virtual QString text(bool realValue=false); + virtual TQString text(bool realValue=false); - QString value() const { return m_varValue.toString(); } + TQString value() const { return m_varValue.toString(); } - static QStringList actionTexts(); + static TQStringList actionTexts(); /** * Converts @p menuNumber to field variable subtype number */ @@ -618,7 +619,7 @@ public: */ static FieldSubType fieldSubType( short int menuNumber); - virtual QStringList subTypeList(); + virtual TQStringList subTypeList(); virtual void setVariableSubType( short int subtype ) { m_subtype = subtype; } virtual short int subType() const { return m_subtype; } @@ -632,21 +633,21 @@ protected: class KOTEXT_EXPORT KoMailMergeVariable : public KoVariable { public: - KoMailMergeVariable( KoTextDocument *textdoc, const QString &name, KoVariableFormat *varFormat, KoVariableCollection *_varColl ); + KoMailMergeVariable( KoTextDocument *textdoc, const TQString &name, KoVariableFormat *varFormat, KoVariableCollection *_varColl ); virtual VariableType type() const { return VT_MAILMERGE; } - static QStringList actionTexts(); - virtual QString fieldCode(); + static TQStringList actionTexts(); + virtual TQString fieldCode(); - virtual void saveVariable( QDomElement &parentElem ); - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void saveVariable( TQDomElement &tqparentElem ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; - virtual QString text(bool realValue=false); - QString name() const { return m_varValue.toString(); } - virtual QString value() const; + virtual TQString text(bool realValue=false); + TQString name() const { return m_varValue.toString(); } + virtual TQString value() const; protected: }; @@ -666,26 +667,26 @@ public: { return VT_PGNUM; } enum { VST_PGNUM_CURRENT = 0, VST_PGNUM_TOTAL = 1, VST_CURRENT_SECTION = 2 , VST_PGNUM_PREVIOUS = 3, VST_PGNUM_NEXT = 4 }; - static QStringList actionTexts(); - virtual QString fieldCode(); + static TQStringList actionTexts(); + virtual TQString fieldCode(); - virtual QStringList subTypeList(); + virtual TQStringList subTypeList(); virtual void setVariableSubType( short int subtype ); // For the 'current page' variable. This is called by the app e.g. when painting // a given page (see KWTextFrameSet::drawFrame and KPTextObject::recalcPageNum) - void setPgNum( int pgNum ) { m_varValue = QVariant( pgNum); } + void setPgNum( int pgNum ) { m_varValue = TQVariant( pgNum); } // For the 'current section title' variable. Same thing. - void setSectionTitle( const QString& title ); + void setSectionTitle( const TQString& title ); virtual short int subType() const { return m_subtype; } virtual void recalc() = 0; - virtual void saveVariable( QDomElement &parentElem ); - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void saveVariable( TQDomElement &tqparentElem ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; protected: short int m_subtype; @@ -695,34 +696,34 @@ protected: class KOTEXT_EXPORT KoLinkVariable : public KoVariable { public: - KoLinkVariable( KoTextDocument *textdoc, const QString & _linkName, const QString & _ulr,KoVariableFormat *varFormat, KoVariableCollection *_varColl ); - 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 ); + KoLinkVariable( KoTextDocument *textdoc, const TQString & _linkName, const TQString & _ulr,KoVariableFormat *varFormat, KoVariableCollection *_varColl ); + 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 ); virtual VariableType type() const { return VT_LINK; } - static QStringList actionTexts(); - virtual QString fieldCode(); + static TQStringList actionTexts(); + virtual TQString fieldCode(); - virtual void saveVariable( QDomElement &parentElem ); - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void saveVariable( TQDomElement &tqparentElem ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; - virtual QString text(bool realValue=false); - QString value() const { return m_varValue.toString(); } - QString url() const { return m_url;} + virtual TQString text(bool realValue=false); + TQString value() const { return m_varValue.toString(); } + TQString url() const { return m_url;} virtual void recalc(); - void setLink(const QString & _linkName, const QString &_url) + void setLink(const TQString & _linkName, const TQString &_url) { - m_varValue=QVariant(_linkName); + m_varValue=TQVariant(_linkName); m_url=_url; } protected: - QString m_url; + TQString m_url; }; @@ -730,28 +731,28 @@ protected: class KOTEXT_EXPORT KoNoteVariable : public KoVariable { public: - KoNoteVariable( KoTextDocument *textdoc, const QString & _note,KoVariableFormat *varFormat, KoVariableCollection *_varColl ); - 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 ); + KoNoteVariable( KoTextDocument *textdoc, const TQString & _note,KoVariableFormat *varFormat, KoVariableCollection *_varColl ); + 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 ); virtual VariableType type() const { return VT_NOTE; } - static QStringList actionTexts(); - virtual QString fieldCode(); + static TQStringList actionTexts(); + virtual TQString fieldCode(); - virtual void saveVariable( QDomElement &parentElem ); - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void saveVariable( TQDomElement &tqparentElem ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; - virtual QString text(bool realValue=false); - QString note() const { return m_varValue.toString(); } - void setNote( const QString & _note) { m_varValue = QVariant(_note); } + virtual TQString text(bool realValue=false); + TQString note() const { return m_varValue.toString(); } + void setNote( const TQString & _note) { m_varValue = TQVariant(_note); } virtual void recalc(); - QString createdNote() const; + TQString createdNote() const; protected: - QDate m_createdNoteDate; + TQDate m_createdNoteDate; }; @@ -777,24 +778,24 @@ public: virtual VariableType type() const { return VT_STATISTIC; } - static QStringList actionTexts(); + static TQStringList actionTexts(); - virtual QStringList subTypeList(); + virtual TQStringList subTypeList(); - virtual void saveVariable( QDomElement &parentElem ); - virtual void load( QDomElement &elem ); - virtual void loadOasis( const QDomElement &elem, KoOasisContext& context ); + virtual void saveVariable( TQDomElement &tqparentElem ); + virtual void load( TQDomElement &elem ); + virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context ); virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const; virtual short int subType() const { return m_subtype; } virtual void setVariableSubType( short int subtype ); - QString name() const { return m_varValue.toString(); } - virtual QString fieldCode(); + TQString name() const { return m_varValue.toString(); } + virtual TQString fieldCode(); - QString value() const; - void setValue( const QString &v ); + TQString value() const; + void setValue( const TQString &v ); static void setExtendedType( bool _b) { m_extendedType = _b; } static bool extendedType() { return m_extendedType; } protected: |