KDEUI
ktextedit.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KTEXTEDIT_H
00021 #define KTEXTEDIT_H
00022
00023 #include <kdeui_export.h>
00024 #include <sonnet/highlighter.h>
00025 #include <QtGui/QTextEdit>
00026
00044 class KDEUI_EXPORT KTextEdit : public QTextEdit
00045 {
00046 Q_OBJECT
00047
00048 public:
00053 explicit KTextEdit( const QString& text, QWidget *parent = 0 );
00054
00059 explicit KTextEdit( QWidget *parent = 0 );
00060
00064 ~KTextEdit();
00065
00069 virtual void setReadOnly( bool readOnly );
00070
00082 void setCheckSpellingEnabled( bool check );
00083
00092 bool checkSpellingEnabled() const;
00093
00102 void highlightWord( int length, int pos );
00103
00117 void setSpellCheckingConfigFileName(const QString &fileName);
00118
00123 void setSpellCheckingLanguage(const QString &language);
00124
00139 virtual void createHighlighter();
00140
00149 Sonnet::Highlighter* highlighter() const;
00150
00164 void setHighlighter(Sonnet::Highlighter *_highLighter);
00165
00170 QMenu *mousePopupMenu();
00171
00176 void enableFindReplace( bool enabled);
00177
00178
00179 Q_SIGNALS:
00185 void checkSpellingChanged( bool );
00186
00191 void spellCheckStatus(const QString &);
00192
00200 void languageChanged(const QString &language);
00201
00202 public Q_SLOTS:
00207 void checkSpelling();
00208
00213 void replace();
00214
00215 protected Q_SLOTS:
00219 void slotDoReplace();
00220 void slotReplaceNext();
00221 void slotDoFind();
00222 void slotFind();
00223 void slotFindNext();
00224 void slotReplace();
00225
00226
00227 protected:
00231 virtual bool event(QEvent*);
00232
00236 virtual void keyPressEvent( QKeyEvent* );
00237
00242 virtual void focusInEvent( QFocusEvent* );
00243
00248 virtual void wheelEvent( QWheelEvent* );
00249
00254 virtual void deleteWordBack();
00255
00260 virtual void deleteWordForward();
00261
00266 virtual void contextMenuEvent( QContextMenuEvent* );
00267
00268 private:
00269 class Private;
00270 Private *const d;
00271
00272 Q_PRIVATE_SLOT( d, void slotSpellCheckDone( const QString& ) )
00273
00274 Q_PRIVATE_SLOT( d, void spellCheckerMisspelling( const QString&, int ) )
00275 Q_PRIVATE_SLOT( d, void spellCheckerCorrected(const QString&, int,const QString&) )
00276 Q_PRIVATE_SLOT( d, void spellCheckerCanceled())
00277 Q_PRIVATE_SLOT( d, void spellCheckerAutoCorrect(const QString&,const QString&) )
00278 Q_PRIVATE_SLOT( d, void spellCheckerFinished() )
00279 Q_PRIVATE_SLOT( d, void toggleAutoSpellCheck() )
00280 Q_PRIVATE_SLOT( d, void slotAllowTab() )
00281 Q_PRIVATE_SLOT( d, void menuActivated( QAction* ) )
00282 Q_PRIVATE_SLOT( d, void slotFindHighlight(const QString&, int, int))
00283 Q_PRIVATE_SLOT( d, void slotReplaceText(const QString &, int, int, int))
00284 };
00285
00286 #endif // KTEXTEDIT_H