Diffstat (limited to 'noncore/net/mail/libmailwrapper/mailtypes.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 1420f79..17c6db9 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -11,26 +11,26 @@ | |||
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> | 15 | #include <qmap.h> |
16 | #include <qvaluelist.h> | 16 | #include <qvaluelist.h> |
17 | 17 | ||
18 | class AbstractMail; | 18 | class AbstractMail; |
19 | /* a class to describe mails in a mailbox */ | 19 | /* a class to describe mails in a mailbox */ |
20 | /* Attention! | 20 | /* Attention! |
21 | From programmers point of view it would make sense to | 21 | From programmers point of view it would make sense to |
22 | store the mail body into this class, too. | 22 | store the mail body into this class, too. |
23 | But: not from the point of view of the device. | 23 | But: not from the point of view of the device. |
24 | Mailbodies can be real large. So we request them when | 24 | Mailbodies can be real large. So we request them when |
25 | needed from the mail-wrapper class direct from the server itself | 25 | needed from the mail-wrapper class direct from the server itself |
26 | (imap) or from a file-based cache (pop3?) | 26 | (imap) or from a file-based cache (pop3?) |
27 | So there is no interface "const QString&body()" but you should | 27 | So there is no interface "const QString&body()" but you should |
28 | make a request to the mailwrapper with this class as parameter to | 28 | make a request to the mailwrapper with this class as parameter to |
29 | get the body. Same words for the attachments. | 29 | get the body. Same words for the attachments. |
30 | */ | 30 | */ |
31 | class RecMail | 31 | class RecMail |
32 | { | 32 | { |
33 | public: | 33 | public: |
34 | RecMail(); | 34 | RecMail(); |
35 | RecMail(const RecMail&old); | 35 | RecMail(const RecMail&old); |
36 | virtual ~RecMail(); | 36 | virtual ~RecMail(); |
@@ -52,142 +52,145 @@ public: | |||
52 | void setMsgsize(int size){msg_size = size;} | 52 | void setMsgsize(int size){msg_size = size;} |
53 | const int Msgsize()const{return msg_size;} | 53 | const int Msgsize()const{return msg_size;} |
54 | 54 | ||
55 | 55 | ||
56 | void setTo(const QStringList&list); | 56 | void setTo(const QStringList&list); |
57 | const QStringList&To()const; | 57 | const QStringList&To()const; |
58 | void setCC(const QStringList&list); | 58 | void setCC(const QStringList&list); |
59 | const QStringList&CC()const; | 59 | const QStringList&CC()const; |
60 | void setBcc(const QStringList&list); | 60 | void setBcc(const QStringList&list); |
61 | const QStringList&Bcc()const; | 61 | const QStringList&Bcc()const; |
62 | void setInreply(const QStringList&list); | 62 | void setInreply(const QStringList&list); |
63 | const QStringList&Inreply()const; | 63 | const QStringList&Inreply()const; |
64 | void setReferences(const QStringList&list); | ||
65 | const QStringList&References()const; | ||
66 | |||
64 | const QBitArray&getFlags()const{return msg_flags;} | 67 | const QBitArray&getFlags()const{return msg_flags;} |
65 | void setFlags(const QBitArray&flags){msg_flags = flags;} | 68 | void setFlags(const QBitArray&flags){msg_flags = flags;} |
66 | 69 | ||
67 | void setWrapper(AbstractMail*wrapper); | 70 | void setWrapper(AbstractMail*wrapper); |
68 | AbstractMail* Wrapper(); | 71 | AbstractMail* Wrapper(); |
69 | 72 | ||
70 | protected: | 73 | protected: |
71 | QString subject,date,from,mbox,msg_id,replyto; | 74 | QString subject,date,from,mbox,msg_id,replyto; |
72 | int msg_number,msg_size; | 75 | int msg_number,msg_size; |
73 | QBitArray msg_flags; | 76 | QBitArray msg_flags; |
74 | QStringList to,cc,bcc,in_reply_to; | 77 | QStringList to,cc,bcc,in_reply_to,references; |
75 | AbstractMail*wrapper; | 78 | AbstractMail*wrapper; |
76 | void init(); | 79 | void init(); |
77 | void copy_old(const RecMail&old); | 80 | void copy_old(const RecMail&old); |
78 | }; | 81 | }; |
79 | 82 | ||
80 | typedef QMap<QString,QString> part_plist_t; | 83 | typedef QMap<QString,QString> part_plist_t; |
81 | 84 | ||
82 | class RecPart | 85 | class RecPart |
83 | { | 86 | { |
84 | protected: | 87 | protected: |
85 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; | 88 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; |
86 | unsigned int m_lines,m_size; | 89 | unsigned int m_lines,m_size; |
87 | part_plist_t m_Parameters; | 90 | part_plist_t m_Parameters; |
88 | /* describes the position in the mail */ | 91 | /* describes the position in the mail */ |
89 | QValueList<int> m_poslist; | 92 | QValueList<int> m_poslist; |
90 | 93 | ||
91 | public: | 94 | public: |
92 | RecPart(); | 95 | RecPart(); |
93 | virtual ~RecPart(); | 96 | virtual ~RecPart(); |
94 | 97 | ||
95 | const QString&Type()const; | 98 | const QString&Type()const; |
96 | void setType(const QString&type); | 99 | void setType(const QString&type); |
97 | const QString&Subtype()const; | 100 | const QString&Subtype()const; |
98 | void setSubtype(const QString&subtype); | 101 | void setSubtype(const QString&subtype); |
99 | const QString&Identifier()const; | 102 | const QString&Identifier()const; |
100 | void setIdentifier(const QString&identifier); | 103 | void setIdentifier(const QString&identifier); |
101 | const QString&Encoding()const; | 104 | const QString&Encoding()const; |
102 | void setEncoding(const QString&encoding); | 105 | void setEncoding(const QString&encoding); |
103 | const QString&Description()const; | 106 | const QString&Description()const; |
104 | void setDescription(const QString&desc); | 107 | void setDescription(const QString&desc); |
105 | void setLines(unsigned int lines); | 108 | void setLines(unsigned int lines); |
106 | const unsigned int Lines()const; | 109 | const unsigned int Lines()const; |
107 | void setSize(unsigned int size); | 110 | void setSize(unsigned int size); |
108 | const unsigned int Size()const; | 111 | const unsigned int Size()const; |
109 | 112 | ||
110 | 113 | ||
111 | void setParameters(const part_plist_t&list); | 114 | void setParameters(const part_plist_t&list); |
112 | const part_plist_t&Parameters()const; | 115 | const part_plist_t&Parameters()const; |
113 | void addParameter(const QString&key,const QString&value); | 116 | void addParameter(const QString&key,const QString&value); |
114 | const QString searchParamter(const QString&key)const; | 117 | const QString searchParamter(const QString&key)const; |
115 | void setPositionlist(const QValueList<int>&poslist); | 118 | void setPositionlist(const QValueList<int>&poslist); |
116 | const QValueList<int>& Positionlist()const; | 119 | const QValueList<int>& Positionlist()const; |
117 | }; | 120 | }; |
118 | 121 | ||
119 | class RecBody | 122 | class RecBody |
120 | { | 123 | { |
121 | protected: | 124 | protected: |
122 | QString m_BodyText; | 125 | QString m_BodyText; |
123 | QValueList<RecPart> m_PartsList; | 126 | QValueList<RecPart> m_PartsList; |
124 | RecPart m_description; | 127 | RecPart m_description; |
125 | 128 | ||
126 | public: | 129 | public: |
127 | RecBody(); | 130 | RecBody(); |
128 | virtual ~RecBody(); | 131 | virtual ~RecBody(); |
129 | void setBodytext(const QString&); | 132 | void setBodytext(const QString&); |
130 | const QString& Bodytext()const; | 133 | const QString& Bodytext()const; |
131 | 134 | ||
132 | void setDescription(const RecPart&des); | 135 | void setDescription(const RecPart&des); |
133 | const RecPart& Description()const; | 136 | const RecPart& Description()const; |
134 | 137 | ||
135 | void setParts(const QValueList<RecPart>&parts); | 138 | void setParts(const QValueList<RecPart>&parts); |
136 | const QValueList<RecPart>& Parts()const; | 139 | const QValueList<RecPart>& Parts()const; |
137 | void addPart(const RecPart&part); | 140 | void addPart(const RecPart&part); |
138 | }; | 141 | }; |
139 | 142 | ||
140 | class encodedString | 143 | class encodedString |
141 | { | 144 | { |
142 | public: | 145 | public: |
143 | encodedString(); | 146 | encodedString(); |
144 | /* | 147 | /* |
145 | creates an new content string. | 148 | creates an new content string. |
146 | it makes a deep copy of it! | 149 | it makes a deep copy of it! |
147 | */ | 150 | */ |
148 | encodedString(const char*nContent,unsigned int length); | 151 | encodedString(const char*nContent,unsigned int length); |
149 | /* | 152 | /* |
150 | Take over the nContent. Means: it will just copy the pointer, not the content. | 153 | Take over the nContent. Means: it will just copy the pointer, not the content. |
151 | so make sure: No one else frees the string, the string has allocated with | 154 | so make sure: No one else frees the string, the string has allocated with |
152 | malloc for compatibility with c-based libs | 155 | malloc for compatibility with c-based libs |
153 | */ | 156 | */ |
154 | encodedString(char*nContent,unsigned int nSize); | 157 | encodedString(char*nContent,unsigned int nSize); |
155 | /* copy construkor - makes ALWAYS a deep copy!!!! */ | 158 | /* copy construkor - makes ALWAYS a deep copy!!!! */ |
156 | encodedString(const encodedString&old); | 159 | encodedString(const encodedString&old); |
157 | /* assign operator - makes ALWAYS a deep copy!!!! */ | 160 | /* assign operator - makes ALWAYS a deep copy!!!! */ |
158 | encodedString& operator=(const encodedString&old); | 161 | encodedString& operator=(const encodedString&old); |
159 | /* destructor - cleans the content */ | 162 | /* destructor - cleans the content */ |
160 | virtual ~encodedString(); | 163 | virtual ~encodedString(); |
161 | 164 | ||
162 | /* returns a pointer to the content - do not delete yoursel! */ | 165 | /* returns a pointer to the content - do not delete yoursel! */ |
163 | const char*Content()const; | 166 | const char*Content()const; |
164 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ | 167 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ |
165 | const int Length()const; | 168 | const int Length()const; |
166 | 169 | ||
167 | /* | 170 | /* |
168 | makes a deep copy of nContent! | 171 | makes a deep copy of nContent! |
169 | */ | 172 | */ |
170 | void setContent(const char*nContent,int nSize); | 173 | void setContent(const char*nContent,int nSize); |
171 | /* | 174 | /* |
172 | Take over the nContent. Means: it will just copy the pointer, not the content. | 175 | Take over the nContent. Means: it will just copy the pointer, not the content. |
173 | so make sure: No one else frees the string, the string has allocated with | 176 | so make sure: No one else frees the string, the string has allocated with |
174 | malloc for compatibility with c-based libs | 177 | malloc for compatibility with c-based libs |
175 | */ | 178 | */ |
176 | void setContent(char*nContent,int nSize); | 179 | void setContent(char*nContent,int nSize); |
177 | 180 | ||
178 | protected: | 181 | protected: |
179 | char * content; | 182 | char * content; |
180 | unsigned int size; | 183 | unsigned int size; |
181 | 184 | ||
182 | void init(); | 185 | void init(); |
183 | void copy_old(const encodedString&old); | 186 | void copy_old(const encodedString&old); |
184 | void clean(); | 187 | void clean(); |
185 | }; | 188 | }; |
186 | 189 | ||
187 | struct folderStat | 190 | struct folderStat |
188 | { | 191 | { |
189 | unsigned int message_count; | 192 | unsigned int message_count; |
190 | unsigned int message_unseen; | 193 | unsigned int message_unseen; |
191 | unsigned int message_recent; | 194 | unsigned int message_recent; |
192 | folderStat&operator=(const folderStat&old); | 195 | folderStat&operator=(const folderStat&old); |
193 | }; | 196 | }; |