Diffstat (limited to 'kmicromail/libmailwrapper/mailtypes.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/mailtypes.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h index 32d92c0..39c0bac 100644 --- a/kmicromail/libmailwrapper/mailtypes.h +++ b/kmicromail/libmailwrapper/mailtypes.h | |||
@@ -1,153 +1,154 @@ | |||
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> | 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 | 18 | ||
19 | class AbstractMail; | 19 | class AbstractMail; |
20 | /* a class to describe mails in a mailbox */ | 20 | /* a class to describe mails in a mailbox */ |
21 | /* Attention! | 21 | /* Attention! |
22 | From programmers point of view it would make sense to | 22 | From programmers point of view it would make sense to |
23 | store the mail body into this class, too. | 23 | store the mail body into this class, too. |
24 | But: not from the point of view of the device. | 24 | But: not from the point of view of the device. |
25 | Mailbodies can be real large. So we request them when | 25 | Mailbodies can be real large. So we request them when |
26 | needed from the mail-wrapper class direct from the server itself | 26 | needed from the mail-wrapper class direct from the server itself |
27 | (imap) or from a file-based cache (pop3?) | 27 | (imap) or from a file-based cache (pop3?) |
28 | So there is no interface "const QString&body()" but you should | 28 | So there is no interface "const QString&body()" but you should |
29 | 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 |
30 | get the body. Same words for the attachments. | 30 | get the body. Same words for the attachments. |
31 | */ | 31 | */ |
32 | class RecMail:public Opie::Core::ORefCount | 32 | class RecMail:public Opie::Core::ORefCount |
33 | { | 33 | { |
34 | public: | 34 | public: |
35 | RecMail(); | 35 | RecMail(); |
36 | RecMail(const RecMail&old); | 36 | RecMail(const RecMail&old); |
37 | virtual ~RecMail(); | 37 | virtual ~RecMail(); |
38 | bool isEqual( RecMail* r1 ); | 38 | bool isEqual( RecMail* r1 ); |
39 | 39 | ||
40 | const unsigned int getNumber()const{return msg_number;} | 40 | const unsigned int getNumber()const{return msg_number;} |
41 | void setNumber(unsigned int number){msg_number=number;} | 41 | void setNumber(unsigned int number){msg_number=number;} |
42 | const QString&getDate()const{ return date; } | 42 | const QString&getDate()const{ return date; } |
43 | void setDate( const QString&a ) { date = a; } | 43 | void setDate( const QString&a ) { date = a; } |
44 | const QString&getIsoDate()const{ return isodate; } | 44 | const QString&getIsoDate()const{ return isodate; } |
45 | void setIsoDate( const QString&a ) { isodate = a; } | 45 | void setIsoDate( const QString&a ) { isodate = a; } |
46 | const QString&getFrom()const{ return from; } | 46 | const QString&getFrom()const{ return from; } |
47 | void setFrom( const QString&a ) { from = a; } | 47 | void setFrom( const QString&a ) { from = a; } |
48 | const QString&getSubject()const { return subject; } | 48 | const QString&getSubject()const { return subject; } |
49 | void setSubject( const QString&s ) { subject = s; } | 49 | void setSubject( const QString&s ) { subject = s; } |
50 | const QString&getMbox()const{return mbox;} | 50 | const QString&getMbox()const{return mbox;} |
51 | void setMbox(const QString&box){mbox = box;} | 51 | void setMbox(const QString&box){mbox = box;} |
52 | void setMsgid(const QString&id){msg_id=id;} | 52 | void setMsgid(const QString&id){msg_id=id;} |
53 | const QString&Msgid()const{return msg_id;} | 53 | const QString&Msgid()const{return msg_id;} |
54 | void setReplyto(const QString&reply){replyto=reply;} | 54 | void setReplyto(const QString&reply){replyto=reply;} |
55 | const QString&Replyto()const{return replyto;} | 55 | const QString&Replyto()const{return replyto;} |
56 | void setMsgsize(unsigned int size){msg_size = size;} | 56 | void setMsgsize(unsigned int size){msg_size = size;} |
57 | const unsigned int Msgsize()const{return msg_size;} | 57 | const unsigned int Msgsize()const{return msg_size;} |
58 | const QString MsgsizeString()const; | ||
58 | 59 | ||
59 | 60 | ||
60 | void setTo(const QStringList&list); | 61 | void setTo(const QStringList&list); |
61 | const QStringList&To()const; | 62 | const QStringList&To()const; |
62 | void setCC(const QStringList&list); | 63 | void setCC(const QStringList&list); |
63 | const QStringList&CC()const; | 64 | const QStringList&CC()const; |
64 | void setBcc(const QStringList&list); | 65 | void setBcc(const QStringList&list); |
65 | const QStringList&Bcc()const; | 66 | const QStringList&Bcc()const; |
66 | void setInreply(const QStringList&list); | 67 | void setInreply(const QStringList&list); |
67 | const QStringList&Inreply()const; | 68 | const QStringList&Inreply()const; |
68 | void setReferences(const QStringList&list); | 69 | void setReferences(const QStringList&list); |
69 | const QStringList&References()const; | 70 | const QStringList&References()const; |
70 | 71 | ||
71 | const QBitArray&getFlags()const{return msg_flags;} | 72 | const QBitArray&getFlags()const{return msg_flags;} |
72 | void setFlags(const QBitArray&flags){msg_flags = flags;} | 73 | void setFlags(const QBitArray&flags){msg_flags = flags;} |
73 | 74 | ||
74 | void setWrapper(AbstractMail*wrapper); | 75 | void setWrapper(AbstractMail*wrapper); |
75 | AbstractMail* Wrapper(); | 76 | AbstractMail* Wrapper(); |
76 | // public for debugging | 77 | // public for debugging |
77 | QString subject,date,isodate,from,mbox,msg_id,replyto; | 78 | QString subject,date,isodate,from,mbox,msg_id,replyto; |
78 | 79 | ||
79 | protected: | 80 | protected: |
80 | //QString subject,date,isodate,from,mbox,msg_id,replyto; | 81 | //QString subject,date,isodate,from,mbox,msg_id,replyto; |
81 | unsigned int msg_number,msg_size; | 82 | unsigned int msg_number,msg_size; |
82 | QBitArray msg_flags; | 83 | QBitArray msg_flags; |
83 | QStringList to,cc,bcc,in_reply_to,references; | 84 | QStringList to,cc,bcc,in_reply_to,references; |
84 | AbstractMail*wrapper; | 85 | AbstractMail*wrapper; |
85 | void init(); | 86 | void init(); |
86 | void copy_old(const RecMail&old); | 87 | void copy_old(const RecMail&old); |
87 | }; | 88 | }; |
88 | 89 | ||
89 | typedef Opie::Core::OSmartPointer<RecMail> RecMailP; | 90 | typedef Opie::Core::OSmartPointer<RecMail> RecMailP; |
90 | typedef QMap<QString,QString> part_plist_t; | 91 | typedef QMap<QString,QString> part_plist_t; |
91 | 92 | ||
92 | class RecPart:public Opie::Core::ORefCount | 93 | class RecPart:public Opie::Core::ORefCount |
93 | { | 94 | { |
94 | protected: | 95 | protected: |
95 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; | 96 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; |
96 | unsigned int m_lines,m_size; | 97 | unsigned int m_lines,m_size; |
97 | part_plist_t m_Parameters; | 98 | part_plist_t m_Parameters; |
98 | /* describes the position in the mail */ | 99 | /* describes the position in the mail */ |
99 | QValueList<int> m_poslist; | 100 | QValueList<int> m_poslist; |
100 | 101 | ||
101 | public: | 102 | public: |
102 | RecPart(); | 103 | RecPart(); |
103 | RecPart(const RecPart&); | 104 | RecPart(const RecPart&); |
104 | virtual ~RecPart(); | 105 | virtual ~RecPart(); |
105 | 106 | ||
106 | const QString&Type()const; | 107 | const QString&Type()const; |
107 | void setType(const QString&type); | 108 | void setType(const QString&type); |
108 | const QString&Subtype()const; | 109 | const QString&Subtype()const; |
109 | void setSubtype(const QString&subtype); | 110 | void setSubtype(const QString&subtype); |
110 | const QString&Identifier()const; | 111 | const QString&Identifier()const; |
111 | void setIdentifier(const QString&identifier); | 112 | void setIdentifier(const QString&identifier); |
112 | const QString&Encoding()const; | 113 | const QString&Encoding()const; |
113 | void setEncoding(const QString&encoding); | 114 | void setEncoding(const QString&encoding); |
114 | const QString&Description()const; | 115 | const QString&Description()const; |
115 | void setDescription(const QString&desc); | 116 | void setDescription(const QString&desc); |
116 | void setLines(unsigned int lines); | 117 | void setLines(unsigned int lines); |
117 | const unsigned int Lines()const; | 118 | const unsigned int Lines()const; |
118 | void setSize(unsigned int size); | 119 | void setSize(unsigned int size); |
119 | const unsigned int Size()const; | 120 | const unsigned int Size()const; |
120 | 121 | ||
121 | 122 | ||
122 | void setParameters(const part_plist_t&list); | 123 | void setParameters(const part_plist_t&list); |
123 | const part_plist_t&Parameters()const; | 124 | const part_plist_t&Parameters()const; |
124 | void addParameter(const QString&key,const QString&value); | 125 | void addParameter(const QString&key,const QString&value); |
125 | const QString searchParamter(const QString&key)const; | 126 | const QString searchParamter(const QString&key)const; |
126 | void setPositionlist(const QValueList<int>&poslist); | 127 | void setPositionlist(const QValueList<int>&poslist); |
127 | const QValueList<int>& Positionlist()const; | 128 | const QValueList<int>& Positionlist()const; |
128 | }; | 129 | }; |
129 | 130 | ||
130 | typedef Opie::Core::OSmartPointer<RecPart> RecPartP; | 131 | typedef Opie::Core::OSmartPointer<RecPart> RecPartP; |
131 | 132 | ||
132 | class RecBody:public Opie::Core::ORefCount | 133 | class RecBody:public Opie::Core::ORefCount |
133 | { | 134 | { |
134 | protected: | 135 | protected: |
135 | QString m_BodyText; | 136 | QString m_BodyText; |
136 | QString mCharset; | 137 | QString mCharset; |
137 | QValueList<RecPartP> m_PartsList; | 138 | QValueList<RecPartP> m_PartsList; |
138 | RecPartP m_description; | 139 | RecPartP m_description; |
139 | 140 | ||
140 | public: | 141 | public: |
141 | RecBody(); | 142 | RecBody(); |
142 | RecBody(const RecBody&old); | 143 | RecBody(const RecBody&old); |
143 | virtual ~RecBody(); | 144 | virtual ~RecBody(); |
144 | void setBodytext(const QString&); | 145 | void setBodytext(const QString&); |
145 | const QString& Bodytext()const; | 146 | const QString& Bodytext()const; |
146 | void setCharset(const QString&); | 147 | void setCharset(const QString&); |
147 | QString getCharset()const; | 148 | QString getCharset()const; |
148 | 149 | ||
149 | void setDescription(const RecPartP&des); | 150 | void setDescription(const RecPartP&des); |
150 | const RecPartP& Description()const; | 151 | const RecPartP& Description()const; |
151 | 152 | ||
152 | void setParts(const QValueList<RecPartP>&parts); | 153 | void setParts(const QValueList<RecPartP>&parts); |
153 | const QValueList<RecPartP>& Parts()const; | 154 | const QValueList<RecPartP>& Parts()const; |