summaryrefslogtreecommitdiff
path: root/noncore/net/mail/mailtypes.h
Unidiff
Diffstat (limited to 'noncore/net/mail/mailtypes.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mailtypes.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/noncore/net/mail/mailtypes.h b/noncore/net/mail/mailtypes.h
new file mode 100644
index 0000000..bb6a483
--- a/dev/null
+++ b/noncore/net/mail/mailtypes.h
@@ -0,0 +1,98 @@
1#ifndef __MAIL_TYPES_H
2#define __MAIL_TYPES_H
3
4#define FLAG_ANSWERED 0
5#define FLAG_FLAGGED 1
6#define FLAG_DELETED 2
7#define FLAG_SEEN 3
8#define FLAG_DRAFT 4
9#define FLAG_RECENT 5
10
11#include <qlist.h>
12#include <qbitarray.h>
13#include <qstring.h>
14#include <qstringlist.h>
15
16/* a class to describe mails in a mailbox */
17/* Attention!
18 From programmers point of view it would make sense to
19 store the mail body into this class, too.
20 But: not from the point of view of the device.
21 Mailbodies can be real large. So we request them when
22 needed from the mail-wrapper class direct from the server itself
23 (imap) or from a file-based cache (pop3?)
24 So there is no interface "const QString&body()" but you should
25 make a request to the mailwrapper with this class as parameter to
26 get the body. Same words for the attachments.
27*/
28class RecMail
29{
30public:
31 RecMail();
32 virtual ~RecMail(){}
33
34 const int getNumber()const{return msg_number;}
35 void setNumber(int number){msg_number=number;}
36 const QString&getDate()const{ return date; }
37 void setDate( const QString&a ) { date = a; }
38 const QString&getFrom()const{ return from; }
39 void setFrom( const QString&a ) { from = a; }
40 const QString&getSubject()const { return subject; }
41 void setSubject( const QString&s ) { subject = s; }
42 const QString&getMbox()const{return mbox;}
43 void setMbox(const QString&box){mbox = box;}
44
45 void setTo(const QStringList&list);
46 const QStringList&To()const;
47 void setCC(const QStringList&list);
48 const QStringList&CC()const;
49 void setBcc(const QStringList&list);
50 const QStringList&Bcc()const;
51
52 const QBitArray&getFlags()const{return msg_flags;}
53 void setFlags(const QBitArray&flags){msg_flags = flags;}
54
55protected:
56 QString subject,date,from,mbox;
57 int msg_number;
58 QBitArray msg_flags;
59 QStringList to,cc,bcc;
60};
61
62class RecPart
63{
64protected:
65 QString m_type,m_subtype,m_identifier,m_encoding;
66public:
67 RecPart();
68 RecPart(const QString&identifier,const QString&type="",const QString&subtype="",const QString&encoding="BASE64");
69 virtual ~RecPart();
70
71 const QString&Type()const;
72 void setType(const QString&type);
73 const QString&Subtype()const;
74 void setSubtype(const QString&subtype);
75 const QString&Identifier()const;
76 void setIdentifier(const QString&identifier);
77 const QString&Encoding()const;
78 void setEncoding(const QString&encoding);
79};
80
81class RecBody
82{
83protected:
84 QString m_BodyText;
85 QList<RecPart> m_PartsList;
86
87public:
88 RecBody();
89 virtual ~RecBody();
90 void setBodytext(const QString&);
91 const QString& Bodytext()const;
92
93 void setParts(const QList<RecPart>&parts);
94 const QList<RecPart>& Parts()const;
95 void addPart(const RecPart&part);
96};
97
98#endif