diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kotext/KoTextObject.h | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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/KoTextObject.h')
-rw-r--r-- | lib/kotext/KoTextObject.h | 147 |
1 files changed, 74 insertions, 73 deletions
diff --git a/lib/kotext/KoTextObject.h b/lib/kotext/KoTextObject.h index 58c92e9b..e6414f99 100644 --- a/lib/kotext/KoTextObject.h +++ b/lib/kotext/KoTextObject.h @@ -29,12 +29,12 @@ class KoSavingContext; class KCommand; class KoTextFormat; -class QProgressDialog; +class TQProgressDialog; class KoLinkVariable; class KoVariable; //#define TIMING_FORMAT -//#include <qdatetime.h> +//#include <tqdatetime.h> /** * The KoTextFormatInterface is a pure interface that allows access to the @@ -64,11 +64,11 @@ public: */ virtual KCommand *setFormatCommand( const KoTextFormat *format, int flags, bool zoomFont = false ) = 0; - /** Interface for accessing the current parag layout */ + /** Interface for accessing the current parag tqlayout */ virtual const KoParagLayout * currentParagLayoutFormat() const = 0; - /** Interface for changing the paragraph layout. - * @param newLayout pointer to the new layout to apply + /** Interface for changing the paragraph tqlayout. + * @param newLayout pointer to the new tqlayout to apply * @param flags one of the KoParagLayout flags * @param marginIndex type of margin. Only used if flags==KoParagLayout::Margins */ @@ -76,7 +76,7 @@ public: virtual KCommand *setChangeCaseOfTextCommand(KoChangeCaseDia::TypeOfCase _type)=0; - 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 ); void setParagLayoutFormat( KoParagLayout *newLayout,int flags, int marginIndex=-1); void setFormat( KoTextFormat * newFormat, int flags, bool zoomFont = false ); @@ -90,14 +90,14 @@ public: KCommand *setUnderlineCommand(bool on); //void setStrikeOut(bool on); KCommand *setDoubleUnderlineCommand( bool on ); - KCommand *setUnderlineColorCommand( const QColor &color ); + KCommand *setUnderlineColorCommand( const TQColor &color ); KCommand *setStrikeOutCommand(bool on); - //void setTextColor(const QColor &color); - KCommand *setTextColorCommand(const QColor &color); + //void setTextColor(const TQColor &color); + KCommand *setTextColorCommand(const TQColor &color); //void setPointSize( int s ); KCommand *setPointSizeCommand( int s ); - //void setFamily(const QString &font); - KCommand *setFamilyCommand(const QString &font); + //void setFamily(const TQString &font); + KCommand *setFamilyCommand(const TQString &font); //void setTextSubScript(bool on); KCommand *setTextSubScriptCommand(bool on); //void setTextSuperScript(bool on); @@ -106,27 +106,27 @@ public: //void setDefaultFormat(); KCommand *setDefaultFormatCommand(); - //void setTextBackgroundColor(const QColor &); - KCommand *setTextBackgroundColorCommand(const QColor &); + //void setTextBackgroundColor(const TQColor &); + KCommand *setTextBackgroundColorCommand(const TQColor &); //void setAlign(int align); KCommand *setAlignCommand(int align); - //void setMargin(QStyleSheetItem::Margin m, double margin); - KCommand *setMarginCommand(QStyleSheetItem::Margin m, double margin); + //void setMargin(TQStyleSheetItem::Margin m, double margin); + KCommand *setMarginCommand(TQStyleSheetItem::Margin m, double margin); //void setTabList(const KoTabulatorList & tabList ); KCommand *setTabListCommand(const KoTabulatorList & tabList ); - //void setBackgroundColor(const QColor & color ); - KCommand *setBackgroundColorCommand(const QColor & color ); + //void setBackgroundColor(const TQColor & color ); + KCommand *setBackgroundColorCommand(const TQColor & color ); //void setCounter(const KoParagCounter & counter ); KCommand *setCounterCommand(const KoParagCounter & counter ); - KCommand *setLanguageCommand(const QString &); + KCommand *setLanguageCommand(const TQString &); - KCommand *setShadowTextCommand( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor ); + KCommand *setShadowTextCommand( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor ); KCommand *setHyphenationCommand( bool _b ); @@ -140,12 +140,12 @@ public: KCommand *setWordByWordCommand( bool _b ); - QColor textColor() const; - QFont textFont() const; - QString textFontFamily()const; - QString language() const; - QColor textBackgroundColor()const; - QColor textUnderlineColor()const; + TQColor textColor() const; + TQFont textFont() const; + TQString textFontFamily()const; + TQString language() const; + TQColor textBackgroundColor()const; + TQColor textUnderlineColor()const; KoTextFormat::UnderlineType underlineType()const; KoTextFormat::StrikeOutType strikeOutType()const; @@ -164,7 +164,7 @@ public: bool textSuperScript() const; double shadowDistanceX() const; double shadowDistanceY() const; - QColor shadowColor() const; + TQColor shadowColor() const; KoTextFormat::AttributeStyle fontAttribute() const; double relativeTextSize() const; int offsetFromBaseLine()const; @@ -178,9 +178,10 @@ public: * the undo/redo commands). * Editing the text isn't done by KoTextObject but by KoTextView (document/view design). */ -class KOTEXT_EXPORT KoTextObject : public QObject, public KoTextFormatInterface +class KOTEXT_EXPORT KoTextObject : public TQObject, public KoTextFormatInterface { Q_OBJECT + TQ_OBJECT public: /** Constructor. * This constructor creates the contained KoTextDocument automatically. @@ -191,13 +192,13 @@ public: * @param defaultHyphenation the default setting for hyphenation (see KoTextFormatCollection) * @param defaultStyle the style to use by default (initial pararaph, and when deleting a used style) * @param tabStopWidth the global value for the tabstop width - * @param parent parent widget for this object + * @param tqparent tqparent widget for this object * @param name name for this object * */ - KoTextObject( KoTextZoomHandler *zh, const QFont& defaultFont, const QString &defaultLanguage, + KoTextObject( KoTextZoomHandler *zh, const TQFont& defaultFont, const TQString &defaultLanguage, bool defaultHyphenation, KoParagStyle* defaultStyle, int tabStopWidth = -1, - QObject* parent = 0, const char *name = 0 ); + TQObject* tqparent = 0, const char *name = 0 ); /** Alternative constructor. * This constructor allows to use a derived class from KoTextDocument. @@ -205,11 +206,11 @@ public: * @param textdoc the text document to use in this text object. Ownership is transferred * to the text object. * @param defaultStyle the style to use by default (initial pararaph, and when deleting a used style) - * @param parent parent widget for this object + * @param tqparent tqparent widget for this object * @param name name for this object */ KoTextObject( KoTextDocument *textdoc, KoParagStyle* defaultStyle, - QObject* parent = 0, const char *name = 0 ); + TQObject* tqparent = 0, const char *name = 0 ); virtual ~KoTextObject(); @@ -217,7 +218,7 @@ public: static const char * acceptSelectionMimeType(); /// Check if the mimesource @p mime provides one of the OASIS mimetypes, /// and if so, return it. Otherwise return an empty string. - static QCString providesOasis( QMimeSource* mime ); + static TQCString providesOasis( TQMimeSource* mime ); void setNeedSpellCheck(bool b); bool needSpellCheck() const { return m_needsSpellCheck;} @@ -239,7 +240,7 @@ public: /** return true if some text is selected */ bool hasSelection() const { return textdoc->hasSelection( KoTextDocument::Standard, true ); } /** returns the selected text [without formatting] if hasSelection() */ - QString selectedText( KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ) const { + TQString selectedText( KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ) const { return textdoc->selectedText( selectionId ); } /** returns true if the given selection has any custom item in it */ @@ -250,7 +251,7 @@ public: CheckNewLine = 1, /// < if true, the text to be inserted is checked for '\\n' (as a paragraph delimiter) OverwriteMode = 2, DoNotRemoveSelected = 4, ///< whether to remove selected text before - DoNotRepaint = 8 ///< usually we repaint in insert(), this allows to turn it off + DoNotRepaint = 8 ///< usually we tqrepaint in insert(), this allows to turn it off }; /** @@ -264,10 +265,10 @@ public: * @param customItemsMap the map of custom items to include in the new text * @param selectionId which selection to use (See KoTextDocument::SelectionId) */ - void insert( KoTextCursor * cursor, KoTextFormat * currentFormat, const QString &text, - const QString & commandName, + void insert( KoTextCursor * cursor, KoTextFormat * currentFormat, const TQString &text, + const TQString & commandName, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard, - int insertFlags = DefaultInsertFlags, // KDE4: TODO use QFlags + int insertFlags = DefaultInsertFlags, // KDE4: TODO use TQFlags CustomItemsMap customItemsMap = CustomItemsMap() ); /** @@ -278,14 +279,14 @@ public: * @param createUndoRedo create an undo history entry for this removal */ void removeSelectedText( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard, - const QString & cmdName = QString::null, bool createUndoRedo=true ); + const TQString & cmdName = TQString(), bool createUndoRedo=true ); - KCommand * replaceSelectionCommand( KoTextCursor * cursor, const QString & replacement, - const QString & cmdName, + KCommand * replaceSelectionCommand( KoTextCursor * cursor, const TQString & replacement, + const TQString & cmdName, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard, - int insertFlags = DefaultInsertFlags, // KDE4: TODO use QFlags + int insertFlags = DefaultInsertFlags, // KDE4: TODO use TQFlags CustomItemsMap customItemsMap = CustomItemsMap() ); - KCommand * removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool repaint = true ); + KCommand * removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool tqrepaint = true ); KCommand* insertParagraphCommand( KoTextCursor * cursor ); /** @@ -300,15 +301,15 @@ public: * what it does (presumably, removes the selection and replaces it * with the pasted text). */ - void pasteText( KoTextCursor * cursor, const QString & text, KoTextFormat * currentFormat, + void pasteText( KoTextCursor * cursor, const TQString & text, KoTextFormat * currentFormat, bool removeSelected ); void selectAll( bool select ); - /** Highlighting support (for search/replace, spellchecking etc.). + /** Highlighting support (for search/tqreplace, spellchecking etc.). * Don't forget to ensure the paragraph is visible. */ - void highlightPortion( KoTextParag * parag, int index, int length, bool repaint ); - void removeHighlight( bool repaint ); + void highlightPortion( KoTextParag * parag, int index, int length, bool tqrepaint ); + void removeHighlight( bool tqrepaint ); /** Implementation of setFormatCommand from KoTextFormatInterface - apply change to the whole document */ KCommand *setFormatCommand( const KoTextFormat *format, int flags, bool zoomFont = false ); @@ -317,7 +318,7 @@ public: Returns a command if the format was applied to a selection */ KCommand *setFormatCommand( KoTextCursor * cursor, KoTextFormat ** currentFormat, const KoTextFormat *format, int flags, bool zoomFont = false, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); - enum KeyboardAction { // keep in sync with QTextEdit + enum KeyboardAction { // keep in sync with TQTextEdit ActionBackspace, ActionDelete, ActionReturn, @@ -333,21 +334,21 @@ public: KCommand * setLineSpacingCommand( KoTextCursor * cursor, double spacing, KoParagLayout::SpacingType _type,KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); KCommand * setBordersCommand( KoTextCursor * cursor, const KoBorder& leftBorder, const KoBorder& rightBorder, const KoBorder& topBorder, const KoBorder& bottomBorder, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); KCommand * setJoinBordersCommand( KoTextCursor * cursor, bool join, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); - KCommand * setMarginCommand( KoTextCursor * cursor, QStyleSheetItem::Margin m, double margin, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard); + KCommand * setMarginCommand( KoTextCursor * cursor, TQStyleSheetItem::Margin m, double margin, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard); KCommand* setTabListCommand( KoTextCursor * cursor,const KoTabulatorList & tabList , KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); - KCommand* setBackgroundColorCommand( KoTextCursor * cursor,const QColor & color , KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); + KCommand* setBackgroundColorCommand( KoTextCursor * cursor,const TQColor & color , KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); - KCommand * setParagDirectionCommand( KoTextCursor * cursor, QChar::Direction d, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); + KCommand * setParagDirectionCommand( KoTextCursor * cursor, TQChar::Direction d, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ); /** * Apply a KoParagStyle to a selection. * @param cursor the current cursor; used if there is no selection. Can be 0L if there is one. * @param style the KoParagStyle to apply * @param selectionId the id of the selection, usually Standard or Temp - * @param paragLayoutFlags which settings from the paragraph layout to apply + * @param paragLayoutFlags which settings from the paragraph tqlayout to apply * @param formatFlags which settings from the text format to apply * @param createUndoRedo if true, an undo/redo command will be created and emitted - * @param interactive if true, the text will be reformatted/repainted to show the new style + * @param interactive if true, the text will be reformatted/tqrepainted to show the new style */ void applyStyle( KoTextCursor * cursor, const KoParagStyle * style, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard, @@ -409,14 +410,14 @@ public: int zoomedFontSize( int docFontSize ) const; /** Set the bottom of the view - in LU */ - void setViewArea( QWidget* w, int maxY ); + void setViewArea( TQWidget* w, int maxY ); /** Make sure that @p parag is formatted */ void ensureFormatted( KoTextParag * parag, bool emitAfterFormatting = true ); void setLastFormattedParag( KoTextParag *parag ); - static QChar customItemChar() { return QChar( s_customItemChar ); } + static TQChar customItemChar() { return TQChar( s_customItemChar ); } - // Qt should really have support for public signals + // TQt should really have support for public signals void emitHideCursor() { emit hideCursor(); } void emitShowCursor() { emit showCursor(); } void emitEnsureCursorVisible() { emit ensureCursorVisible(); } @@ -428,7 +429,7 @@ public: /** * Abort the current formatMore() loop, or prevent the next one from starting. * Use with care. This is e.g. for KWFootNoteVariable, so that it can do - * a frame layout before formatting the main text again. + * a frame tqlayout before formatting the main text again. * It is important to make sure that formatMore will be called again ;) */ void abortFormatting(); @@ -440,29 +441,29 @@ public: virtual KCommand *setChangeCaseOfTextCommand(KoChangeCaseDia::TypeOfCase _type); KCommand *changeCaseOfText(KoTextCursor *cursor, KoChangeCaseDia::TypeOfCase _type); - QString textChangedCase(const QString& _text, KoChangeCaseDia::TypeOfCase _type); + TQString textChangedCase(const TQString& _text, KoChangeCaseDia::TypeOfCase _type); KCommand *changeCaseOfTextParag(int cursorPosStart, int cursorPosEnd,KoChangeCaseDia::TypeOfCase _type,KoTextCursor *cursor, KoTextParag *parag); - void loadOasisContent( const QDomElement &bodyElem, KoOasisContext& context, KoStyleCollection * styleColl ); + void loadOasisContent( const TQDomElement &bodyElem, KoOasisContext& context, KoStyleCollection * styleColl ); void saveOasisContent( KoXmlWriter& writer, KoSavingContext& context ) const; // Similar to KoTextDocument::loadOasisText but there's no newline inserted before the first paragraph // or after the last one - so it's possible to paste just a few chars. // It also handles m_lastFormatted - KoTextCursor pasteOasisText( const QDomElement &bodyElem, KoOasisContext& context, + KoTextCursor pasteOasisText( const TQDomElement &bodyElem, KoOasisContext& context, KoTextCursor& cursor, KoStyleCollection * styleColl ); #ifndef NDEBUG void printRTDebug(int); #endif - bool statistics( QProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace, ulong & words, ulong & sentences, ulong & syllables, ulong & lines, bool selected ); + bool statistics( TQProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace, ulong & words, ulong & sentences, ulong & syllables, ulong & lines, bool selected ); int numberOfparagraphLineSelected( KoTextParag *parag); /** * Return the variable at the given point (in document coordinates), if any */ - KoVariable* variableAtPoint( const QPoint& iPoint ) const; + KoVariable* variableAtPoint( const TQPoint& iPoint ) const; /** * Return the variable at the given position, if any. @@ -499,8 +500,8 @@ signals: */ void newCommand( KCommand *cmd ); - /** Tell the world that we'd like some repainting to happen */ - void repaintChanged( KoTextObject * ); + /** Tell the world that we'd like some tqrepainting to happen */ + void tqrepaintChanged( KoTextObject * ); void hideCursor(); void showCursor(); @@ -528,7 +529,7 @@ public slots: // The return value is used by ensureFormatted bool formatMore( int count = 10, bool emitAfterFormatting = true ); - void emitRepaintChanged() { emit repaintChanged( this ); } + void emitRepaintChanged() { emit tqrepaintChanged( this ); } public: // made public for KWTextFrameSet... @@ -549,7 +550,7 @@ public: // made public for KWTextFrameSet... * See also the place-holder command (in fact an empty macro-command is created * right at the beginning, so that it's possible to undo at any time). */ - struct KOTEXT_EXPORT UndoRedoInfo { // borrowed from QTextEdit + struct KOTEXT_EXPORT UndoRedoInfo { // borrowed from TQTextEdit enum Type { Invalid, Insert, Delete, Return, RemoveSelected }; UndoRedoInfo( KoTextObject* textobj ); ~UndoRedoInfo() {} @@ -561,9 +562,9 @@ public: // made public for KWTextFrameSet... int eid; // id of last parag int index; // index (for insertion/deletion) Type type; // type of command - KoTextObject* textobj; // parent + KoTextObject* textobj; // tqparent CustomItemsMap customItemsMap; // character position -> qtextcustomitem - QValueList<KoParagLayout> oldParagLayouts; + TQValueList<KoParagLayout> oldParagLayouts; KoParagLayout newParagLayout; KoTextCursor *cursor; // basically a "mark" of the view that started this undo/redo info // If the view changes, the next call to checkUndoRedoInfo will terminate the previous view's edition @@ -575,7 +576,7 @@ public: // made public for KWTextFrameSet... * build delayed (see the UndoRedoInfo structure), in order to * have an entry in the undo/redo history asap. */ - void newPlaceHolderCommand( const QString & name ); + void newPlaceHolderCommand( const TQString & name ); void checkUndoRedoInfo( KoTextCursor * cursor, UndoRedoInfo::Type t ); /** for KWTextFrameSet */ @@ -617,20 +618,20 @@ private: Any operation on a paragraph pushes this backward. */ KoTextParag *m_lastFormatted; /** Idle-time formatting */ - QTimer *formatTimer, *changeIntervalTimer; + TQTimer *formatTimer, *changeIntervalTimer; int interval; /** The total height available for our text object at the moment */ int m_availableHeight; /** Store the "needs" of each view */ - QMap<QWidget *, int> m_mapViewAreas; + TQMap<TQWidget *, int> m_mapViewAreas; - //QPtrDict<int> m_origFontSizes; // Format -> doc font size. + //TQPtrDict<int> m_origFontSizes; // Format -> doc font size. bool m_highlightSelectionAdded; #ifdef TIMING_FORMAT - QTime m_time; + TQTime m_time; #endif static const char s_customItemChar; |