| 1 | /* |
| 2 | ** CWLocalFolder.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_CWLocalFolder |
| 23 | #define _Pantomime_H_CWLocalFolder |
| 24 | |
| 25 | #import <Pantomime/CWConstants.h> |
| 26 | #import <Pantomime/CWFolder.h> |
| 27 | |
| 28 | #import <Foundation/NSArray.h> |
| 29 | #import <Foundation/NSData.h> |
| 30 | #import <Foundation/NSDictionary.h> |
| 31 | #import <Foundation/NSString.h> |
| 32 | |
| 33 | #include <stdio.h> |
| 34 | |
| 35 | /*! |
| 36 | @class CWLocalFolder |
| 37 | @discussion This class, which extends the CWFolder class, is used to |
| 38 | implement local-mailboxes (mbox or maildir format) |
| 39 | specific features. |
| 40 | */ |
| 41 | @interface CWLocalFolder : CWFolder |
| 42 | { |
| 43 | NSString *_path; |
| 44 | |
| 45 | PantomimeFolderFormat _type; |
| 46 | int fd; |
| 47 | FILE *stream; |
| 48 | } |
| 49 | |
| 50 | /*! |
| 51 | @method initWithPath: |
| 52 | @discussion This method is used to initialize the receiver |
| 53 | with the folder at the specified path. Normally, |
| 54 | you should not invoke this method directly. You |
| 55 | should rather use one of the -folderForName:... |
| 56 | method found in CWLocalStore. This method |
| 57 | will open the mailbox at the specified path. |
| 58 | @param thePath The path of the folder. |
| 59 | @result An instance of CWLocalFolder, nil on error. |
| 60 | */ |
| 61 | - (id) initWithPath: (NSString *) thePath; |
| 62 | |
| 63 | /*! |
| 64 | @method parse |
| 65 | @discussion This method is used to parse some or message headers (and only that) |
| 66 | of the receiver. On completion, it posts a PantomimeFolderPrefetchCompleted |
| 67 | notification (and calls -folderPrefetchCompleted: on the delegate, if any). |
| 68 | This method call is blocking. Among the headers that are always parsed are: |
| 69 | Cc, Date, From, In-Reply-To, Message-ID, References, Status, Subject, |
| 70 | To and X-Status. |
| 71 | @param theBOOL If YES, all headers are parsed. Otherwise, only some are. |
| 72 | */ |
| 73 | - (void) parse: (BOOL) theBOOL; |
| 74 | |
| 75 | /*! |
| 76 | @method fd |
| 77 | @discussion This method is used to get the associated file descriptor |
| 78 | of the receiver. |
| 79 | @result The file descriptor, -1 if none was set. |
| 80 | */ |
| 81 | - (int) fd; |
| 82 | |
| 83 | /*! |
| 84 | @method setFD: |
| 85 | @discussion This method is used to set the associated file descriptor |
| 86 | of the receiver. Normally, you should never invoke this |
| 87 | method directly. |
| 88 | @param theFD The associated file descriptor. |
| 89 | */ |
| 90 | - (void) setFD: (int) theFD; |
| 91 | |
| 92 | /*! |
| 93 | @method path |
| 94 | @discussion This method is used to obtain the full path of the folder. |
| 95 | @result The full path. |
| 96 | */ |
| 97 | - (NSString *) path; |
| 98 | |
| 99 | /*! |
| 100 | @method setPath: |
| 101 | @discussion This method is used to set the full path of the folder. |
| 102 | @param thePath The full path. |
| 103 | */ |
| 104 | - (void) setPath: (NSString *) thePath; |
| 105 | |
| 106 | /*! |
| 107 | @method stream |
| 108 | @discussion This method is used to get the associated stream |
| 109 | of the receiver. |
| 110 | @result The stream, NULL if none was set. |
| 111 | */ |
| 112 | - (FILE *) stream; |
| 113 | |
| 114 | /*! |
| 115 | @method setStream: |
| 116 | @discussion This method is used to set the associated stream |
| 117 | of the receiver. Normally, you should never invoke this |
| 118 | method directly. |
| 119 | @param theStream The associated stream. |
| 120 | */ |
| 121 | - (void) setStream: (FILE *) theStream; |
| 122 | |
| 123 | /*! |
| 124 | @method type |
| 125 | @discussion This method is used to get the type of folder |
| 126 | the receiver is. Possible values are part of the |
| 127 | PantomimeFolderFormat enum. |
| 128 | @result The type of the folder. |
| 129 | */ |
| 130 | - (PantomimeFolderFormat) type; |
| 131 | |
| 132 | /*! |
| 133 | @method setType: |
| 134 | @discussion This method is used to set the type of the receiver. |
| 135 | Accepted values are part of the PantomimeFolderFormat enum. |
| 136 | @param theType The type of the receiver. |
| 137 | */ |
| 138 | - (void) setType: (PantomimeFolderFormat) theType; |
| 139 | |
| 140 | @end |
| 141 | |
| 142 | #endif // _Pantomime_H_CWLocalFolder |