]> err.no Git - sope/blob - sope-ical/NGiCal/NGVCard.h
added support for photo types
[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, NGVCardSimpleValue;
60 @class NGVCardPhone, NGVCardAddress;
61
62 @interface NGVCard : NSObject
63 {
64   NSString     *uid;
65   NSString     *version;
66   NSString     *vClass;
67   NSString     *prodID;
68   NSString     *profile;
69   NSString     *source;
70   NSString     *vName;
71   // TODO: 'rev' (datetime)
72
73   NSString     *fn;
74   NSString     *role;
75   NSString     *title;
76   NSString     *bday;
77   NSString     *note;
78
79   NGVCardName  *n;
80   NGVCardOrg   *org;
81   
82   NGVCardStrArrayValue *nickname;
83   NGVCardStrArrayValue *categories;
84   
85   NSArray      *tel;
86   NSArray      *adr;
87   NSArray      *email;
88   NSArray      *label;
89   NSArray      *url;
90   NSArray      *fburl;
91   NSArray      *caluri;
92   NSDictionary *x;
93   
94   NSData       *photo;
95   NSString     *photoType; // an IANA registered name
96 }
97
98 + (NSArray *)parseVCardsFromSource:(id)_src;
99
100 - (id)initWithUid:(NSString *)_uid version:(NSString *)_version;
101
102 /* accessors */
103
104 - (NSString *)version;
105
106 - (void)setUid:(NSString *)_uid;
107 - (NSString *)uid;
108
109 - (void)setVClass:(NSString *)_s;
110 - (NSString *)vClass;
111 - (void)setVName:(NSString *)_s;
112 - (NSString *)vName;
113 - (void)setProdID:(NSString *)_s;
114 - (NSString *)prodID;
115 - (void)setProfile:(NSString *)_s;
116 - (NSString *)profile;
117 - (void)setSource:(NSString *)_s;
118 - (NSString *)source;
119
120 - (void)setFn:(NSString *)_fn;
121 - (NSString *)fn;
122 - (void)setRole:(NSString *)_s;
123 - (NSString *)role;
124 - (void)setTitle:(NSString *)_title;
125 - (NSString *)title;
126 - (void)setBday:(NSString *)_bday;
127 - (NSString *)bday;
128 - (void)setNote:(NSString *)_note;
129 - (NSString *)note;
130
131 - (void)setN:(NGVCardName *)_v;
132 - (NGVCardName *)n;
133 - (void)setOrg:(NGVCardOrg *)_v;
134 - (NGVCardOrg *)org;
135
136 - (void)setNickname:(id)_v;
137 - (NGVCardStrArrayValue *)nickname;
138 - (void)setCategories:(id)_v;
139 - (NGVCardStrArrayValue *)categories;
140
141 - (void)setTel:(NSArray *)_tel;
142 - (NSArray *)tel;
143 - (void)setAdr:(NSArray *)_adr;
144 - (NSArray *)adr;
145 - (void)setEmail:(NSArray *)_array;
146 - (NSArray *)email;
147 - (void)setLabel:(NSArray *)_array;
148 - (NSArray *)label;
149 - (void)setUrl:(NSArray *)_url;
150 - (NSArray *)url;
151
152 - (void)setFreeBusyURL:(NSArray *)_v;
153 - (NSArray *)freeBusyURL;
154 - (void)setCalURI:(NSArray *)_calURI;
155 - (NSArray *)calURI;
156
157 - (void)setX:(NSDictionary *)_dict;
158 - (NSDictionary *)x;
159
160 - (void)setPhoto:(NSData *)_photo;
161 - (NSData *)photo;
162 - (void)setPhotoType:(NSString *)_photoType;
163 - (NSString *)photoType;
164
165 /* convenience */
166
167 - (NGVCardSimpleValue *)preferredEMail;
168 - (NGVCardPhone *)preferredTel;
169 - (NGVCardAddress *)preferredAdr;
170 - (NSString *)photoMimeType;
171
172 @end
173
174 #endif /* __NGiCal_NGVCard_H__ */