2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include "NGImap4MessageGlobalID.h"
26 @implementation NGImap4MessageGlobalID
28 + (id)imap4MessageGlobalIDWithFolderGlobalID:(EOGlobalID *)_gid
29 andUid:(unsigned int)_uid
31 NGImap4MessageGlobalID *gid;
33 gid = [[self alloc] initWithFolderGlobalID:_gid andUid:_uid];
34 return [gid autorelease];
37 - (id)initWithFolderGlobalID:(EOGlobalID *)_gid andUid:(unsigned int)_uid {
38 if ((self = [super init])) {
39 self->folderGlobalID = [_gid retain];
45 return [self initWithFolderGlobalID:nil andUid:0];
49 [self->folderGlobalID release];
55 - (EOGlobalID *)folderGlobalID {
56 return self->folderGlobalID;
68 - (BOOL)isEqualToImap4MessageGlobalID:(NGImap4MessageGlobalID *)_other {
73 if (self->uid != _other->uid)
76 return (self->folderGlobalID == _other->folderGlobalID)
78 : [self->folderGlobalID isEqual:_other->folderGlobalID];
81 - (BOOL)isEqual:(id)_otherObject {
82 if (_otherObject == self)
84 if (![_otherObject isKindOfClass:[self class]])
87 return [self isEqualToImap4MessageGlobalID:_otherObject];
92 - (id)copyWithZone:(NSZone *)_zone {
96 /* compatibility to some older stuff */
98 - (NSString *)entityName {
99 return @"NGImap4Message";
102 // TODO: emulate EOKeyGlobalID
104 @end /* NGImap4MessageGlobalID */