2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
22 #include "NGImap4MessageGlobalID.h"
25 @implementation NGImap4MessageGlobalID
27 + (id)imap4MessageGlobalIDWithFolderGlobalID:(EOGlobalID *)_gid
28 andUid:(unsigned int)_uid
30 NGImap4MessageGlobalID *gid;
32 gid = [[self alloc] initWithFolderGlobalID:_gid andUid:_uid];
33 return [gid autorelease];
36 - (id)initWithFolderGlobalID:(EOGlobalID *)_gid andUid:(unsigned int)_uid {
37 if ((self = [super init])) {
38 self->folderGlobalID = [_gid retain];
44 return [self initWithFolderGlobalID:nil andUid:0];
48 [self->folderGlobalID release];
54 - (EOGlobalID *)folderGlobalID {
55 return self->folderGlobalID;
67 - (BOOL)isEqualToImap4MessageGlobalID:(NGImap4MessageGlobalID *)_other {
72 if (self->uid != _other->uid)
75 return (self->folderGlobalID == _other->folderGlobalID)
77 : [self->folderGlobalID isEqual:_other->folderGlobalID];
80 - (BOOL)isEqual:(id)_otherObject {
81 if (_otherObject == self)
83 if (![_otherObject isKindOfClass:[self class]])
86 return [self isEqualToImap4MessageGlobalID:_otherObject];
91 - (id)copyWithZone:(NSZone *)_zone {
95 /* compatibility to some older stuff */
97 - (NSString *)entityName {
98 return @"NGImap4Message";
101 // TODO: emulate EOKeyGlobalID
103 @end /* NGImap4MessageGlobalID */