MailBridge.h
author Jens Alfke <jens@mooseyard.com>
Sat Mar 28 09:36:46 2009 -0700 (2009-03-28)
changeset 20 5a71993a1a70
permissions -rw-r--r--
Added some new utilities, taken from Murky.
jens@17
     1
/*
jens@17
     2
 * Mail.h
jens@17
     3
 */
jens@17
     4
jens@17
     5
#import <AppKit/AppKit.h>
jens@17
     6
#import <ScriptingBridge/ScriptingBridge.h>
jens@17
     7
jens@17
     8
jens@17
     9
@class MailItem, MailApplication, MailColor, MailDocument, MailWindow, MailText, MailAttachment, MailParagraph, MailWord, MailCharacter, MailAttributeRun, MailOutgoingMessage, MailLdapServer, MailApplication, MailMessageViewer, MailSignature, MailMessage, MailAccount, MailImapAccount, MailMacAccount, MailPopAccount, MailSmtpServer, MailMailbox, MailRule, MailRuleCondition, MailRecipient, MailBccRecipient, MailCcRecipient, MailToRecipient, MailContainer, MailHeader, MailMailAttachment;
jens@17
    10
jens@17
    11
typedef enum {
jens@17
    12
	MailSavoYes = 'yes ' /* Save the file. */,
jens@17
    13
	MailSavoNo = 'no  ' /* Do not save the file. */,
jens@17
    14
	MailSavoAsk = 'ask ' /* Ask the user whether or not to save the file. */
jens@17
    15
} MailSavo;
jens@17
    16
jens@17
    17
typedef enum {
jens@17
    18
	MailEdmfPlainText = 'dmpt' /* Plain Text */,
jens@17
    19
	MailEdmfRichText = 'dmrt' /* Rich Text */
jens@17
    20
} MailEdmf;
jens@17
    21
jens@17
    22
typedef enum {
jens@17
    23
	MailHedeAll = 'hdal' /* All */,
jens@17
    24
	MailHedeCustom = 'hdcu' /* Custom */,
jens@17
    25
	MailHedeDefault = 'hdde' /* Default */,
jens@17
    26
	MailHedeNoHeaders = 'hdnn' /* No headers */
jens@17
    27
} MailHede;
jens@17
    28
jens@17
    29
typedef enum {
jens@17
    30
	MailLdasBase = 'lsba' /* LDAP scope of 'Base' */,
jens@17
    31
	MailLdasOneLevel = 'lsol' /* LDAP scope of 'One Level' */,
jens@17
    32
	MailLdasSubtree = 'lsst' /* LDAP scope of 'Subtree' */
jens@17
    33
} MailLdas;
jens@17
    34
jens@17
    35
typedef enum {
jens@17
    36
	MailQqclBlue = 'ccbl' /* Blue */,
jens@17
    37
	MailQqclGreen = 'ccgr' /* Green */,
jens@17
    38
	MailQqclOrange = 'ccor' /* Orange */,
jens@17
    39
	MailQqclOther = 'ccot' /* Other */,
jens@17
    40
	MailQqclPurple = 'ccpu' /* Purple */,
jens@17
    41
	MailQqclRed = 'ccre' /* Red */,
jens@17
    42
	MailQqclYellow = 'ccye' /* Yellow */
jens@17
    43
} MailQqcl;
jens@17
    44
jens@17
    45
typedef enum {
jens@17
    46
	MailMvclAttachmentsColumn = 'ecat' /* Column containing the number of attachments a message contains */,
jens@17
    47
	MailMvclBuddyAvailabilityColumn = 'ecba' /* Column indicating whether the sender of a message is online or not */,
jens@17
    48
	MailMvclMessageColor = 'eccl' /* Used to indicate sorting should be done by color */,
jens@17
    49
	MailMvclDateReceivedColumn = 'ecdr' /* Column containing the date a message was received */,
jens@17
    50
	MailMvclDateSentColumn = 'ecds' /* Column containing the date a message was sent */,
jens@17
    51
	MailMvclFlagsColumn = 'ecfl' /* Column containing the flags of a message */,
jens@17
    52
	MailMvclFromColumn = 'ecfr' /* Column containing the sender's name */,
jens@17
    53
	MailMvclMailboxColumn = 'ecmb' /* Column containing the name of the mailbox or account a message is in */,
jens@17
    54
	MailMvclMessageStatusColumn = 'ecms' /* Column indicating a messages status (read, unread, replied to, forwarded, etc) */,
jens@17
    55
	MailMvclNumberColumn = 'ecnm' /* Column containing the number of a message in a mailbox */,
jens@17
    56
	MailMvclSizeColumn = 'ecsz' /* Column containing the size of a message */,
jens@17
    57
	MailMvclSubjectColumn = 'ecsu' /* Column containing the subject of a message */,
jens@17
    58
	MailMvclToColumn = 'ecto' /* Column containing the recipients of a message */
jens@17
    59
} MailMvcl;
jens@17
    60
jens@17
    61
typedef enum {
jens@17
    62
	MailExutPassword = 'axct' /* Clear text password */,
jens@17
    63
	MailExutApop = 'aapo' /* APOP */,
jens@17
    64
	MailExutKerberos5 = 'axk5' /* Kerberos 5 */,
jens@17
    65
	MailExutNtlm = 'axnt' /* NTLM */,
jens@17
    66
	MailExutMd5 = 'axmd' /* MD5 */,
jens@17
    67
	MailExutNone = 'ccno' /* None */
jens@17
    68
} MailExut;
jens@17
    69
jens@17
    70
typedef enum {
jens@17
    71
	MailCclrBlue = 'ccbl' /* Blue */,
jens@17
    72
	MailCclrGray = 'ccgy' /* Gray */,
jens@17
    73
	MailCclrGreen = 'ccgr' /* Green */,
jens@17
    74
	MailCclrNone = 'ccno' /* None */,
jens@17
    75
	MailCclrOrange = 'ccor' /* Orange */,
jens@17
    76
	MailCclrOther = 'ccot' /* Other */,
jens@17
    77
	MailCclrPurple = 'ccpu' /* Purple */,
jens@17
    78
	MailCclrRed = 'ccre' /* Red */,
jens@17
    79
	MailCclrYellow = 'ccye' /* Yellow */
jens@17
    80
} MailCclr;
jens@17
    81
jens@17
    82
typedef enum {
jens@17
    83
	MailE9xpAllMessagesAndTheirAttachments = 'x9al' /* All messages and their attachments */,
jens@17
    84
	MailE9xpAllMessagesButOmitAttachments = 'x9bo' /* All messages but omit attachments */,
jens@17
    85
	MailE9xpDoNotKeepCopiesOfAnyMessages = 'x9no' /* Do not keep copies of any messages */,
jens@17
    86
	MailE9xpOnlyMessagesIHaveRead = 'x9wr' /* Only messages I have read */
jens@17
    87
} MailE9xp;
jens@17
    88
jens@17
    89
typedef enum {
jens@17
    90
	MailEnrqBeginsWithValue = 'rqbw' /* Begins with value */,
jens@17
    91
	MailEnrqDoesContainValue = 'rqco' /* Does contain value */,
jens@17
    92
	MailEnrqDoesNotContainValue = 'rqdn' /* Does not contain value */,
jens@17
    93
	MailEnrqEndsWithValue = 'rqew' /* Ends with value */,
jens@17
    94
	MailEnrqEqualToValue = 'rqie' /* Equal to value */,
jens@17
    95
	MailEnrqLessThanValue = 'rqlt' /* Less than value */,
jens@17
    96
	MailEnrqGreaterThanValue = 'rqgt' /* Greater than value */,
jens@17
    97
	MailEnrqNone = 'rqno' /* Indicates no qualifier is applicable */
jens@17
    98
} MailEnrq;
jens@17
    99
jens@17
   100
typedef enum {
jens@17
   101
	MailErutAccount = 'tacc' /* Account */,
jens@17
   102
	MailErutAnyRecipient = 'tanr' /* Any recipient */,
jens@17
   103
	MailErutCcHeader = 'tccc' /* Cc header */,
jens@17
   104
	MailErutMatchesEveryMessage = 'tevm' /* Every message */,
jens@17
   105
	MailErutFromHeader = 'tfro' /* From header */,
jens@17
   106
	MailErutHeaderKey = 'thdk' /* An arbitrary header key */,
jens@17
   107
	MailErutMessageContent = 'tmec' /* Message content */,
jens@17
   108
	MailErutMessageIsJunkMail = 'tmij' /* Message is junk mail */,
jens@17
   109
	MailErutSenderIsInMyAddressBook = 'tsii' /* Sender is in my address book */,
jens@17
   110
	MailErutSenderIsMemberOfGroup = 'tsim' /* Sender is member of group */,
jens@17
   111
	MailErutSenderIsNotInMyAddressBook = 'tsin' /* Sender is not in my address book */,
jens@17
   112
	MailErutSenderIsNotMemberOfGroup = 'tsig' /* Sender is not member of group */,
jens@17
   113
	MailErutSubjectHeader = 'tsub' /* Subject header */,
jens@17
   114
	MailErutToHeader = 'ttoo' /* To header */,
jens@17
   115
	MailErutToOrCcHeader = 'ttoc' /* To or Cc header */
jens@17
   116
} MailErut;
jens@17
   117
jens@17
   118
typedef enum {
jens@17
   119
	MailEtocImap = 'etim' /* IMAP */,
jens@17
   120
	MailEtocPop = 'etpo' /* POP */,
jens@17
   121
	MailEtocSmtp = 'etsm' /* SMTP */,
jens@17
   122
	MailEtocMac = 'etit' /* .Mac */
jens@17
   123
} MailEtoc;
jens@17
   124
jens@17
   125
jens@17
   126
jens@17
   127
/*
jens@17
   128
 * Standard Suite
jens@17
   129
 */
jens@17
   130
jens@17
   131
// Abstract object provides a base class for scripting classes.  It is never used directly.
jens@17
   132
@interface MailItem : SBObject
jens@17
   133
jens@17
   134
@property (copy) NSDictionary *properties;  // All of the object's properties.
jens@17
   135
jens@17
   136
- (void) open;  // Open an object.
jens@17
   137
- (void) print;  // Print an object.
jens@17
   138
- (void) closeSaving:(MailSavo)saving savingIn:(NSURL *)savingIn;  // Close an object.
jens@17
   139
- (void) delete;  // Delete an object.
jens@17
   140
- (void) duplicateTo:(SBObject *)to;  // Copy object(s) and put the copies at a new location.
jens@17
   141
- (BOOL) exists;  // Verify if an object exists.
jens@17
   142
- (void) moveTo:(SBObject *)to;  // Move object(s) to a new location.
jens@17
   143
- (void) saveIn:(NSString *)in_ as:(NSString *)as;  // Save an object.
jens@17
   144
jens@17
   145
@end
jens@17
   146
jens@17
   147
// An application's top level scripting object.
jens@17
   148
@interface MailApplication : SBApplication
jens@17
   149
+ (MailApplication *) application;
jens@17
   150
jens@17
   151
- (SBElementArray *) documents;
jens@17
   152
- (SBElementArray *) windows;
jens@17
   153
jens@17
   154
@property (copy, readonly) NSString *name;  // The name of the application.
jens@17
   155
@property (readonly) BOOL frontmost;  // Is this the frontmost (active) application?
jens@17
   156
@property (copy, readonly) NSString *version;  // The version of the application.
jens@17
   157
jens@17
   158
- (void) quitSaving:(MailSavo)saving;  // Quit an application.
jens@17
   159
- (void) checkForNewMailFor:(MailAccount *)for_;  // Triggers a check for email.
jens@17
   160
- (NSString *) extractNameFrom:(NSString *)x;  // Command to get the full name out of a fully specified email address. E.g. Calling this with "John Doe <jdoe@example.com>" as the direct object would return "John Doe"
jens@17
   161
- (NSString *) extractAddressFrom:(NSString *)x;  // Command to get just the email address of a fully specified email address. E.g. Calling this with "John Doe <jdoe@example.com>" as the direct object would return "jdoe@example.com"
jens@17
   162
- (void) GetURL:(NSString *)x;  // Opens a mailto URL.
jens@17
   163
- (void) importMailMailboxAt:(NSString *)at;  // Imports a mailbox in Mail's mbox format.
jens@17
   164
- (void) mailto:(NSString *)x;  // Opens a mailto URL.
jens@17
   165
- (void) performMailActionWithMessages:(NSArray *)x inMailboxes:(MailMailbox *)inMailboxes forRule:(MailRule *)forRule;  // Script handler invoked by rules and menus that execute AppleScripts.  The direct parameter of this handler is a list of messages being acted upon.
jens@17
   166
- (void) synchronizeWith:(MailAccount *)with;  // Command to trigger synchronizing of an IMAP account with the server.
jens@17
   167
jens@17
   168
@end
jens@17
   169
jens@17
   170
// A color.
jens@17
   171
@interface MailColor : SBObject
jens@17
   172
jens@17
   173
- (void) open;  // Open an object.
jens@17
   174
- (void) print;  // Print an object.
jens@17
   175
- (void) closeSaving:(MailSavo)saving savingIn:(NSURL *)savingIn;  // Close an object.
jens@17
   176
- (void) delete;  // Delete an object.
jens@17
   177
- (void) duplicateTo:(SBObject *)to;  // Copy object(s) and put the copies at a new location.
jens@17
   178
- (BOOL) exists;  // Verify if an object exists.
jens@17
   179
- (void) moveTo:(SBObject *)to;  // Move object(s) to a new location.
jens@17
   180
- (void) saveIn:(NSString *)in_ as:(NSString *)as;  // Save an object.
jens@17
   181
jens@17
   182
@end
jens@17
   183
jens@17
   184
// A document.
jens@17
   185
@interface MailDocument : SBObject
jens@17
   186
jens@17
   187
@property (copy) NSString *path;  // The document's path.
jens@17
   188
@property (readonly) BOOL modified;  // Has the document been modified since the last save?
jens@17
   189
@property (copy) NSString *name;  // The document's name.
jens@17
   190
jens@17
   191
- (void) open;  // Open an object.
jens@17
   192
- (void) print;  // Print an object.
jens@17
   193
- (void) closeSaving:(MailSavo)saving savingIn:(NSURL *)savingIn;  // Close an object.
jens@17
   194
- (void) delete;  // Delete an object.
jens@17
   195
- (void) duplicateTo:(SBObject *)to;  // Copy object(s) and put the copies at a new location.
jens@17
   196
- (BOOL) exists;  // Verify if an object exists.
jens@17
   197
- (void) moveTo:(SBObject *)to;  // Move object(s) to a new location.
jens@17
   198
- (void) saveIn:(NSString *)in_ as:(NSString *)as;  // Save an object.
jens@17
   199
jens@17
   200
@end
jens@17
   201
jens@17
   202
// A window.
jens@17
   203
@interface MailWindow : SBObject
jens@17
   204
jens@17
   205
@property (copy) NSString *name;  // The full title of the window.
jens@17
   206
- (NSInteger) id;  // The unique identifier of the window.
jens@17
   207
@property NSRect bounds;  // The bounding rectangle of the window.
jens@17
   208
@property (readonly) BOOL closeable;  // Whether the window has a close box.
jens@17
   209
@property (readonly) BOOL titled;  // Whether the window has a title bar.
jens@17
   210
@property NSInteger index;  // The index of the window in the back-to-front window ordering.
jens@17
   211
@property (readonly) BOOL floating;  // Whether the window floats.
jens@17
   212
@property (readonly) BOOL miniaturizable;  // Whether the window can be miniaturized.
jens@17
   213
@property BOOL miniaturized;  // Whether the window is currently miniaturized.
jens@17
   214
@property (readonly) BOOL modal;  // Whether the window is the application's current modal window.
jens@17
   215
@property (readonly) BOOL resizable;  // Whether the window can be resized.
jens@17
   216
@property BOOL visible;  // Whether the window is currently visible.
jens@17
   217
@property (readonly) BOOL zoomable;  // Whether the window can be zoomed.
jens@17
   218
@property BOOL zoomed;  // Whether the window is currently zoomed.
jens@17
   219
jens@17
   220
- (void) open;  // Open an object.
jens@17
   221
- (void) print;  // Print an object.
jens@17
   222
- (void) closeSaving:(MailSavo)saving savingIn:(NSURL *)savingIn;  // Close an object.
jens@17
   223
- (void) delete;  // Delete an object.
jens@17
   224
- (void) duplicateTo:(SBObject *)to;  // Copy object(s) and put the copies at a new location.
jens@17
   225
- (BOOL) exists;  // Verify if an object exists.
jens@17
   226
- (void) moveTo:(SBObject *)to;  // Move object(s) to a new location.
jens@17
   227
- (void) saveIn:(NSString *)in_ as:(NSString *)as;  // Save an object.
jens@17
   228
jens@17
   229
@end
jens@17
   230
jens@17
   231
jens@17
   232
jens@17
   233
/*
jens@17
   234
 * Text Suite
jens@17
   235
 */
jens@17
   236
jens@17
   237
// Rich (styled) text
jens@17
   238
@interface MailText : SBObject
jens@17
   239
jens@17
   240
- (SBElementArray *) paragraphs;
jens@17
   241
- (SBElementArray *) words;
jens@17
   242
- (SBElementArray *) characters;
jens@17
   243
- (SBElementArray *) attributeRuns;
jens@17
   244
- (SBElementArray *) attachments;
jens@17
   245
jens@17
   246
@property (copy) NSColor *color;  // The color of the first character.
jens@17
   247
@property (copy) NSString *font;  // The name of the font of the first character.
jens@17
   248
@property (copy) NSNumber *size;  // The size in points of the first character.
jens@17
   249
jens@17
   250
- (void) open;  // Open an object.
jens@17
   251
- (void) print;  // Print an object.
jens@17
   252
- (void) closeSaving:(MailSavo)saving savingIn:(NSURL *)savingIn;  // Close an object.
jens@17
   253
- (void) delete;  // Delete an object.
jens@17
   254
- (void) duplicateTo:(SBObject *)to;  // Copy object(s) and put the copies at a new location.
jens@17
   255
- (BOOL) exists;  // Verify if an object exists.
jens@17
   256
- (void) moveTo:(SBObject *)to;  // Move object(s) to a new location.
jens@17
   257
- (void) saveIn:(NSString *)in_ as:(NSString *)as;  // Save an object.
jens@17
   258
- (NSString *) extractNameFrom;  // Command to get the full name out of a fully specified email address. E.g. Calling this with "John Doe <jdoe@example.com>" as the direct object would return "John Doe"
jens@17
   259
- (NSString *) extractAddressFrom;  // Command to get just the email address of a fully specified email address. E.g. Calling this with "John Doe <jdoe@example.com>" as the direct object would return "jdoe@example.com"
jens@17
   260
- (void) GetURL;  // Opens a mailto URL.
jens@17
   261
- (void) mailto;  // Opens a mailto URL.
jens@17
   262
jens@17
   263
@end
jens@17
   264
jens@17
   265
// Represents an inline text attachment.  This class is used mainly for make commands.
jens@17
   266
@interface MailAttachment : MailText
jens@17
   267
jens@17
   268
@property (copy) NSString *fileName;  // The path to the file for the attachment
jens@17
   269
jens@17
   270
jens@17
   271
@end
jens@17
   272
jens@17
   273
// This subdivides the text into paragraphs.
jens@17
   274
@interface MailParagraph : MailText
jens@17
   275
jens@17
   276
jens@17
   277
@end
jens@17
   278
jens@17
   279
// This subdivides the text into words.
jens@17
   280
@interface MailWord : MailText
jens@17
   281
jens@17
   282
jens@17
   283
@end
jens@17
   284
jens@17
   285
// This subdivides the text into characters.
jens@17
   286
@interface MailCharacter : MailText
jens@17
   287
jens@17
   288
jens@17
   289
@end
jens@17
   290
jens@17
   291
// This subdivides the text into chunks that all have the same attributes.
jens@17
   292
@interface MailAttributeRun : MailText
jens@17
   293
jens@17
   294
jens@17
   295
@end
jens@17
   296
jens@17
   297
jens@17
   298
jens@17
   299
/*
jens@17
   300
 * Mail
jens@17
   301
 */
jens@17
   302
jens@17
   303
// A new email message
jens@17
   304
@interface MailOutgoingMessage : MailItem
jens@17
   305
jens@17
   306
- (SBElementArray *) bccRecipients;
jens@17
   307
- (SBElementArray *) ccRecipients;
jens@17
   308
- (SBElementArray *) recipients;
jens@17
   309
- (SBElementArray *) toRecipients;
jens@17
   310
jens@17
   311
@property (copy) NSString *sender;  // The sender of the message
jens@17
   312
@property (copy) NSString *subject;  // The subject of the message
jens@17
   313
@property (copy) MailText *content;  // The contents of the message
jens@17
   314
@property BOOL visible;  // Controls whether the message window is shown on the screen.  The default is false
jens@17
   315
@property (copy) MailSignature *messageSignature;  // The signature of the message
jens@17
   316
- (NSInteger) id;  // The unique identifier of the message
jens@17
   317
jens@17
   318
- (BOOL) send;  // Sends a message.
jens@17
   319
jens@17
   320
@end
jens@17
   321
jens@17
   322
// LDAP servers for use in type completion in Mail
jens@17
   323
@interface MailLdapServer : MailItem
jens@17
   324
jens@17
   325
@property BOOL enabled;  // Indicates whether this LDAP server will be used for type completion in Mail
jens@17
   326
@property (copy) NSString *name;  // Name of LDAP server configuration to be displayed in Composing preferences
jens@17
   327
@property NSInteger port;  // Port number for the LDAP server (default is 389)
jens@17
   328
@property MailLdas scope;  // Scope setting for the LDAP server
jens@17
   329
@property (copy) NSString *searchBase;  // Search base for this LDAP server (not required by all LDAP servers)
jens@17
   330
@property (copy) NSString *hostName;  // Internet address (myldapserver.company.com) for LDAP server
jens@17
   331
jens@17
   332
jens@17
   333
@end
jens@17
   334
jens@17
   335
// Mail's top level scripting object.
jens@17
   336
@interface MailApplication (Mail)
jens@17
   337
jens@17
   338
- (SBElementArray *) accounts;
jens@17
   339
- (SBElementArray *) outgoingMessages;
jens@17
   340
- (SBElementArray *) smtpServers;
jens@17
   341
- (SBElementArray *) MacAccounts;
jens@17
   342
- (SBElementArray *) imapAccounts;
jens@17
   343
- (SBElementArray *) ldapServers;
jens@17
   344
- (SBElementArray *) mailboxes;
jens@17
   345
- (SBElementArray *) messageViewers;
jens@17
   346
- (SBElementArray *) popAccounts;
jens@17
   347
- (SBElementArray *) rules;
jens@17
   348
- (SBElementArray *) signatures;
jens@17
   349
jens@17
   350
@property (copy, readonly) NSString *version;  // The version of the application.
jens@17
   351
@property BOOL alwaysBccMyself;  // Indicates whether you will be included in the Bcc: field of messages which you are composing
jens@17
   352
@property BOOL alwaysCcMyself;  // Indicates whether you will be included in the Cc: field of messages which you are composing
jens@17
   353
@property (copy, readonly) NSArray *selection;  // List of messages that the user has selected
jens@17
   354
@property (copy, readonly) NSString *applicationVersion;  // The build number for the Mail application bundle
jens@17
   355
@property NSInteger fetchInterval;  // The interval (in minutes) between automatic fetches of new mail
jens@17
   356
@property (readonly) NSInteger backgroundActivityCount;  // Number of background activities currently running in Mail, according to the Activity Viewer
jens@17
   357
@property BOOL chooseSignatureWhenComposing;  // Indicates whether user can choose a signature directly in a new compose window
jens@17
   358
@property BOOL colorQuotedText;  // Indicates whether quoted text should be colored
jens@17
   359
@property MailEdmf defaultMessageFormat;  // Default format for messages being composed or message replies
jens@17
   360
@property BOOL downloadHtmlAttachments;  // Indicates whether images and attachments in HTML messages should be downloaded and displayed
jens@17
   361
@property (copy, readonly) MailMailbox *draftsMailbox;  // The top level Drafts mailbox
jens@17
   362
@property BOOL expandGroupAddresses;  // Indicates whether group addresses will be expanded when entered into the address fields of a new compose message
jens@17
   363
@property (copy) NSString *fixedWidthFont;  // Font for plain text messages, only used if 'use fixed width font' is set to true
jens@17
   364
@property double fixedWidthFontSize;  // Font size for plain text messages, only used if 'use fixed width font' is set to true
jens@17
   365
@property (copy, readonly) NSString *frameworkVersion;  // The build number for the Message framework, used by Mail
jens@17
   366
@property MailHede headerDetail;  // The level of detail shown for headers on incoming messages
jens@17
   367
@property (copy, readonly) MailMailbox *inbox;  // The top level In mailbox
jens@17
   368
@property BOOL includeAllOriginalMessageText;  // Indicates whether all of the original message will be quoted or only the text you have selected (if any)
jens@17
   369
@property BOOL quoteOriginalMessage;  // Indicates whether the text of the original message will be included in replies
jens@17
   370
@property BOOL checkSpellingWhileTyping;  // Indicates whether spelling will be checked automatically in messages being composed
jens@17
   371
@property (copy, readonly) MailMailbox *junkMailbox;  // The top level Junk mailbox
jens@17
   372
@property MailQqcl levelOneQuotingColor;  // Color for quoted text with one level of indentation
jens@17
   373
@property MailQqcl levelTwoQuotingColor;  // Color for quoted text with two levels of indentation
jens@17
   374
@property MailQqcl levelThreeQuotingColor;  // Color for quoted text with three levels of indentation
jens@17
   375
@property (copy) NSString *messageFont;  // Font for messages (proportional font)
jens@17
   376
@property double messageFontSize;  // Font size for messages (proportional font)
jens@17
   377
@property (copy) NSString *messageListFont;  // Font for message list
jens@17
   378
@property double messageListFontSize;  // Font size for message list
jens@17
   379
@property (copy) NSString *newMailSound;  // Name of new mail sound or 'None' if no sound is selected
jens@17
   380
@property (copy, readonly) MailMailbox *outbox;  // The top level Out mailbox
jens@17
   381
@property BOOL shouldPlayOtherMailSounds;  // Indicates whether sounds will be played for various things such as when a messages is sent or if no mail is found when manually checking for new mail or if there is a fetch error
jens@17
   382
@property BOOL sameReplyFormat;  // Indicates whether replies will be in the same text format as the message to which you are replying
jens@17
   383
@property (copy) NSString *selectedSignature;  // Name of current selected signature (or 'randomly', 'sequentially', or 'none')
jens@17
   384
@property (copy, readonly) MailMailbox *sentMailbox;  // The top level Sent mailbox
jens@17
   385
@property BOOL fetchesAutomatically;  // Indicates whether mail will automatically be fetched at a specific interval
jens@17
   386
@property BOOL highlightSelectedThread;  // Indicates whether threads should be highlighted in the Mail viewer window
jens@17
   387
@property BOOL showOnlineBuddyStatus;  // Indicates whether Mail will show online buddy status
jens@17
   388
@property (copy, readonly) MailMailbox *trashMailbox;  // The top level Trash mailbox
jens@17
   389
@property BOOL useAddressCompletion;  // Indicates whether network directories (LDAP) and Address Book will be used for address completion
jens@17
   390
@property BOOL useFixedWidthFont;  // Should fixed-width font be used for plain text messages?
jens@17
   391
@property (copy, readonly) NSString *primaryEmail;  // The user's primary email address
jens@17
   392
jens@17
   393
@end
jens@17
   394
jens@17
   395
// Represents the object responsible for managing a viewer window
jens@17
   396
@interface MailMessageViewer : MailItem
jens@17
   397
jens@17
   398
- (SBElementArray *) messages;
jens@17
   399
jens@17
   400
@property (copy, readonly) MailMailbox *draftsMailbox;  // The top level Drafts mailbox
jens@17
   401
@property (copy, readonly) MailMailbox *inbox;  // The top level In mailbox
jens@17
   402
@property (copy, readonly) MailMailbox *junkMailbox;  // The top level Junk mailbox
jens@17
   403
@property (copy, readonly) MailMailbox *outbox;  // The top level Out mailbox
jens@17
   404
@property (copy, readonly) MailMailbox *sentMailbox;  // The top level Sent mailbox
jens@17
   405
@property (copy, readonly) MailMailbox *trashMailbox;  // The top level Trash mailbox
jens@17
   406
@property MailMvcl sortColumn;  // The column that is currently sorted in the viewer
jens@17
   407
@property BOOL sortedAscending;  // Whether the viewer is sorted ascending or not
jens@17
   408
@property BOOL mailboxListVisible;  // Controls whether the list of mailboxes is visible or not
jens@17
   409
@property BOOL previewPaneIsVisible;  // Controls whether the preview pane of the message viewer window is visible or not
jens@17
   410
@property MailMvcl visibleColumns;  // List of columns that are visible.  The subject column and the message status column will always be visible
jens@17
   411
- (NSInteger) id;  // The unique identifier of the message viewer
jens@17
   412
@property (copy) NSArray *visibleMessages;  // List of messages currently being displayed in the viewer
jens@17
   413
@property (copy) NSArray *selectedMessages;  // List of messages currently selected
jens@17
   414
@property (copy) NSArray *selectedMailboxes;  // List of mailboxes currently selected in the list of mailboxes
jens@17
   415
@property (copy) MailWindow *window;  // The window for the message viewer
jens@17
   416
jens@17
   417
jens@17
   418
@end
jens@17
   419
jens@17
   420
// Email signatures
jens@17
   421
@interface MailSignature : MailItem
jens@17
   422
jens@17
   423
@property (copy) NSString *content;  // Contents of email signature. If there is a version with fonts and/or styles, that will be returned over the plain text version
jens@17
   424
@property (copy) NSString *name;  // Name of the signature
jens@17
   425
jens@17
   426
jens@17
   427
@end
jens@17
   428
jens@17
   429
jens@17
   430
jens@17
   431
/*
jens@17
   432
 * Message
jens@17
   433
 */
jens@17
   434
jens@17
   435
// An email message
jens@17
   436
@interface MailMessage : MailItem
jens@17
   437
jens@17
   438
- (SBElementArray *) bccRecipients;
jens@17
   439
- (SBElementArray *) ccRecipients;
jens@17
   440
- (SBElementArray *) recipients;
jens@17
   441
- (SBElementArray *) toRecipients;
jens@17
   442
- (SBElementArray *) headers;
jens@17
   443
- (SBElementArray *) mailAttachments;
jens@17
   444
jens@17
   445
- (NSInteger) id;  // The unique identifier of the message.
jens@17
   446
@property (copy, readonly) NSString *allHeaders;  // All the headers of the message
jens@17
   447
@property MailCclr backgroundColor;  // The background color of the message
jens@17
   448
@property (copy) MailMailbox *mailbox;  // The mailbox in which this message is filed
jens@17
   449
@property (copy) MailText *content;  // Contents of an email message
jens@17
   450
@property (copy, readonly) NSDate *dateReceived;  // The date a message was received
jens@17
   451
@property (copy, readonly) NSDate *dateSent;  // The date a message was sent
jens@17
   452
@property BOOL deletedStatus;  // Indicates whether the message is deleted or not
jens@17
   453
@property BOOL flaggedStatus;  // Indicates whether the message is flagged or not
jens@17
   454
@property BOOL junkMailStatus;  // Indicates whether the message has been marked junk or evaluated to be junk by the junk mail filter.
jens@17
   455
@property BOOL readStatus;  // Indicates whether the message is read or not
jens@17
   456
@property (copy, readonly) NSString *messageId;  // The unique message ID string
jens@17
   457
@property (copy, readonly) NSString *source;  // Raw source of the message
jens@17
   458
@property (copy) NSString *replyTo;  // The address that replies should be sent to
jens@17
   459
@property NSInteger messageSize;  // The size (in bytes) of a message
jens@17
   460
@property (copy) NSString *sender;  // The sender of the message
jens@17
   461
@property (copy) NSString *subject;  // The subject of the message
jens@17
   462
@property BOOL wasForwarded;  // Indicates whether the message was forwarded or not
jens@17
   463
@property BOOL wasRedirected;  // Indicates whether the message was redirected or not
jens@17
   464
@property BOOL wasRepliedTo;  // Indicates whether the message was replied to or not
jens@17
   465
jens@17
   466
- (void) bounce;  // Bounces a message back to the sender.
jens@17
   467
- (void) delete;  // Delete a message.
jens@17
   468
- (void) duplicateTo:(MailMailbox *)to;  // Copy message(s) and put the copies in the specified mailbox.
jens@17
   469
- (MailOutgoingMessage *) forwardOpeningWindow:(BOOL)openingWindow;  // Creates a forwarded message.
jens@17
   470
- (void) moveTo:(MailMailbox *)to;  // Move message(s) to a new mailbox.
jens@17
   471
- (MailOutgoingMessage *) redirectOpeningWindow:(BOOL)openingWindow;  // Creates a redirected message.
jens@17
   472
- (MailOutgoingMessage *) replyOpeningWindow:(BOOL)openingWindow replyToAll:(BOOL)replyToAll;  // Creates a reply message.
jens@17
   473
jens@17
   474
@end
jens@17
   475
jens@17
   476
// A Mail account for receiving messages (IMAP/POP/.Mac). To create a new receiving account, use the 'pop account', 'imap account', and 'Mac account' objects
jens@17
   477
@interface MailAccount : MailItem
jens@17
   478
jens@17
   479
- (SBElementArray *) mailboxes;
jens@17
   480
jens@17
   481
@property (copy) MailSmtpServer *deliveryAccount;  // The delivery account used when sending mail from this account
jens@17
   482
@property (copy) NSString *name;  // The name of an account
jens@17
   483
@property (copy) NSString *password;  // Password for this account. Can be set, but not read via scripting
jens@17
   484
@property MailExut authentication;  // Preferred authentication scheme for account
jens@17
   485
@property (readonly) MailEtoc accountType;  // The type of an account
jens@17
   486
@property (copy) NSArray *emailAddresses;  // The list of email addresses configured for an account
jens@17
   487
@property (copy) NSString *fullName;  // The users full name configured for an account
jens@17
   488
@property NSInteger emptyJunkMessagesFrequency;  // Number of days before junk messages are deleted (0 = delete on quit, -1 = never delete)
jens@17
   489
@property NSInteger emptySentMessagesFrequency;  // Number of days before archived sent messages are deleted (0 = delete on quit, -1 = never delete)
jens@17
   490
@property NSInteger emptyTrashFrequency;  // Number of days before messages in the trash are permanently deleted (0 = delete on quit, -1 = never delete)
jens@17
   491
@property BOOL emptyJunkMessagesOnQuit;  // Indicates whether the messages in the junk messages mailboxes will be deleted on quit
jens@17
   492
@property BOOL emptySentMessagesOnQuit;  // Indicates whether the messages in the sent messages mailboxes will be deleted on quit
jens@17
   493
@property BOOL emptyTrashOnQuit;  // Indicates whether the messages in deleted messages mailboxes will be permanently deleted on quit
jens@17
   494
@property BOOL enabled;  // Indicates whether the account is enabled or not
jens@17
   495
@property (copy) NSString *userName;  // The user name used to connect to an account
jens@17
   496
@property (copy, readonly) NSURL *accountDirectory;  // The directory where the account stores things on disk
jens@17
   497
@property NSInteger port;  // The port used to connect to an account
jens@17
   498
@property (copy) NSString *serverName;  // The host name used to connect to an account
jens@17
   499
@property BOOL includeWhenGettingNewMail;  // Indicates whether the account will be included when getting new mail
jens@17
   500
@property BOOL moveDeletedMessagesToTrash;  // Indicates whether messages that are deleted will be moved to the trash mailbox
jens@17
   501
@property BOOL usesSsl;  // Indicates whether SSL is enabled for this receiving account
jens@17
   502
jens@17
   503
jens@17
   504
@end
jens@17
   505
jens@17
   506
// An IMAP email account
jens@17
   507
@interface MailImapAccount : MailAccount
jens@17
   508
jens@17
   509
@property BOOL compactMailboxesWhenClosing;  // Indicates whether an IMAP mailbox is automatically compacted when you quit Mail or switch to another mailbox
jens@17
   510
@property MailE9xp messageCaching;  // Message caching setting for this account
jens@17
   511
@property BOOL storeDraftsOnServer;  // Indicates whether drafts will be stored on the IMAP server
jens@17
   512
@property BOOL storeJunkMailOnServer;  // Indicates whether junk mail will be stored on the IMAP server
jens@17
   513
@property BOOL storeSentMessagesOnServer;  // Indicates whether sent messages will be stored on the IMAP server
jens@17
   514
@property BOOL storeDeletedMessagesOnServer;  // Indicates whether deleted messages will be stored on the IMAP server
jens@17
   515
jens@17
   516
jens@17
   517
@end
jens@17
   518
jens@17
   519
// A .Mac email account
jens@17
   520
@interface MailMacAccount : MailImapAccount
jens@17
   521
jens@17
   522
jens@17
   523
@end
jens@17
   524
jens@17
   525
// A POP email account
jens@17
   526
@interface MailPopAccount : MailAccount
jens@17
   527
jens@17
   528
@property NSInteger bigMessageWarningSize;  // If message size (in bytes) is over this amount, Mail will prompt you asking whether you want to download the message (-1 = do not prompt)
jens@17
   529
@property NSInteger delayedMessageDeletionInterval;  // Number of days before messages that have been downloaded will be deleted from the server (0 = delete immediately after downloading)
jens@17
   530
@property BOOL deleteMailOnServer;  // Indicates whether POP account deletes messages on the server after downloading
jens@17
   531
@property BOOL deleteMessagesWhenMovedFromInbox;  // Indicates whether messages will be deleted from the server when moved from your POP inbox
jens@17
   532
jens@17
   533
jens@17
   534
@end
jens@17
   535
jens@17
   536
// An SMTP account (for sending email)
jens@17
   537
@interface MailSmtpServer : MailItem
jens@17
   538
jens@17
   539
@property (copy, readonly) NSString *name;  // The name of an account
jens@17
   540
@property (copy) NSString *password;  // Password for this account. Can be set, but not read via scripting
jens@17
   541
@property (readonly) MailEtoc accountType;  // The type of an account
jens@17
   542
@property MailExut authentication;  // Preferred authentication scheme for account
jens@17
   543
@property BOOL enabled;  // Indicates whether the account is enabled or not
jens@17
   544
@property (copy) NSString *userName;  // The user name used to connect to an account
jens@17
   545
@property NSInteger port;  // The port used to connect to an account
jens@17
   546
@property (copy) NSString *serverName;  // The host name used to connect to an account
jens@17
   547
@property BOOL usesSsl;  // Indicates whether SSL is enabled for this receiving account
jens@17
   548
jens@17
   549
jens@17
   550
@end
jens@17
   551
jens@17
   552
// A mailbox that holds messages
jens@17
   553
@interface MailMailbox : MailItem
jens@17
   554
jens@17
   555
- (SBElementArray *) mailboxes;
jens@17
   556
- (SBElementArray *) messages;
jens@17
   557
jens@17
   558
@property (copy) NSString *name;  // The name of a mailbox
jens@17
   559
@property (readonly) NSInteger unreadCount;  // The number of unread messages in the mailbox
jens@17
   560
@property (copy, readonly) MailAccount *account;
jens@17
   561
@property (copy, readonly) MailMailbox *container;
jens@17
   562
jens@17
   563
jens@17
   564
@end
jens@17
   565
jens@17
   566
// Class for message rules
jens@17
   567
@interface MailRule : MailItem
jens@17
   568
jens@17
   569
- (SBElementArray *) ruleConditions;
jens@17
   570
jens@17
   571
@property MailCclr colorMessage;  // If rule matches, apply this color
jens@17
   572
@property BOOL deleteMessage;  // If rule matches, delete message
jens@17
   573
@property (copy) NSString *forwardText;  // If rule matches, prepend this text to the forwarded message. Set to empty string to include no prepended text
jens@17
   574
@property (copy) NSString *forwardMessage;  // If rule matches, forward message to this address, or multiple addresses, separated by commas. Set to empty string to disable this action
jens@17
   575
@property BOOL markFlagged;  // If rule matches, mark message as flagged
jens@17
   576
@property BOOL markRead;  // If rule matches, mark message as read
jens@17
   577
@property (copy) NSString *playSound;  // If rule matches, play this sound (specify name of sound or path to sound)
jens@17
   578
@property (copy) NSArray *redirectMessage;  // If rule matches, redirect message to this address or multiple addresses, separate by commas. Set to empty string to disable this action
jens@17
   579
@property (copy) NSString *replyText;  // If rule matches, reply to message and prepend with this text. Set to empty string to disable this action
jens@17
   580
@property (copy) NSURL *runScript;  // If rule matches, run this AppleScript.  Set to POSIX path of compiled AppleScript file.  Set to empty string to disable this action
jens@17
   581
@property BOOL allConditionsMustBeMet;  // Indicates whether all conditions must be met for rule to execute
jens@17
   582
@property (copy) MailMailbox *copyMessage;  // If rule matches, copy to this mailbox
jens@17
   583
@property (copy) MailMailbox *moveMessage;  // If rule matches, move to this mailbox
jens@17
   584
@property BOOL highlightTextUsingColor;  // Indicates whether the color will be used to highlight the text or background of a message in the message list
jens@17
   585
@property BOOL enabled;  // Indicates whether the rule is enabled
jens@17
   586
@property (copy) NSString *name;  // Name of rule
jens@17
   587
@property BOOL shouldCopyMessage;  // Indicates whether the rule has a copy action
jens@17
   588
@property BOOL shouldMoveMessage;  // Indicates whether the rule has a transfer action
jens@17
   589
@property BOOL stopEvaluatingRules;  // If rule matches, stop rule evaluation for this message
jens@17
   590
jens@17
   591
jens@17
   592
@end
jens@17
   593
jens@17
   594
// Class for conditions that can be attached to a single rule
jens@17
   595
@interface MailRuleCondition : MailItem
jens@17
   596
jens@17
   597
@property (copy) NSString *expression;  // Rule expression field
jens@17
   598
@property (copy) NSString *header;  // Rule header key
jens@17
   599
@property MailEnrq qualifier;  // Rule qualifier
jens@17
   600
@property MailErut ruleType;  // Rule type
jens@17
   601
jens@17
   602
jens@17
   603
@end
jens@17
   604
jens@17
   605
// An email recipient
jens@17
   606
@interface MailRecipient : MailItem
jens@17
   607
jens@17
   608
@property (copy) NSString *address;  // The recipients email address
jens@17
   609
@property (copy) NSString *name;  // The name used for display
jens@17
   610
jens@17
   611
jens@17
   612
@end
jens@17
   613
jens@17
   614
// An email recipient in the Bcc: field
jens@17
   615
@interface MailBccRecipient : MailRecipient
jens@17
   616
jens@17
   617
jens@17
   618
@end
jens@17
   619
jens@17
   620
// An email recipient in the Cc: field
jens@17
   621
@interface MailCcRecipient : MailRecipient
jens@17
   622
jens@17
   623
jens@17
   624
@end
jens@17
   625
jens@17
   626
// An email recipient in the To: field
jens@17
   627
@interface MailToRecipient : MailRecipient
jens@17
   628
jens@17
   629
jens@17
   630
@end
jens@17
   631
jens@17
   632
// A mailbox that contains other mailboxes.
jens@17
   633
@interface MailContainer : MailMailbox
jens@17
   634
jens@17
   635
jens@17
   636
@end
jens@17
   637
jens@17
   638
// A header value for a message.  E.g. To, Subject, From.
jens@17
   639
@interface MailHeader : MailItem
jens@17
   640
jens@17
   641
@property (copy) NSString *content;  // Contents of the header
jens@17
   642
@property (copy) NSString *name;  // Name of the header value
jens@17
   643
jens@17
   644
jens@17
   645
@end
jens@17
   646
jens@17
   647
// A file attached to a received message.
jens@17
   648
@interface MailMailAttachment : MailItem
jens@17
   649
jens@17
   650
@property (copy, readonly) NSString *name;  // Name of the attachment
jens@17
   651
@property (copy, readonly) NSString *MIMEType;  // MIME type of the attachment E.g. text/plain.
jens@17
   652
@property (readonly) NSInteger fileSize;  // Approximate size in bytes.
jens@17
   653
@property (readonly) BOOL downloaded;  // Indicates whether the attachment has been downloaded.
jens@17
   654
- (NSString *) id;  // The unique identifier of the attachment.
jens@17
   655
jens@17
   656
jens@17
   657
@end
jens@17
   658