/* Copyright (C) 2004 SKYRIX Software AG This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. OGo 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with OGo; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "NGImap4Envelope.h" #include "NGImap4EnvelopeAddress.h" #include "imCommon.h" @implementation NGImap4Envelope - (void)dealloc { [self->date release]; [self->subject release]; [self->inReplyTo release]; [self->msgId release]; [self->from release]; [self->sender release]; [self->replyTo release]; [self->to release]; [self->cc release]; [self->bcc release]; [super dealloc]; } /* accessors */ - (NSCalendarDate *)date { return self->date; } - (id)subject { return self->subject; } - (NSString *)inReplyTo { return self->inReplyTo; } - (NSString *)messageID { return self->msgId; } - (NGImap4EnvelopeAddress *)from { return self->from; } - (NGImap4EnvelopeAddress *)sender { return self->sender; } - (NGImap4EnvelopeAddress *)replyTo { return self->replyTo; } - (NSArray *)to { return self->to; } - (NSArray *)cc { return self->cc; } - (NSArray *)bcc { return self->bcc; } /* derived accessors */ - (BOOL)hasTo { return [self->to count] > 0 ? YES : NO; } - (BOOL)hasCC { return [self->cc count] > 0 ? YES : NO; } - (BOOL)hasBCC { return [self->bcc count] > 0 ? YES : NO; } /* description */ - (NSString *)description { NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; if (self->date) [ms appendFormat:@" date='%@'", self->date]; if (self->subject) [ms appendFormat:@" subject='%@'", self->subject]; if (self->msgId) [ms appendFormat:@" msgid='%@'", self->msgId]; if (self->inReplyTo) [ms appendFormat:@" inreplyto='%@'", self->inReplyTo]; if (self->from) [ms appendFormat:@" from=%@", [self->from email]]; if (self->sender) [ms appendFormat:@" sender=%@", [self->sender email]]; if (self->to) [ms appendFormat:@" to=%@", self->to]; if (self->cc) [ms appendFormat:@" cc=%@", self->cc]; if (self->bcc) [ms appendFormat:@" bcc=%@", self->bcc]; [ms appendString:@">"]; return ms; } @end /* NGImap4Envelope */