• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

highlighter.h

Go to the documentation of this file.
00001 
00021 #ifndef SONNET_HIGHLIGHTER_H
00022 #define SONNET_HIGHLIGHTER_H
00023 
00024 #include <QtGui/QSyntaxHighlighter>
00025 #include <QtCore/QStringList>
00026 #include <kdemacros.h>
00027 #include <kdeui_export.h>
00028 
00029 class QTextEdit;
00030 
00032 namespace Sonnet
00033 {
00035     class KDEUI_EXPORT Highlighter : public QSyntaxHighlighter
00036     {
00037         Q_OBJECT
00038     public:
00039         explicit Highlighter(QTextEdit *textEdit,
00040                              const QString &configFile = QString(),
00041                              const QColor &col=QColor());
00042         ~Highlighter();
00043 
00044         bool spellCheckerFound() const;
00045 
00046         QString currentLanguage() const;
00047         void setCurrentLanguage(const QString &lang);
00048 
00049         static QStringList personalWords();
00050 
00064         void setActive(bool active);
00065 
00073         bool isActive() const;
00074 
00075         bool automatic() const;
00076 
00077         void setAutomatic(bool automatic);
00078 
00086         void addWordToDictionary(const QString &word);
00087 
00096         void ignoreWord(const QString &word);
00097 
00109         QStringList suggestionsForWord(const QString &word, int max = 10 );
00110 
00118         bool isWordMisspelled(const QString &word);
00119 
00120     Q_SIGNALS:
00121 
00128         void activeChanged(const QString &description);
00129 
00138         QT_MOC_COMPAT void newSuggestions(const QString &originalWord, const QStringList &suggestions);
00139 
00140     protected:
00141 
00142         virtual void highlightBlock(const QString &text);
00143         virtual void setMisspelled(int start, int count);
00144         virtual void unsetMisspelled(int start,  int count);
00145 
00146         bool eventFilter(QObject *o, QEvent *e);
00147         bool intraWordEditing() const;
00148         void setIntraWordEditing(bool editing);
00149 
00150     public Q_SLOTS:
00151         void slotAutoDetection();
00152         void slotRehighlight();
00153     private:
00154         virtual void connectNotify(const char* signal);
00155         virtual void disconnectNotify(const char* signal);
00156         class Private;
00157         Private *const d;
00158         Q_DISABLE_COPY( Highlighter )
00159     };
00160 
00161 }
00162 
00163 #endif

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal