32
32
#ifndef _MESSAGEVIEWER_HTMLSTATUSBAR_H_
33
33
#define _MESSAGEVIEWER_HTMLSTATUSBAR_H_
41
namespace MessageViewer {
41
44
* @short The HTML statusbar widget for use with the reader.
43
46
* The HTML status bar is a small widget that acts as an indicator
44
* for the message content. It can be in one of two modes:
47
* for the message content. It can be in one of four modes:
47
50
* <dt><code>Normal</code></dt>
48
51
* <dd>Default. No HTML.</dd>
49
* <dt><code>Neutral</code></dt>
50
* <dd>Temporary value. Used while the real mode is undetermined.</dd>
51
52
* <dt><code>Html</code></dt>
52
53
* <dd>HTML content is being shown. Since HTML mails can mimic all sorts
53
54
* of KMail markup in the reader, this provides out-of-band information
54
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>
57
62
* @author Ingo Kloecker <kloecker@kde.org>, Marc Mutz <mutz@kde.org>
59
64
class HtmlStatusBar : public QLabel {
62
72
explicit HtmlStatusBar( QWidget * parent=0, const char * name=0, Qt::WFlags f=0 );
63
73
virtual ~HtmlStatusBar();
71
75
/** @return current mode. */
72
Mode mode() const { return mMode ; }
73
bool isHtml() const { return mode() == Html ; }
74
bool isNormal() const { return mode() == Normal ; }
75
bool isNeutral() const { return mode() == Neutral ; }
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; }
77
82
// Update the status bar, for example when the color scheme changed.
81
/** Switch to "html mode". */
82
86
void setHtmlMode();
83
87
/** Switch to "normal mode". */
84
88
void setNormalMode();
85
/** Switch to "neutral" mode (currently == normal mode). */
86
void setNeutralMode();
89
/** Switch to "multipart html mode". */
90
void setMultipartHtmlMode();
91
/** Switch to "multipart plain mode". */
92
void setMultipartPlainMode();
87
93
/** Switch to mode @p m */
88
void setMode( Mode m );
94
void setMode( Util::HtmlMode m, UpdateMode mode = Update );
98
/** The user has clicked the status bar. */
103
void mousePressEvent( QMouseEvent * event );
91
106
QString message() const;
107
QString toolTip() const;
92
108
QColor bgColor() const;
93
109
QColor fgColor() const;
111
Util::HtmlMode mMode;
98
116
#endif // _KMAIL_HTMLSTATUSBAR_H_