KPIMTextedit Library
emailquotehighlighter.h
00001
00020 #ifndef KPIMTEXTEDIT_EMAILQUOTEHIGHLIGHTER_H
00021 #define KPIMTEXTEDIT_EMAILQUOTEHIGHLIGHTER_H
00022
00023 #include "kpimtextedit_export.h"
00024
00025 #include <sonnet/highlighter.h>
00026
00027 #include <memory>
00028
00029 namespace KPIMTextEdit
00030 {
00031 class TextEdit;
00032
00044 class KPIMTEXTEDIT_EXPORT EMailQuoteHighlighter : public Sonnet::Highlighter
00045 {
00046 public:
00047
00052 explicit EMailQuoteHighlighter( TextEdit *textEdit,
00053 const QColor &normalColor = Qt::black,
00054 const QColor "eDepth1 = QColor( 0x00, 0x80, 0x00 ),
00055 const QColor "eDepth2 = QColor( 0x00, 0x80, 0x00 ),
00056 const QColor "eDepth3 = QColor( 0x00, 0x80, 0x00 ),
00057 const QColor &misspelledColor = Qt::red );
00058
00059 ~EMailQuoteHighlighter();
00060
00071 void setQuoteColor( const QColor &normalColor,
00072 const QColor "eDepth1,
00073 const QColor "eDepth2,
00074 const QColor "eDepth3,
00075 const QColor &misspelledColor = Qt::red );
00076
00082 void toggleSpellHighlighting( bool on );
00083
00087 virtual void highlightBlock ( const QString & text );
00088
00089 protected:
00090
00096 virtual void unsetMisspelled( int start, int count );
00097
00102 virtual void setMisspelled( int start, int count );
00103
00104 private:
00105 class EMailQuoteHighlighterPrivate;
00106 std::auto_ptr<EMailQuoteHighlighterPrivate> d;
00107 };
00108 }
00109
00110 #endif