split message into several paras and fix file extension markup
[kdepim.git] / knode / kndisplayedheader.h
blobadcaef7383c5c2a486e1550bd530fd0353c77e83
1 /*
2 KNode, the KDE newsreader
3 Copyright (c) 1999-2005 the KNode authors.
4 See file AUTHORS for details
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software Foundation,
12 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15 #ifndef KNDISPLAYEDHEADER_H
16 #define KNDISPLAYEDHEADER_H
18 #include <QBitArray>
19 #include <QStringList>
22 /** A header displayed in the article viewer. */
23 class KNDisplayedHeader {
25 public:
26 KNDisplayedHeader();
27 ~KNDisplayedHeader();
29 //some common headers
30 static QStringList predefs();
32 //name
33 const QString& name() { return n_ame; }
34 void setName(const QString &s) { n_ame = s; }
35 bool hasName() const { return !n_ame.isEmpty(); }
37 //translated name
38 QString translatedName(); // *tries* to translate the name
39 void setTranslatedName(const QString &s); // *tries* to retranslate the name to english
40 void setTranslateName(bool b) { t_ranslateName=b; }
41 bool translateName() const { return t_ranslateName; }
43 //header
44 const QString& header() { return h_eader; }
45 void setHeader(const QString &s) { h_eader = s; }
47 //flags
48 bool flag(int i) { return f_lags.at(i); }
49 void setFlag(int i, bool b) { f_lags.setBit(i, b); }
51 //HTML-tags
52 void createTags();
53 const QString& nameOpenTag() { return t_ags[0]; }
54 const QString& nameCloseTag() { return t_ags[1]; }
55 const QString& headerOpenTag() { return t_ags[2]; }
56 const QString& headerCloseTag() { return t_ags[3]; }
58 typedef QList<KNDisplayedHeader*> List;
60 protected:
61 bool t_ranslateName;
62 QString n_ame, h_eader, t_ags[4];
63 QBitArray f_lags;
67 #endif