Fix akonadimodel.cpp:1: warning: unterminated character constant
[kdepim.git] / messageviewer / htmlquotecolorer.h
blobb8a2e170ea61c6f1a1a0e9043f1cfb03373c9f06
1 /* Copyright 2009 Thomas McGuire <mcguire@kde.org>
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public License as
5 published by the Free Software Foundation; either version 2 of
6 the License or (at your option) version 3 or any later version
7 accepted by the membership of KDE e.V. (or its successor approved
8 by the membership of KDE e.V.), which shall act as a proxy
9 defined in Section 14 of version 3 of the license.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef HTMLQUOTECOLORER_H
20 #define HTMLQUOTECOLORER_H
22 #include <QColor>
24 namespace MessageViewer {
26 /**
27 * Little helper class that takes a HTML source as input and finds all
28 * lines that are quoted with '>' or '|'. The HTML text is then modified so
29 * that the quoted lines appear in the defined quote colors.
31 class HTMLQuoteColorer
33 public:
35 HTMLQuoteColorer();
37 /**
38 * Sets the quote color of the specific leve.
39 * This class supports 3 levels, from 0 to 2.
40 * Level 2 is the most quoted, with three quote signs in front of the line, and
41 * level 0 is the least quoted, with one quote sign in front of the line.
43 * If you don't call this, the color of the quoting will be black.
45 void setQuoteColor( int level, const QColor &color );
47 /**
48 * Do the work and add nice colors to the HTML.
49 * @param htmlSource the input HTML code
50 * @return the modified HTML code, without any <body>, <html> or <head> tags
52 QString process( const QString &htmlSource );
54 private:
56 QColor mQuoteColors[3];
61 #endif