summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoTextFormat.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KoTextFormat.h')
-rw-r--r--lib/kotext/KoTextFormat.h178
1 files changed, 89 insertions, 89 deletions
diff --git a/lib/kotext/KoTextFormat.h b/lib/kotext/KoTextFormat.h
index 850dcd2f..25211f54 100644
--- a/lib/kotext/KoTextFormat.h
+++ b/lib/kotext/KoTextFormat.h
@@ -24,14 +24,14 @@
#undef S_NONE // Solaris defines it in sys/signal.h
-#include <qcolor.h>
-#include <qfont.h>
-#include <qstring.h>
-#include <qdict.h>
+#include <tqcolor.h>
+#include <tqfont.h>
+#include <tqstring.h>
+#include <tqdict.h>
#include <koffice_export.h>
class KoGenStyle;
-class QFontMetrics;
+class TQFontMetrics;
class KoCharStyle;
class KoTextFormatCollection;
class KoTextZoomHandler;
@@ -73,10 +73,10 @@ public:
}
void clearCache();
// caching for speedup when formatting
- QFont* m_screenFont; // font to be used when painting (zoom-dependent)
- QFontMetrics* m_screenFontMetrics; // font metrics on screen (zoom-dependent)
- QFont* m_refFont; // font to be used when formatting text for layout units
- QFontMetrics* m_refFontMetrics; // font metrics for m_refFontMetrics
+ TQFont* m_screenFont; // font to be used when painting (zoom-dependent)
+ TQFontMetrics* m_screenFontMetrics; // font metrics on screen (zoom-dependent)
+ TQFont* m_refFont; // font to be used when formatting text for tqlayout units
+ TQFontMetrics* m_refFontMetrics; // font metrics for m_refFontMetrics
int m_refAscent;
int m_refDescent;
int m_refHeight;
@@ -89,7 +89,7 @@ public:
double m_shadowDistanceX; // 0 in both x and y means no shadow
double m_shadowDistanceY;
- QColor m_shadowColor;
+ TQColor m_shadowColor;
bool m_bWordByWord;
bool m_bHyphenation;
};
@@ -124,7 +124,7 @@ public:
WordByWord | Attribute | Hyphenation | UnderLineWidth
};
- enum VerticalAlignment { AlignNormal, AlignSubScript, AlignSuperScript, AlignCustom }; // QRT now has it in another order, but it's too late, we use this order in KWord's file format now !
+ enum VerticalAlignment { AlignNormal, AlignSubScript, AlignSuperScript, AlignCustom }; // TQRT now has it in another order, but it's too late, we use this order in KWord's file format now !
enum UnderlineType { U_NONE = 0, U_SIMPLE = 1, U_DOUBLE = 2, U_SIMPLE_BOLD = 3, U_WAVE = 4};
enum StrikeOutType { S_NONE = 0, S_SIMPLE = 1, S_DOUBLE = 2, S_SIMPLE_BOLD = 3};
enum UnderlineStyle { U_SOLID = 0 , U_DASH = 1, U_DOT = 2, U_DASH_DOT = 3, U_DASH_DOT_DOT = 4};
@@ -138,35 +138,35 @@ public:
/// A simple text format with some default settings
/// Only used for the default format
- KoTextFormat( const QFont &f, const QColor &c, const QString &_language,
- bool hyphenation, KoTextFormatCollection *parent = 0 );
+ KoTextFormat( const TQFont &f, const TQColor &c, const TQString &_language,
+ bool hyphenation, KoTextFormatCollection *tqparent = 0 );
/// A complete text format (used by KoFontDia)
- KoTextFormat( const QFont &_font,
+ KoTextFormat( const TQFont &_font,
VerticalAlignment _valign,
- const QColor & _color,
- const QColor & _backGroundColor,
- const QColor & _underlineColor,
+ const TQColor & _color,
+ const TQColor & _backGroundColor,
+ const TQColor & _underlineColor,
KoTextFormat::UnderlineType _underlineType,
KoTextFormat::UnderlineStyle _underlineStyle,
KoTextFormat::StrikeOutType _strikeOutType,
KoTextFormat::StrikeOutStyle _strikeOutStyle,
KoTextFormat::AttributeStyle _fontAttribute,
- const QString &_language,
+ const TQString &_language,
double _relativeTextSize,
int _offsetFromBaseLine,
bool _wordByWord,
bool _hyphenation,
double _shadowDistanceX,
double _shadowDistanceY,
- const QColor& shadowColor );
+ const TQColor& shadowColor );
KoTextFormat( const KoTextFormat &fm );
- //KoTextFormat makeTextFormat( const QStyleSheetItem *style, const QMap<QString,QString>& attr ) const;
+ //KoTextFormat makeTextFormat( const TQStyleSheetItem *style, const TQMap<TQString,TQString>& attr ) const;
KoTextFormat& operator=( const KoTextFormat &fm );
void copyFormat( const KoTextFormat &fm, int flags );
- QColor color() const;
- QFont font() const;
+ TQColor color() const;
+ TQFont font() const;
int pointSize() const { return font().pointSize(); }
bool isMisspelled() const;
VerticalAlignment vAlign() const;
@@ -177,8 +177,8 @@ public:
* Do not call this for custom items, or for complex glyphs.
* But this can still be used for ' ' (for parag counters), 'x' (for tabs) etc.
*/
- int width( const QChar &c ) const;
- int width( const QString &str, int pos ) const;
+ int width( const TQChar &c ) const;
+ int width( const TQString &str, int pos ) const;
int height() const; // in LU pixels
int ascent() const; // in LU pixels
int descent() const; // in LU pixels
@@ -189,19 +189,19 @@ public:
void setBold( bool b );
void setItalic( bool b );
void setUnderline( bool b );
- void setFamily( const QString &f );
+ void setFamily( const TQString &f );
void setPointSize( int s );
- void setFont( const QFont &f );
- void setColor( const QColor &c );
+ void setFont( const TQFont &f );
+ void setColor( const TQColor &c );
void setMisspelled( bool b );
void setVAlign( VerticalAlignment a );
bool operator==( const KoTextFormat &f ) const;
- KoTextFormatCollection *parent() const;
- void setCollection( KoTextFormatCollection *parent ) { collection = parent; }
- QString key() const;
+ KoTextFormatCollection *tqparent() const;
+ void setCollection( KoTextFormatCollection *tqparent ) { collection = tqparent; }
+ TQString key() const;
- static QString getKey( const QFont &f, const QColor &c, bool misspelled, VerticalAlignment vAlign );
+ static TQString getKey( const TQFont &f, const TQColor &c, bool misspelled, VerticalAlignment vAlign );
void addRef();
void removeRef();
@@ -211,7 +211,7 @@ public:
/** Call this when a text color is set to 'invalid', meaning 'whatever the
* default for the color scheme is' */
- static QColor defaultTextColor( QPainter * painter );
+ static TQColor defaultTextColor( TQPainter * painter );
void setStrikeOutType (StrikeOutType _type);
StrikeOutType strikeOutType()const {return m_strikeOutType;}
@@ -220,11 +220,11 @@ public:
StrikeOutStyle strikeOutStyle()const {return m_strikeOutStyle;}
- void setTextBackgroundColor(const QColor &);
- QColor textBackgroundColor()const {return m_textBackColor;}
+ void setTextBackgroundColor(const TQColor &);
+ TQColor textBackgroundColor()const {return m_textBackColor;}
- void setTextUnderlineColor(const QColor &);
- QColor textUnderlineColor()const {return m_textUnderlineColor;}
+ void setTextUnderlineColor(const TQColor &);
+ TQColor textUnderlineColor()const {return m_textUnderlineColor;}
void setUnderlineType (UnderlineType _type);
UnderlineType underlineType()const {return m_underlineType;}
@@ -232,8 +232,8 @@ public:
void setUnderlineStyle (UnderlineStyle _type);
UnderlineStyle underlineStyle()const {return m_underlineStyle;}
- void setLanguage( const QString & _lang);
- QString language() const { return m_language;}
+ void setLanguage( const TQString & _lang);
+ TQString language() const { return m_language;}
void setHyphenation( bool b );
bool hyphenation() const { return d->m_bHyphenation; }
@@ -250,17 +250,17 @@ public:
double shadowDistanceX() const { return d->m_shadowDistanceX; }
double shadowDistanceY() const { return d->m_shadowDistanceY; }
- QColor shadowColor() const;
+ TQColor shadowColor() const;
/// Return the amount of pixels for the horizontal shadow distance at a given zoom level
int shadowX( KoTextZoomHandler *zh ) const;
/// Return the amount of pixels for the vertical shadow distance at a given zoom level
int shadowY( KoTextZoomHandler *zh ) const;
- void setShadow( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor );
+ void setShadow( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor );
/// Return css string for the shadow, used when saving
- QString shadowAsCss() const;
- static QString shadowAsCss( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor );
+ TQString shadowAsCss() const;
+ static TQString shadowAsCss( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor );
/// Load shadow attributes from a css string, used when loading
- void parseShadowFromCss( const QString& css );
+ void parseShadowFromCss( const TQString& css );
double relativeTextSize() const { return d->m_relativeTextSize;}
void setRelativeTextSize( double _size );
@@ -297,29 +297,29 @@ public:
* This is the one used during formatting, independently from the zoom level.
* This method takes care of superscript and subscript (smaller font).
*/
- const QFontMetrics& refFontMetrics() const;
+ const TQFontMetrics& refFontMetrics() const;
/**
* Returns the font metrics for the font used at the zoom & resolution
* given by 'zh'. Despite the name, this is probably valid for printing too.
* This method takes care of superscript and subscript (smaller font).
*/
- const QFontMetrics& screenFontMetrics( const KoTextZoomHandler* zh ) const;
+ const TQFontMetrics& screenFontMetrics( const KoTextZoomHandler* zh ) const;
/**
* @return the reference font, i.e. with the size specified by the user.
- * This is used at text layout time (e.g. kotextformatter)
+ * This is used at text tqlayout time (e.g. kotextformatter)
*/
- QFont refFont() const;
+ TQFont refFont() const;
/**
* Returns the font to be used at the zoom & resolution given by 'zh'.
* Despite the name, this is probably valid for printing too.
* This method takes care of superscript and subscript (smaller font).
*/
- QFont screenFont( const KoTextZoomHandler* zh ) const;
+ TQFont screenFont( const KoTextZoomHandler* zh ) const;
- QFont smallCapsFont( const KoTextZoomHandler* zh, bool applyZoom ) const;
+ TQFont smallCapsFont( const KoTextZoomHandler* zh, bool applyZoom ) const;
/**
* Return the width of one char in one paragraph.
@@ -338,20 +338,20 @@ public:
void applyCharStyle( KoCharStyle *_style );
KoCharStyle *style() const;
- static QString underlineStyleToString( UnderlineStyle _lineType );
- static QString strikeOutStyleToString( StrikeOutStyle _lineType );
- static UnderlineStyle stringToUnderlineStyle( const QString & _str );
- static StrikeOutStyle stringToStrikeOutStyle( const QString & _str );
+ static TQString underlineStyleToString( UnderlineStyle _lineType );
+ static TQString strikeOutStyleToString( StrikeOutStyle _lineType );
+ static UnderlineStyle stringToUnderlineStyle( const TQString & _str );
+ static StrikeOutStyle stringToStrikeOutStyle( const TQString & _str );
- static QString attributeFontToString( KoTextFormat::AttributeStyle _attr );
- static AttributeStyle stringToAttributeFont( const QString & _str );
+ static TQString attributeFontToString( KoTextFormat::AttributeStyle _attr );
+ static AttributeStyle stringToAttributeFont( const TQString & _str );
- QString displayedString( const QString& c )const;
- static QStringList underlineTypeList();
- static QStringList strikeOutTypeList();
- static QStringList fontAttributeList();
- static QStringList underlineStyleList();
- static QStringList strikeOutStyleList();
+ TQString displayedString( const TQString& c )const;
+ static TQStringList underlineTypeList();
+ static TQStringList strikeOutTypeList();
+ static TQStringList fontAttributeList();
+ static TQStringList underlineStyleList();
+ static TQStringList strikeOutStyleList();
/// Load a text format from OASIS XML
void load( KoOasisContext& context );
@@ -367,37 +367,37 @@ public:
void zoomChanged();
protected:
- QChar displayedChar( QChar c )const;
+ TQChar displayedChar( TQChar c )const;
void generateKey();
private:
void update();
- QColor m_textBackColor;
- QColor m_textUnderlineColor;
+ TQColor m_textBackColor;
+ TQColor m_textUnderlineColor;
UnderlineType m_underlineType;
StrikeOutType m_strikeOutType;
UnderlineStyle m_underlineStyle;
StrikeOutStyle m_strikeOutStyle;
- QString m_language;
+ TQString m_language;
AttributeStyle m_attributeFont;
class KoTextFormatPrivate;
KoTextFormatPrivate *d;
- QFont fn;
- QColor col;
+ TQFont fn;
+ TQColor col;
uint missp : 1;
//uint linkColor : 1;
VerticalAlignment va;
KoTextFormatCollection *collection;
int ref;
- QString m_key;
+ TQString m_key;
};
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class Q_EXPORT QDict<KoTextFormat>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQ_EXPORT TQDict<KoTextFormat>;
+// TQMOC_SKIP_END
#endif
class KOTEXT_EXPORT KoTextFormatCollection
@@ -412,8 +412,8 @@ public:
* @param defaultLanguage the language to use for the default format
* @param defaultHyphenation the hyphenation setting for the default format
*/
- KoTextFormatCollection( const QFont& defaultFont, const QColor& defaultColor,
- const QString & defaultLanguage, bool defaultHyphenation );
+ KoTextFormatCollection( const TQFont& defaultFont, const TQColor& defaultColor,
+ const TQString & defaultLanguage, bool defaultHyphenation );
/*virtual*/ ~KoTextFormatCollection();
void setDefaultFormat( KoTextFormat *f );
@@ -421,42 +421,42 @@ public:
/*virtual*/ KoTextFormat *format( const KoTextFormat *f );
/*virtual*/ KoTextFormat *format( const KoTextFormat *of, const KoTextFormat *nf, int flags );
// Only used for the default format
-// /*virtual*/ KoTextFormat *format( const QFont &f, const QColor &c , const QString &_language, bool hyphen );
+// /*virtual*/ KoTextFormat *format( const TQFont &f, const TQColor &c , const TQString &_language, bool hyphen );
/*virtual*/ void remove( KoTextFormat *f );
/*virtual*/ KoTextFormat *createFormat( const KoTextFormat &f ) { return new KoTextFormat( f ); }
// Only used for the default format
-// /*virtual*/ KoTextFormat *createFormat( const QFont &f, const QColor &c, const QString & _language, bool hyphen ) { return new KoTextFormat( f, c, _language, hyphen, this ); }
+// /*virtual*/ KoTextFormat *createFormat( const TQFont &f, const TQColor &c, const TQString & _language, bool hyphen ) { return new KoTextFormat( f, c, _language, hyphen, this ); }
void debug();
// Called when the zoom or resolution changes
void zoomChanged();
- //void setPainter( QPainter *p );
- //QStyleSheet *styleSheet() const { return sheet; }
- //void setStyleSheet( QStyleSheet *s ) { sheet = s; }
+ //void setPainter( TQPainter *p );
+ //TQStyleSheet *styleSheet() const { return sheet; }
+ //void setStyleSheet( TQStyleSheet *s ) { sheet = s; }
//void updateStyles();
//void updateFontSizes( int base );
- //void updateFontAttributes( const QFont &f, const QFont &old );
+ //void updateFontAttributes( const TQFont &f, const TQFont &old );
- QDict<KoTextFormat> & dict() { return cKey; }
+ TQDict<KoTextFormat> & dict() { return cKey; }
private:
KoTextFormat *defFormat, *lastFormat, *cachedFormat;
- QDict<KoTextFormat> cKey;
+ TQDict<KoTextFormat> cKey;
KoTextFormat *cres;
- QFont cfont;
- QColor ccol;
- QString kof, knf;
+ TQFont cfont;
+ TQColor ccol;
+ TQString kof, knf;
int cflags;
- //QStyleSheet *sheet;
+ //TQStyleSheet *sheet;
};
-inline QColor KoTextFormat::color() const
+inline TQColor KoTextFormat::color() const
{
return col;
}
-inline QFont KoTextFormat::font() const
+inline TQFont KoTextFormat::font() const
{
return fn;
}
@@ -476,7 +476,7 @@ inline bool KoTextFormat::operator==( const KoTextFormat &f ) const
return key() == f.key();
}
-inline KoTextFormatCollection *KoTextFormat::parent() const
+inline KoTextFormatCollection *KoTextFormat::tqparent() const
{
return collection;
}