~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to messageviewer/htmlstatusbar.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#ifndef _MESSAGEVIEWER_HTMLSTATUSBAR_H_
33
33
#define _MESSAGEVIEWER_HTMLSTATUSBAR_H_
34
34
 
 
35
#include "util.h"
35
36
#include <QLabel>
36
37
class QString;
37
38
class QColor;
 
39
class QMouseEvent;
38
40
 
 
41
namespace MessageViewer {
39
42
 
40
43
/**
41
44
  * @short The HTML statusbar widget for use with the reader.
42
45
  *
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:
45
48
  *
46
49
  * <dl>
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>
55
60
  * </dl>
56
61
  *
57
62
  * @author Ingo Kloecker <kloecker@kde.org>, Marc Mutz <mutz@kde.org>
59
64
class HtmlStatusBar : public QLabel {
60
65
  Q_OBJECT
61
66
public:
 
67
  enum UpdateMode {
 
68
    NoUpdate,
 
69
    Update
 
70
  };
 
71
 
62
72
  explicit HtmlStatusBar( QWidget * parent=0, const char * name=0, Qt::WFlags f=0 );
63
73
  virtual ~HtmlStatusBar();
64
74
 
65
 
  enum Mode {
66
 
    Normal,
67
 
    Html,
68
 
    Neutral
69
 
  };
70
 
 
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; }
76
81
 
77
82
  // Update the status bar, for example when the color scheme changed.
78
83
  void update();
79
84
 
80
85
public slots:
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 );
 
95
 
 
96
signals:
 
97
 
 
98
  /** The user has clicked the status bar. */
 
99
  void clicked();
 
100
 
 
101
protected:
 
102
 
 
103
  void mousePressEvent( QMouseEvent * event );
89
104
 
90
105
private:
91
106
  QString message() const;
 
107
  QString toolTip() const;
92
108
  QColor bgColor() const;
93
109
  QColor fgColor() const;
94
110
 
95
 
  Mode mMode;
 
111
  Util::HtmlMode mMode;
96
112
};
97
113
 
 
114
}
 
115
 
98
116
#endif // _KMAIL_HTMLSTATUSBAR_H_