From 046fd5c270c07284c82736a68346cfe09a28d4e1 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 4 Aug 2006 22:49:24 +0000 Subject: [PATCH] Monotone-Parent: 91dd6d07cd2a752896f5efd6ce493656b0ec13ea Monotone-Revision: c5bd8349d3bd533853811e2ced9d7a0f040f66e8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-04T22:49:24 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 ++ SoObjects/Contacts/SOGoPersonalAB.h | 42 +++++++++++++++++ SoObjects/Contacts/SOGoPersonalAB.m | 72 +++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 SoObjects/Contacts/SOGoPersonalAB.h create mode 100644 SoObjects/Contacts/SOGoPersonalAB.m diff --git a/ChangeLog b/ChangeLog index 4756d20bd..ac9c43f3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-08-04 Wolfgang Sourdeau + * SoObjects/Contacts/SOGoPersonalAB.[hm]: new class module + implementing the SOGoContactSource protocol. Does nothing + currently but will be used to implement access to the personal + address book of the user stored in the SOGo database. + * SoObjects/Contacts/SOGoContactSource.h: new "SOGoContactSource" protocol defining an API common to all possible types of contact sources. diff --git a/SoObjects/Contacts/SOGoPersonalAB.h b/SoObjects/Contacts/SOGoPersonalAB.h new file mode 100644 index 000000000..e0a36d72c --- /dev/null +++ b/SoObjects/Contacts/SOGoPersonalAB.h @@ -0,0 +1,42 @@ +/* SOGoPersonalAB.h - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file 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, or (at your option) + * any later version. + * + * This file 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; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef SOGOPERSONALAB_H +#define SOGOPERSONALAB_H + +#import "SOGoContactSource.h" + +@class NSObject; +@class NSString; + +@interface SOGoPersonalAB : NSObject +{ + NSString *username; +} + ++ (id) personalABForUser: (NSString *) user; + +- (void) setUsername: (NSString *) user; + +@end + +#endif /* SOGOPERSONALAB_H */ diff --git a/SoObjects/Contacts/SOGoPersonalAB.m b/SoObjects/Contacts/SOGoPersonalAB.m new file mode 100644 index 000000000..aecc60374 --- /dev/null +++ b/SoObjects/Contacts/SOGoPersonalAB.m @@ -0,0 +1,72 @@ +/* SOGoPersonalAB.m - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file 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, or (at your option) + * any later version. + * + * This file 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; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +#import "SOGoPersonalAB.h" + +@implementation SOGoPersonalAB + ++ (id) personalABForUser: (NSString *) user +{ + id newAB; + + newAB = [self new]; + [newAB setUsername: user]; + + return newAB; +} + +- (id) init +{ + if ((self = [super init])) + { + username = nil; + } + + return self; +} + +- (void) dealloc +{ + if (username) + [username release]; + [super dealloc]; +} + +- (void) setUsername: (NSString *) user +{ + if (username) + [username release]; + username = user; + if (username) + [username retain]; +} + +- (SOGoContactRecord *) lookupRecordWithId: (NSString *) recordId +{ + NSLog (@"returning nothing for '%@'", recordId); + + return nil; +} + +@end