summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoTextDocument.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kotext/KoTextDocument.h
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kotext/KoTextDocument.h')
-rw-r--r--lib/kotext/KoTextDocument.h147
1 files changed, 74 insertions, 73 deletions
diff --git a/lib/kotext/KoTextDocument.h b/lib/kotext/KoTextDocument.h
index 39143d08..2b658a1a 100644
--- a/lib/kotext/KoTextDocument.h
+++ b/lib/kotext/KoTextDocument.h
@@ -23,13 +23,13 @@
#include "KoRichText.h"
#include <koffice_export.h>
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class Q_EXPORT QMap<int, QColor>;
-template class Q_EXPORT QMap<int, bool>;
-template class Q_EXPORT QMap<int, KoTextDocumentSelection>;
-template class Q_EXPORT QPtrList<KoTextDocument>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQ_EXPORT TQMap<int, TQColor>;
+template class TQ_EXPORT TQMap<int, bool>;
+template class TQ_EXPORT TQMap<int, KoTextDocumentSelection>;
+template class TQ_EXPORT TQPtrList<KoTextDocument>;
+// TQMOC_SKIP_END
#endif
class KoStyleCollection;
@@ -42,9 +42,10 @@ class KoTextFormatter;
class KoTextParag;
class CustomItemsMap;
-class KOTEXT_EXPORT KoTextDocument : public QObject
+class KOTEXT_EXPORT KoTextDocument : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
friend class KoTextCursor;
friend class KoTextParag;
@@ -54,7 +55,7 @@ public:
enum SelectionId {
Standard = 0,
InputMethodPreedit = 1,
- HighlightSelection = 2, // used to highlight during search/replace
+ HighlightSelection = 2, // used to highlight during search/tqreplace
Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to
// remove multiple lines with removeSelectedText()
};
@@ -64,13 +65,13 @@ public:
// see below for constructor
virtual ~KoTextDocument();
- //KoTextDocument *parent() const { return par; }
+ //KoTextDocument *tqparent() const { return par; }
- void setText( const QString &text, const QString &context );
+ void setText( const TQString &text, const TQString &context );
- //QString text() const;
- //QString text( int parag ) const;
- //QString originalText() const;
+ //TQString text() const;
+ //TQString text( int parag ) const;
+ //TQString originalText() const;
int x() const;
int y() const;
@@ -93,7 +94,7 @@ public:
void setFirstParag( KoTextParag *p );
void setLastParag( KoTextParag *p );
- void invalidate();
+ void tqinvalidate();
//void setPreProcessor( KoTextPreProcessor *sh );
//KoTextPreProcessor *preProcessor() const;
@@ -101,9 +102,9 @@ public:
void setFormatter( KoTextFormatterBase *f );
KoTextFormatterBase *formatter() const;
- QColor selectionColor( int id ) const;
+ TQColor selectionColor( int id ) const;
bool invertSelectionText( int id ) const;
- void setSelectionColor( int id, const QColor &c );
+ void setSelectionColor( int id, const TQColor &c );
void setInvertSelectionText( int id, bool b );
bool hasSelection( int id, bool visible = false ) const;
bool isSelectionSwapped( int id ); //// kotext
@@ -121,7 +122,7 @@ public:
int numSelections() const { return nSelections; }
void addSelection( int id );
- QString selectedText( int id, bool withCustom = TRUE ) const;
+ TQString selectedText( int id, bool withCustom = TRUE ) const;
//void copySelectedText( int id );
void removeSelectedText( int id, KoTextCursor *cursor );
@@ -134,35 +135,35 @@ public:
KoTextFormatCollection *formatCollection() const;
- bool find( const QString &expr, bool cs, bool wo, bool forward, int *parag, int *index, KoTextCursor *cursor );
+ bool tqfind( const TQString &expr, bool cs, bool wo, bool forward, int *parag, int *index, KoTextCursor *cursor );
- //void setTextFormat( Qt::TextFormat f );
- //Qt::TextFormat textFormat() const;
+ //void setTextFormat( TQt::TextFormat f );
+ //TQt::TextFormat textFormat() const;
- bool inSelection( int selId, const QPoint &pos ) const;
+ bool inSelection( int selId, const TQPoint &pos ) const;
void setUnderlineLinks( bool b ) { underlLinks = b; }
bool underlineLinks() const { return underlLinks; }
- void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; }
- QBrush *paper() const { return backBrush; }
+ void setPaper( TQBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; }
+ TQBrush *paper() const { return backBrush; }
- //void doLayout( QPainter *p, int w );
+ //void doLayout( TQPainter *p, int w );
#if 0 // see KoTextDocument
- void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 );
- void drawParag( QPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
- QPixmap *&doubleBuffer, const QColorGroup &cg,
+ void draw( TQPainter *p, const TQRect& rect, const TQColorGroup &cg, const TQBrush *paper = 0 );
+ void drawParag( TQPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
+ TQPixmap *&doubleBuffer, const TQColorGroup &cg,
bool drawCursor, KoTextCursor *cursor, bool resetChanged = TRUE );
- KoTextParag *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg,
+ KoTextParag *draw( TQPainter *p, int cx, int cy, int cw, int ch, const TQColorGroup &cg,
bool onlyChanged = FALSE, bool drawCursor = FALSE, KoTextCursor *cursor = 0,
bool resetChanged = TRUE );
#endif
- //void setDefaultFont( const QFont &f );
+ //void setDefaultFont( const TQFont &f );
void registerCustomItem( KoTextCustomItem *i, KoTextParag *p );
void unregisterCustomItem( KoTextCustomItem *i, KoTextParag *p );
- const QPtrList<KoTextCustomItem> & allCustomItems() const { return customItems; }
+ const TQPtrList<KoTextCustomItem> & allCustomItems() const { return customItems; }
void setFlow( KoTextFlow *f );
void takeFlow();
@@ -176,20 +177,20 @@ public:
void setUseFormatCollection( bool b ) { useFC = b; }
bool useFormatCollection() const { return useFC; }
-#ifdef QTEXTTABLE_AVAILABLE
+#ifdef TQTEXTTABLE_AVAILABLE
KoTextTableCell *tableCell() const { return tc; }
void setTableCell( KoTextTableCell *c ) { tc = c; }
#endif
- void setPlainText( const QString &text );
- //void setRichText( const QString &text, const QString &context );
- //QString richText( KoTextParag *p = 0 ) const;
- QString plainText() const;
+ void setPlainText( const TQString &text );
+ //void setRichText( const TQString &text, const TQString &context );
+ //TQString richText( KoTextParag *p = 0 ) const;
+ TQString plainText() const;
//bool focusNextPrevChild( bool next );
- int alignment() const;
- void setAlignment( int a );
+ int tqalignment() const;
+ void tqsetAlignment( int a );
int *tabArray() const;
int tabStopWidth() const;
@@ -202,12 +203,12 @@ public:
int length() const;
void clear( bool createEmptyParag = FALSE );
- KoTextParag* loadList( const QDomElement& list, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph );
+ KoTextParag* loadList( const TQDomElement& list, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph );
// For normal loading nextParagraph and pos are 0.
- KoTextParag* loadOasisText( const QDomElement &bodyElem, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph );
+ KoTextParag* loadOasisText( const TQDomElement &bodyElem, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph );
- QString copySelection( KoXmlWriter& writer, KoSavingContext& context, int selectionId );
+ TQString copySelection( KoXmlWriter& writer, KoSavingContext& context, int selectionId );
void saveOasisContent( KoXmlWriter& writer, KoSavingContext& context ) const;
@@ -226,7 +227,7 @@ signals:
private:
void init();
- QPixmap *bufferPixmap( const QSize &s );
+ TQPixmap *bufferPixmap( const TQSize &s );
//// Beginning of kotext additions
@@ -242,7 +243,7 @@ public:
* If not, ownership of the given one is transferred to the document.
* @param createInitialParag if true, an initial KoTextParag is created. Set to false if you reimplement createParag,
* since the constructor can't call the reimplementation. In that case, make sure to call
- * clear(true) in your constructor; QRT doesn't support documents without paragraphs.
+ * clear(true) in your constructor; TQRT doesn't support documents without paragraphs.
*/
KoTextDocument( KoTextZoomHandler *zoomHandler,
KoTextFormatCollection *fc, KoTextFormatter *formatter = 0L,
@@ -291,15 +292,15 @@ public:
};
/** The main drawing method. Equivalent to KoTextDocument::draw, but reimplemented
* for wysiwyg */
- KoTextParag *drawWYSIWYG( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg,
+ KoTextParag *drawWYSIWYG( TQPainter *p, int cx, int cy, int cw, int ch, const TQColorGroup &cg,
KoTextZoomHandler* zoomHandler, bool onlyChanged = FALSE,
bool drawCursor = FALSE, KoTextCursor *cursor = 0,
bool resetChanged = TRUE, uint drawingFlags = KoTextDocument::DrawSelections );
/** Draw a single paragraph (used by drawWYSIWYG and by KWTextFrameSet::drawCursor).
* Equivalent to KoTextDocument::draw, but modified for wysiwyg */
- void drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
- QPixmap *&doubleBuffer, const QColorGroup &cg,
+ void drawParagWYSIWYG( TQPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
+ TQPixmap *&doubleBuffer, const TQColorGroup &cg,
KoTextZoomHandler* zoomHandler,
bool drawCursor, KoTextCursor *cursor,
bool resetChanged = TRUE,
@@ -313,13 +314,13 @@ public:
/** Set by drawParagWYSIWYG, used by KoTextParag::drawParagStringInternal */
bool dontDrawingNoteVariable() const { return (m_drawingFlags & DontDrawNoteVariable); }
- virtual KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts );
+ virtual KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts );
void emitNewCommand(KCommand *cmd) {
emit newCommand( cmd );
}
void emitRepaintChanged() {
- emit repaintChanged();
+ emit tqrepaintChanged();
}
signals:
/**
@@ -329,21 +330,21 @@ signals:
*/
void newCommand( KCommand *cmd );
/**
- * Tell the world that we'd like some repainting to happen.
+ * Tell the world that we'd like some tqrepainting to happen.
* KoTextObject connects (and forwards) that one.
*/
- void repaintChanged();
+ void tqrepaintChanged();
protected:
- void drawWithoutDoubleBuffer( QPainter *p, const QRect &rect, const QColorGroup &cg,
- KoTextZoomHandler* zoomHandler, const QBrush *paper = 0 );
+ void drawWithoutDoubleBuffer( TQPainter *p, const TQRect &rect, const TQColorGroup &cg,
+ KoTextZoomHandler* zoomHandler, const TQBrush *paper = 0 );
/**
* Called by loadOasisText. This allows to extend the loading mechanism
* for special tags no handled by kotext (images, textboxes, tables, etc.)
* @return true if @p tag was handled.
*/
- virtual bool loadOasisBodyTag( const QDomElement& /*tag*/, KoOasisContext& /*context*/,
+ virtual bool loadOasisBodyTag( const TQDomElement& /*tag*/, KoOasisContext& /*context*/,
KoTextParag* & /*lastParagraph*/, KoStyleCollection* /*styleColl*/,
KoTextParag* /*nextParagraph*/ ) {
return false;
@@ -356,9 +357,9 @@ protected:
* KoTextDocument.
* @return true (and optionally @p textData and @p customItem) if @p tag was handled.
*/
- virtual bool loadSpanTag( const QDomElement& /*tag*/, KoOasisContext& /*context*/,
+ virtual bool loadSpanTag( const TQDomElement& /*tag*/, KoOasisContext& /*context*/,
KoTextParag* /*parag*/, uint /*pos*/,
- QString& /*textData*/, KoTextCustomItem* & /*customItem*/ ) {
+ TQString& /*textData*/, KoTextCustomItem* & /*customItem*/ ) {
return false;
}
@@ -372,22 +373,22 @@ private:
//// End of kotext additions
private:
- /*struct Q_EXPORT Focus {
+ /*struct TQ_EXPORT Focus {
KoTextParag *parag;
int start, len;
- QString href;
+ TQString href;
};*/
int cx, cy; //, cw, vw;
KoTextParag *fParag, *lParag;
//KoTextPreProcessor *pProcessor;
- QMap<int, QColor> selectionColors;
- QMap<int, KoTextDocumentSelection> selections;
- QMap<int, bool> selectionText;
+ TQMap<int, TQColor> selectionColors;
+ TQMap<int, KoTextDocumentSelection> selections;
+ TQMap<int, bool> selectionText;
KoTextDocCommandHistory *commandHistory;
KoTextFormatterBase *pFormatter;
KoTextFormatCollection *fCollection;
- //Qt::TextFormat txtFormat;
+ //TQt::TextFormat txtFormat;
//bool preferRichText : 1;
bool m_pageBreakEnabled : 1;
bool useFC : 1;
@@ -397,9 +398,9 @@ private:
bool addMargs : 1;
int nSelections;
KoTextFlow *flow_;
- QPtrList<KoTextCustomItem> customItems;
- QBrush *backBrush;
- QPixmap *buf_pixmap;
+ TQPtrList<KoTextCustomItem> customItems;
+ TQBrush *backBrush;
+ TQPixmap *buf_pixmap;
//Focus focusIndicator;
//int minw;
int leftmargin;
@@ -423,7 +424,7 @@ inline int KoTextDocument::y() const
inline int KoTextDocument::width() const
{
return flow_->width();
- //return QMAX( cw, flow_->width() );
+ //return TQMAX( cw, flow_->width() );
}
//inline int KoTextDocument::visibleWidth() const
@@ -453,7 +454,7 @@ inline void KoTextDocument::setLastParag( KoTextParag *p )
inline void KoTextDocument::setWidth( int w )
{
- //cw = QMAX( w, minw );
+ //cw = TQMAX( w, minw );
flow_->setWidth( w );
//vw = w;
}
@@ -509,7 +510,7 @@ inline KoTextFormatterBase *KoTextDocument::formatter() const
return pFormatter;
}
-inline QColor KoTextDocument::selectionColor( int id ) const
+inline TQColor KoTextDocument::selectionColor( int id ) const
{
return selectionColors[ id ];
}
@@ -519,7 +520,7 @@ inline bool KoTextDocument::invertSelectionText( int id ) const
return selectionText[ id ];
}
-inline void KoTextDocument::setSelectionColor( int id, const QColor &c )
+inline void KoTextDocument::setSelectionColor( int id, const TQColor &c )
{
selectionColors[ id ] = c;
}
@@ -534,12 +535,12 @@ inline KoTextFormatCollection *KoTextDocument::formatCollection() const
return fCollection;
}
-inline int KoTextDocument::alignment() const
+inline int KoTextDocument::tqalignment() const
{
return align;
}
-inline void KoTextDocument::setAlignment( int a )
+inline void KoTextDocument::tqsetAlignment( int a )
{
align = a;
}
@@ -564,7 +565,7 @@ inline void KoTextDocument::setTabStops( int tw )
tStopWidth = tw;
}
-/*inline QString KoTextDocument::originalText() const
+/*inline TQString KoTextDocument::originalText() const
{
if ( oTextValid )
return oText;
@@ -600,12 +601,12 @@ public:
};
class KCommand;
-class QDomElement;
+class TQDomElement;
class KMacroCommand;
/** A CustomItemsMap associates a custom item to an index
* Used in the undo/redo info for insert/delete text. */
-class CustomItemsMap : public QMap<int, KoTextCustomItem *>
+class CustomItemsMap : public TQMap<int, KoTextCustomItem *>
{
public: