typo fix spotted by Freek de Kruijf
[kdepim.git] / messageviewer / htmlstatusbar.h
blob89dd5c2563f1993e67e876ee85f4d044697de754
1 /* -*- c++ -*-
2 htmlstatusbar.h
4 This file is part of KMail, the KDE mail client.
5 Copyright (c) 2002 Ingo Kloecker <kloecker@kde.org>
6 Copyright (c) 2003 Marc Mutz <mutz@kde.org>
8 KMail is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License, version 2, as
10 published by the Free Software Foundation.
12 KMail is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 In addition, as a special exception, the copyright holders give
22 permission to link the code of this program with any edition of
23 the Qt library by Trolltech AS, Norway (or with modified versions
24 of Qt that use the same license as Qt), and distribute linked
25 combinations including the two. You must obey the GNU General
26 Public License in all respects for all of the code used other than
27 Qt. If you modify this file, you may extend this exception to
28 your version of the file, but you are not obligated to do so. If
29 you do not wish to do so, delete this exception statement from
30 your version.
32 #ifndef _MESSAGEVIEWER_HTMLSTATUSBAR_H_
33 #define _MESSAGEVIEWER_HTMLSTATUSBAR_H_
35 #include "util.h"
36 #include <QLabel>
37 class QString;
38 class QColor;
39 class QMouseEvent;
41 namespace MessageViewer {
43 /**
44 * @short The HTML statusbar widget for use with the reader.
46 * The HTML status bar is a small widget that acts as an indicator
47 * for the message content. It can be in one of four modes:
49 * <dl>
50 * <dt><code>Normal</code></dt>
51 * <dd>Default. No HTML.</dd>
52 * <dt><code>Html</code></dt>
53 * <dd>HTML content is being shown. Since HTML mails can mimic all sorts
54 * of KMail markup in the reader, this provides out-of-band information
55 * about the presence of (rendered) HTML.</dd>
56 * <dt><code>MultipartPlain</code></dt>
57 * <dd>Viewed as plain text with HTML part also available.</dd>
58 * <dt><code>MultipartHtml</code></dt>
59 * <dd>Viewed as Html with plain text part also available.</dd>
60 * </dl>
62 * @author Ingo Kloecker <kloecker@kde.org>, Marc Mutz <mutz@kde.org>
63 **/
64 class HtmlStatusBar : public QLabel {
65 Q_OBJECT
66 public:
67 enum UpdateMode {
68 NoUpdate,
69 Update
72 explicit HtmlStatusBar( QWidget * parent=0, const char * name=0, Qt::WFlags f=0 );
73 virtual ~HtmlStatusBar();
75 /** @return current mode. */
76 Util::HtmlMode mode() const { return mMode ; }
77 bool isHtml() const { return mode() == Util::Html; }
78 bool isNormal() const { return mode() == Util::Normal; }
79 bool isMultipartHtml() const { return mode() == Util::MultipartHtml; }
80 bool isMultipartPlain() const { return mode() == Util::MultipartPlain; }
82 // Update the status bar, for example when the color scheme changed.
83 void update();
85 public slots:
86 void setHtmlMode();
87 /** Switch to "normal mode". */
88 void setNormalMode();
89 /** Switch to "multipart html mode". */
90 void setMultipartHtmlMode();
91 /** Switch to "multipart plain mode". */
92 void setMultipartPlainMode();
93 /** Switch to mode @p m */
94 void setMode( Util::HtmlMode m, UpdateMode mode = Update );
96 signals:
98 /** The user has clicked the status bar. */
99 void clicked();
101 protected:
103 void mousePressEvent( QMouseEvent * event );
105 private:
106 QString message() const;
107 QString toolTip() const;
108 QColor bgColor() const;
109 QColor fgColor() const;
111 Util::HtmlMode mMode;
116 #endif // _KMAIL_HTMLSTATUSBAR_H_