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 */ ICalProperty(long obj)150 private ICalProperty(long obj) 151 { 152 init(obj); 153 } 154 ICalProperty()155 public ICalProperty() 156 { 157 init(); 158 } 159 ICalProperty(String str)160 public ICalProperty(String str) 161 { 162 init(str); 163 } 164 ICalProperty( int kind)165 public ICalProperty(/* ICalPropertyKind */ int kind) 166 { 167 init(kind); 168 } 169 as_ical_string()170 public native String as_ical_string(); isa()171 public native /* ICalPropertyKind */ int isa(); isa_property(Object property)172 public native boolean isa_property(Object property); 173 add_parameter(ICalParameter parameter)174 public native void add_parameter(ICalParameter parameter); set_parameter(ICalParameter parameter)175 public native void set_parameter(ICalParameter parameter); set_parameter_from_string(String name, String val)176 public native void set_parameter_from_string(String name, String val); get_parameter_as_string(String name)177 public native String get_parameter_as_string(String name); remove_parameter_by_kind( int kind)178 public native void remove_parameter_by_kind(/* ICalParameterKind */ int kind); count_parameters()179 public native int count_parameters(); 180 181 /* Iterate through the parameters */ get_first_parameter( int kind)182 public native ICalParameter get_first_parameter(/* ICalParameterKind */ int kind); get_next_parameter( int kind)183 public native ICalParameter get_next_parameter(/* ICalParameterKind */ int kind); 184 185 /* Access the value of the property */ set_value(ICalValue val)186 public native void set_value(ICalValue val); set_value_from_string(String val, String kind)187 public native void set_value_from_string(String val, String kind); 188 get_value()189 public native ICalValue get_value(); get_value_as_string()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 */ get_name()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 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 */ set_action( int v)221 public native void set_action(/* ICalPropertyAction */ int v); get_action()222 public native /* ICalPropertyAction */ int get_action(); 223 224 /* ATTENDEE */ set_attendee(String val)225 public native void set_attendee(String val); get_attendee()226 public native String get_attendee(); 227 228 /* CALSCALE */ 229 //public native void set_calscale(String val); 230 //public native String get_calscale(); 231 232 /* CATEGORIES */ 233 //public native void set_categories(String val); 234 //public native String get_categories(); 235 236 /* CLASS */ 237 //public native void set_class(String val); 238 //public native String get_class(); 239 240 /* COMMENT */ set_comment(String val)241 public native void set_comment(String val); get_comment()242 public native String get_comment(); 243 244 /* COMPLETED */ 245 //void set_completed(ICalTimeType val); 246 //ICalTimeType get_completed(); 247 248 /* CONTACT */ 249 //public native void set_contact(String val); 250 //public native String get_contact(); 251 252 /* CREATED */ 253 //void set_created(ICalTimeType val); 254 //ICalTimeType get_created(); 255 256 /* DESCRIPTION */ set_description(String val)257 public native void set_description(String val); get_description()258 public native String get_description(); 259 260 /* DTEND */ set_dtend(ICalTimeType val)261 public native void set_dtend(ICalTimeType val); get_dtend()262 public native ICalTimeType get_dtend(); 263 264 /* DTSTAMP */ set_dtstamp(ICalTimeType val)265 public native void set_dtstamp(ICalTimeType val); get_dtstamp()266 public native ICalTimeType get_dtstamp(); 267 268 /* DTSTART */ set_dtstart(ICalTimeType val)269 public native void set_dtstart(ICalTimeType val); get_dtstart()270 public native ICalTimeType get_dtstart(); 271 272 /* DUE */ set_due(ICalTimeType val)273 public native void set_due(ICalTimeType val); get_due()274 public native ICalTimeType get_due(); 275 276 /* DURATION */ set_duration(ICalDurationType val)277 public native void set_duration(ICalDurationType val); get_duration()278 public native ICalDurationType get_duration(); 279 280 /* EXDATE */ set_exdate(ICalTimeType val)281 public native void set_exdate(ICalTimeType val); get_exdate()282 public native ICalTimeType get_exdate(); 283 284 /* EXRULE */ set_exrule(ICalRecurrenceType val)285 public native void set_exrule(ICalRecurrenceType val); get_exrule()286 public native ICalRecurrenceType get_exrule(); 287 288 /* EXPAND */ set_expand(int val)289 public void set_expand(int val) {} // @-@:p0 TMA TODO get_expand()290 public int get_expand() {return 0;} // @-@:p0 TMA TODO 291 292 /* FREEBUSY */ set_freebusy(ICalPeriodType val)293 public native void set_freebusy(ICalPeriodType val); get_freebusy()294 public native ICalPeriodType get_freebusy(); 295 296 /* GEO */ 297 //void set_geo(struct icalgeotype val); 298 //struct icalgeotype get_geo(); 299 300 /* LAST-MODIFIED */ 301 //void set_lastmodified(ICalTimeType val); 302 //ICalTimeType get_lastmodified(); 303 304 /* LOCATION */ set_location(String val)305 public native void set_location(String val); get_location()306 public native String get_location(); 307 308 /* MAXRESULTS */ 309 //public native void set_maxresults(int val); 310 //public native int get_maxresults(); 311 312 /* MAXRESULTSSIZE */ 313 //public native void set_maxresultsize(int val); 314 //public native int get_maxresultsize(); 315 316 /* METHOD */ set_method( int val)317 public native void set_method(/* ICalPropertyMethod */ int val); get_method()318 public native /* ICalPropertyMethod */ int get_method(); 319 320 /* ORGANIZER */ set_organizer(String val)321 public native void set_organizer(String val); get_organizer()322 public native String get_organizer(); 323 324 /* OWNER */ set_owner(String val)325 public native void set_owner(String val); get_owner()326 public native String get_owner(); 327 328 /* PERCENT-COMPLETE */ 329 //void set_percentcomplete(int val); 330 //int get_percentcomplete(); 331 332 /* PRIORITY */ 333 //void set_priority(int val); 334 //int get_priority(); 335 336 /* PRODID */ set_prodid(String val)337 public native void set_prodid(String val); get_prodid()338 public native String get_prodid(); 339 340 /* QUERY */ set_query(String val)341 public native void set_query(String val); get_query()342 public native String get_query(); 343 344 /* QUERYNAME */ set_queryname(String val)345 public native void set_queryname(String val); get_queryname()346 public native String get_queryname(); 347 348 /* RDATE */ 349 //void set_rdate(struct icaldatetimeperiodtype val); 350 //struct icaldatetimeperiodtype get_rdate(); 351 352 /* RECURRENCE-ID */ set_recurrenceid(ICalTimeType val)353 public native void set_recurrenceid(ICalTimeType val); get_recurrenceid()354 public native ICalTimeType get_recurrenceid(); 355 356 /* RELATED-TO */ 357 //public native void set_relatedto(String val); 358 //public native String get_relatedto(); 359 360 /* RELCALID */ set_relcalid(String val)361 public native void set_relcalid(String val); get_relcalid()362 public native String get_relcalid(); 363 364 /* REPEAT */ set_repeat(int val)365 public native void set_repeat(int val); get_repeat()366 public native int get_repeat(); 367 368 /* REQUEST-STATUS */ 369 //public native void set_requeststatus(String val); 370 //public native String get_requeststatus(); 371 372 /* RESOURCES */ 373 //public native void set_resources(String val); 374 //public native String get_resources(); 375 376 /* RRULE */ set_rrule(ICalRecurrenceType val)377 public native void set_rrule(ICalRecurrenceType val); get_rrule()378 public native ICalRecurrenceType get_rrule(); 379 380 /* SCOPE */ 381 //public native void set_scope(String val); 382 //public native String get_scope(); 383 384 /* SEQUENCE */ 385 //public native void set_sequence(int val); 386 //public native int get_sequence(); 387 388 /* STATUS */ set_status( int val)389 public native void set_status(/* ICalPropertyStatus */ int val); get_status()390 public native /* ICalPropertyStatus */ int get_status(); 391 392 /* SUMMARY */ set_summary(String val)393 public native void set_summary(String val); get_summary()394 public native String get_summary(); 395 396 /* TARGET */ set_target(String val)397 public native void set_target(String val); get_target()398 public native String get_target(); 399 400 /* TRANSP */ 401 //public native void set_transp(String val); 402 //public native String get_transp(); 403 404 /* TRIGGER */ set_trigger(ICalTriggerType val)405 public native void set_trigger(ICalTriggerType val); get_trigger()406 public native ICalTriggerType get_trigger(); 407 408 /* TZID */ set_tzid(String val)409 public native void set_tzid(String val); get_tzid()410 public native String get_tzid(); 411 412 /* TZNAME */ 413 //public native void set_tzname(String val); 414 //public native String get_tzname(); 415 416 /* TZOFFSETFROM */ 417 //public native void set_tzoffsetfrom(int val); 418 //public native int get_tzoffsetfrom(); 419 420 421 /* TZOFFSETTO */ 422 //public native void set_tzoffsetto(int val); 423 //public native int get_tzoffsetto(); 424 425 /* TZURL */ 426 //public native void set_tzurl(String val); 427 //public native String get_tzurl(); 428 429 /* UID */ set_uid(String val)430 public native void set_uid(String val); get_uid()431 public native String get_uid(); 432 433 /* URL */ 434 //public native void set_url(String val); 435 //public native String get_url(); 436 437 /* VERSION */ 438 //public native void set_version(String val); 439 //public native String get_version(); 440 441 /* X */ 442 //void set_x(String val); 443 //String get_x(); 444 445 /* X-LIC-CLUSTERCOUNT */ 446 //void set_xlicclustercount(String val); 447 //String get_xlicclustercount(); 448 449 /* X-LIC-ERROR */ 450 //void set_xlicerror(String val); 451 //String get_xlicerror(); 452 453 /* X-LIC-MIMECHARSET */ 454 //void set_xlicmimecharset(String val); 455 //String get_xlicmimecharset(); 456 457 /* X-LIC-MIMECID */ 458 //void set_xlicmimecid(String val); 459 //String get_xlicmimecid(); 460 461 /* X-LIC-MIMECONTENTTYPE */ 462 //void set_xlicmimecontenttype(String val); 463 //String get_xlicmimecontenttype(); 464 465 /* X-LIC-MIMEENCODING */ 466 //void set_xlicmimeencoding(String val); 467 //String get_xlicmimeencoding(); 468 469 /* X-LIC-MIMEFILENAME */ 470 //void set_xlicmimefilename(String val); 471 //String get_xlicmimefilename(); 472 473 /* X-LIC-MIMEOPTINFO */ 474 //void set_xlicmimeoptinfo(String val); 475 //String get_xlicmimeoptinfo(); 476 477 /** 478 * init the native class 479 */ init(long obj)480 private void init(long obj) 481 { 482 m_Obj = obj; 483 } 484 init()485 private native void init(); init(String str)486 private native void init(String str); init( int kind)487 private native void init(/* ICalPropertyKind */ int kind); 488 489 /** 490 * load the jni library for this class 491 */ 492 static { 493 System.loadLibrary("ical_jni"); 494 } 495 main(String[] args)496 public static void main(String[] args) 497 { 498 System.out.println("*** ICalProperty main called ok."); 499 } 500 501 /** pointer to C++ object */ 502 private long m_Obj = 0; 503 } 504