+2005-05-10 Helge Hess <helge.hess@opengroupware.org>
+
+ * NGVCard.m: added support for profile, source, name (v4.5.45)
+
2005-05-09 Helge Hess <helge.hess@opengroupware.org>
* first version of working vCard SAX handler (v4.5.54)
NSString *version;
NSString *vClass;
NSString *prodID;
+ NSString *profile;
+ NSString *source;
+ NSString *vName;
// TODO: 'rev' (datetime)
NSString *fn;
- (void)setVClass:(NSString *)_s;
- (NSString *)vClass;
+- (void)setVName:(NSString *)_s;
+- (NSString *)vName;
- (void)setProdID:(NSString *)_s;
- (NSString *)prodID;
+- (void)setProfile:(NSString *)_s;
+- (NSString *)profile;
+- (void)setSource:(NSString *)_s;
+- (NSString *)source;
- (void)setFn:(NSString *)_fn;
- (NSString *)fn;
}
- (void)dealloc {
+ [self->profile release];
+ [self->source release];
+ [self->vName release];
[self->n release];
[self->org release];
[self->nickname release];
return self->vClass;
}
+- (void)setVName:(NSString *)_value {
+ ASSIGNCOPY(self->vName, _value);
+}
+- (NSString *)vName {
+ return self->vName;
+}
+
- (void)setProdID:(NSString *)_prodID {
ASSIGNCOPY(self->prodID, _prodID);
}
return self->prodID;
}
+- (void)setProfile:(NSString *)_value {
+ ASSIGNCOPY(self->profile, _value);
+}
+- (NSString *)profile {
+ return self->profile;
+}
+
+- (void)setSource:(NSString *)_value {
+ ASSIGNCOPY(self->source, _value);
+}
+- (NSString *)source {
+ return self->source;
+}
+
- (void)setFn:(NSString *)_fn {
ASSIGNCOPY(self->fn, _fn);
}
andAddTo:self->fburl];
}
+/* OGo?? tags */
+
+- (void)startProfile:(id<SaxAttributes>)_attrs {
+ [self startCollectingContent];
+}
+- (void)endProfile {
+ [self->vCard setProfile:[self finishCollectingContent]];
+}
+
+- (void)startSource:(id<SaxAttributes>)_attrs {
+ [self startCollectingContent];
+}
+- (void)endSource {
+ [self->vCard setSource:[self finishCollectingContent]];
+}
+
+- (void)startName:(id<SaxAttributes>)_attrs {
+ [self startCollectingContent];
+}
+- (void)endName {
+ [self->vCard setVName:[self finishCollectingContent]];
+}
+
/* element events */
[self startFN:_attrs];
else if (c0 == 'g' && [_localName isEqualToString:@"geo"])
[self startGeo];
+ // TODO: following are generated by LSAddress, but not in spec?
+ else if (c0 == 'P' && [_localName isEqualToString:@"PROFILE"])
+ [self startProfile:_attrs];
+ else if (c0 == 'S' && [_localName isEqualToString:@"SOURCE"])
+ [self startSource:_attrs];
+ else if (c0 == 'N' && [_localName isEqualToString:@"NAME"])
+ [self startName:_attrs];
else {
if (self->vcs.isInN || self->vcs.isInOrg || self->vcs.isInAdr ||
self->vcs.isInGeo)
[self endFN];
else if (c0 == 'g' && [_localName isEqualToString:@"geo"])
[self endGeo];
+ else if (c0 == 'P' && [_localName isEqualToString:@"PROFILE"])
+ [self endProfile];
+ else if (c0 == 'S' && [_localName isEqualToString:@"SOURCE"])
+ [self endSource];
+ else if (c0 == 'N' && [_localName isEqualToString:@"NAME"])
+ [self endName];
else {
if (self->vcs.isInN || self->vcs.isInOrg || self->vcs.isInAdr ||
self->vcs.isInGeo)