1 /*======================================================================
2 FILE: ICalProperty.java
3 CREATOR: gnorman 01/09/02
4 (C) COPYRIGHT 2002, Critical Path
5 ======================================================================*/
7 package net.cp.jlibical;
9 public class ICalProperty
11 /** It's not typesafe, but it's simple to understand! */
12 public interface ICalPropertyMethod
14 // icalproperty_method
15 int ICAL_METHOD_X = 10011;
16 int ICAL_METHOD_PUBLISH = 10012;
17 int ICAL_METHOD_REQUEST = 10013;
18 int ICAL_METHOD_REPLY = 10014;
19 int ICAL_METHOD_ADD = 10015;
20 int ICAL_METHOD_CANCEL = 10016;
21 int ICAL_METHOD_REFRESH = 10017;
22 int ICAL_METHOD_COUNTER = 10018;
23 int ICAL_METHOD_DECLINECOUNTER = 10019;
24 int ICAL_METHOD_CREATE = 10020;
25 int ICAL_METHOD_READ = 10021;
26 int ICAL_METHOD_RESPONSE = 10022;
27 int ICAL_METHOD_MOVE = 10023;
28 int ICAL_METHOD_MODIFY = 10024;
29 int ICAL_METHOD_GENERATEUID = 10025;
30 int ICAL_METHOD_DELETE = 10026;
31 int ICAL_METHOD_NONE = 10027;
34 /** It's not typesafe, but it's simple to understand! */
35 public interface ICalPropertyAction
37 // icalproperty_action
38 int ICAL_ACTION_X = 10000;
39 int ICAL_ACTION_AUDIO = 10001;
40 int ICAL_ACTION_DISPLAY = 10002;
41 int ICAL_ACTION_EMAIL = 10003;
42 int ICAL_ACTION_PROCEDURE = 10004;
43 int ICAL_ACTION_NONE = 10005;
46 /** It's not typesafe, but it's simple to understand! */
47 public interface ICalPropertyKind
50 int ICAL_ANY_PROPERTY = 0;
51 int ICAL_ACTION_PROPERTY=1;
52 int ICAL_ALLOWCONFLICT_PROPERTY=2;
53 int ICAL_ATTACH_PROPERTY=3;
54 int ICAL_ATTENDEE_PROPERTY=4;
55 int ICAL_CALID_PROPERTY=5;
56 int ICAL_CALMASTER_PROPERTY=6;
57 int ICAL_CALSCALE_PROPERTY=7;
58 int ICAL_CARID_PROPERTY=8;
59 int ICAL_CATEGORIES_PROPERTY=9;
60 int ICAL_CLASS_PROPERTY=10;
61 int ICAL_COMMENT_PROPERTY=11;
62 int ICAL_COMPLETED_PROPERTY=12;
63 int ICAL_CONTACT_PROPERTY=13;
64 int ICAL_CREATED_PROPERTY=14;
65 int ICAL_DATEFORMAT_PROPERTY=15;
66 int ICAL_DECREED_PROPERTY=16;
67 int ICAL_DEFAULTCHARSET_PROPERTY=17;
68 int ICAL_DEFAULTLOCALE_PROPERTY=18;
69 int ICAL_DEFAULTTZID_PROPERTY=19;
70 int ICAL_DESCRIPTION_PROPERTY=20;
71 int ICAL_DTEND_PROPERTY=21;
72 int ICAL_DTSTAMP_PROPERTY=22;
73 int ICAL_DTSTART_PROPERTY=23;
74 int ICAL_DUE_PROPERTY=24;
75 int ICAL_DURATION_PROPERTY=25;
76 int ICAL_EXDATE_PROPERTY=26;
77 int ICAL_EXPAND_PROPERTY=27;
78 int ICAL_EXRULE_PROPERTY=28;
79 int ICAL_FREEBUSY_PROPERTY=29;
80 int ICAL_GEO_PROPERTY=30;
81 int ICAL_GRANT_PROPERTY=31;
82 int ICAL_LASTMODIFIED_PROPERTY=32;
83 int ICAL_LOCATION_PROPERTY=33;
84 int ICAL_MAXRESULTS_PROPERTY=34;
85 int ICAL_MAXRESULTSSIZE_PROPERTY=35;
86 int ICAL_METHOD_PROPERTY=36;
87 int ICAL_ORGANIZER_PROPERTY=37;
88 int ICAL_OWNER_PROPERTY=38;
89 int ICAL_PERCENTCOMPLETE_PROPERTY=39;
90 int ICAL_PRIORITY_PROPERTY=40;
91 int ICAL_PRODID_PROPERTY=41;
92 int ICAL_QUERY_PROPERTY=42;
93 int ICAL_QUERYNAME_PROPERTY=43;
94 int ICAL_RDATE_PROPERTY=44;
95 int ICAL_RECURRENCEID_PROPERTY=45;
96 int ICAL_RELATEDTO_PROPERTY=46;
97 int ICAL_RELCALID_PROPERTY=47;
98 int ICAL_REPEAT_PROPERTY=48;
99 int ICAL_REQUESTSTATUS_PROPERTY=49;
100 int ICAL_RESOURCES_PROPERTY=50;
101 int ICAL_RRULE_PROPERTY=51;
102 int ICAL_SCOPE_PROPERTY=52;
103 int ICAL_SEQUENCE_PROPERTY=53;
104 int ICAL_STATUS_PROPERTY=54;
105 int ICAL_SUMMARY_PROPERTY=55;
106 int ICAL_TARGET_PROPERTY=56;
107 int ICAL_TIMEFORMAT_PROPERTY=57;
108 int ICAL_TRANSP_PROPERTY=58;
109 int ICAL_TRIGGER_PROPERTY=59;
110 int ICAL_TZID_PROPERTY=60;
111 int ICAL_TZNAME_PROPERTY=61;
112 int ICAL_TZOFFSETFROM_PROPERTY=62;
113 int ICAL_TZOFFSETTO_PROPERTY=63;
114 int ICAL_TZURL_PROPERTY=64;
115 int ICAL_UID_PROPERTY=65;
116 int ICAL_URL_PROPERTY=66;
117 int ICAL_VERSION_PROPERTY=67;
118 int ICAL_X_PROPERTY=68;
119 int ICAL_XLICCLASS_PROPERTY=69;
120 int ICAL_XLICCLUSTERCOUNT_PROPERTY=70;
121 int ICAL_XLICERROR_PROPERTY=71;
122 int ICAL_XLICMIMECHARSET_PROPERTY=72;
123 int ICAL_XLICMIMECID_PROPERTY=73;
124 int ICAL_XLICMIMECONTENTTYPE_PROPERTY=74;
125 int ICAL_XLICMIMEENCODING_PROPERTY=75;
126 int ICAL_XLICMIMEFILENAME_PROPERTY=76;
127 int ICAL_XLICMIMEOPTINFO_PROPERTY=77;
128 int ICAL_NO_PROPERTY=78;
131 public interface ICalPropertyStatus
133 // icalproperty_status
134 int ICAL_STATUS_X = 10028;
135 int ICAL_STATUS_TENTATIVE = 10029;
136 int ICAL_STATUS_CONFIRMED = 10030;
137 int ICAL_STATUS_COMPLETED = 10031;
138 int ICAL_STATUS_NEEDSACTION = 10032;
139 int ICAL_STATUS_CANCELLED = 10033;
140 int ICAL_STATUS_INPROCESS = 10034;
141 int ICAL_STATUS_DRAFT = 10035;
142 int ICAL_STATUS_FINAL = 10036;
143 int ICAL_STATUS_NONE = 10037;
147 * Constructor for ICalProperty
148 * @param obj c++ pointer
150 private ICalProperty(long obj)
155 public ICalProperty()
160 public ICalProperty(String str)
165 public ICalProperty(/* ICalPropertyKind */ int kind)
170 public native String as_ical_string();
171 public native /* ICalPropertyKind */ int isa();
172 public native boolean isa_property(Object property);
174 public native void add_parameter(ICalParameter parameter);
175 public native void set_parameter(ICalParameter parameter);
176 public native void set_parameter_from_string(String name, String val);
177 public native String get_parameter_as_string(String name);
178 public native void remove_parameter(/* ICalParameterKind */ int kind);
179 public native int count_parameters();
181 /* Iterate through the parameters */
182 public native ICalParameter get_first_parameter(/* ICalParameterKind */ int kind);
183 public native ICalParameter get_next_parameter(/* ICalParameterKind */ int kind);
185 /* Access the value of the property */
186 public native void set_value(ICalValue val);
187 public native void set_value_from_string(String val, String kind);
189 public native ICalValue get_value();
190 public native String get_value_as_string();
192 /* Return the name of the property -- the type name converted to a
193 String, or the value of get_x_name if the type is X property
195 public native String get_name();
197 /* Deal with X properties */
198 //static void set_x_name(ICalProperty prop, String name);
199 //static String get_x_name(ICalProperty prop);
201 //public native static /* ICalValueKind */ int icalparameter_value_to_value_kind(/* ICalParameterValue */ int val);
203 /* Convert kinds to String and get default value type */
204 //public native static /* ICalValueKind */ int kind_to_value_kind(/* ICalPropertyKind */ int kind);
205 //public native static /* ICalValueKind */ int value_kind_to_kind(/* ICalValueKind */ int kind);
206 //public native static String kind_to_string(/* ICalPropertyKind */ int kind);
207 //public native static /* ICalPropertyKind */ int string_to_kind(String str);
209 //public native static /* ICalPropertyMethod */ int string_to_method(String str);
210 //public native static String method_to_string(/* ICalPropertyMethod */ int method);
212 //public native static String enum_to_string(int e);
213 //public native static int string_to_enum(String str);
215 //public native static String status_to_string(/* ICalPropertyStatus */ int status);
216 //public native static /* ICalPropertyStatus */ int string_to_status(String str);
218 //public native static int enum_belongs_to_property(/* ICalPropertyKind */ int kind, int e);
221 public native void set_action(/* ICalPropertyAction */ int v);
222 public native /* ICalPropertyAction */ int get_action();
225 //void set_attach(struct icalattachtype v);
226 //struct icalattachtype get_attach();
229 public native void set_attendee(String val);
230 public native String get_attendee();
233 //public native void set_calscale(String val);
234 //public native String get_calscale();
237 //public native void set_categories(String val);
238 //public native String get_categories();
241 //public native void set_class(String val);
242 //public native String get_class();
245 public native void set_comment(String val);
246 public native String get_comment();
249 //void set_completed(ICalTimeType val);
250 //ICalTimeType get_completed();
253 //public native void set_contact(String val);
254 //public native String get_contact();
257 //void set_created(ICalTimeType val);
258 //ICalTimeType get_created();
261 public native void set_description(String val);
262 public native String get_description();
265 public native void set_dtend(ICalTimeType val);
266 public native ICalTimeType get_dtend();
269 public native void set_dtstamp(ICalTimeType val);
270 public native ICalTimeType get_dtstamp();
273 public native void set_dtstart(ICalTimeType val);
274 public native ICalTimeType get_dtstart();
277 public native void set_due(ICalTimeType val);
278 public native ICalTimeType get_due();
281 public native void set_duration(ICalDurationType val);
282 public native ICalDurationType get_duration();
285 public native void set_exdate(ICalTimeType val);
286 public native ICalTimeType get_exdate();
289 public native void set_exrule(ICalRecurrenceType val);
290 public native ICalRecurrenceType get_exrule();
293 public void set_expand(int val) {} // @-@:p0 TMA TODO
294 public int get_expand() {return 0;} // @-@:p0 TMA TODO
297 public native void set_freebusy(ICalPeriodType val);
298 public native ICalPeriodType get_freebusy();
301 //void set_geo(struct icalgeotype val);
302 //struct icalgeotype get_geo();
305 //void set_lastmodified(ICalTimeType val);
306 //ICalTimeType get_lastmodified();
309 public native void set_location(String val);
310 public native String get_location();
313 //public native void set_maxresults(int val);
314 //public native int get_maxresults();
317 //public native void set_maxresultsize(int val);
318 //public native int get_maxresultsize();
321 public native void set_method(/* ICalPropertyMethod */ int val);
322 public native /* ICalPropertyMethod */ int get_method();
325 public native void set_organizer(String val);
326 public native String get_organizer();
329 public native void set_owner(String val);
330 public native String get_owner();
332 /* PERCENT-COMPLETE */
333 //void set_percentcomplete(int val);
334 //int get_percentcomplete();
337 //void set_priority(int val);
338 //int get_priority();
341 public native void set_prodid(String val);
342 public native String get_prodid();
345 public native void set_query(String val);
346 public native String get_query();
349 public native void set_queryname(String val);
350 public native String get_queryname();
353 //void set_rdate(struct icaldatetimeperiodtype val);
354 //struct icaldatetimeperiodtype get_rdate();
357 public native void set_recurrenceid(ICalTimeType val);
358 public native ICalTimeType get_recurrenceid();
361 //public native void set_relatedto(String val);
362 //public native String get_relatedto();
365 public native void set_relcalid(String val);
366 public native String get_relcalid();
369 public native void set_repeat(int val);
370 public native int get_repeat();
373 //public native void set_requeststatus(String val);
374 //public native String get_requeststatus();
377 //public native void set_resources(String val);
378 //public native String get_resources();
381 public native void set_rrule(ICalRecurrenceType val);
382 public native ICalRecurrenceType get_rrule();
385 //public native void set_scope(String val);
386 //public native String get_scope();
389 //public native void set_sequence(int val);
390 //public native int get_sequence();
393 public native void set_status(/* ICalPropertyStatus */ int val);
394 public native /* ICalPropertyStatus */ int get_status();
397 public native void set_summary(String val);
398 public native String get_summary();
401 public native void set_target(String val);
402 public native String get_target();
405 //public native void set_transp(String val);
406 //public native String get_transp();
409 public native void set_trigger(ICalTriggerType val);
410 public native ICalTriggerType get_trigger();
413 public native void set_tzid(String val);
414 public native String get_tzid();
417 //public native void set_tzname(String val);
418 //public native String get_tzname();
421 //public native void set_tzoffsetfrom(int val);
422 //public native int get_tzoffsetfrom();
426 //public native void set_tzoffsetto(int val);
427 //public native int get_tzoffsetto();
430 //public native void set_tzurl(String val);
431 //public native String get_tzurl();
434 public native void set_uid(String val);
435 public native String get_uid();
438 //public native void set_url(String val);
439 //public native String get_url();
442 //public native void set_version(String val);
443 //public native String get_version();
446 //void set_x(String val);
449 /* X-LIC-CLUSTERCOUNT */
450 //void set_xlicclustercount(String val);
451 //String get_xlicclustercount();
454 //void set_xlicerror(String val);
455 //String get_xlicerror();
457 /* X-LIC-MIMECHARSET */
458 //void set_xlicmimecharset(String val);
459 //String get_xlicmimecharset();
462 //void set_xlicmimecid(String val);
463 //String get_xlicmimecid();
465 /* X-LIC-MIMECONTENTTYPE */
466 //void set_xlicmimecontenttype(String val);
467 //String get_xlicmimecontenttype();
469 /* X-LIC-MIMEENCODING */
470 //void set_xlicmimeencoding(String val);
471 //String get_xlicmimeencoding();
473 /* X-LIC-MIMEFILENAME */
474 //void set_xlicmimefilename(String val);
475 //String get_xlicmimefilename();
477 /* X-LIC-MIMEOPTINFO */
478 //void set_xlicmimeoptinfo(String val);
479 //String get_xlicmimeoptinfo();
482 * init the native class
484 private void init(long obj)
489 private native void init();
490 private native void init(String str);
491 private native void init(/* ICalPropertyKind */ int kind);
494 * load the jni library for this class
497 System.loadLibrary("ical_jni");
500 public static void main(String[] args)
502 System.out.println("*** ICalProperty main called ok.");
505 /** pointer to C++ object */
506 private long m_Obj = 0;