fix errors found while translating
[kdepim.git] / kmail / htmlstatusbar.h
blob0986bcd8aa0cdff1aff1dcc38030501fd1aa5d22
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 _KMAIL_HTMLSTATUSBAR_H_
33 #define _KMAIL_HTMLSTATUSBAR_H_
35 #include <QLabel>
37 class QString;
38 class QColor;
40 namespace KMail {
42 /**
43 * @short The HTML statusbar widget for use with the reader.
45 * The HTML status bar is a small widget that acts as an indicator
46 * for the message content. It can be in one of two modes:
48 * <dl>
49 * <dt><code>Normal</code></dt>
50 * <dd>Default. No HTML.</dd>
51 * <dt><code>Neutral</code></dt>
52 * <dd>Temporary value. Used while the real mode is undetermined.</dd>
53 * <dt><code>Html</code></dt>
54 * <dd>HTML content is being shown. Since HTML mails can mimic all sorts
55 * of KMail markup in the reader, this provides out-of-band information
56 * about the presence of (rendered) HTML.</dd>
57 * </dl>
59 * @author Ingo Kloecker <kloecker@kde.org>, Marc Mutz <mutz@kde.org>
60 **/
61 class HtmlStatusBar : public QLabel {
62 Q_OBJECT
63 public:
64 explicit HtmlStatusBar( QWidget * parent=0, const char * name=0, Qt::WFlags f=0 );
65 virtual ~HtmlStatusBar();
67 enum Mode {
68 Normal,
69 Html,
70 Neutral
73 /** @return current mode. */
74 Mode mode() const { return mMode ; }
75 bool isHtml() const { return mode() == Html ; }
76 bool isNormal() const { return mode() == Normal ; }
77 bool isNeutral() const { return mode() == Neutral ; }
79 // Update the status bar, for example when the color scheme changed.
80 void update();
82 public slots:
83 /** Switch to "html mode". */
84 void setHtmlMode();
85 /** Switch to "normal mode". */
86 void setNormalMode();
87 /** Switch to "neutral" mode (currently == normal mode). */
88 void setNeutralMode();
89 /** Switch to mode @p m */
90 void setMode( Mode m );
92 private:
93 QString message() const;
94 QColor bgColor() const;
95 QColor fgColor() const;
97 Mode mMode;
100 } // namespace KMail
102 #endif // _KMAIL_HTMLSTATUSBAR_H_