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