summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/mailtypes.h
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mailtypes.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h
index 900f10a..60db527 100644
--- a/noncore/net/mail/libmailwrapper/mailtypes.h
+++ b/noncore/net/mail/libmailwrapper/mailtypes.h
@@ -3,24 +3,26 @@
3 3
4#define FLAG_ANSWERED 0 4#define FLAG_ANSWERED 0
5#define FLAG_FLAGGED 1 5#define FLAG_FLAGGED 1
6#define FLAG_DELETED 2 6#define FLAG_DELETED 2
7#define FLAG_SEEN 3 7#define FLAG_SEEN 3
8#define FLAG_DRAFT 4 8#define FLAG_DRAFT 4
9#define FLAG_RECENT 5 9#define FLAG_RECENT 5
10 10
11#include <qlist.h> 11#include <qlist.h>
12#include <qbitarray.h> 12#include <qbitarray.h>
13#include <qstring.h> 13#include <qstring.h>
14#include <qstringlist.h> 14#include <qstringlist.h>
15#include <qmap.h>
16#include <qvaluelist.h>
15 17
16/* a class to describe mails in a mailbox */ 18/* a class to describe mails in a mailbox */
17/* Attention! 19/* Attention!
18 From programmers point of view it would make sense to 20 From programmers point of view it would make sense to
19 store the mail body into this class, too. 21 store the mail body into this class, too.
20 But: not from the point of view of the device. 22 But: not from the point of view of the device.
21 Mailbodies can be real large. So we request them when 23 Mailbodies can be real large. So we request them when
22 needed from the mail-wrapper class direct from the server itself 24 needed from the mail-wrapper class direct from the server itself
23 (imap) or from a file-based cache (pop3?) 25 (imap) or from a file-based cache (pop3?)
24 So there is no interface "const QString&body()" but you should 26 So there is no interface "const QString&body()" but you should
25 make a request to the mailwrapper with this class as parameter to 27 make a request to the mailwrapper with this class as parameter to
26 get the body. Same words for the attachments. 28 get the body. Same words for the attachments.
@@ -59,57 +61,68 @@ public:
59 const QBitArray&getFlags()const{return msg_flags;} 61 const QBitArray&getFlags()const{return msg_flags;}
60 void setFlags(const QBitArray&flags){msg_flags = flags;} 62 void setFlags(const QBitArray&flags){msg_flags = flags;}
61 63
62protected: 64protected:
63 QString subject,date,from,mbox,msg_id,replyto; 65 QString subject,date,from,mbox,msg_id,replyto;
64 int msg_number,msg_size; 66 int msg_number,msg_size;
65 QBitArray msg_flags; 67 QBitArray msg_flags;
66 QStringList to,cc,bcc; 68 QStringList to,cc,bcc;
67 void init(); 69 void init();
68 void copy_old(const RecMail&old); 70 void copy_old(const RecMail&old);
69}; 71};
70 72
73typedef QMap<QString,QString> part_plist_t;
74
71class RecPart 75class RecPart
72{ 76{
73protected: 77protected:
74 QString m_type,m_subtype,m_identifier,m_encoding; 78 QString m_type,m_subtype,m_identifier,m_encoding;
75 unsigned int m_lines; 79 unsigned int m_lines;
80 part_plist_t m_Parameters;
81 /* describes the position in the mail */
82 QValueList<int> m_poslist;
83
76public: 84public:
77 RecPart(); 85 RecPart();
78 RecPart(const QString&identifier,const QString&type="",const QString&subtype="",const QString&encoding="BASE64",unsigned int lines=0);
79 virtual ~RecPart(); 86 virtual ~RecPart();
80 87
81 const QString&Type()const; 88 const QString&Type()const;
82 void setType(const QString&type); 89 void setType(const QString&type);
83 const QString&Subtype()const; 90 const QString&Subtype()const;
84 void setSubtype(const QString&subtype); 91 void setSubtype(const QString&subtype);
85 const QString&Identifier()const; 92 const QString&Identifier()const;
86 void setIdentifier(const QString&identifier); 93 void setIdentifier(const QString&identifier);
87 const QString&Encoding()const; 94 const QString&Encoding()const;
88 void setEncoding(const QString&encoding); 95 void setEncoding(const QString&encoding);
89 void setLines(unsigned int lines); 96 void setLines(unsigned int lines);
90 const unsigned int Lines()const; 97 const unsigned int Lines()const;
98
99 void setParameters(const part_plist_t&list);
100 const part_plist_t&Parameters()const;
101 void addParameter(const QString&key,const QString&value);
102 const QString searchParamter(const QString&key)const;
103 void setPositionlist(const QValueList<int>&poslist);
104 const QValueList<int>& Positionlist()const;
91}; 105};
92 106
93class RecBody 107class RecBody
94{ 108{
95protected: 109protected:
96 QString m_BodyText,m_type,m_subtype; 110 QString m_BodyText;
97 QList<RecPart> m_PartsList; 111 QList<RecPart> m_PartsList;
112 RecPart m_description;
98 113
99public: 114public:
100 RecBody(); 115 RecBody();
101 virtual ~RecBody(); 116 virtual ~RecBody();
102 void setBodytext(const QString&); 117 void setBodytext(const QString&);
103 const QString& Bodytext()const; 118 const QString& Bodytext()const;
104 void setType(const QString&);
105 const QString&Type()const;
106 void setSubtype(const QString&);
107 const QString&Subtype()const;
108 119
120 void setDescription(const RecPart&des);
121 const RecPart& Description()const;
109 122
110 void setParts(const QList<RecPart>&parts); 123 void setParts(const QList<RecPart>&parts);
111 const QList<RecPart>& Parts()const; 124 const QList<RecPart>& Parts()const;
112 void addPart(const RecPart&part); 125 void addPart(const RecPart&part);
113}; 126};
114 127
115#endif 128#endif