bump to 1.0.0 and clean up spec file
[platform/upstream/libical.git] / src / java / ICalProperty.java
1 /*======================================================================
2  FILE: ICalProperty.java
3  CREATOR: gnorman 01/09/02
4  (C) COPYRIGHT 2002, Critical Path
5 ======================================================================*/
6
7 package net.cp.jlibical;
8
9 public class ICalProperty
10 {
11         /** It's not typesafe, but it's simple to understand! */
12         public interface ICalPropertyMethod
13         {
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;
32         }
33
34         /** It's not typesafe, but it's simple to understand! */
35         public interface ICalPropertyAction
36         {
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;
44         }
45
46         /** It's not typesafe, but it's simple to understand! */
47         public interface ICalPropertyKind
48         {
49                 // icalproperty_kind
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;
129         }
130
131         public interface ICalPropertyStatus
132         {
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;
144         }
145
146         /**
147          * Constructor for ICalProperty
148          * @param obj c++ pointer
149          */
150         private ICalProperty(long obj)
151         {
152                 init(obj);
153         }
154
155         public ICalProperty()
156         {
157                 init();
158         }
159
160         public ICalProperty(String str)
161         {
162                 init(str);
163         }
164
165         public ICalProperty(/* ICalPropertyKind */ int kind)
166         {
167                 init(kind);
168         }
169
170         public native String as_ical_string();
171         public native /* ICalPropertyKind */ int isa();
172         public native boolean isa_property(Object property);
173
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();
180
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);
184
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);
188
189         public native ICalValue get_value();
190         public native String get_value_as_string();
191
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
194         */
195         public native String get_name();
196
197         /* Deal with X properties */
198         //static void set_x_name(ICalProperty prop, String name);
199         //static String get_x_name(ICalProperty prop);
200
201         //public native static /* ICalValueKind */ int icalparameter_value_to_value_kind(/* ICalParameterValue */ int val);
202
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);
208
209         //public native static /* ICalPropertyMethod */ int string_to_method(String str);
210         //public native static String method_to_string(/* ICalPropertyMethod */ int method);
211
212         //public native static String enum_to_string(int e);
213         //public native static int string_to_enum(String str);
214
215         //public native static String status_to_string(/* ICalPropertyStatus */ int status);
216         //public native static /* ICalPropertyStatus */ int string_to_status(String str);
217
218         //public native static int enum_belongs_to_property(/* ICalPropertyKind */ int kind, int e);
219
220         /* ACTION */
221         public native void set_action(/* ICalPropertyAction */ int v);
222         public native /* ICalPropertyAction */ int get_action();
223
224         /* ATTACH */
225         //void set_attach(struct icalattachtype v);
226         //struct icalattachtype get_attach();
227
228         /* ATTENDEE */
229         public native void set_attendee(String val);
230         public native String get_attendee();
231
232         /* CALSCALE */
233         //public native void set_calscale(String val);
234         //public native String get_calscale();
235
236         /* CATEGORIES */
237         //public native void set_categories(String val);
238         //public native String get_categories();
239
240         /* CLASS */
241         //public native void set_class(String val);
242         //public native String get_class();
243
244         /* COMMENT */
245         public native void set_comment(String val);
246         public native String get_comment();
247
248         /* COMPLETED */
249         //void set_completed(ICalTimeType val);
250         //ICalTimeType get_completed();
251
252         /* CONTACT */
253         //public native void set_contact(String val);
254         //public native String get_contact();
255
256         /* CREATED */
257         //void set_created(ICalTimeType val);
258         //ICalTimeType get_created();
259
260         /* DESCRIPTION */
261         public native void set_description(String val);
262         public native String get_description();
263
264         /* DTEND */
265         public native void set_dtend(ICalTimeType val);
266         public native ICalTimeType get_dtend();
267
268         /* DTSTAMP */
269         public native void set_dtstamp(ICalTimeType val);
270         public native ICalTimeType get_dtstamp();
271
272         /* DTSTART */
273         public native void set_dtstart(ICalTimeType val);
274         public native ICalTimeType get_dtstart();
275
276         /* DUE */
277         public native void set_due(ICalTimeType val);
278         public native ICalTimeType get_due();
279
280         /* DURATION */
281         public native void set_duration(ICalDurationType val);
282         public native ICalDurationType get_duration();
283
284         /* EXDATE */
285         public native void set_exdate(ICalTimeType val);
286         public native ICalTimeType get_exdate();
287
288         /* EXRULE */
289         public native void set_exrule(ICalRecurrenceType val);
290         public native ICalRecurrenceType get_exrule();
291
292         /* EXPAND */
293         public void set_expand(int val) {} // @-@:p0 TMA TODO
294         public int get_expand() {return 0;} // @-@:p0 TMA TODO
295
296         /* FREEBUSY */
297         public native void set_freebusy(ICalPeriodType val);
298         public native ICalPeriodType get_freebusy();
299
300         /* GEO */
301         //void set_geo(struct icalgeotype val);
302         //struct icalgeotype get_geo();
303
304         /* LAST-MODIFIED */
305         //void set_lastmodified(ICalTimeType val);
306         //ICalTimeType get_lastmodified();
307
308         /* LOCATION */
309         public native void set_location(String val);
310         public native String get_location();
311
312         /* MAXRESULTS */
313         //public native void set_maxresults(int val);
314         //public native int get_maxresults();
315
316         /* MAXRESULTSSIZE */
317         //public native void set_maxresultsize(int val);
318         //public native int get_maxresultsize();
319
320         /* METHOD */
321         public native void set_method(/* ICalPropertyMethod */ int val);
322         public native /* ICalPropertyMethod */ int get_method();
323
324         /* ORGANIZER */
325         public native void set_organizer(String val);
326         public native String get_organizer();
327
328         /* OWNER */
329         public native void set_owner(String val);
330         public native String get_owner();
331
332         /* PERCENT-COMPLETE */
333         //void set_percentcomplete(int val);
334         //int get_percentcomplete();
335
336         /* PRIORITY */
337         //void set_priority(int val);
338         //int get_priority();
339
340         /* PRODID */
341         public native void set_prodid(String val);
342         public native String get_prodid();
343
344         /* QUERY */
345         public native void set_query(String val);
346         public native String get_query();
347
348         /* QUERYNAME */
349         public native void set_queryname(String val);
350         public native String get_queryname();
351
352         /* RDATE */
353         //void set_rdate(struct icaldatetimeperiodtype val);
354         //struct icaldatetimeperiodtype get_rdate();
355
356         /* RECURRENCE-ID */
357         public native  void set_recurrenceid(ICalTimeType val);
358         public native  ICalTimeType get_recurrenceid();
359
360         /* RELATED-TO */
361         //public native void set_relatedto(String val);
362         //public native String get_relatedto();
363
364         /* RELCALID */
365         public native void set_relcalid(String val);
366         public native String get_relcalid();
367
368         /* REPEAT */
369         public native void set_repeat(int val);
370         public native int get_repeat();
371
372         /* REQUEST-STATUS */
373         //public native void set_requeststatus(String val);
374         //public native String get_requeststatus();
375
376         /* RESOURCES */
377         //public native void set_resources(String val);
378         //public native String get_resources();
379
380         /* RRULE */
381         public native void set_rrule(ICalRecurrenceType val);
382         public native ICalRecurrenceType get_rrule();
383
384         /* SCOPE */
385         //public native void set_scope(String val);
386         //public native String get_scope();
387
388         /* SEQUENCE */
389         //public native void set_sequence(int val);
390         //public native int get_sequence();
391
392         /* STATUS */
393         public native void set_status(/* ICalPropertyStatus */ int val);
394         public native /* ICalPropertyStatus */ int get_status();
395
396         /* SUMMARY */
397         public native void set_summary(String val);
398         public native String get_summary();
399
400         /* TARGET */
401         public native void set_target(String val);
402         public native String get_target();
403
404         /* TRANSP */
405         //public native void set_transp(String val);
406         //public native String get_transp();
407
408         /* TRIGGER */
409         public native void set_trigger(ICalTriggerType val);
410         public native ICalTriggerType get_trigger();
411
412         /* TZID */
413         public native void set_tzid(String val);
414         public native String get_tzid();
415
416         /* TZNAME */
417         //public native void set_tzname(String val);
418         //public native String get_tzname();
419
420         /* TZOFFSETFROM */
421         //public native void set_tzoffsetfrom(int val);
422         //public native int get_tzoffsetfrom();
423
424
425         /* TZOFFSETTO */
426         //public native void set_tzoffsetto(int val);
427         //public native int get_tzoffsetto();
428
429         /* TZURL */
430         //public native void set_tzurl(String val);
431         //public native String get_tzurl();
432
433         /* UID */
434         public native void set_uid(String val);
435         public native String get_uid();
436
437         /* URL */
438         //public native void set_url(String val);
439         //public native String get_url();
440
441         /* VERSION */
442         //public native void set_version(String val);
443         //public native String get_version();
444
445         /* X */
446         //void set_x(String val);
447         //String get_x();
448
449         /* X-LIC-CLUSTERCOUNT */
450         //void set_xlicclustercount(String val);
451         //String get_xlicclustercount();
452
453         /* X-LIC-ERROR */
454         //void set_xlicerror(String val);
455         //String get_xlicerror();
456
457         /* X-LIC-MIMECHARSET */
458         //void set_xlicmimecharset(String val);
459         //String get_xlicmimecharset();
460
461         /* X-LIC-MIMECID */
462         //void set_xlicmimecid(String val);
463         //String get_xlicmimecid();
464
465         /* X-LIC-MIMECONTENTTYPE */
466         //void set_xlicmimecontenttype(String val);
467         //String get_xlicmimecontenttype();
468
469         /* X-LIC-MIMEENCODING */
470         //void set_xlicmimeencoding(String val);
471         //String get_xlicmimeencoding();
472
473         /* X-LIC-MIMEFILENAME */
474         //void set_xlicmimefilename(String val);
475         //String get_xlicmimefilename();
476
477         /* X-LIC-MIMEOPTINFO */
478         //void set_xlicmimeoptinfo(String val);
479         //String get_xlicmimeoptinfo();
480
481         /**
482          * init the native class
483          */
484         private void init(long obj)
485         {
486                 m_Obj = obj;
487         }
488
489         private native void init();
490         private native void init(String str);
491         private native void init(/* ICalPropertyKind */ int kind);
492
493         /**
494          * load the jni library for this class
495          */
496         static {
497                 System.loadLibrary("ical_jni");
498         }
499
500         public static void main(String[] args)
501         {
502                 System.out.println("*** ICalProperty main called ok.");
503         }
504
505         /** pointer to C++ object  */
506         private long    m_Obj = 0;
507 }