From 3ef76c0b8ca7e8356a4c3fa1d5c1f7db5d84699d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 9 Aug 2006 21:15:49 +0000 Subject: [PATCH] Monotone-Parent: 9ddb8a8c0200ef2ba32370aff1ace4928f5fad1c Monotone-Revision: 303ddd8a8e16f590ab977483cbbff96e6bc504b8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-09T21:15:49 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++ .../Contacts/NGVCardSimpleValue+Contact.h | 34 +++++++++++++++ .../Contacts/NGVCardSimpleValue+Contact.m | 43 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 SoObjects/Contacts/NGVCardSimpleValue+Contact.h create mode 100644 SoObjects/Contacts/NGVCardSimpleValue+Contact.m diff --git a/ChangeLog b/ChangeLog index c2bffab6d..6120cb53d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2006-08-09 Wolfgang Sourdeau + * SoObjects/Contacts/NGVCardSimpleValue+Contact.m + ([NGVCardSimpleValue -vCardEntryString]): generates the correct + entry for the textual representation of the vCard. + + * SoObjects/Contacts/NGVCardSimpleValue+Contact.[hm]: new class + extension. + * SoObjects/Contacts/SOGoContactGCSEntry.[hm]: new module name of "SOGoContactObject". diff --git a/SoObjects/Contacts/NGVCardSimpleValue+Contact.h b/SoObjects/Contacts/NGVCardSimpleValue+Contact.h new file mode 100644 index 000000000..dc627a413 --- /dev/null +++ b/SoObjects/Contacts/NGVCardSimpleValue+Contact.h @@ -0,0 +1,34 @@ +/* NGVCardSimpleValue+Contact.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 NGVCARDSIMPLEVALUE_CONTACT_H +#define NGVCARDSIMPLEVALUE_CONTACT_H + +#import + +@interface NGVCardSimpleValue (SOGoContact) + +- (NSString *) vCardEntryString; + +@end + +#endif /* NGVCARDSIMPLEVALUE_CONTACT_H */ diff --git a/SoObjects/Contacts/NGVCardSimpleValue+Contact.m b/SoObjects/Contacts/NGVCardSimpleValue+Contact.m new file mode 100644 index 000000000..79e07049f --- /dev/null +++ b/SoObjects/Contacts/NGVCardSimpleValue+Contact.m @@ -0,0 +1,43 @@ +/* NGVCardSimpleValue+Contact.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 "NGVCardSimpleValue+Contact.h" + +@implementation NGVCardSimpleValue (SOGoContact) + +- (NSString *) vCardEntryString +{ + NSMutableString *string; + NSArray *data; + + string = [NSMutableString stringWithFormat: @"%@", [self group]]; + data = [self types]; + if ([data count] > 0) + [string appendFormat: @";TYPE=%@", [data componentsJoinedByString: @","]]; + [string appendFormat: @":%@", value]; + + return string; +} + +@end