]> err.no Git - sope/blob - sope-ical/NGiCal/NGVCard.h
finishing touches on the vcard parser
[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 @class NGVCardStrArrayValue, NGVCardOrg, NGVCardName;
60
61 @interface NGVCard : NSObject
62 {
63   NSString     *uid;
64   NSString     *version;
65   NSString     *vClass;
66   NSString     *prodID;
67   // TODO: 'rev' (datetime)
68
69   NSString     *fn;
70   NSString     *role;
71   NSString     *title;
72   NSString     *bday;
73   NSString     *note;
74
75   NGVCardName  *n;
76   NGVCardOrg   *org;
77   
78   NGVCardStrArrayValue *nickname;
79   NGVCardStrArrayValue *categories;
80   
81   NSArray      *tel;
82   NSArray      *adr;
83   NSArray      *email;
84   NSArray      *label;
85   NSArray      *url;
86   NSArray      *fburl;
87   NSArray      *caluri;
88   NSDictionary *x;
89 }
90
91 + (NSArray *)parseVCardsFromSource:(id)_src;
92
93 - (id)initWithUid:(NSString *)_uid version:(NSString *)_version;
94
95 /* accessors */
96
97 - (NSString *)version;
98
99 - (void)setUid:(NSString *)_uid;
100 - (NSString *)uid;
101
102 - (void)setVClass:(NSString *)_s;
103 - (NSString *)vClass;
104 - (void)setProdID:(NSString *)_s;
105 - (NSString *)prodID;
106
107 - (void)setFn:(NSString *)_fn;
108 - (NSString *)fn;
109 - (void)setRole:(NSString *)_s;
110 - (NSString *)role;
111 - (void)setTitle:(NSString *)_title;
112 - (NSString *)title;
113 - (void)setBday:(NSString *)_bday;
114 - (NSString *)bday;
115 - (void)setNote:(NSString *)_note;
116 - (NSString *)note;
117
118 - (void)setN:(NGVCardName *)_v;
119 - (NGVCardName *)n;
120 - (void)setOrg:(NGVCardOrg *)_v;
121 - (NGVCardOrg *)org;
122
123 - (void)setNickname:(id)_v;
124 - (NGVCardStrArrayValue *)nickname;
125 - (void)setCategories:(id)_v;
126 - (NGVCardStrArrayValue *)categories;
127
128 - (void)setTel:(NSArray *)_tel;
129 - (NSArray *)tel;
130 - (void)setAdr:(NSArray *)_adr;
131 - (NSArray *)adr;
132 - (void)setEmail:(NSArray *)_array;
133 - (NSArray *)email;
134 - (void)setLabel:(NSArray *)_array;
135 - (NSArray *)label;
136 - (void)setUrl:(NSArray *)_url;
137 - (NSArray *)url;
138
139 - (void)setFreeBusyURL:(NSArray *)_v;
140 - (NSArray *)freeBusyURL;
141 - (void)setCalURI:(NSArray *)_calURI;
142 - (NSArray *)calURI;
143
144 - (void)setX:(NSDictionary *)_dict;
145 - (NSDictionary *)x;
146
147 @end
148
149 #endif /* __NGiCal_NGVCard_H__ */