| 1 | /* |
| 2 | ** CWPOP3Folder.h |
| 3 | ** |
| 4 | ** Copyright (c) 2001-2006 Ludovic Marcotte |
| 5 | ** |
| 6 | ** Author: Ludovic Marcotte <[email protected]> |
| 7 | ** |
| 8 | ** This library is free software; you can redistribute it and/or |
| 9 | ** modify it under the terms of the GNU Lesser General Public |
| 10 | ** License as published by the Free Software Foundation; either |
| 11 | ** version 2.1 of the License, or (at your option) any later version. |
| 12 | ** |
| 13 | ** This library is distributed in the hope that it will be useful, |
| 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | ** Lesser General Public License for more details. |
| 17 | ** |
| 18 | ** You should have received a copy of the GNU General Public License |
| 19 | ** along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | */ |
| 21 | |
| 22 | #ifndef _Pantomime_H_CWPOP3Folder |
| 23 | #define _Pantomime_H_CWPOP3Folder |
| 24 | |
| 25 | #import <Pantomime/CWFolder.h> |
| 26 | |
| 27 | #import <Foundation/NSDictionary.h> |
| 28 | #import <Foundation/NSString.h> |
| 29 | |
| 30 | /*! |
| 31 | @class CWPOP3Folder |
| 32 | @discussion This class, which extends the Folder class, is used to |
| 33 | implement POP3-specific features. |
| 34 | */ |
| 35 | @interface CWPOP3Folder : CWFolder |
| 36 | { |
| 37 | BOOL _leave_on_server; |
| 38 | unsigned int _retain_period; |
| 39 | } |
| 40 | |
| 41 | /*! |
| 42 | @method prefetchMessageAtIndex: numberOfLines: |
| 43 | @discussion This method is used to fetch a certain amount of lines of |
| 44 | the message, at the specified index. On completion, this method posts |
| 45 | the PantomimeMessagePrefetchCompleted (and calls -messagePrefetchCompleted: |
| 46 | on the delegate, if any). This method is fully asynchronous. Since |
| 47 | this method can be used to partially fetch the message, it is the |
| 48 | responsability of the caller to verify if the message's data |
| 49 | is fully loaded. One can verify the lenght of the message's data |
| 50 | and compare it to the message's size. |
| 51 | @param theIndex The index of the message, which is 1-based in POP3. |
| 52 | @param theNumberOfLines The number of lines to fetch. Specifying 0 |
| 53 | will only fetch the headers. |
| 54 | */ |
| 55 | - (void) prefetchMessageAtIndex: (NSUInteger) theIndex |
| 56 | numberOfLines: (NSUInteger) theNumberOfLines; |
| 57 | |
| 58 | /*! |
| 59 | @method prefetch |
| 60 | @discussion This method is used to cache a certain amount of information from |
| 61 | the POP3 server, for all messages. It caches the number of messages, |
| 62 | their size and UID. On completion, it posts a PantomimeFolderPrefetchCompleted |
| 63 | notification (and calls -folderPrefetchCompleted: on the delegate, if any). |
| 64 | This method is also fully asynchronous. |
| 65 | */ |
| 66 | - (void) prefetch; |
| 67 | |
| 68 | /*! |
| 69 | @method leaveOnServer |
| 70 | @discussion This method is used to verify if the receiver leaves the messages |
| 71 | on server after retrieve them. |
| 72 | @result The value. |
| 73 | */ |
| 74 | - (BOOL) leaveOnServer; |
| 75 | |
| 76 | /*! |
| 77 | @method setLeaveOnServer: |
| 78 | @discussion This method is used to set the flag to leave or not the messages on the POP3 |
| 79 | server after fetching them. |
| 80 | @param theBOOL YES if we want to leave them on the server after a fetch. If NO, the |
| 81 | messages will be automatically deleted after being fetched. |
| 82 | */ |
| 83 | - (void) setLeaveOnServer: (BOOL) theBOOL; |
| 84 | |
| 85 | /*! |
| 86 | @method retainPeriod |
| 87 | @discussion This method is used to obtain the retain period for the messages, |
| 88 | if left on the server. |
| 89 | @result The retain period. A value of 0 means that the messages will always |
| 90 | be retained. |
| 91 | */ |
| 92 | - (unsigned int) retainPeriod; |
| 93 | |
| 94 | /*! |
| 95 | @method setRetainPeriod: |
| 96 | @discussion This method is used to set the retain period (in days) before |
| 97 | the messages are deleted from the server. In order for this |
| 98 | to work, the receiver must have a cache (instance of CWPOP3CacheManager). |
| 99 | @param theRetainPeriod The retain period to use, in number of days. |
| 100 | */ |
| 101 | - (void) setRetainPeriod: (unsigned int) theRetainPeriod; |
| 102 | |
| 103 | @end |
| 104 | |
| 105 | #endif // _Pantomime_H_CWPOP3Folder |