• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KPIMTextedit Library

  • KPIMTextEdit
  • EMailQuoteHighlighter
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KPIMTextEdit::EMailQuoteHighlighter Class Reference

#include <emailquotehighlighter.h>

Inherits Highlighter.

Public Member Functions

 EMailQuoteHighlighter (TextEdit *textEdit, const QColor &normalColor=Qt::black, const QColor &quoteDepth1=QColor(0x00, 0x80, 0x00), const QColor &quoteDepth2=QColor(0x00, 0x80, 0x00), const QColor &quoteDepth3=QColor(0x00, 0x80, 0x00), const QColor &misspelledColor=Qt::red)
 
virtual void highlightBlock (const QString &text)
 
void setQuoteColor (const QColor &normalColor, const QColor &quoteDepth1, const QColor &quoteDepth2, const QColor &quoteDepth3, const QColor &misspelledColor=Qt::red)
 
void toggleSpellHighlighting (bool on)
 

Static Public Member Functions

static QString highlightParagraph (const QString &text, const QColor &quoteDepth1=QColor(0x00, 0x80, 0x00), const QColor &quoteDepth2=QColor(0x00, 0x80, 0x00), const QColor &quoteDepth3=QColor(0x00, 0x80, 0x00))
 
static QString highlightText (const QString &text, const QColor &quoteDepth1=QColor(0x00, 0x80, 0x00), const QColor &quoteDepth2=QColor(0x00, 0x80, 0x00), const QColor &quoteDepth3=QColor(0x00, 0x80, 0x00))
 

Protected Member Functions

virtual void setMisspelled (int start, int count)
 
virtual void unsetMisspelled (int start, int count)
 

Detailed Description

This highlighter highlights spelling mistakes and also highlightes quotes.

Spelling mistakes inside quotes will not be highlighted. The quote highlighting color is configurable.

Spell highlighting is disabled by default but can be toggled.

Since
4.3

Definition at line 44 of file emailquotehighlighter.h.

Constructor & Destructor Documentation

KPIMTextEdit::EMailQuoteHighlighter::EMailQuoteHighlighter ( TextEdit *  textEdit,
const QColor &  normalColor = Qt::black,
const QColor &  quoteDepth1 = QColor( 0x00, 0x80, 0x00 ),
const QColor &  quoteDepth2 = QColor( 0x00, 0x80, 0x00 ),
const QColor &  quoteDepth3 = QColor( 0x00, 0x80, 0x00 ),
const QColor &  misspelledColor = Qt::red 
)
explicit

Constructor.

See setQuoteColor() for the parameters. FIXME: Default colors don't obey color scheme

Definition at line 35 of file emailquotehighlighter.cpp.

Member Function Documentation

void KPIMTextEdit::EMailQuoteHighlighter::highlightBlock ( const QString &  text)
virtual

Reimplemented to highlight quote blocks.

Definition at line 127 of file emailquotehighlighter.cpp.

QString KPIMTextEdit::EMailQuoteHighlighter::highlightParagraph ( const QString &  text,
const QColor &  quoteDepth1 = QColor( 0x00, 0x80, 0x00 ),
const QColor &  quoteDepth2 = QColor( 0x00, 0x80, 0x00 ),
const QColor &  quoteDepth3 = QColor( 0x00, 0x80, 0x00 ) 
)
static

Use this static method to get proper highlighting for a single line.

Since
4.4

Definition at line 80 of file emailquotehighlighter.cpp.

QString KPIMTextEdit::EMailQuoteHighlighter::highlightText ( const QString &  text,
const QColor &  quoteDepth1 = QColor( 0x00, 0x80, 0x00 ),
const QColor &  quoteDepth2 = QColor( 0x00, 0x80, 0x00 ),
const QColor &  quoteDepth3 = QColor( 0x00, 0x80, 0x00 ) 
)
static

Use this static method to get a text consisting of multiple lines highligted.

Since
4.4

Definition at line 63 of file emailquotehighlighter.cpp.

void KPIMTextEdit::EMailQuoteHighlighter::setMisspelled ( int  start,
int  count 
)
protectedvirtual

Reimplemented to set the color of the misspelled word to a color defined by setQuoteColor().

Definition at line 159 of file emailquotehighlighter.cpp.

void KPIMTextEdit::EMailQuoteHighlighter::setQuoteColor ( const QColor &  normalColor,
const QColor &  quoteDepth1,
const QColor &  quoteDepth2,
const QColor &  quoteDepth3,
const QColor &  misspelledColor = Qt::red 
)

Sets the colors used for highlighting quoted text and spelling mistakes.

Parameters
quoteDepth1color for text quoted 1 level deep
quoteDepth2color for text quoted 2 level deep
quoteDepth3color for text quoted 3 level deep
misspelledColorcolor in which misspelled words will be underlined
normalColorwill be ignored, only provided for KNode compatibility.

Definition at line 106 of file emailquotehighlighter.cpp.

void KPIMTextEdit::EMailQuoteHighlighter::toggleSpellHighlighting ( bool  on)

Turns spellcheck highlighting on or off.

Parameters
onif true, spelling mistakes will be highlighted

Definition at line 119 of file emailquotehighlighter.cpp.

void KPIMTextEdit::EMailQuoteHighlighter::unsetMisspelled ( int  start,
int  count 
)
protectedvirtual

Reimplemented, the base version sets the text color to black, which is not what we want.

We do nothing, the format is already reset by Qt.

Parameters
startthe beginning of text
countthe amount of characters to set

Definition at line 153 of file emailquotehighlighter.cpp.


The documentation for this class was generated from the following files:
  • emailquotehighlighter.h
  • emailquotehighlighter.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KPIMTextedit Library

Skip menu "KPIMTextedit Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal