diff options
Diffstat (limited to 'lib/kotext/KoAutoFormat.h')
-rw-r--r-- | lib/kotext/KoAutoFormat.h | 129 |
1 files changed, 65 insertions, 64 deletions
diff --git a/lib/kotext/KoAutoFormat.h b/lib/kotext/KoAutoFormat.h index 3e2283dd..4f59fbaa 100644 --- a/lib/kotext/KoAutoFormat.h +++ b/lib/kotext/KoAutoFormat.h @@ -21,15 +21,15 @@ #ifndef koautoformat_h #define koautoformat_h -#include <qstring.h> -#include <qmap.h> -#include <qvaluelist.h> -#include <qstringlist.h> -#include <qptrvector.h> -#include <qdom.h> -#include <qdict.h> -#include <qlabel.h> -#include <qwidget.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> +#include <tqptrvector.h> +#include <tqdom.h> +#include <tqdict.h> +#include <tqlabel.h> +#include <tqwidget.h> #include <koffice_export.h> class KoDocument; @@ -46,20 +46,21 @@ class KoTextFormat; -class KoCompletionBox : public QLabel +class KoCompletionBox : public TQLabel { Q_OBJECT + TQ_OBJECT public: - KoCompletionBox( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + KoCompletionBox( TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0 ); ~KoCompletionBox(); - QString& lastWord(); - void setLastWord(QString const &); + TQString& lastWord(); + void setLastWord(TQString const &); protected: - void mousePressEvent( QMouseEvent * ); + void mousePressEvent( TQMouseEvent * ); private: - QString m_lastWord; + TQString m_lastWord; }; @@ -71,11 +72,11 @@ class KoAutoFormatEntry { public: // The text to find is actually the key in KWAutoFormat's map. - // What we replace it with is replace(). - KoAutoFormatEntry(const QString& replace = QString::null); + // What we replace it with is tqreplace(). + KoAutoFormatEntry(const TQString& tqreplace = TQString()); ~KoAutoFormatEntry(); - QString replace() const { return m_replace; } - void changeReplace(const QString & rep){ m_replace = rep; } + TQString tqreplace() const { return m_tqreplace; } + void changeReplace(const TQString & rep){ m_tqreplace = rep; } KoSearchContext *formatEntryContext()const; void createNewEntryContext(); @@ -83,12 +84,12 @@ public: void clearFormatEntryContext( ); protected: - QString m_replace; + TQString m_tqreplace; // For formatting in the replacement - not implemented yet KoSearchContext *m_formatOptions; }; -typedef QMap< QString, KoAutoFormatEntry > KoAutoFormatEntryMap; +typedef TQMap< TQString, KoAutoFormatEntry > KoAutoFormatEntryMap; /******************************************************************/ /* Class: KoAutoFormat */ @@ -114,7 +115,7 @@ public: * Called by edit widget when a character (@p ch) has been inserted * into @p parag, at the given @p index. */ - void doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, QChar ch,KoTextObject *txtObj ); + void doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, TQChar ch,KoTextObject *txtObj ); /** * Called by edit widget when a call a competion @@ -122,29 +123,29 @@ public: bool doCompletion( KoTextCursor* textEditCursor, KoTextParag *parag, int const index,KoTextObject *txtObj ); bool doToolTipCompletion( KoTextCursor* textEditCursor, KoTextParag *parag, int index,KoTextObject *txtObj,int keyPress ); - void showToolTipBox(KoTextParag *parag, int index, QWidget *widget, const QPoint &pos); + void showToolTipBox(KoTextParag *parag, int index, TQWidget *widget, const TQPoint &pos); void removeToolTipCompletion(); - bool doIgnoreDoubleSpace( KoTextParag *parag, int index,QChar ch ); + bool doIgnoreDoubleSpace( KoTextParag *parag, int index,TQChar ch ); /** * Helper method, returns the last word before parag,index */ - static QString getLastWord( KoTextParag *parag, int const index ); - QString getLastWord( const int max_words, KoTextParag *parag, int const index ); + static TQString getLastWord( KoTextParag *parag, int const index ); + TQString getLastWord( const int max_words, KoTextParag *parag, int const index ); /** * Helper method, returns the last word before parag,index * different from getLastWord, because we test just space character * and not punctualtion character */ - static QString getWordAfterSpace( KoTextParag * parag, int const index); + static TQString getWordAfterSpace( KoTextParag * parag, int const index); // Config for the typographic quotes. Used by the dialog. struct TypographicQuotes { - QChar begin, end; - bool replace; // aka enabled + TQChar begin, end; + bool tqreplace; // aka enabled }; // Configuration (on/off/settings). Called by the dialog. @@ -159,7 +160,7 @@ public: void configRemoveSpaceBeginEndLine( bool _space); void configUseBulletStyle( bool _ubs); - void configBulletStyle( QChar b ); + void configBulletStyle( TQChar b ); void configAutoChangeFormat( bool b); @@ -189,7 +190,7 @@ public: void configCapitalizeNameOfDays( bool b); - void configAutoFormatLanguage( const QString &_lang); + void configAutoFormatLanguage( const TQString &_lang); void configKeyCompletionAction( KeyCompletionAction action ); @@ -223,7 +224,7 @@ public: bool getConfigUseBulletSyle() const { return m_useBulletStyle;} - QChar getConfigBulletStyle() const + TQChar getConfigBulletStyle() const { return m_bulletStyle; } bool getConfigAutoChangeFormat() const @@ -268,30 +269,30 @@ public: bool getConfigCapitalizeNameOfDays() const { return m_bCapitalizeNameOfDays; } - QString getConfigAutoFormatLanguage( )const + TQString getConfigAutoFormatLanguage( )const { return m_autoFormatLanguage;} KeyCompletionAction getConfigKeyAction() const { return m_keyCompletionAction;} - const QDict<KoAutoFormatEntry> & getAutoFormatEntries() const{ + const TQDict<KoAutoFormatEntry> & getAutoFormatEntries() const{ return m_entries; } - KoAutoFormatEntry * findFormatEntry(const QString & text) { + KoAutoFormatEntry * findFormatEntry(const TQString & text) { return m_entries[text]; } // Add/remove entries, called by the dialog - void addAutoFormatEntry( const QString &key, KoAutoFormatEntry *entry ) { + void addAutoFormatEntry( const TQString &key, KoAutoFormatEntry *entry ) { m_entries.insert( key, entry ); buildMaxLen(); } - void addAutoFormatEntry( const QString &key, const QString &replace ); + void addAutoFormatEntry( const TQString &key, const TQString &tqreplace ); - void removeAutoFormatEntry( const QString &key ) { + void removeAutoFormatEntry( const TQString &key ) { m_entries.setAutoDelete(true); m_entries.remove( key ); m_entries.setAutoDelete(false); @@ -302,17 +303,17 @@ public: void copyAutoFormatEntries( const KoAutoFormat & other ) { m_entries = other.m_entries; } - void copyListException( const QStringList & _list) + void copyListException( const TQStringList & _list) { m_upperCaseExceptions=_list;} - void copyListTwoUpperCaseException( const QStringList &_list) + void copyListTwoUpperCaseException( const TQStringList &_list) { m_twoUpperLetterException=_list; } - QStringList listException() const {return m_upperCaseExceptions;} + TQStringList listException() const {return m_upperCaseExceptions;} - QStringList listTwoUpperLetterException() const {return m_twoUpperLetterException;} + TQStringList listTwoUpperLetterException() const {return m_twoUpperLetterException;} - QStringList listCompletion() const; + TQStringList listCompletion() const; KCompletion *getCompletion() const { return m_listCompletion; } @@ -323,52 +324,52 @@ public: void readConfig(bool force = false); void saveConfig(); - static bool isUpper( const QChar &c ); - static bool isLower( const QChar &c ); - static bool isMark( const QChar &c ); // End of sentence - static bool isSeparator( const QChar &c ); + static bool isUpper( const TQChar &c ); + static bool isLower( const TQChar &c ); + static bool isMark( const TQChar &c ); // End of sentence + static bool isSeparator( const TQChar &c ); void updateMaxWords(); protected: //return a ref to index otherwise when we uperCase, index is bad ! KCommand *doAutoCorrect( KoTextCursor* textEditCursor, KoTextParag *parag, int & index, KoTextObject *txtObj ); - KCommand *doUpperCase( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const QString & word , KoTextObject *txtObj ); + KCommand *doUpperCase( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const TQString & word , KoTextObject *txtObj ); KCommand * doTypographicQuotes( KoTextCursor* textEditCursor, KoTextParag *parag, int index, KoTextObject *txtObj, bool doubleQuotes ); void buildMaxLen(); - void doAutoDetectUrl( KoTextCursor *textEditCursor, KoTextParag *parag, int & index, QString & word, KoTextObject *txtObj ); + void doAutoDetectUrl( KoTextCursor *textEditCursor, KoTextParag *parag, int & index, TQString & word, KoTextObject *txtObj ); KCommand *doRemoveSpaceBeginEndLine( KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj, int& index ); - KCommand *doAutoChangeFormat( KoTextCursor *textEditCursor, KoTextParag *parag, int index, const QString & word, KoTextObject *txtObj ); + KCommand *doAutoChangeFormat( KoTextCursor *textEditCursor, KoTextParag *parag, int index, const TQString & word, KoTextObject *txtObj ); KCommand *doUseBulletStyle(KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj, int& index ); - KCommand *doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTextParag *parag, int & index, const QString & word , KoTextObject *txtObj ); + KCommand *doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTextParag *parag, int & index, const TQString & word , KoTextObject *txtObj ); KCommand *doUseNumberStyle(KoTextCursor * /*textEditCursor*/, KoTextParag *parag, KoTextObject *txtObj, int& index ); void doAutoIncludeUpperUpper(KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj ); void doAutoIncludeAbbreviation(KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj ); - KCommand *doAutoSuperScript( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const QString & word , KoTextObject *txtObj ); + KCommand *doAutoSuperScript( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const TQString & word , KoTextObject *txtObj ); - KCommand *doCapitalizeNameOfDays( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const QString & word , KoTextObject *txtObj ); + KCommand *doCapitalizeNameOfDays( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const TQString & word , KoTextObject *txtObj ); static void changeTextFormat(KoSearchContext *formatOptions, KoTextFormat * format, int & flags ); - void loadEntry( const QDomElement &nl, bool _allLanguages = false); - QDomElement saveEntry( QDictIterator<KoAutoFormatEntry> _entry, QDomDocument doc); + void loadEntry( const TQDomElement &nl, bool _allLanguages = false); + TQDomElement saveEntry( TQDictIterator<KoAutoFormatEntry> _entry, TQDomDocument doc); private: void detectStartOfLink(KoTextParag * parag, int const index, bool const insertedDot); void autoFormatIsActive(); void loadListOfWordCompletion(); - void loadAutoCorrection( const QDomElement & _de, bool _allLanguages = false ); + void loadAutoCorrection( const TQDomElement & _de, bool _allLanguages = false ); void loadAllLanguagesAutoCorrection(); - KCommand *autoFormatWord( KoTextCursor* textEditCursor, KoTextParag *parag, int &index, KoTextObject *txtObj, QString * _wordArray, bool _allLanguages ); + KCommand *autoFormatWord( KoTextCursor* textEditCursor, KoTextParag *parag, int &index, KoTextObject *txtObj, TQString * _wordArray, bool _allLanguages ); void readAutoCorrectConfig(); KoDocument *m_doc; KoVariableCollection *m_varCollection; KoVariableFormatCollection *m_varFormatCollection; - QString m_autoFormatLanguage; + TQString m_autoFormatLanguage; bool m_configRead; bool m_convertUpperCase, m_convertUpperUpper,m_advancedAutoCorrect; bool m_autoDetectUrl, m_ignoreDoubleSpace, m_removeSpaceBeginEndLine; @@ -388,7 +389,7 @@ private: bool m_bCapitalizeNameOfDays; /// Indicates if doAutoFormat has called itself bool m_wordInserted; - QChar m_bulletStyle; + TQChar m_bulletStyle; TypographicQuotes m_typographicSimpleQuotes; @@ -400,19 +401,19 @@ private: KCompletion *m_listCompletion; - QDict<KoAutoFormatEntry> m_entries; - QDict<KoAutoFormatEntry> m_allLanguages; + TQDict<KoAutoFormatEntry> m_entries; + TQDict<KoAutoFormatEntry> m_allLanguages; KoAutoFormatEntryMap m_superScriptEntries; - QStringList m_upperCaseExceptions; - QStringList m_twoUpperLetterException; + TQStringList m_upperCaseExceptions; + TQStringList m_twoUpperLetterException; uint m_maxFindLength; uint m_minCompletionWordLength; uint m_nbMaxCompletionWord; uint m_countMaxWords; - QStringList m_cacheNameOfDays; + TQStringList m_cacheNameOfDays; KoCompletionBox *m_completionBox; KeyCompletionAction m_keyCompletionAction; }; |