summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/mailtypes.h
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mailtypes.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h
index 10d367f..dc10de6 100644
--- a/noncore/net/mail/libmailwrapper/mailtypes.h
+++ b/noncore/net/mail/libmailwrapper/mailtypes.h
@@ -1,93 +1,96 @@
1#ifndef __MAIL_TYPES_H 1#ifndef __MAIL_TYPES_H
2#define __MAIL_TYPES_H 2#define __MAIL_TYPES_H
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 <opie2/osmartpointer.h>
12
11#include <qbitarray.h> 13#include <qbitarray.h>
12#include <qstring.h> 14#include <qstring.h>
13#include <qstringlist.h> 15#include <qstringlist.h>
14#include <qmap.h> 16#include <qmap.h>
15#include <qvaluelist.h> 17#include <qvaluelist.h>
16 18
17class AbstractMail; 19class AbstractMail;
18/* a class to describe mails in a mailbox */ 20/* a class to describe mails in a mailbox */
19/* Attention! 21/* Attention!
20 From programmers point of view it would make sense to 22 From programmers point of view it would make sense to
21 store the mail body into this class, too. 23 store the mail body into this class, too.
22 But: not from the point of view of the device. 24 But: not from the point of view of the device.
23 Mailbodies can be real large. So we request them when 25 Mailbodies can be real large. So we request them when
24 needed from the mail-wrapper class direct from the server itself 26 needed from the mail-wrapper class direct from the server itself
25 (imap) or from a file-based cache (pop3?) 27 (imap) or from a file-based cache (pop3?)
26 So there is no interface "const QString&body()" but you should 28 So there is no interface "const QString&body()" but you should
27 make a request to the mailwrapper with this class as parameter to 29 make a request to the mailwrapper with this class as parameter to
28 get the body. Same words for the attachments. 30 get the body. Same words for the attachments.
29*/ 31*/
30class RecMail 32class RecMail:public Opie::ORefCount
31{ 33{
32public: 34public:
33 RecMail(); 35 RecMail();
34 RecMail(const RecMail&old); 36 RecMail(const RecMail&old);
35 virtual ~RecMail(); 37 virtual ~RecMail();
36 38
37 const int getNumber()const{return msg_number;} 39 const unsigned int getNumber()const{return msg_number;}
38 void setNumber(int number){msg_number=number;} 40 void setNumber(unsigned int number){msg_number=number;}
39 const QString&getDate()const{ return date; } 41 const QString&getDate()const{ return date; }
40 void setDate( const QString&a ) { date = a; } 42 void setDate( const QString&a ) { date = a; }
41 const QString&getFrom()const{ return from; } 43 const QString&getFrom()const{ return from; }
42 void setFrom( const QString&a ) { from = a; } 44 void setFrom( const QString&a ) { from = a; }
43 const QString&getSubject()const { return subject; } 45 const QString&getSubject()const { return subject; }
44 void setSubject( const QString&s ) { subject = s; } 46 void setSubject( const QString&s ) { subject = s; }
45 const QString&getMbox()const{return mbox;} 47 const QString&getMbox()const{return mbox;}
46 void setMbox(const QString&box){mbox = box;} 48 void setMbox(const QString&box){mbox = box;}
47 void setMsgid(const QString&id){msg_id=id;} 49 void setMsgid(const QString&id){msg_id=id;}
48 const QString&Msgid()const{return msg_id;} 50 const QString&Msgid()const{return msg_id;}
49 void setReplyto(const QString&reply){replyto=reply;} 51 void setReplyto(const QString&reply){replyto=reply;}
50 const QString&Replyto()const{return replyto;} 52 const QString&Replyto()const{return replyto;}
51 void setMsgsize(int size){msg_size = size;} 53 void setMsgsize(unsigned int size){msg_size = size;}
52 const int Msgsize()const{return msg_size;} 54 const unsigned int Msgsize()const{return msg_size;}
53 55
54 56
55 void setTo(const QStringList&list); 57 void setTo(const QStringList&list);
56 const QStringList&To()const; 58 const QStringList&To()const;
57 void setCC(const QStringList&list); 59 void setCC(const QStringList&list);
58 const QStringList&CC()const; 60 const QStringList&CC()const;
59 void setBcc(const QStringList&list); 61 void setBcc(const QStringList&list);
60 const QStringList&Bcc()const; 62 const QStringList&Bcc()const;
61 void setInreply(const QStringList&list); 63 void setInreply(const QStringList&list);
62 const QStringList&Inreply()const; 64 const QStringList&Inreply()const;
63 void setReferences(const QStringList&list); 65 void setReferences(const QStringList&list);
64 const QStringList&References()const; 66 const QStringList&References()const;
65 67
66 const QBitArray&getFlags()const{return msg_flags;} 68 const QBitArray&getFlags()const{return msg_flags;}
67 void setFlags(const QBitArray&flags){msg_flags = flags;} 69 void setFlags(const QBitArray&flags){msg_flags = flags;}
68 70
69 void setWrapper(AbstractMail*wrapper); 71 void setWrapper(AbstractMail*wrapper);
70 AbstractMail* Wrapper(); 72 AbstractMail* Wrapper();
71 73
72protected: 74protected:
73 QString subject,date,from,mbox,msg_id,replyto; 75 QString subject,date,from,mbox,msg_id,replyto;
74 int msg_number,msg_size; 76 unsigned int msg_number,msg_size;
75 QBitArray msg_flags; 77 QBitArray msg_flags;
76 QStringList to,cc,bcc,in_reply_to,references; 78 QStringList to,cc,bcc,in_reply_to,references;
77 AbstractMail*wrapper; 79 AbstractMail*wrapper;
78 void init(); 80 void init();
79 void copy_old(const RecMail&old); 81 void copy_old(const RecMail&old);
80}; 82};
81 83
84typedef Opie::OSmartPointer<RecMail> RecMailP;
82typedef QMap<QString,QString> part_plist_t; 85typedef QMap<QString,QString> part_plist_t;
83 86
84class RecPart 87class RecPart
85{ 88{
86protected: 89protected:
87 QString m_type,m_subtype,m_identifier,m_encoding,m_description; 90 QString m_type,m_subtype,m_identifier,m_encoding,m_description;
88 unsigned int m_lines,m_size; 91 unsigned int m_lines,m_size;
89 part_plist_t m_Parameters; 92 part_plist_t m_Parameters;
90 /* describes the position in the mail */ 93 /* describes the position in the mail */
91 QValueList<int> m_poslist; 94 QValueList<int> m_poslist;
92 95
93public: 96public: