| 1 | /* |
| 2 | ** CWLocalStore.h |
| 3 | ** |
| 4 | ** Copyright (c) 2001-2007 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_CWLocalStore |
| 23 | #define _Pantomime_H_CWLocalStore |
| 24 | |
| 25 | #include <Pantomime/CWStore.h> |
| 26 | |
| 27 | #import <Foundation/NSArray.h> |
| 28 | #import <Foundation/NSEnumerator.h> |
| 29 | #import <Foundation/NSFileManager.h> |
| 30 | #import <Foundation/NSObject.h> |
| 31 | #import <Foundation/NSString.h> |
| 32 | |
| 33 | /*! |
| 34 | @class CWLocalStore |
| 35 | @abstract Pantomime local folders client code. |
| 36 | @discussion This class, which implements the CWStore protocol, is Pantomime's code |
| 37 | for accessing local folders such as mbox mailboxes, maildir mailboxes |
| 38 | and more.. |
| 39 | */ |
| 40 | @interface CWLocalStore : NSObject <CWStore> |
| 41 | { |
| 42 | @private |
| 43 | NSMutableDictionary *_openFolders; |
| 44 | NSMutableArray *_folders; |
| 45 | NSString *_path; |
| 46 | id _delegate; |
| 47 | BOOL _secure; |
| 48 | } |
| 49 | |
| 50 | /*! |
| 51 | @method initWithPath: |
| 52 | @discussion This is the designated initializer for the CWLocalStore class. |
| 53 | This method is used to initialize the receiver with the |
| 54 | full path of where folders are located. Folders can be in |
| 55 | the mbox format, maildir format or directories which hold |
| 56 | mbox mailboxes. |
| 57 | @param thePath The full path to the mail store. |
| 58 | */ |
| 59 | - (id) initWithPath: (NSString *) thePath; |
| 60 | |
| 61 | /*! |
| 62 | @method delegate |
| 63 | @discussion This method is used to get the delegate of the CWLocalStore's instance. |
| 64 | @result The delegate, nil if none was previously set. |
| 65 | */ |
| 66 | - (id) delegate; |
| 67 | |
| 68 | /*! |
| 69 | @method setDelegate: |
| 70 | @discussion This method is used to set the CWLocalStore's delegate. |
| 71 | The delegate will not be retained. The CWLocalStore class |
| 72 | will invoke methods on the delegate based on actions performed. |
| 73 | @param theDelegate The delegate, which implements various callback methods. |
| 74 | */ |
| 75 | - (void) setDelegate: (id) theDelegate; |
| 76 | |
| 77 | /*! |
| 78 | @method path |
| 79 | @discussion This method is used to obtain the full path to the mail store. |
| 80 | @result The full path to the mail store. |
| 81 | */ |
| 82 | - (NSString *) path; |
| 83 | |
| 84 | /*! |
| 85 | @method setPath: |
| 86 | @discussion This method is used to set the full path to the mail store. |
| 87 | @param thePath The full path to the mail store. |
| 88 | */ |
| 89 | - (void) setPath: (NSString *) thePath; |
| 90 | |
| 91 | /*! |
| 92 | @method setEnforceMode: |
| 93 | @discussion This method is used to enforce or not secure modes |
| 94 | (0600 for files, 0700 for directories) on newly created |
| 95 | mailboxes. If not enforced, the default permissions |
| 96 | used by Foundation when creating files or directories |
| 97 | will be used. By default, secure modes are enforced. |
| 98 | @param theBOOL YES to enforce secure modes, NO otherwise. |
| 99 | */ |
| 100 | - (void) setEnforceMode: (BOOL) theBOOL; |
| 101 | |
| 102 | /*! |
| 103 | @method isEnforcingMode |
| 104 | @discussion This method is used to verify if secure modes |
| 105 | are enforced. |
| 106 | @result YES if secure modes are enforced, NO otherwise. |
| 107 | */ |
| 108 | - (BOOL) isEnforcingMode; |
| 109 | |
| 110 | @end |
| 111 | |
| 112 | #endif // _Pantomime_H_CWLocalStore |