diff options
Diffstat (limited to 'examples/maildirresource/libmaildir/maildir.h')
-rw-r--r-- | examples/maildirresource/libmaildir/maildir.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/examples/maildirresource/libmaildir/maildir.h b/examples/maildirresource/libmaildir/maildir.h index a89a832..6c68656 100644 --- a/examples/maildirresource/libmaildir/maildir.h +++ b/examples/maildirresource/libmaildir/maildir.h | |||
@@ -167,13 +167,14 @@ public: | |||
167 | */ | 167 | */ |
168 | QByteArray readEntry( const QString& key ) const; | 168 | QByteArray readEntry( const QString& key ) const; |
169 | 169 | ||
170 | enum MailFlags { | 170 | enum Flag { |
171 | Forwarded, | 171 | Forwarded = 0x1, |
172 | Replied, | 172 | Replied = 0x2, |
173 | Seen, | 173 | Seen = 0x4, |
174 | Flagged | 174 | Flagged = 0x8, |
175 | Deleted = 0x10 | ||
175 | }; | 176 | }; |
176 | Q_DECLARE_FLAGS(Flags, MailFlags); | 177 | Q_DECLARE_FLAGS(Flags, Flag); |
177 | 178 | ||
178 | /** | 179 | /** |
179 | * Return the flags encoded in the maildir file name for an entry | 180 | * Return the flags encoded in the maildir file name for an entry |
@@ -184,7 +185,7 @@ public: | |||
184 | * Return the contents of the headers section of the file the maildir with the given @p file, that | 185 | * Return the contents of the headers section of the file the maildir with the given @p file, that |
185 | * is a full path to the file. You can get it by using findRealKey(key) . | 186 | * is a full path to the file. You can get it by using findRealKey(key) . |
186 | */ | 187 | */ |
187 | QByteArray readEntryHeadersFromFile( const QString& file ) const; | 188 | static QByteArray readEntryHeadersFromFile( const QString& file ); |
188 | 189 | ||
189 | /** | 190 | /** |
190 | * Return the contents of the headers section of the file the maildir with the given @p key. | 191 | * Return the contents of the headers section of the file the maildir with the given @p key. |
@@ -211,7 +212,7 @@ public: | |||
211 | * Change the flags for an entry specified by @p key. Returns the new key of the entry (the key might change because | 212 | * Change the flags for an entry specified by @p key. Returns the new key of the entry (the key might change because |
212 | * flags are stored in the unique filename). | 213 | * flags are stored in the unique filename). |
213 | */ | 214 | */ |
214 | // QString changeEntryFlags( const QString& key, const Sink::Item::Flags& flags ); | 215 | QString changeEntryFlags( const QString& key, const Flags& flags ); |
215 | 216 | ||
216 | /** | 217 | /** |
217 | * Moves this maildir into @p destination. | 218 | * Moves this maildir into @p destination. |
@@ -261,6 +262,19 @@ public: | |||
261 | querying the last error string. */ | 262 | querying the last error string. */ |
262 | QString lastError() const; | 263 | QString lastError() const; |
263 | 264 | ||
265 | /** | ||
266 | * Returns the key from the file identified by the full path @param file. | ||
267 | */ | ||
268 | static QString getKeyFromFile( const QString& file ); | ||
269 | |||
270 | /** | ||
271 | * Returns the directory from a file. | ||
272 | * | ||
273 | * Strips key and new/cur/tmp. | ||
274 | * The returned path is ended with a trailing slash. | ||
275 | */ | ||
276 | static QString getDirectoryFromFile( const QString& file ); | ||
277 | |||
264 | private: | 278 | private: |
265 | void swap( const Maildir& ); | 279 | void swap( const Maildir& ); |
266 | class Private; | 280 | class Private; |