| 1 | /* |
| 2 | ** CWSendmail.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_CWSendmail |
| 23 | #define _Pantomime_H_CWSendmail |
| 24 | |
| 25 | #include <Pantomime/CWTransport.h> |
| 26 | |
| 27 | #import <Foundation/NSObject.h> |
| 28 | #import <Foundation/NSString.h> |
| 29 | |
| 30 | @class NSTask; |
| 31 | |
| 32 | /*! |
| 33 | @class CWSendmail |
| 34 | @discussion This class, which implements the CWTransport protocol, is used |
| 35 | to provide an interface to the "sendmail" command found on |
| 36 | most UNIX system in order to submit messages directly |
| 37 | instead of using SMTP. |
| 38 | */ |
| 39 | @interface CWSendmail : NSObject <CWTransport> |
| 40 | { |
| 41 | @private |
| 42 | NSMutableArray *_recipients; |
| 43 | CWMessage *_message; |
| 44 | NSData *_data; |
| 45 | |
| 46 | NSString *_path; |
| 47 | id _delegate; |
| 48 | } |
| 49 | |
| 50 | /*! |
| 51 | @method initWithPath: |
| 52 | @discussion This is the designated initializer for the CWSendmail class. |
| 53 | @param thePath The complete path to the "sendmail" binary. |
| 54 | @result An instance of Sendmail, nil on error. |
| 55 | */ |
| 56 | - (id) initWithPath: (NSString *) thePath; |
| 57 | |
| 58 | /*! |
| 59 | @method setDelegate: |
| 60 | @discussion This method is used to set the CWSendmail instance's delegate. |
| 61 | The delegate will not be retained. The CWSendmail class |
| 62 | (and its subclasses) will invoke methods on the delegate |
| 63 | based on actions performed. |
| 64 | @param theDelegate The delegate, which implements various callback methods. |
| 65 | */ |
| 66 | - (void) setDelegate: (id) theDelegate; |
| 67 | |
| 68 | /*! |
| 69 | @method delegate |
| 70 | @discussion This method is used to obtain the delegate of the CWSendmail's instance. |
| 71 | @result The delegate, nil if none was previously set. |
| 72 | */ |
| 73 | - (id) delegate; |
| 74 | |
| 75 | /*! |
| 76 | @method setPath: |
| 77 | @discussion This method is used to set the path to the "sendmail" binary. |
| 78 | @param thePath The full path to the binary. |
| 79 | */ |
| 80 | - (void) setPath: (NSString *) thePath; |
| 81 | |
| 82 | /*! |
| 83 | @method path |
| 84 | @discussion This method is used to get the path to the "sendmail" binary |
| 85 | previously set by calling -setPath:. |
| 86 | @result The path to the "sendmail" binary. |
| 87 | */ |
| 88 | - (NSString *) path; |
| 89 | |
| 90 | @end |
| 91 | |
| 92 | #endif // _Pantomime_H_CWSendmail |