summaryrefslogtreecommitdiffstats
path: root/kword/KWTextFrameSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'kword/KWTextFrameSet.h')
-rw-r--r--kword/KWTextFrameSet.h170
1 files changed, 86 insertions, 84 deletions
diff --git a/kword/KWTextFrameSet.h b/kword/KWTextFrameSet.h
index 97aba9497..3477bc3f6 100644
--- a/kword/KWTextFrameSet.h
+++ b/kword/KWTextFrameSet.h
@@ -49,8 +49,8 @@ class KAction;
class KNamedCommand;
class KMacroCommand;
-class QDragObject;
-class QProgressDialog;
+class TQDragObject;
+class TQProgressDialog;
/**
* Class: KWTextFrameSet
@@ -63,11 +63,12 @@ class QProgressDialog;
class KWTextFrameSet : public KWFrameSet, public KoTextFlow, public KoTextFormatInterface
{
Q_OBJECT
+ TQ_OBJECT
public:
/// Cnstructor
- KWTextFrameSet( KWDocument *_doc, const QString & name );
+ KWTextFrameSet( KWDocument *_doc, const TQString & name );
/// Used for OASIS loading
- KWTextFrameSet( KWDocument* doc, const QDomElement& tag, KoOasisContext& context );
+ KWTextFrameSet( KWDocument* doc, const TQDomElement& tag, KoOasisContext& context );
/// Destructor
~KWTextFrameSet();
@@ -92,19 +93,19 @@ public:
void clearUndoRedoInfo();
/** Convert the @p dPoint in the normal coordinate system (and in pt)
- * into a point (@p iPoint) in the internal qtextdoc coordinates (in layout units). */
- KWFrame * documentToInternal( const KoPoint &dPoint, QPoint &iPoint ) const;
+ * into a point (@p iPoint) in the internal qtextdoc coordinates (in tqlayout units). */
+ KWFrame * documentToInternal( const KoPoint &dPoint, TQPoint &iPoint ) const;
/// used by documentToInternalMouseSelection()
enum RelativePosition { InsideFrame, LeftOfFrame, TopOfFrame, AtEnd };
- KWFrame * documentToInternalMouseSelection( const KoPoint &dPoint, QPoint &iPoint, RelativePosition& relPos, KWViewMode *viewMode ) const;
+ KWFrame * documentToInternalMouseSelection( const KoPoint &dPoint, TQPoint &iPoint, RelativePosition& relPos, KWViewMode *viewMode ) const;
- /** Convert the @p in the internal qtextdoc coordinates (in layout units)
+ /** Convert the @p in the internal qtextdoc coordinates (in tqlayout units)
* into a point in the document coordinate system (in pt).
* Also returns the frame in which this point is. */
KWFrame * internalToDocument( const KoPoint &relPoint, KoPoint &dPoint ) const;
// version taking a LU point as input
- KWFrame * internalToDocument( const QPoint &iPoint, KoPoint &dPoint ) const;
+ KWFrame * internalToDocument( const TQPoint &iPoint, KoPoint &dPoint ) const;
/** Same as internalToDocument, but goes directly to the normal coords (zoomed)
* since this method is used for view stuff only (mouse).
@@ -114,18 +115,18 @@ public:
* @param iPoint internal document point
* @param dPoint the other point
*/
- KWFrame * internalToDocumentWithHint( const QPoint &iPoint, KoPoint &dPoint, const KoPoint &hintDPoint ) const;
+ KWFrame * internalToDocumentWithHint( const TQPoint &iPoint, KoPoint &dPoint, const KoPoint &hintDPoint ) const;
/** A variant of internalToDocument, when the frame is already known.
* Both faster, and more correct for inline frames that spawn over multiple containing frames
*/
KoPoint internalToDocumentKnowingFrame( const KoPoint &relPoint, KWFrame* theFrame ) const;
// [deprecated?] version taking a LU point as input
- KoPoint internalToDocumentKnowingFrame( const QPoint &iPoint, KWFrame* theFrame ) const;
+ KoPoint internalToDocumentKnowingFrame( const TQPoint &iPoint, KWFrame* theFrame ) const;
/** Implementation of Ctrl+PageUp/PageDown
- * Returns a point in layout units (for placing the cursor) */
- QPoint moveToPage( int currentPgNum, short int direction ) const;
+ * Returns a point in tqlayout units (for placing the cursor) */
+ TQPoint moveToPage( int currentPgNum, short int direction ) const;
/** Return the available height in pixels (sum of all frames' height, with zoom applied)
* Used to know if we need to create more pages. */
@@ -152,72 +153,72 @@ public:
* @param nPointBottom the max the view looks at, in normal coordinates
* @param viewMode the current viewMode
*/
- void updateViewArea( QWidget * w, KWViewMode* viewMode, const QPoint & nPointBottom );
+ void updateViewArea( TQWidget * w, KWViewMode* viewMode, const TQPoint & nPointBottom );
- virtual QDomElement save( QDomElement &parentElem, bool saveFrames = true )
- { return saveInternal( parentElem, saveFrames, false ); }
+ virtual TQDomElement save( TQDomElement &tqparentElem, bool saveFrames = true )
+ { return saveInternal( tqparentElem, saveFrames, false ); }
/** save to XML - when copying to clipboard (includes floating framesets) */
- virtual QDomElement toXML( QDomElement &parentElem, bool saveFrames = true )
- { return saveInternal( parentElem, saveFrames, true ); }
+ virtual TQDomElement toXML( TQDomElement &tqparentElem, bool saveFrames = true )
+ { return saveInternal( tqparentElem, saveFrames, true ); }
- virtual void load( QDomElement &attributes, bool loadFrames = true );
+ virtual void load( TQDomElement &attributes, bool loadFrames = true );
/// Load the contents of a frame (i.e. the text)
- void loadOasisContent( const QDomElement &bodyElem, KoOasisContext& context );
+ void loadOasisContent( const TQDomElement &bodyElem, KoOasisContext& context );
/// Load a complete textbox (frame and text)
- KWFrame* loadOasis( const QDomElement& frame, const QDomElement &bodyElem, KoOasisContext& context );
+ KWFrame* loadOasis( const TQDomElement& frame, const TQDomElement &bodyElem, KoOasisContext& context );
/// Load a frame and add it to this frameset - called by KWOasisLoader
- KWFrame* loadOasisTextFrame( const QDomElement& frameTag, const QDomElement &tag, KoOasisContext& context );
+ KWFrame* loadOasisTextFrame( const TQDomElement& frameTag, const TQDomElement &tag, KoOasisContext& context );
/// Save the contents of a frame (i.e. the text)
void saveOasisContent( KoXmlWriter& writer, KoSavingContext& context ) const;
/// Save a complete textbox (frame and text)
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context, bool saveFrames ) const;
- virtual QString toPlainText() const;
+ virtual TQString toPlainText() const;
virtual void finalize();
- //virtual void preparePrinting( QPainter *painter, QProgressDialog *progress, int &processedParags );
+ //virtual void preparePrinting( TQPainter *painter, TQProgressDialog *progress, int &processedParags );
/** return true if some text is selected */
bool hasSelection() const;
/** returns the selected text [without formatting] if hasSelection() */
- QString selectedText() const;
+ TQString selectedText() const;
- virtual void drawContents( QPainter *painter, const QRect &crect,
- const QColorGroup &cg, bool onlyChanged, bool resetChanged,
+ virtual void drawContents( TQPainter *painter, const TQRect &crect,
+ const TQColorGroup &cg, bool onlyChanged, bool resetChanged,
KWFrameSetEdit* edit, KWViewMode *viewMode,
KWFrameViewManager *frameViewManager );
- virtual void drawFrame( KWFrame * frame, QPainter *painter, const QRect& fcrect, const QRect& crect,
- const QPoint& translationOffset,
- KWFrame *settingsFrame, const QColorGroup &cg, bool onlyChanged, bool resetChanged,
+ virtual void drawFrame( KWFrame * frame, TQPainter *painter, const TQRect& fcrect, const TQRect& crect,
+ const TQPoint& translationOffset,
+ KWFrame *settingsFrame, const TQColorGroup &cg, bool onlyChanged, bool resetChanged,
KWFrameSetEdit * edit, KWViewMode *viewMode, bool drawUnderlyingFrames );
- virtual void drawFrameContents( KWFrame * frame, QPainter *painter, const QRect & fcrect,
- const QColorGroup &cg, bool onlyChanged, bool resetChanged,
+ virtual void drawFrameContents( KWFrame * frame, TQPainter *painter, const TQRect & fcrect,
+ const TQColorGroup &cg, bool onlyChanged, bool resetChanged,
KWFrameSetEdit * edit, KWViewMode *viewMode );
- void drawCursor( QPainter *p, KoTextCursor *cursor, bool cursorVisible, KWCanvas *canvas, KWFrame *currentFrame );
- QPoint cursorPos( KoTextCursor *cursor, KWCanvas* canvas, KWFrame* currentFrame );
+ void drawCursor( TQPainter *p, KoTextCursor *cursor, bool cursorVisible, KWCanvas *canvas, KWFrame *currentFrame );
+ TQPoint cursorPos( KoTextCursor *cursor, KWCanvas* canvas, KWFrame* currentFrame );
- KCommand* pasteOasis( KoTextCursor * cursor, const QByteArray & data, bool removeSelected );
+ KCommand* pasteOasis( KoTextCursor * cursor, const TQByteArray & data, bool removeSelected );
void insertTOC( KoTextCursor * cursor );
KNamedCommand* insertFrameBreakCommand( KoTextCursor *cursor );
void insertFrameBreak( KoTextCursor * cursor );
KCommand * setPageBreakingCommand( KoTextCursor * cursor, int pageBreaking );
- QRect paragRect( KoTextParag * parag ) const; // in normal coords
+ TQRect paragRect( KoTextParag * parag ) const; // in normal coords
KCommand *deleteAnchoredFrame( KWAnchor * anchor );
void findPosition( const KoPoint &dPoint, KoTextParag * & parag, int & index );
- /** Highlighting support (for search/replace, spellchecking etc.) */
- void highlightPortion( KoTextParag * parag, int index, int length, KWCanvas * canvas, bool repaint = true, KDialogBase* dialog = 0 );
- void removeHighlight( bool repaint = true );
+ /** Highlighting support (for search/tqreplace, spellchecking etc.) */
+ void highlightPortion( KoTextParag * parag, int index, int length, KWCanvas * canvas, bool tqrepaint = true, KDialogBase* dialog = 0 );
+ void removeHighlight( bool tqrepaint = true );
- virtual void addTextFrameSets( QPtrList<KWTextFrameSet> &lst, bool onlyReadWrite=false );
+ virtual void addTextFrameSets( TQPtrList<KWTextFrameSet> &lst, bool onlyReadWrite=false );
/** Update the paragraph that use the given style, after this style was changed.
* The flags tell which changes should be applied.
@@ -236,14 +237,14 @@ public:
#endif
/** Invalidate all paragraphs and start re-formatting */
- virtual void layout();
+ virtual void tqlayout();
/** Invalidate all paragraphs (causes a re-flow of the text upon next redraw) */
- virtual void invalidate();
+ virtual void tqinvalidate();
virtual int paragraphs();
virtual int paragraphsSelected();
/** Calculate statistics for this frameset */
- virtual bool statistics( QProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace,
+ virtual bool statistics( TQProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace,
ulong & words, ulong& sentences, ulong & syllables, ulong & lines, bool selected );
/** reimplemented from KoTextFlow, implements flowing around frames etc. */
@@ -252,7 +253,7 @@ public:
virtual int adjustFlow( int y, int w, int h );
/** Called by KWTextFormatter. Implements page breaking, breaking around frames, etc. */
- int formatVertically( KoTextParag *parag, const QRect& rect );
+ int formatVertically( KoTextParag *parag, const TQRect& rect );
/** Called by KWTextFormatter::postFormat() */
void fixParagWidth( KWTextParag* parag );
@@ -265,7 +266,7 @@ public:
/** The viewmode that was passed to drawContents. Special hook for KWAnchor. Don't use. */
KWViewMode * currentViewMode() const { return m_currentViewMode; }
/** The frame that we are currently drawing in drawFrame. Stored here since we can't pass it
- * through QRT's drawing methods. Used by e.g. KWAnchor. */
+ * through TQRT's drawing methods. Used by e.g. KWAnchor. */
KWFrame * currentDrawnFrame() const { return m_currentDrawnFrame; }
/** Let KoTextFormatInterface access the current format */
@@ -274,19 +275,19 @@ public:
/** Let KoTextFormatInterface set the modified format */
virtual KCommand *setFormatCommand( const KoTextFormat * newFormat, int flags, bool zoomFont = false );
- /** Let KoTextFormatInterface access the current parag layout */
+ /** Let KoTextFormatInterface access the current parag tqlayout */
virtual const KoParagLayout * currentParagLayoutFormat() const;
virtual bool rtl() const ;
- /** Let KoTextFormatInterface set a modified current parag layout */
+ /** Let KoTextFormatInterface set a modified current parag tqlayout */
virtual KCommand *setParagLayoutFormatCommand( KoParagLayout *newLayout, int flags, int marginIndex=-1);
virtual KCommand *setChangeCaseOfTextCommand(KoChangeCaseDia::TypeOfCase _type);
/** (Assuming this==main frameset), recalc the foot note numbers */
- void renumberFootNotes( bool repaint = true );
+ void renumberFootNotes( bool tqrepaint = true );
/**
* Iteration over text objects - used by KWBgSpellCheck
@@ -308,15 +309,15 @@ public:
/**
* Insert a footnote (var and frameset). Shared code for loading and inserting from GUI.
*/
- KWFootNoteFrameSet * insertFootNote( NoteType noteType, KWFootNoteVariable::Numbering numType, const QString &manualString );
+ KWFootNoteFrameSet * insertFootNote( NoteType noteType, KWFootNoteVariable::Numbering numType, const TQString &manualString );
- KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts );
+ KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts );
- QString copyTextParag( KoXmlWriter& writer, KoSavingContext& context, int selectionId );
+ TQString copyTextParag( KoXmlWriter& writer, KoSavingContext& context, int selectionId );
/// Sort selected paragraphs
/// Return a complete OASIS store, ready for "pasting"
- QByteArray sortText(SortType type) const;
+ TQByteArray sortText(SortType type) const;
KoLinkVariable* linkVariableUnderMouse( const KoPoint& dPoint );
KoVariable* variableUnderMouse( const KoPoint& dPoint );
@@ -343,7 +344,7 @@ protected slots:
protected: // for testing purposes
- KWTextFrameSet( const QString & name );
+ KWTextFrameSet( const TQString & name );
private:
void init();
@@ -352,15 +353,15 @@ private:
void getMargins( int yp, int h, int reqMinWidth, int* marginLeft, int* marginRight, int* pageWidth, int* validHeight,
int* breakBegin, int* breakEnd, KoTextParag* parag );
bool checkVerticalBreak( int & yp, int & h, KoTextParag * parag, bool linesTogether, int breakBegin, int breakEnd );
- void frameResized( KWFrame *theFrame, bool invalidateLayout );
+ void frameResized( KWFrame *theFrame, bool tqinvalidateLayout );
/**
* Return the list of frames containing the text that goes from @p y1 to @p y2
* (in internal coordinates).
*/
- QValueList<KWFrame*> framesFromTo( int y1, int y2 ) const;
+ TQValueList<KWFrame*> framesFromTo( int y1, int y2 ) const;
double footerHeaderSizeMax( KWFrame *theFrame );
double footNoteSize( KWFrame *theFrame );
- QDomElement saveInternal( QDomElement &parentElem, bool saveFrames, bool saveAnchorsFramesets );
+ TQDomElement saveInternal( TQDomElement &tqparentElem, bool saveFrames, bool saveAnchorsFramesets );
bool createNewPageAndNewFrame( KoTextParag* lastFormatted, int difference );
private:
@@ -384,6 +385,7 @@ private:
class KWTextFrameSetEdit : public KoTextView, public KWFrameSetEdit
{
Q_OBJECT
+ TQ_OBJECT
public:
KWTextFrameSetEdit( KWTextFrameSet * fs, KWCanvas * canvas );
virtual ~KWTextFrameSetEdit();
@@ -407,19 +409,19 @@ public:
KoTextView * textView() { return this; }
// Events forwarded by the canvas (when being in "edit" mode)
- virtual void keyPressEvent( QKeyEvent * );
- virtual void keyReleaseEvent( QKeyEvent * );
- virtual void imStartEvent( QIMEvent * );
- virtual void imComposeEvent( QIMEvent * );
- virtual void imEndEvent( QIMEvent * );
- virtual void mousePressEvent( QMouseEvent *, const QPoint &, const KoPoint & );
- virtual void mouseMoveEvent( QMouseEvent *, const QPoint &, const KoPoint & ); // only called if button is pressed
- virtual void mouseReleaseEvent( QMouseEvent *, const QPoint &, const KoPoint & );
- virtual void mouseDoubleClickEvent( QMouseEvent *, const QPoint &, const KoPoint & );
- virtual void dragEnterEvent( QDragEnterEvent * );
- virtual void dragMoveEvent( QDragMoveEvent *, const QPoint &, const KoPoint & );
- virtual void dragLeaveEvent( QDragLeaveEvent * );
- virtual void dropEvent( QDropEvent *, const QPoint &, const KoPoint &, KWView* view );
+ virtual void keyPressEvent( TQKeyEvent * );
+ virtual void keyReleaseEvent( TQKeyEvent * );
+ virtual void imStartEvent( TQIMEvent * );
+ virtual void imComposeEvent( TQIMEvent * );
+ virtual void imEndEvent( TQIMEvent * );
+ virtual void mousePressEvent( TQMouseEvent *, const TQPoint &, const KoPoint & );
+ virtual void mouseMoveEvent( TQMouseEvent *, const TQPoint &, const KoPoint & ); // only called if button is pressed
+ virtual void mouseReleaseEvent( TQMouseEvent *, const TQPoint &, const KoPoint & );
+ virtual void mouseDoubleClickEvent( TQMouseEvent *, const TQPoint &, const KoPoint & );
+ virtual void dragEnterEvent( TQDragEnterEvent * );
+ virtual void dragMoveEvent( TQDragMoveEvent *, const TQPoint &, const KoPoint & );
+ virtual void dragLeaveEvent( TQDragLeaveEvent * );
+ virtual void dropEvent( TQDropEvent *, const TQPoint &, const KoPoint &, KWView* view );
virtual void focusInEvent();
virtual void focusOutEvent();
virtual void selectAll();
@@ -437,24 +439,24 @@ public:
void insertFrameBreak() { textFrameSet()->insertFrameBreak( cursor() ); }
void insertWPPage();
void insertVariable( int type, int subtype = 0 );
- void insertFootNote( NoteType noteType, KWFootNoteVariable::Numbering numType, const QString& manualString );
- void insertCustomVariable( const QString &name);
+ void insertFootNote( NoteType noteType, KWFootNoteVariable::Numbering numType, const TQString& manualString );
+ void insertCustomVariable( const TQString &name);
void insertVariable( KoVariable *var,
KoTextFormat *format = 0 /*means currentFormat()*/,
bool refreshCustomMenu = false/*don't refresh all the time custom menu*/ );
- void insertLink(const QString &_linkName, const QString & hrefName);
- void insertComment(const QString &_comment);
+ void insertLink(const TQString &_linkName, const TQString & hrefName);
+ void insertComment(const TQString &_comment);
- void insertExpression(const QString &_c);
- void insertFloatingFrameSet( KWFrameSet * fs, const QString & commandName );
+ void insertExpression(const TQString &_c);
+ void insertFloatingFrameSet( KWFrameSet * fs, const TQString & commandName );
void insertTOC() { textFrameSet()->insertTOC( cursor() ); }
KCommand * setPageBreakingCommand( int pageBreaking )
{ return textFrameSet()->setPageBreakingCommand( cursor(), pageBreaking ); }
//const KoParagLayout & currentParagLayout() const { return m_paragLayout; }
- double currentLeftMargin() const { return m_paragLayout.margins[QStyleSheetItem::MarginLeft]; }
+ double currentLeftMargin() const { return m_paragLayout.margins[TQStyleSheetItem::MarginLeft]; }
virtual void removeToolTipCompletion();
@@ -465,8 +467,8 @@ public:
/// Called by KWView when using the action
void openLink();
- void pasteData( QMimeSource* data, int provides, bool drop );
- KCommand* pasteOasisCommand( QMimeSource* data );
+ void pasteData( TQMimeSource* data, int provides, bool drop );
+ KCommand* pasteOasisCommand( TQMimeSource* data );
/**
* Return the requested border of the paragraph that the cursor currently is in.
@@ -487,16 +489,16 @@ public slots:
protected:
// Reimplemented from KoTextView
- virtual void doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, QChar ch );
- virtual bool doIgnoreDoubleSpace(KoTextParag * parag, int index,QChar ch );
+ virtual void doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, TQChar ch );
+ virtual bool doIgnoreDoubleSpace(KoTextParag * parag, int index,TQChar ch );
virtual bool doCompletion( KoTextCursor* cursor, KoTextParag *parag, int index );
virtual bool doToolTipCompletion( KoTextCursor* cursor, KoTextParag *parag, int index,int keyPress );
- virtual void showToolTipBox(KoTextParag *parag, int index, QWidget *widget, const QPoint &pos);
+ virtual void showToolTipBox(KoTextParag *parag, int index, TQWidget *widget, const TQPoint &pos);
virtual void textIncreaseIndent();
virtual bool textDecreaseIndent();
virtual void startDrag();
- QDragObject * newDrag( QWidget * parent );
+ TQDragObject * newDrag( TQWidget * tqparent );
private slots:
void slotFrameDeleted(KWFrame *);
@@ -513,7 +515,7 @@ class KWFootNoteFrameSet : public KWTextFrameSet
{
public:
/** constructor */
- KWFootNoteFrameSet( KWDocument *doc, const QString & name )
+ KWFootNoteFrameSet( KWDocument *doc, const TQString & name )
: KWTextFrameSet( doc, name ), m_footNoteVar( 0L ) {}
virtual KWordFrameSetIface* dcopObject();
@@ -536,7 +538,7 @@ public:
/** Called by KWTextFrameSet::renumberFootNotes.
* Sets the text of the parag-counter in the footnote text.
*/
- void setCounterText( const QString& text );
+ void setCounterText( const TQString& text );
virtual bool isFootNote() const;
virtual bool isEndNote() const;