]> err.no Git - sope/blob - sope-ical/NGiCal/NGVCard.h
more work on vCard parsing
[sope] / sope-ical / NGiCal / NGVCard.h
1 /*
2   Copyright (C) 2005 Helge Hess
3
4   This file is part of SOPE.
5
6   SOPE is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with SOPE; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #ifndef __NGiCal_NGVCard_H__
23 #define __NGiCal_NGVCard_H__
24
25 #import <Foundation/NSObject.h>
26
27 /*
28   NGVCard
29   
30   Represents a vCard object.
31
32   XML DTD in Dawson-03 Draft:
33     <!ELEMENT vCard      (%prop.man;, (%prop.opt;)*)>
34     
35     <!ATTLIST vCard
36             %attr.lang;
37             xmlns     CDATA #FIXED 
38         'http://www.ietf.org/internet-drafts/draft-dawson-vcard-xml-dtd-02.txt'
39             xmlns:vcf CDATA #FIXED 
40         'http://www.ietf.org/internet-drafts/draft-dawson-vcard-xml-dtd-02.txt'
41             version   CDATA #REQUIRED
42             rev       CDATA #IMPLIED
43             uid       CDATA #IMPLIED
44             prodid    CDATA #IMPLIED
45             class (PUBLIC | PRIVATE | CONFIDENTIAL) "PUBLIC"
46             value NOTATION (VCARD) #IMPLIED>
47     <!-- version - Must be "3.0" if document conforms to this spec -->
48     <!-- rev - ISO 8601 formatted date or date/time string -->
49     <!-- uid - UID associated with the object described by the vCard -->
50     <!-- prodid - ISO 9070 FPI for product that generated vCard -->
51     <!-- class - Security classification for vCard information -->
52   
53   Mandatory elements:
54     n
55     fn
56 */
57
58 @class NSString, NSArray, NSDictionary;
59
60 @interface NGVCard : NSObject
61 {
62   NSString     *uid;
63   NSString     *version;
64   NSString     *vClass;
65   NSString     *prodID;
66   // TODO: 'rev' (datetime)
67   
68   NSArray      *tel;
69   NSArray      *adr;
70   NSArray      *email;
71   NSArray      *label;
72   NSDictionary *x;
73 }
74
75 + (NSArray *)parseVCardsFromSource:(id)_src;
76
77 - (id)initWithUid:(NSString *)_uid version:(NSString *)_version;
78
79 /* accessors */
80
81 - (NSString *)version;
82
83 - (void)setUid:(NSString *)_uid;
84 - (NSString *)uid;
85
86 - (void)setVClass:(NSString *)_s;
87 - (NSString *)vClass;
88 - (void)setProdID:(NSString *)_s;
89 - (NSString *)prodID;
90
91 - (void)setTel:(NSArray *)_tel;
92 - (NSArray *)tel;
93 - (void)setAdr:(NSArray *)_adr;
94 - (NSArray *)adr;
95 - (void)setEmail:(NSArray *)_array;
96 - (NSArray *)email;
97 - (void)setLabel:(NSArray *)_array;
98 - (NSArray *)label;
99
100 - (void)setX:(NSDictionary *)_dict;
101 - (NSDictionary *)x;
102
103 @end
104
105 #endif /* __NGiCal_NGVCard_H__ */