/*
** MessageComposition.m
**
** Copyright (c) 2001, 2002, 2003 Ujwal S. Sathyam
**
** Author: Ujwal S. Sathyam
**
** Description: Scriptable class that works with an EditWindowController
** and a Message.
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see .
*/
#include "MessageComposition.h"
#include "Constants.h"
#include "GNUMail.h"
#include "EditWindowController.h"
#include "ExtendedTextView.h"
#include "Utilities.h"
#include
#include
#include
NSString *NSOperationNotSupportedForKeyException = @"NSOperationNotSupportedForKeyException";
//
//
//
@implementation MessageComposition
- (id) init
{
self = [super init];
if (self != nil)
{
_recipients = [[NSMutableArray allocWithZone:[self zone]] init];
_attachments = [[NSMutableArray allocWithZone:[self zone]] init];
}
// NSLog(@"Initialized message 0x%x", self);
return self;
}
//
//
//
- (void) dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_author release];
[_content release];
[_subject release];
[_recipients release];
[_attachments release];
[_account release];
[super dealloc];
}
//
//
//
- (NSArray *) recipientsWithClass: (Class) theClass
{
NSArray *recipients = [self recipients];
NSMutableArray *result = [NSMutableArray array];
unsigned i, c = [recipients count];
id curRecipient;
for (i=0; i