Monotone-Parent: 319afea7572a1c632cbea66c88afce13529b51f2
Monotone-Revision: 10b56ee326ca77f71fbe5cb41d30b0640a6fe57a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-13T21:16:46 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
8857a3386e
commit
a4b7893600
|
@ -1,34 +0,0 @@
|
||||||
/* NGVCard+Contact.h - this file is part of SOGo
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 Inverse groupe conseil
|
|
||||||
*
|
|
||||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
||||||
*
|
|
||||||
* 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 NGVCARD_CONTACT_H
|
|
||||||
#define NGVCARD_CONTACT_H
|
|
||||||
|
|
||||||
#import <NGiCal/NGVCard.h>
|
|
||||||
|
|
||||||
@interface NGVCard (SOGOContactExtension)
|
|
||||||
|
|
||||||
- (NSString *) asString;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif /* NGVCARD+CONTACT_H */
|
|
|
@ -1,102 +0,0 @@
|
||||||
/* NGVCard+Contact.m - this file is part of SOGo
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 Inverse groupe conseil
|
|
||||||
*
|
|
||||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
||||||
*
|
|
||||||
* 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 <Foundation/NSArray.h>
|
|
||||||
#import <Foundation/NSString.h>
|
|
||||||
|
|
||||||
#import <NGiCal/NGVCardValue.h>
|
|
||||||
|
|
||||||
#import "NGVCardSimpleValue+Contact.h"
|
|
||||||
#import "NGVCard+Contact.h"
|
|
||||||
|
|
||||||
@implementation NGVCard (SOGOContactExtension)
|
|
||||||
|
|
||||||
- (NSString *) asString
|
|
||||||
{
|
|
||||||
NSMutableString *vCardString;
|
|
||||||
NSArray *infos;
|
|
||||||
unsigned int count, max;
|
|
||||||
|
|
||||||
vCardString = [NSMutableString new];
|
|
||||||
[vCardString autorelease];
|
|
||||||
|
|
||||||
[vCardString appendFormat: @"BEGIN:VCARD\r\n"
|
|
||||||
@"VERSION:%@\r\n"
|
|
||||||
@"PRODID:%@\r\n"
|
|
||||||
@"PROFILE:%@\r\n",
|
|
||||||
[self version], [self prodID], [self profile]];
|
|
||||||
[vCardString appendFormat: @"FN:%@\r\n", [self fn]];
|
|
||||||
[vCardString appendFormat: @"N:%@\r\n", [[self n] stringValue]];
|
|
||||||
|
|
||||||
infos = [self email];
|
|
||||||
if ([infos count] > 0)
|
|
||||||
[vCardString appendFormat: @"EMAIL;TYPE=internet,pref:%@\r\n",
|
|
||||||
[infos objectAtIndex: 0]];
|
|
||||||
|
|
||||||
infos = [self tel];
|
|
||||||
max = [infos count];
|
|
||||||
for (count = 0; count < max; count++)
|
|
||||||
[vCardString appendFormat: @"%@\r\n",
|
|
||||||
[[infos objectAtIndex: count] vCardEntryString]];
|
|
||||||
|
|
||||||
// }
|
|
||||||
// count =
|
|
||||||
// if ([infos count] > 0)
|
|
||||||
// [vCardString appendFormat: @"EMAIL;TYPE=internet,pref:%@\r\n",
|
|
||||||
// [infos objectAtIndex: 0]];
|
|
||||||
|
|
||||||
// [self _appendArrayedVCardValues:
|
|
||||||
// [NSArray arrayWithObjects: @"sn", @"givenName", nil]
|
|
||||||
// withFormat: @"N:%@;;;\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
// [self _appendSingleVCardValue: @"telephoneNumber"
|
|
||||||
// withFormat: @"TEL;TYPE=work,voice,pref:%@\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
// [self _appendSingleVCardValue: @"facsimileTelephoneNumber"
|
|
||||||
// withFormat: @"TEL;TYPE=work,fax:%@\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
// [self _appendSingleVCardValue: @"homeTelephoneNumber"
|
|
||||||
// withFormat: @"TEL;TYPE=home,voice:%@\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
// [self _appendSingleVCardValue: @"mobile"
|
|
||||||
// withFormat: @"TEL;TYPE=cell,voice:%@\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
// [self _appendArrayedVCardValues:
|
|
||||||
// [NSArray arrayWithObjects: @"l", @"departmentNumber", nil]
|
|
||||||
// withFormat: @"ORG:%@\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
// [self _appendMultilineVCardValue: @"postalAddress"
|
|
||||||
// withFormat: @"ADR:TYPE=work,postal:%@\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
// [self _appendMultilineVCardValue: @"homePostalAddress"
|
|
||||||
// withFormat: @"ADR:TYPE=home,postal:%@\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
// [self _appendSingleVCardValue: @"labelledURI"
|
|
||||||
// withFormat: @"URL:%@\r\n"
|
|
||||||
// toVCard: vCardString];
|
|
||||||
|
|
||||||
[vCardString appendString: @"END:VCARD\r\n"];
|
|
||||||
|
|
||||||
return vCardString;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
|
@ -1,34 +0,0 @@
|
||||||
/* NGVCardSimpleValue+Contact.h - this file is part of SOGo
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 Inverse groupe conseil
|
|
||||||
*
|
|
||||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
||||||
*
|
|
||||||
* 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 <NGiCal/NGVCardSimpleValue.h>
|
|
||||||
|
|
||||||
@interface NGVCardSimpleValue (SOGoContact)
|
|
||||||
|
|
||||||
- (NSString *) vCardEntryString;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif /* NGVCARDSIMPLEVALUE_CONTACT_H */
|
|
|
@ -1,43 +0,0 @@
|
||||||
/* NGVCardSimpleValue+Contact.m - this file is part of SOGo
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 Inverse groupe conseil
|
|
||||||
*
|
|
||||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
||||||
*
|
|
||||||
* 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 <Foundation/NSArray.h>
|
|
||||||
|
|
||||||
#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
|
|
Loading…
Reference in New Issue