diff options
Diffstat (limited to 'lib/kotext/KoTextParag.h')
| -rw-r--r-- | lib/kotext/KoTextParag.h | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/lib/kotext/KoTextParag.h b/lib/kotext/KoTextParag.h index 1b65b8c39..486a4ae3e 100644 --- a/lib/kotext/KoTextParag.h +++ b/lib/kotext/KoTextParag.h @@ -42,11 +42,11 @@ struct KoTextParagSelection int start, end; }; -#if defined(Q_TEMPLATEDLL) -// MOC_SKIP_BEGIN -template class QMap<int, KoTextParagSelection>; -template class QMap<int, KoTextParagLineStart*>; -// MOC_SKIP_END +#if defined(TQ_TEMPLATEDLL) +// TQMOC_SKIP_BEGIN +template class TQMap<int, KoTextParagSelection>; +template class TQMap<int, KoTextParagLineStart*>; +// TQMOC_SKIP_END #endif class KOTEXT_EXPORT KoTextParag @@ -71,8 +71,8 @@ public: KoTextDocument *document() const; - QRect rect() const; - void setRect( const QRect& rect ) { r = rect; } + TQRect rect() const; + void setRect( const TQRect& rect ) { r = rect; } void setHeight( int h ) { r.setHeight( h ); } void setWidth( int w ) { r.setWidth( w ); } void show(); @@ -84,8 +84,8 @@ public: void setPrev( KoTextParag *s ); void setNext( KoTextParag *s ); - void insert( int index, const QString &s ); - void append( const QString &s, bool reallyAtEnd = FALSE ); + void insert( int index, const TQString &s ); + void append( const TQString &s, bool reallyAtEnd = FALSE ); void truncate( int index ); void remove( int index, int len ); @@ -93,7 +93,7 @@ public: void format( int start = -1, bool doMove = TRUE ); /// Call this to ensure that format() will be called on this paragraph later on - void invalidate( int chr /*ignored*/ = 0 ); + void tqinvalidate( int chr /*ignored*/ = 0 ); /// Returns false if format() needs to be called on this paragraph bool isValid() const; @@ -126,15 +126,15 @@ public: void setParagId( int i ); int paragId() const; - QMap<int, KoTextParagLineStart*> &lineStartList(); + TQMap<int, KoTextParagLineStart*> &lineStartList(); void setFormat( int index, int len, const KoTextFormat *f, bool useCollection = TRUE, int flags = -1 ); - void setAlignment( uint a ); - void setAlignmentDirect( uint a ) { align = a; } - uint alignment() const; + void tqsetAlignment( uint a ); + void tqsetAlignmentDirect( uint a ) { align = a; } + uint tqalignment() const; - virtual void paint( QPainter &painter, const QColorGroup &cg, KoTextCursor *cursor, bool drawSelections, + virtual void paint( TQPainter &painter, const TQColorGroup &cg, KoTextCursor *cursor, bool drawSelections, int clipx, int clipy, int clipw, int cliph ); // kotextparag.cc @@ -154,7 +154,7 @@ public: int customItems() const; - void setDocumentRect( const QRect &r ); + void setDocumentRect( const TQRect &r ); int documentWidth() const; //int documentVisibleWidth() const; int documentX() const; @@ -186,8 +186,8 @@ public: void setMovedDown( bool b ) { movedDown = b; } bool wasMovedDown() const { return movedDown; } - void setDirection( QChar::Direction d ); - QChar::Direction direction() const; + void setDirection( TQChar::Direction d ); + TQChar::Direction direction() const; /// Mark a paragraph as being part of the table of contents (kword only) void setPartOfTableOfContents( bool b ) { m_toc = b; } @@ -197,9 +197,9 @@ public: void insertLineStart( int index, KoTextParagLineStart *ls ); protected: - void drawLabel( QPainter* p, int x, int y, int w, int h, int base, const QColorGroup& cg ); - void drawCursorDefault( QPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const QColorGroup &cg ); - void drawCursor( QPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const QColorGroup &cg ); + void drawLabel( TQPainter* p, int x, int y, int w, int h, int base, const TQColorGroup& cg ); + void drawCursorDefault( TQPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const TQColorGroup &cg ); + void drawCursor( TQPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const TQColorGroup &cg ); /** * We extend KoTextParag with more (zoom-aware) features, @@ -214,15 +214,15 @@ public: /** Sets all or some parameters from a paragLayout struct. * @param flags selects which settings to apply, see KoParagLayout's enum. */ - virtual void setParagLayout( const KoParagLayout &layout, int flags = KoParagLayout::All, + virtual void setParagLayout( const KoParagLayout &tqlayout, int flags = KoParagLayout::All, int marginIndex = -1 ); const KoParagLayout & paragLayout() { return m_layout; } // Margins - double margin( QStyleSheetItem::Margin m ) { return m_layout.margins[m]; } + double margin( TQStyleSheetItem::Margin m ) { return m_layout.margins[m]; } const double * margins() const { return m_layout.margins; } - void setMargin( QStyleSheetItem::Margin m, double _i ); + void setMargin( TQStyleSheetItem::Margin m, double _i ); void setMargins( const double * _i ); /** Line spacing in pt if >=0, can also be one of the LS_* values */ @@ -235,9 +235,9 @@ public: void setLineSpacingType( KoParagLayout::SpacingType _type ); - /** Use this to change the paragraph alignment, not KoTextParag::setAlignment ! */ + /** Use this to change the paragraph tqalignment, not KoTextParag::tqsetAlignment ! */ void setAlign( int align ); - /** Return the real alignment: Auto is resolved to either Left or Right */ + /** Return the real tqalignment: Auto is resolved to either Left or Right */ int resolveAlignment() const; /// The part of the top margin that can be broken by a page break @@ -259,8 +259,8 @@ public: void setJoinBorder( bool join ); // Paragraph background - QColor backgroundColor() { return m_layout.backgroundColor; } - void setBackgroundColor( const QColor& color); + TQColor backgroundColor() { return m_layout.backgroundColor; } + void setBackgroundColor( const TQColor& color); // Counters are used to implement list and heading numbering/bullets. void setCounter( const KoParagCounter & counter ); @@ -301,25 +301,25 @@ public: * Returns the index in the paragraph */ int findCustomItem( const KoTextCustomItem * custom ) const; - /** Cache to find a tab by char index, QMap<char index, tab index> */ - QMap<int, int>& tabCache() { return m_tabCache; } + /** Cache to find a tab by char index, TQMap<char index, tab index> */ + TQMap<int, int>& tabCache() { return m_tabCache; } /** @return the parag rect, in pixels. This takes care of some rounding problems */ - QRect pixelRect( KoTextZoomHandler* zh ) const; + TQRect pixelRect( KoTextZoomHandler* zh ) const; /** draw underline and double underline. Static because it's used * for draw double/simple in variable. */ - static void drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoomHandler *zh, QFont font, const QColor & color, int startX, int baseLine, int bw, int y, int h, QChar firstChar ); + static void drawFontEffects( TQPainter * p, KoTextFormat *format, KoTextZoomHandler *zh, TQFont font, const TQColor & color, int startX, int baseLine, int bw, int y, int h, TQChar firstChar ); /** a bit more clever than KoTextString::toString, e.g. with numbered lists */ - QString toString( int from = 0, int length = 0xffffffff) const; + TQString toString( int from = 0, int length = 0xffffffff) const; /// The app should call this during formatting - e.g. in formatVertically void fixParagWidth( bool viewFormattingChars ); /// Load from XML - virtual void loadOasis( const QDomElement& e, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos ); + virtual void loadOasis( const TQDomElement& e, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos ); /// Save to XML /// By default the whole paragraph is saved. from/to allow to save only a portion of it. /// The 'from' and 'to' characters are both included. @@ -328,20 +328,20 @@ public: /** * Load a section of text from a oasis based xml tree. - * @param parent the xml element that has content as children. + * @param tqparent the xml element that has content as tqchildren. * @param context the context * @param stripLeadingSpace whether to remove leading literal whitespace */ - void loadOasisSpan( const QDomElement& parent, KoOasisContext& context, uint& pos, bool stripLeadingSpace = false ); + void loadOasisSpan( const TQDomElement& tqparent, KoOasisContext& context, uint& pos, bool stripLeadingSpace = false ); /** * Load a section of text from a oasis based xml tree. - * @param parent the xml element that has content as children. + * @param tqparent the xml element that has content as tqchildren. * @param context the context * @param stripLeadingSpace whether to remove leading literal whitespace * @param hasTrailingSpace whether there was trailing literal whitespace in the span's text */ - void loadOasisSpan( const QDomElement& parent, KoOasisContext& context, uint& pos, bool stripLeadingSpace, bool *hasTrailingSpace ); + void loadOasisSpan( const TQDomElement& tqparent, KoOasisContext& context, uint& pos, bool stripLeadingSpace, bool *hasTrailingSpace ); void applyListStyle( KoOasisContext& context, int restartNumbering, bool orderedList, bool heading, int level ); @@ -350,20 +350,20 @@ public: #endif protected: - void invalidateCounters(); + void tqinvalidateCounters(); bool lineHyphenated( int l ) const; - void paintLines( QPainter &painter, const QColorGroup &cg, KoTextCursor *cursor, bool drawSelections, + void paintLines( TQPainter &painter, const TQColorGroup &cg, KoTextCursor *cursor, bool drawSelections, int clipx, int clipy, int clipw, int cliph ); - void drawParagString( QPainter &painter, const QString &str, int start, int len, int startX, + void drawParagString( TQPainter &painter, const TQString &str, int start, int len, int startX, int lastY, int baseLine, int bw, int h, bool drawSelections, - KoTextFormat *lastFormat, const QMemArray<int> &selectionStarts, - const QMemArray<int> &selectionEnds, const QColorGroup &cg, bool rightToLeft, int line ); - void drawParagStringInternal( QPainter &painter, const QString &s, int start, int len, int startX, + KoTextFormat *lastFormat, const TQMemArray<int> &selectionStarts, + const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line ); + void drawParagStringInternal( TQPainter &painter, const TQString &s, int start, int len, int startX, int lastY, int baseLine, int bw, int h, bool drawSelections, - KoTextFormat *lastFormat, const QMemArray<int> &selectionStarts, - const QMemArray<int> &selectionEnds, const QColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, bool drawingShadow ); + KoTextFormat *lastFormat, const TQMemArray<int> &selectionStarts, + const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, bool drawingShadow ); /// Bitfield for drawFormattingChars's "whichFormattingChars" param enum { FormattingSpace = 1, FormattingBreak = 2, FormattingEndParag = 4, FormattingTabs = 8, @@ -373,17 +373,17 @@ protected: /// kotextdocument drawingflag for it was set. /// The last arg is a bit special: drawParagStringInternal always sets it to "all", /// but reimplementations can change its value. - virtual void drawFormattingChars( QPainter &painter, int start, int len, + virtual void drawFormattingChars( TQPainter &painter, int start, int len, int lastY_pix, int baseLine_pix, int h_pix, // in pixels bool drawSelections, - KoTextFormat *format, const QMemArray<int> &selectionStarts, - const QMemArray<int> &selectionEnds, const QColorGroup &cg, + KoTextFormat *format, const TQMemArray<int> &selectionStarts, + const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, int whichFormattingChars ); protected: KoParagLayout m_layout; - QMap<int, int> m_tabCache; + TQMap<int, int> m_tabCache; private: KoParagLayout loadParagLayout( KoOasisContext& context, KoStyleCollection *styleCollection, bool findStyle ); @@ -392,13 +392,13 @@ private: /////// End of kotext-specific additions private: - QMap<int, KoTextParagSelection> &selections() const; - QPtrList<KoTextCustomItem> &floatingItems() const; + TQMap<int, KoTextParagSelection> &selections() const; + TQPtrList<KoTextCustomItem> &floatingItems() const; /// Returns the height of the biggest character in that line int heightForLineSpacing( int startChar, int lastChar ) const; - QMap<int, KoTextParagLineStart*> lineStarts; - QRect r; + TQMap<int, KoTextParagLineStart*> lineStarts; + TQRect r; KoTextParag *p, *n; KoTextDocument *doc; bool m_invalid : 1; @@ -413,17 +413,17 @@ private: int id; int m_wused; KoTextString *str; - QMap<int, KoTextParagSelection> *mSelections; - QPtrList<KoTextCustomItem> *mFloatingItems; + TQMap<int, KoTextParagSelection> *mSelections; + TQPtrList<KoTextCustomItem> *mFloatingItems; KoTextFormat *defFormat; // is this really used? int *tArray; - // Those things are used by QRT for the case of a paragraph without document + // Those things are used by TQRT for the case of a paragraph without document // We don't use this currently, and it's not worth making EVERY parag bigger // just for a special case that's rarely used. Better have lightweight KoTextDocument // replacement (with common base class), if we ever want efficient single-parag docs... //int tabStopWidth; - //QRect docRect; + //TQRect docRect; //KoTextFormatterBase *pFormatter; //KoTextDocCommandHistory *commandHistory; }; @@ -433,7 +433,7 @@ inline int KoTextParag::length() const return str->length(); } -inline QRect KoTextParag::rect() const +inline TQRect KoTextParag::rect() const { return r; } @@ -458,12 +458,12 @@ inline short int KoTextParag::lineChanged() return m_lineChanged; } -inline void KoTextParag::append( const QString &s, bool reallyAtEnd ) +inline void KoTextParag::append( const TQString &s, bool reallyAtEnd ) { if ( reallyAtEnd ) insert( str->length(), s ); else - insert( QMAX( str->length() - 1, 0 ), s ); + insert( TQMAX( str->length() - 1, 0 ), s ); } inline KoTextParag *KoTextParag::prev() const @@ -505,7 +505,7 @@ inline int KoTextParag::paragId() const return id; } -inline QMap<int, KoTextParagLineStart*> &KoTextParag::lineStartList() +inline TQMap<int, KoTextParagLineStart*> &KoTextParag::lineStartList() { return lineStarts; } @@ -520,21 +520,21 @@ inline KoTextDocument *KoTextParag::document() const return doc; } -inline void KoTextParag::setAlignment( uint a ) +inline void KoTextParag::tqsetAlignment( uint a ) { if ( a == align ) return; align = a; - invalidate( 0 ); + tqinvalidate( 0 ); } -/*inline void KoTextParag::setListStyle( QStyleSheetItem::ListStyle ls ) +/*inline void KoTextParag::setListStyle( TQStyleSheetItem::ListStyle ls ) { lstyle = ls; - invalidate( 0 ); + tqinvalidate( 0 ); } -inline QStyleSheetItem::ListStyle KoTextParag::listStyle() const +inline TQStyleSheetItem::ListStyle KoTextParag::listStyle() const { return lstyle; }*/ |
