]> err.no Git - sope/commitdiff
added some properties
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 9 May 2005 23:33:03 +0000 (23:33 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 9 May 2005 23:33:03 +0000 (23:33 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@808 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-ical/NGiCal/ChangeLog
sope-ical/NGiCal/NGVCard.h
sope-ical/NGiCal/NGVCard.m
sope-ical/NGiCal/NGVCardSaxHandler.m

index c63ba0044b019314a738a3324ce6c5e681af8e64..8f20a7fdef4c0e4264c4e354be8b6251cbc39bbf 100644 (file)
@@ -1,3 +1,7 @@
+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)
index a5d8a4023dbe520bc173df12038d175bc5b66d71..82e689e1dbfd2b518d3efb5d880e7bb9595be607 100644 (file)
@@ -64,6 +64,9 @@
   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;
index 2aace43a9e456e94273e6d77668b44db436ac4d8..783918cf8efc2ee965b16f8a414f8ae4b86e6d86 100644 (file)
@@ -77,6 +77,9 @@ static NGVCardSaxHandler         *sax   = nil; // THREAD
 }
 
 - (void)dealloc {
+  [self->profile    release];
+  [self->source     release];
+  [self->vName      release];
   [self->n          release];
   [self->org        release];
   [self->nickname   release];
@@ -121,6 +124,13 @@ static NGVCardSaxHandler         *sax   = nil; // THREAD
   return self->vClass;
 }
 
+- (void)setVName:(NSString *)_value {
+  ASSIGNCOPY(self->vName, _value);
+}
+- (NSString *)vName {
+  return self->vName;
+}
+
 - (void)setProdID:(NSString *)_prodID {
   ASSIGNCOPY(self->prodID, _prodID);
 }
@@ -128,6 +138,20 @@ static NGVCardSaxHandler         *sax   = nil; // THREAD
   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);
 }
index aec3c3d4c57fb7f32f15d8f43f2908a99fe51419..b169e2ed3933ce7150fa994c5d92685ec18391b5 100644 (file)
        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)