diff options
Diffstat (limited to 'framework/domain/csshelper.cpp')
-rw-r--r-- | framework/domain/csshelper.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/framework/domain/csshelper.cpp b/framework/domain/csshelper.cpp new file mode 100644 index 00000000..a6355c57 --- /dev/null +++ b/framework/domain/csshelper.cpp | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | csshelper.cpp | ||
3 | |||
4 | This file is part of KMail, the KDE mail client. | ||
5 | Copyright (c) 2003 Marc Mutz <mutz@kde.org> | ||
6 | |||
7 | KMail is free software; you can redistribute it and/or modify it | ||
8 | under the terms of the GNU General Public License, version 2, as | ||
9 | published by the Free Software Foundation. | ||
10 | |||
11 | KMail is distributed in the hope that it will be useful, but | ||
12 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program; if not, write to the Free Software | ||
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | |||
20 | In addition, as a special exception, the copyright holders give | ||
21 | permission to link the code of this program with any edition of | ||
22 | the Qt library by Trolltech AS, Norway (or with modified versions | ||
23 | of Qt that use the same license as Qt), and distribute linked | ||
24 | combinations including the two. You must obey the GNU General | ||
25 | Public License in all respects for all of the code used other than | ||
26 | Qt. If you modify this file, you may extend this exception to | ||
27 | your version of the file, but you are not obligated to do so. If | ||
28 | you do not wish to do so, delete this exception statement from | ||
29 | your version. | ||
30 | */ | ||
31 | |||
32 | #include "csshelper.h" | ||
33 | |||
34 | #include <QColor> | ||
35 | #include <QDebug> | ||
36 | #include <QFile> | ||
37 | #include <QFont> | ||
38 | #include <QFont> | ||
39 | #include <QPalette> | ||
40 | |||
41 | CSSHelper::CSSHelper(const QPaintDevice *pd) : | ||
42 | MessageViewer::CSSHelperBase(pd) | ||
43 | { | ||
44 | |||
45 | } | ||
46 | |||
47 | QString cssDefinitions() | ||
48 | { | ||
49 | QFile file(QLatin1String(MAIL_DATA_DIR) + QLatin1Char('/') + "mail.css"); | ||
50 | if (file.open(QFile::ReadOnly)) { | ||
51 | return file.readAll(); | ||
52 | } | ||
53 | return QString(); | ||
54 | } | ||
55 | |||
56 | QString CSSHelper::htmlHead(bool fixed) const | ||
57 | { | ||
58 | return | ||
59 | QLatin1String("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" | ||
60 | "<html><head><title></title><style>\n") | ||
61 | + ::cssDefinitions() + | ||
62 | QLatin1String("</style></head>\n" | ||
63 | "<body>\n"); | ||
64 | } \ No newline at end of file | ||