1 /* 2 ** MessageComposition.h 3 ** 4 ** Copyright (c) 2001-2004 Ujwal S. Sathyam 5 ** 6 ** Author: Ujwal S. Sathyam 7 ** 8 ** Description: Header file for scriptable MessageComposition class. 9 ** 10 ** This program is free software; you can redistribute it and/or modify 11 ** it under the terms of the GNU General Public License as published by 12 ** the Free Software Foundation; either version 2 of the License, or 13 ** (at your option) any later version. 14 ** 15 ** This program is distributed in the hope that it will be useful, 16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 ** GNU General Public License for more details. 19 ** 20 ** You should have received a copy of the GNU General Public License 21 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 22 */ 23 24 #ifndef _GNUMail_H_MessageComposition 25 #define _GNUMail_H_MessageComposition 26 27 #import <Foundation/Foundation.h> 28 #import <AppKit/AppKit.h> 29 30 @class CWInternetAddress; 31 @class ToRecipient; 32 @class CcRecipient; 33 @class BccRecipient; 34 @class EditWindowController; 35 36 @interface MessageComposition : NSObject 37 { 38 // instance variables for attributes: 39 NSString *_author; 40 NSTextStorage *_content; 41 int _signaturePosition; 42 BOOL _hasSignature; 43 NSString *_subject; 44 NSMutableArray *_attachments; 45 NSString *_account; 46 47 // instance variables for to-many relationships: 48 NSMutableArray *_recipients; 49 50 @private 51 EditWindowController *_editWindowController; 52 } 53 54 - (void) send; 55 - (void) show: (BOOL) flag; 56 - (void) addAttachment: (NSString *) aFileName; 57 58 // 59 // accessors for attributes: 60 // 61 - (NSString *) author; 62 - (void) setAuthor: (NSString *)author; 63 - (NSTextStorage *) content; 64 - (void) setContent: (NSTextStorage *)content; 65 - (int) signaturePosition; 66 - (void) setSignaturePosition: (int) signaturePosition; 67 - (BOOL) hasSignature; 68 - (void) setHasSignature: (BOOL) hasSignature; 69 - (NSString *) subject; 70 - (void) setSubject: (NSString *) subject; 71 - (NSArray *) attachments; 72 - (void) setAttachments: (NSArray *) attachments; 73 - (NSString *) account; 74 - (void) setAccount: (NSString *) accountName; 75 76 // 77 // accessors for to-many relationships: 78 // 79 - (NSArray *)recipients; 80 - (void) setRecipients: (NSArray *) recipients; 81 - (NSArray *)ccRecipients; 82 - (void) setCcRecipients: (NSArray *) ccRecipients; 83 - (NSArray *)bccRecipients; 84 - (void) setBccRecipients: (NSArray *) bccRecipients; 85 - (NSArray *)toRecipients; 86 - (void) setToRecipients: (NSArray *) toRecipients; 87 88 @end 89 90 91 // 92 // 93 // 94 @interface MessageComposition (KeyValueCoding) 95 96 - (void) insertInRecipients: (CWInternetAddress *) object; 97 - (void) insertInRecipients: (CWInternetAddress *) object atIndex: (unsigned) index; 98 - (void) removeFromRecipientsAtIndex: (unsigned) index; 99 - (void) replaceInRecipients: (CWInternetAddress *) object atIndex: (unsigned) index; 100 - (id) valueInRecipientsAtIndex: (unsigned) index; 101 - (void) insertInToRecipients: (ToRecipient *) object; 102 - (void) insertInToRecipients: (ToRecipient *) object atIndex: (unsigned) index; 103 - (void) removeFromToRecipientsAtIndex: (unsigned) index; 104 - (void) replaceInToRecipients: (ToRecipient *) object atIndex: (unsigned) index; 105 - (id) valueInToRecipientsAtIndex: (unsigned) index; 106 - (void) insertInCcRecipients: (CcRecipient *) object; 107 - (void) insertInCcRecipients: (CcRecipient *) object atIndex: (unsigned) index; 108 - (void) removeFromCcRecipientsAtIndex: (unsigned) index; 109 - (void) replaceInCcRecipients: (CcRecipient *) object atIndex: (unsigned) index; 110 - (id) valueInCcRecipientsAtIndex: (unsigned) index; 111 - (void) insertInBccRecipients: (BccRecipient *) object; 112 - (void) insertInBccRecipients: (BccRecipient *) object atIndex: (unsigned) index; 113 - (void) removeFromBccRecipientsAtIndex: (unsigned) index; 114 - (void) replaceInBccRecipients: (BccRecipient *) object atIndex: (unsigned) index; 115 - (id) valueInBccRecipientsAtIndex: (unsigned) index; 116 117 @end 118 119 @interface MessageComposition (Private) 120 121 - (void) _loadMessage; 122 123 @end 124 125 #ifdef MACOSX 126 @interface MessageComposition (ScriptingSupport) 127 128 // 129 // Object specifier 130 // 131 - (NSScriptObjectSpecifier *)objectSpecifier; 132 133 // 134 // Handlers for supported commands: 135 // 136 - (void) handleSendMessageScriptCommand: (NSScriptCommand *) command; 137 - (void) handleShowMessageScriptCommand: (NSScriptCommand *) command; 138 - (void) handleAttachScriptCommand: (NSScriptCommand *) command; 139 140 @end 141 142 #endif 143 144 #endif // _GNUMail_H_MessageComposition 145