diff options
author | Allen Winter <allen.winter@kdab.com> | 2014-05-31 17:22:41 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2014-05-31 17:22:41 -0400 |
commit | bc831ea040913b1069e8eaf99496dc12704b94a9 (patch) | |
tree | 1502b86977c42dd5e5d202a2ff3807b08309f9ff /src/java | |
parent | c1d3761c08651f469a3bd3a8130e6005b8e26136 (diff) | |
download | libical-git-bc831ea040913b1069e8eaf99496dc12704b94a9.tar.gz |
Re-arrange after svn to git conversion
Diffstat (limited to 'src/java')
39 files changed, 8897 insertions, 0 deletions
diff --git a/src/java/CMakeLists.txt b/src/java/CMakeLists.txt new file mode 100644 index 00000000..4ae0edd5 --- /dev/null +++ b/src/java/CMakeLists.txt @@ -0,0 +1,41 @@ + +########### next target ############### + +set(ical_jni_LIB_SRCS + jlibical_consts_cxx.h + jlibical_utils_cxx.cpp + jlibical_utils_cxx.h + jniICalDurationType_cxx.cpp + jniICalDurationType_cxx.h + jniICalPeriodType_cxx.cpp + jniICalPeriodType_cxx.h + jniICalRecurrenceType_cxx.cpp + jniICalRecurrenceType_cxx.h + jniICalTimeType_cxx.cpp + jniICalTimeType_cxx.h + jniICalTriggerType_cxx.cpp + jniICalTriggerType_cxx.h + net_cp_jlibical_ICalParameter_cxx.cpp + net_cp_jlibical_ICalParameter_cxx.h + net_cp_jlibical_ICalProperty_cxx.cpp + net_cp_jlibical_ICalProperty_cxx.h + net_cp_jlibical_ICalValue_cxx.cpp + net_cp_jlibical_ICalValue_cxx.h + net_cp_jlibical_VComponent_cxx.cpp + net_cp_jlibical_VComponent_cxx.h +) + +add_library(ical_jni ${LIBRARY_TYPE} ${ical_jni_LIB_SRCS}) + +target_link_libraries(ical_jni ical_cxx) + +set_target_properties(ical_jni PROPERTIES + VERSION ${LIBICAL_LIB_VERSION_STRING} + SOVERSION ${LIBICAL_LIB_MAJOR_VERSION} +) +install(TARGETS ical_jni DESTINATION lib) + +########### install files ############### + +install(FILES DESTINATION /include) +install(FILES libical.jar DESTINATION /share) diff --git a/src/java/ICalDurationType.java b/src/java/ICalDurationType.java new file mode 100644 index 00000000..2dcc2344 --- /dev/null +++ b/src/java/ICalDurationType.java @@ -0,0 +1,114 @@ +/*====================================================================== + FILE: ICalDurationType.java + CREATOR: structConverter 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +/** struct icaldurationtype */ +public class ICalDurationType +{ + /** + * Constructor for pre-existing native icaldurationtype. + * @param obj c++ pointer + */ + ICalDurationType(long obj) + { + init(obj); + } + + /** + * Constructor for default ICalDurationType + */ + public ICalDurationType() + { + } + + public void setIs_neg(int lcl_arg0) + { + is_neg = lcl_arg0; + } + public int getIs_neg() + { + return is_neg; + } + + public void setDays(long lcl_arg0) + { + days = lcl_arg0; + } + public long getDays() + { + return days; + } + + public void setWeeks(long lcl_arg0) + { + weeks = lcl_arg0; + } + public long getWeeks() + { + return weeks; + } + + public void setHours(long lcl_arg0) + { + hours = lcl_arg0; + } + public long getHours() + { + return hours; + } + + public void setMinutes(long lcl_arg0) + { + minutes = lcl_arg0; + } + public long getMinutes() + { + return minutes; + } + + public void setSeconds(long lcl_arg0) + { + seconds = lcl_arg0; + } + public long getSeconds() + { + return seconds; + } + + // -------------------------------------------------------- + // Initialization + // -------------------------------------------------------- + + /** + * native code inits from an existing struct. + */ + private native void init(long aDuration); + + /** + * optimization: init field id cache, + */ + private native static void initFIDs(); + + /** + * load the jni library for this class + */ + static { + System.loadLibrary("ical_jni"); + initFIDs(); + } + + // -------------------------------------------------------- + // Fields + // -------------------------------------------------------- + + private int is_neg; + private long days; // unsigned int + private long weeks; // unsigned int + private long hours; // unsigned int + private long minutes; // unsigned int + private long seconds; // unsigned int +} diff --git a/src/java/ICalParameter.java b/src/java/ICalParameter.java new file mode 100644 index 00000000..74bf3db8 --- /dev/null +++ b/src/java/ICalParameter.java @@ -0,0 +1,259 @@ +/*====================================================================== + FILE: ICalParameter.java + CREATOR: gnorman 01/09/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class ICalParameter +{ + /** It's not typesafe, but it's simple to understand! */ + public interface ICalParameterKind + { + // icalparameter_kind + int ICAL_ANY_PARAMETER = 0; + int ICAL_ALTREP_PARAMETER = 1; + int ICAL_CN_PARAMETER = 2; + int ICAL_CUTYPE_PARAMETER = 3; + int ICAL_DELEGATEDFROM_PARAMETER = 4; + int ICAL_DELEGATEDTO_PARAMETER = 5; + int ICAL_DIR_PARAMETER = 6; + int ICAL_ENCODING_PARAMETER = 7; + int ICAL_FBTYPE_PARAMETER = 8; + int ICAL_FMTTYPE_PARAMETER = 9; + int ICAL_LANGUAGE_PARAMETER = 10; + int ICAL_MEMBER_PARAMETER = 11; + int ICAL_PARTSTAT_PARAMETER = 12; + int ICAL_RANGE_PARAMETER = 13; + int ICAL_RELATED_PARAMETER = 14; + int ICAL_RELTYPE_PARAMETER = 15; + int ICAL_RIGHTREF_PARAMETER = 16; + int ICAL_ROLE_PARAMETER = 17; + int ICAL_RSVP_PARAMETER = 18; + int ICAL_SENTBY_PARAMETER = 19; + int ICAL_TZID_PARAMETER = 20; + int ICAL_VALUE_PARAMETER = 21; + int ICAL_WKST_PARAMETER = 22; + int ICAL_X_PARAMETER = 23; + int ICAL_XLICCOMPARETYPE_PARAMETER = 24; + int ICAL_XLICERRORTYPE_PARAMETER = 25; + int ICAL_NO_PARAMETER = 26; + } + + /** It's not typesafe, but it's simple to understand! */ + public interface ICalParameterEncoding + { + // icalparameter_encoding + int ICAL_ENCODING_X = 20007; + int ICAL_ENCODING_8BIT = 20008; + int ICAL_ENCODING_BASE64 = 20009; + int ICAL_ENCODING_NONE = 20010; + } + + public interface ICalParameterPartStat { + int ICAL_PARTSTAT_X = 20017; + int ICAL_PARTSTAT_NEEDSACTION = 20018; + int ICAL_PARTSTAT_ACCEPTED = 20019; + int ICAL_PARTSTAT_DECLINED = 20020; + int ICAL_PARTSTAT_TENTATIVE = 20021; + int ICAL_PARTSTAT_DELEGATED = 20022; + int ICAL_PARTSTAT_COMPLETED = 20023; + int ICAL_PARTSTAT_INPROCESS = 20024; + int ICAL_PARTSTAT_NONE = 20025; + } + + public interface ICalParameterRole { + int ICAL_ROLE_X = 20047; + int ICAL_ROLE_CHAIR = 20048; + int ICAL_ROLE_REQPARTICIPANT = 20049; + int ICAL_ROLE_OPTPARTICIPANT = 20050; + int ICAL_ROLE_NONPARTICIPANT = 20051; + int ICAL_ROLE_NONE = 20052; + } + + /** + * Constructor for ICalParameter + * @param obj c++ pointer + */ + private ICalParameter(long obj) + { + init(obj); + } + + /** + * Constructor for ICalParameter + */ + public ICalParameter() + { + init(); + } + + /** + * Create instance from a string of form "PARAMNAME=VALUE" + */ + public ICalParameter(String str) + { + init(str); + } + + /** + * Create from just the value, the part after the "=" + */ + public ICalParameter(/* ICalParameterKind */ int kind, String str) + { + init(kind,str); + } + + /** + * Create empty value for specified kind + */ + public ICalParameter(/* ICalParameterKind */ int kind) + { + init(kind); + } + + /** + * Return ical String representation + */ + public native String as_ical_string(); + + /** + * Return true if this instance is valid + */ + //public native boolean is_valid(); + + /** + * Return what kind of parameter this instance represents + */ + public native /* ICalParameterKind */ int isa(); + + /** + * Return true if this is a parameter + */ + public native boolean isa_parameter(Object parameter); + + /* Convert enumerations */ + //public native static String kind_to_string(/* ICalParameterKind */ int kind); + //public native static /* ICalParameterKind */ int string_to_kind(String str); + + /* DELEGATED-FROM */ + //public native String get_delegatedfrom(); + //public native void set_delegatedfrom(String v); + + /* RELATED */ + //public native icalparameter_related get_related(); + //public native void set_related(icalparameter_related v); + + /* SENT-BY */ + //public native String get_sentby(); + //public native void set_sentby(String v); + + /* LANGUAGE */ + public native String get_language(); + public native void set_language(String v); + + /* RELTYPE */ + //public native icalparameter_reltype get_reltype(); + //public native void set_reltype(icalparameter_reltype v); + + /* ENCODING */ + public native /* ICalParameterEncoding */ int get_encoding(); + public native void set_encoding(/* ICalParameterEncoding */ int v); + + /* ALTREP */ + //public native String get_altrep(); + //public native void set_altrep(String v); + + /* FMTTYPE */ + //public native String get_fmttype(); + //public native void set_fmttype(String v); + + /* FBTYPE */ + //public native icalparameter_fbtype get_fbtype(); + //public native void set_fbtype(icalparameter_fbtype v); + + /* RSVP */ + //public native icalparameter_rsvp get_rsvp(); + //public native void set_rsvp(icalparameter_rsvp v); + + /* RANGE */ + //public native icalparameter_range get_range(); + //public native void set_range(icalparameter_range v); + + /* DELEGATED-TO */ + //public native String get_delegatedto(); + //public native void set_delegatedto(String v); + + /* CN */ + //public native String get_cn(); + //public native void set_cn(String v); + + /* ROLE */ + public native /* ICalParameterRole */ int get_role(); + public native void set_role(/* ICalParameterRole */ int v); + + /* X-LIC-COMPARETYPE */ + //public native icalparameter_xliccomparetype get_xliccomparetype(); + //public native void set_xliccomparetype(icalparameter_xliccomparetype v); + + /* PARTSTAT */ + public native /* ICalParameterPartStat */ int get_partstat(); + public native void set_partstat(/* ICalParameterPartStat */ int v); + + /* X-LIC-ERRORTYPE */ + //public native icalparameter_xlicerrortype get_xlicerrortype(); + //public native void set_xlicerrortype(icalparameter_xlicerrortype v); + + /* MEMBER */ + //public native String get_member(); + //public native void set_member(String v); + + /* X */ + //public native String get_x(); + //public native void set_x(String v); + + /* CUTYPE */ + //public native icalparameter_cutype get_cutype(); + //public native void set_cutype(icalparameter_cutype v); + + /* TZID */ + //public native String get_tzid(); + //public native void set_tzid(String v); + + /* VALUE */ + //public native /* ICalParameterValue */ int get_value(); + //public native void set_value(/* ICalParameterValue */ int v); + + /* DIR */ + //public native String get_dir(); + //public native void set_dir(String v); + + /** + * init the native class + */ + private void init(long obj) + { + m_Obj = obj; + } + + private native void init(); + private native void init(String str); + private native void init(/* ICalParameterKind */ int kind, String str); + private native void init(/* ICalParameterKind */ int kind); + + /** + * load the jni library for this class + */ + static { + System.loadLibrary("ical_jni"); + } + + public static void main(String[] args) + { + System.out.println("*** ICalParameter main called ok."); + } + + /** pointer to C++ object */ + private long m_Obj = 0; +} diff --git a/src/java/ICalPeriodType.java b/src/java/ICalPeriodType.java new file mode 100644 index 00000000..204ff2a1 --- /dev/null +++ b/src/java/ICalPeriodType.java @@ -0,0 +1,71 @@ +/*====================================================================== + FILE: ICalPeriodType.java + CREATOR: structConverter 01/11/02 +======================================================================*/ + +package net.cp.jlibical; + +public class ICalPeriodType +{ + public ICalPeriodType(long obj) + { + init(obj); + } + + public ICalPeriodType() + { + } + + public ICalPeriodType(long aStart, long aEnd, long aDuration) + { + init(aStart, aEnd, aDuration); + } + + public void setStart(ICalTimeType lcl_arg0) + { + start = lcl_arg0; + } + public ICalTimeType getStart() + { + return start; + } + + public void setEnd(ICalTimeType lcl_arg0) + { + end = lcl_arg0; + } + public ICalTimeType getEnd() + { + return end; + } + + public void setDuration(ICalDurationType lcl_arg0) + { + duration = lcl_arg0; + } + public ICalDurationType getDuration() + { + return duration; + } + + private void init(long aStart, long aEnd, long aDuration) + { + start = new ICalTimeType(aStart); + end = new ICalTimeType(aEnd); + duration = new ICalDurationType(aDuration); + } + + private native void init(long obj); + + private native static void initFIDs(); + + static { + System.loadLibrary("ical_jni"); + initFIDs(); + } + + private ICalTimeType start = new ICalTimeType(); + private ICalTimeType end = new ICalTimeType(); + private ICalDurationType duration = new ICalDurationType(); +} + diff --git a/src/java/ICalProperty.java b/src/java/ICalProperty.java new file mode 100644 index 00000000..02bb2912 --- /dev/null +++ b/src/java/ICalProperty.java @@ -0,0 +1,507 @@ +/*====================================================================== + FILE: ICalProperty.java + CREATOR: gnorman 01/09/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class ICalProperty +{ + /** It's not typesafe, but it's simple to understand! */ + public interface ICalPropertyMethod + { + // icalproperty_method + int ICAL_METHOD_X = 10011; + int ICAL_METHOD_PUBLISH = 10012; + int ICAL_METHOD_REQUEST = 10013; + int ICAL_METHOD_REPLY = 10014; + int ICAL_METHOD_ADD = 10015; + int ICAL_METHOD_CANCEL = 10016; + int ICAL_METHOD_REFRESH = 10017; + int ICAL_METHOD_COUNTER = 10018; + int ICAL_METHOD_DECLINECOUNTER = 10019; + int ICAL_METHOD_CREATE = 10020; + int ICAL_METHOD_READ = 10021; + int ICAL_METHOD_RESPONSE = 10022; + int ICAL_METHOD_MOVE = 10023; + int ICAL_METHOD_MODIFY = 10024; + int ICAL_METHOD_GENERATEUID = 10025; + int ICAL_METHOD_DELETE = 10026; + int ICAL_METHOD_NONE = 10027; + } + + /** It's not typesafe, but it's simple to understand! */ + public interface ICalPropertyAction + { + // icalproperty_action + int ICAL_ACTION_X = 10000; + int ICAL_ACTION_AUDIO = 10001; + int ICAL_ACTION_DISPLAY = 10002; + int ICAL_ACTION_EMAIL = 10003; + int ICAL_ACTION_PROCEDURE = 10004; + int ICAL_ACTION_NONE = 10005; + } + + /** It's not typesafe, but it's simple to understand! */ + public interface ICalPropertyKind + { + // icalproperty_kind + int ICAL_ANY_PROPERTY = 0; + int ICAL_ACTION_PROPERTY=1; + int ICAL_ALLOWCONFLICT_PROPERTY=2; + int ICAL_ATTACH_PROPERTY=3; + int ICAL_ATTENDEE_PROPERTY=4; + int ICAL_CALID_PROPERTY=5; + int ICAL_CALMASTER_PROPERTY=6; + int ICAL_CALSCALE_PROPERTY=7; + int ICAL_CARID_PROPERTY=8; + int ICAL_CATEGORIES_PROPERTY=9; + int ICAL_CLASS_PROPERTY=10; + int ICAL_COMMENT_PROPERTY=11; + int ICAL_COMPLETED_PROPERTY=12; + int ICAL_CONTACT_PROPERTY=13; + int ICAL_CREATED_PROPERTY=14; + int ICAL_DATEFORMAT_PROPERTY=15; + int ICAL_DECREED_PROPERTY=16; + int ICAL_DEFAULTCHARSET_PROPERTY=17; + int ICAL_DEFAULTLOCALE_PROPERTY=18; + int ICAL_DEFAULTTZID_PROPERTY=19; + int ICAL_DESCRIPTION_PROPERTY=20; + int ICAL_DTEND_PROPERTY=21; + int ICAL_DTSTAMP_PROPERTY=22; + int ICAL_DTSTART_PROPERTY=23; + int ICAL_DUE_PROPERTY=24; + int ICAL_DURATION_PROPERTY=25; + int ICAL_EXDATE_PROPERTY=26; + int ICAL_EXPAND_PROPERTY=27; + int ICAL_EXRULE_PROPERTY=28; + int ICAL_FREEBUSY_PROPERTY=29; + int ICAL_GEO_PROPERTY=30; + int ICAL_GRANT_PROPERTY=31; + int ICAL_LASTMODIFIED_PROPERTY=32; + int ICAL_LOCATION_PROPERTY=33; + int ICAL_MAXRESULTS_PROPERTY=34; + int ICAL_MAXRESULTSSIZE_PROPERTY=35; + int ICAL_METHOD_PROPERTY=36; + int ICAL_ORGANIZER_PROPERTY=37; + int ICAL_OWNER_PROPERTY=38; + int ICAL_PERCENTCOMPLETE_PROPERTY=39; + int ICAL_PRIORITY_PROPERTY=40; + int ICAL_PRODID_PROPERTY=41; + int ICAL_QUERY_PROPERTY=42; + int ICAL_QUERYNAME_PROPERTY=43; + int ICAL_RDATE_PROPERTY=44; + int ICAL_RECURRENCEID_PROPERTY=45; + int ICAL_RELATEDTO_PROPERTY=46; + int ICAL_RELCALID_PROPERTY=47; + int ICAL_REPEAT_PROPERTY=48; + int ICAL_REQUESTSTATUS_PROPERTY=49; + int ICAL_RESOURCES_PROPERTY=50; + int ICAL_RRULE_PROPERTY=51; + int ICAL_SCOPE_PROPERTY=52; + int ICAL_SEQUENCE_PROPERTY=53; + int ICAL_STATUS_PROPERTY=54; + int ICAL_SUMMARY_PROPERTY=55; + int ICAL_TARGET_PROPERTY=56; + int ICAL_TIMEFORMAT_PROPERTY=57; + int ICAL_TRANSP_PROPERTY=58; + int ICAL_TRIGGER_PROPERTY=59; + int ICAL_TZID_PROPERTY=60; + int ICAL_TZNAME_PROPERTY=61; + int ICAL_TZOFFSETFROM_PROPERTY=62; + int ICAL_TZOFFSETTO_PROPERTY=63; + int ICAL_TZURL_PROPERTY=64; + int ICAL_UID_PROPERTY=65; + int ICAL_URL_PROPERTY=66; + int ICAL_VERSION_PROPERTY=67; + int ICAL_X_PROPERTY=68; + int ICAL_XLICCLASS_PROPERTY=69; + int ICAL_XLICCLUSTERCOUNT_PROPERTY=70; + int ICAL_XLICERROR_PROPERTY=71; + int ICAL_XLICMIMECHARSET_PROPERTY=72; + int ICAL_XLICMIMECID_PROPERTY=73; + int ICAL_XLICMIMECONTENTTYPE_PROPERTY=74; + int ICAL_XLICMIMEENCODING_PROPERTY=75; + int ICAL_XLICMIMEFILENAME_PROPERTY=76; + int ICAL_XLICMIMEOPTINFO_PROPERTY=77; + int ICAL_NO_PROPERTY=78; + } + + public interface ICalPropertyStatus + { + // icalproperty_status + int ICAL_STATUS_X = 10028; + int ICAL_STATUS_TENTATIVE = 10029; + int ICAL_STATUS_CONFIRMED = 10030; + int ICAL_STATUS_COMPLETED = 10031; + int ICAL_STATUS_NEEDSACTION = 10032; + int ICAL_STATUS_CANCELLED = 10033; + int ICAL_STATUS_INPROCESS = 10034; + int ICAL_STATUS_DRAFT = 10035; + int ICAL_STATUS_FINAL = 10036; + int ICAL_STATUS_NONE = 10037; + } + + /** + * Constructor for ICalProperty + * @param obj c++ pointer + */ + private ICalProperty(long obj) + { + init(obj); + } + + public ICalProperty() + { + init(); + } + + public ICalProperty(String str) + { + init(str); + } + + public ICalProperty(/* ICalPropertyKind */ int kind) + { + init(kind); + } + + public native String as_ical_string(); + public native /* ICalPropertyKind */ int isa(); + public native boolean isa_property(Object property); + + public native void add_parameter(ICalParameter parameter); + public native void set_parameter(ICalParameter parameter); + public native void set_parameter_from_string(String name, String val); + public native String get_parameter_as_string(String name); + public native void remove_parameter(/* ICalParameterKind */ int kind); + public native int count_parameters(); + + /* Iterate through the parameters */ + public native ICalParameter get_first_parameter(/* ICalParameterKind */ int kind); + public native ICalParameter get_next_parameter(/* ICalParameterKind */ int kind); + + /* Access the value of the property */ + public native void set_value(ICalValue val); + public native void set_value_from_string(String val, String kind); + + public native ICalValue get_value(); + public native String get_value_as_string(); + + /* Return the name of the property -- the type name converted to a + String, or the value of get_x_name if the type is X property + */ + public native String get_name(); + + /* Deal with X properties */ + //static void set_x_name(ICalProperty prop, String name); + //static String get_x_name(ICalProperty prop); + + //public native static /* ICalValueKind */ int icalparameter_value_to_value_kind(/* ICalParameterValue */ int val); + + /* Convert kinds to String and get default value type */ + //public native static /* ICalValueKind */ int kind_to_value_kind(/* ICalPropertyKind */ int kind); + //public native static /* ICalValueKind */ int value_kind_to_kind(/* ICalValueKind */ int kind); + //public native static String kind_to_string(/* ICalPropertyKind */ int kind); + //public native static /* ICalPropertyKind */ int string_to_kind(String str); + + //public native static /* ICalPropertyMethod */ int string_to_method(String str); + //public native static String method_to_string(/* ICalPropertyMethod */ int method); + + //public native static String enum_to_string(int e); + //public native static int string_to_enum(String str); + + //public native static String status_to_string(/* ICalPropertyStatus */ int status); + //public native static /* ICalPropertyStatus */ int string_to_status(String str); + + //public native static int enum_belongs_to_property(/* ICalPropertyKind */ int kind, int e); + + /* ACTION */ + public native void set_action(/* ICalPropertyAction */ int v); + public native /* ICalPropertyAction */ int get_action(); + + /* ATTACH */ + //void set_attach(struct icalattachtype v); + //struct icalattachtype get_attach(); + + /* ATTENDEE */ + public native void set_attendee(String val); + public native String get_attendee(); + + /* CALSCALE */ + //public native void set_calscale(String val); + //public native String get_calscale(); + + /* CATEGORIES */ + //public native void set_categories(String val); + //public native String get_categories(); + + /* CLASS */ + //public native void set_class(String val); + //public native String get_class(); + + /* COMMENT */ + public native void set_comment(String val); + public native String get_comment(); + + /* COMPLETED */ + //void set_completed(ICalTimeType val); + //ICalTimeType get_completed(); + + /* CONTACT */ + //public native void set_contact(String val); + //public native String get_contact(); + + /* CREATED */ + //void set_created(ICalTimeType val); + //ICalTimeType get_created(); + + /* DESCRIPTION */ + public native void set_description(String val); + public native String get_description(); + + /* DTEND */ + public native void set_dtend(ICalTimeType val); + public native ICalTimeType get_dtend(); + + /* DTSTAMP */ + public native void set_dtstamp(ICalTimeType val); + public native ICalTimeType get_dtstamp(); + + /* DTSTART */ + public native void set_dtstart(ICalTimeType val); + public native ICalTimeType get_dtstart(); + + /* DUE */ + public native void set_due(ICalTimeType val); + public native ICalTimeType get_due(); + + /* DURATION */ + public native void set_duration(ICalDurationType val); + public native ICalDurationType get_duration(); + + /* EXDATE */ + public native void set_exdate(ICalTimeType val); + public native ICalTimeType get_exdate(); + + /* EXRULE */ + public native void set_exrule(ICalRecurrenceType val); + public native ICalRecurrenceType get_exrule(); + + /* EXPAND */ + public void set_expand(int val) {} // @-@:p0 TMA TODO + public int get_expand() {return 0;} // @-@:p0 TMA TODO + + /* FREEBUSY */ + public native void set_freebusy(ICalPeriodType val); + public native ICalPeriodType get_freebusy(); + + /* GEO */ + //void set_geo(struct icalgeotype val); + //struct icalgeotype get_geo(); + + /* LAST-MODIFIED */ + //void set_lastmodified(ICalTimeType val); + //ICalTimeType get_lastmodified(); + + /* LOCATION */ + public native void set_location(String val); + public native String get_location(); + + /* MAXRESULTS */ + //public native void set_maxresults(int val); + //public native int get_maxresults(); + + /* MAXRESULTSSIZE */ + //public native void set_maxresultsize(int val); + //public native int get_maxresultsize(); + + /* METHOD */ + public native void set_method(/* ICalPropertyMethod */ int val); + public native /* ICalPropertyMethod */ int get_method(); + + /* ORGANIZER */ + public native void set_organizer(String val); + public native String get_organizer(); + + /* OWNER */ + public native void set_owner(String val); + public native String get_owner(); + + /* PERCENT-COMPLETE */ + //void set_percentcomplete(int val); + //int get_percentcomplete(); + + /* PRIORITY */ + //void set_priority(int val); + //int get_priority(); + + /* PRODID */ + public native void set_prodid(String val); + public native String get_prodid(); + + /* QUERY */ + public native void set_query(String val); + public native String get_query(); + + /* QUERYNAME */ + public native void set_queryname(String val); + public native String get_queryname(); + + /* RDATE */ + //void set_rdate(struct icaldatetimeperiodtype val); + //struct icaldatetimeperiodtype get_rdate(); + + /* RECURRENCE-ID */ + public native void set_recurrenceid(ICalTimeType val); + public native ICalTimeType get_recurrenceid(); + + /* RELATED-TO */ + //public native void set_relatedto(String val); + //public native String get_relatedto(); + + /* RELCALID */ + public native void set_relcalid(String val); + public native String get_relcalid(); + + /* REPEAT */ + public native void set_repeat(int val); + public native int get_repeat(); + + /* REQUEST-STATUS */ + //public native void set_requeststatus(String val); + //public native String get_requeststatus(); + + /* RESOURCES */ + //public native void set_resources(String val); + //public native String get_resources(); + + /* RRULE */ + public native void set_rrule(ICalRecurrenceType val); + public native ICalRecurrenceType get_rrule(); + + /* SCOPE */ + //public native void set_scope(String val); + //public native String get_scope(); + + /* SEQUENCE */ + //public native void set_sequence(int val); + //public native int get_sequence(); + + /* STATUS */ + public native void set_status(/* ICalPropertyStatus */ int val); + public native /* ICalPropertyStatus */ int get_status(); + + /* SUMMARY */ + public native void set_summary(String val); + public native String get_summary(); + + /* TARGET */ + public native void set_target(String val); + public native String get_target(); + + /* TRANSP */ + //public native void set_transp(String val); + //public native String get_transp(); + + /* TRIGGER */ + public native void set_trigger(ICalTriggerType val); + public native ICalTriggerType get_trigger(); + + /* TZID */ + public native void set_tzid(String val); + public native String get_tzid(); + + /* TZNAME */ + //public native void set_tzname(String val); + //public native String get_tzname(); + + /* TZOFFSETFROM */ + //public native void set_tzoffsetfrom(int val); + //public native int get_tzoffsetfrom(); + + + /* TZOFFSETTO */ + //public native void set_tzoffsetto(int val); + //public native int get_tzoffsetto(); + + /* TZURL */ + //public native void set_tzurl(String val); + //public native String get_tzurl(); + + /* UID */ + public native void set_uid(String val); + public native String get_uid(); + + /* URL */ + //public native void set_url(String val); + //public native String get_url(); + + /* VERSION */ + //public native void set_version(String val); + //public native String get_version(); + + /* X */ + //void set_x(String val); + //String get_x(); + + /* X-LIC-CLUSTERCOUNT */ + //void set_xlicclustercount(String val); + //String get_xlicclustercount(); + + /* X-LIC-ERROR */ + //void set_xlicerror(String val); + //String get_xlicerror(); + + /* X-LIC-MIMECHARSET */ + //void set_xlicmimecharset(String val); + //String get_xlicmimecharset(); + + /* X-LIC-MIMECID */ + //void set_xlicmimecid(String val); + //String get_xlicmimecid(); + + /* X-LIC-MIMECONTENTTYPE */ + //void set_xlicmimecontenttype(String val); + //String get_xlicmimecontenttype(); + + /* X-LIC-MIMEENCODING */ + //void set_xlicmimeencoding(String val); + //String get_xlicmimeencoding(); + + /* X-LIC-MIMEFILENAME */ + //void set_xlicmimefilename(String val); + //String get_xlicmimefilename(); + + /* X-LIC-MIMEOPTINFO */ + //void set_xlicmimeoptinfo(String val); + //String get_xlicmimeoptinfo(); + + /** + * init the native class + */ + private void init(long obj) + { + m_Obj = obj; + } + + private native void init(); + private native void init(String str); + private native void init(/* ICalPropertyKind */ int kind); + + /** + * load the jni library for this class + */ + static { + System.loadLibrary("ical_jni"); + } + + public static void main(String[] args) + { + System.out.println("*** ICalProperty main called ok."); + } + + /** pointer to C++ object */ + private long m_Obj = 0; +} diff --git a/src/java/ICalRecurrenceType.java b/src/java/ICalRecurrenceType.java new file mode 100644 index 00000000..cfe27911 --- /dev/null +++ b/src/java/ICalRecurrenceType.java @@ -0,0 +1,284 @@ +/*====================================================================== + FILE: ICalRecurrenceType.java + CREATOR: structConverter 01/11/02 +======================================================================*/ + +package net.cp.jlibical; + +public class ICalRecurrenceType +{ + public interface ICalRecurrenceTypeFrequency + { + int ICAL_SECONDLY_RECURRENCE=0; + int ICAL_MINUTELY_RECURRENCE=1; + int ICAL_HOURLY_RECURRENCE=2; + int ICAL_DAILY_RECURRENCE=3; + int ICAL_WEEKLY_RECURRENCE=4; + int ICAL_MONTHLY_RECURRENCE=5; + int ICAL_YEARLY_RECURRENCE=6; + int ICAL_NO_RECURRENCE=7; + } + + public interface ICalRecurrenceTypeWeekday + { + int ICAL_NO_WEEKDAY=0; + int ICAL_SUNDAY_WEEKDAY=1; + int ICAL_MONDAY_WEEKDAY=2; + int ICAL_TUESDAY_WEEKDAY=3; + int ICAL_WEDNESDAY_WEEKDAY=4; + int ICAL_THURSDAY_WEEKDAY=5; + int ICAL_FRIDAY_WEEKDAY=6; + int ICAL_SATURDAY_WEEKDAY=7; + } + + ICalRecurrenceType(long obj) + { + init(obj); + } + + public ICalRecurrenceType() + { + } + + public void setUntil(ICalTimeType lcl_arg0) + { + until = lcl_arg0; + } + public ICalTimeType getUntil() + { + return until; + } + + public void setFreq(int lcl_arg0) + { + freq = lcl_arg0; + } + public int getFreq() + { + return freq; + } + + public void setWeek_start(int lcl_arg0) + { + week_start = lcl_arg0; + } + public int getWeek_start() + { + return week_start; + } + + public void setCount(int lcl_arg0) + { + count = lcl_arg0; + } + public int getCount() + { + return count; + } + + public void setInterval(short lcl_arg0) + { + interval = lcl_arg0; + } + public short getInterval() + { + return interval; + } + + public void setBy_second(short[] lcl_arg0) + { + by_second = lcl_arg0; + } + + public void setBy_secondIndexed(int ix,short lcl_arg0) + { + by_second[ix] = lcl_arg0; + } + public short[] getBy_second() + { + return by_second; + } + public short getBy_secondIndexed(int ix) + { + return by_second[ix]; + } + + public void setBy_minute(short[] lcl_arg0) + { + by_minute = lcl_arg0; + } + + public void setBy_minuteIndexed(int ix,short lcl_arg0) + { + by_minute[ix] = lcl_arg0; + } + public short[] getBy_minute() + { + return by_minute; + } + public short getBy_minuteIndexed(int ix) + { + return by_minute[ix]; + } + + public void setBy_hour(short[] lcl_arg0) + { + by_hour = lcl_arg0; + } + + public void setBy_hourIndexed(int ix,short lcl_arg0) + { + by_hour[ix] = lcl_arg0; + } + public short[] getBy_hour() + { + return by_hour; + } + public short getBy_hourIndexed(int ix) + { + return by_hour[ix]; + } + + public void setBy_day(short[] lcl_arg0) + { + by_day = lcl_arg0; + } + + public void setBy_dayIndexed(int ix,short lcl_arg0) + { + by_day[ix] = lcl_arg0; + } + public short[] getBy_day() + { + return by_day; + } + public short getBy_dayIndexed(int ix) + { + return by_day[ix]; + } + + public void setBy_month_day(short[] lcl_arg0) + { + by_month_day = lcl_arg0; + } + + public void setBy_month_dayIndexed(int ix,short lcl_arg0) + { + by_month_day[ix] = lcl_arg0; + } + public short[] getBy_month_day() + { + return by_month_day; + } + public short getBy_month_dayIndexed(int ix) + { + return by_month_day[ix]; + } + + public void setBy_year_day(short[] lcl_arg0) + { + by_year_day = lcl_arg0; + } + + public void setBy_year_dayIndexed(int ix,short lcl_arg0) + { + by_year_day[ix] = lcl_arg0; + } + public short[] getBy_year_day() + { + return by_year_day; + } + public short getBy_year_dayIndexed(int ix) + { + return by_year_day[ix]; + } + + public void setBy_week_no(short[] lcl_arg0) + { + by_week_no = lcl_arg0; + } + + public void setBy_week_noIndexed(int ix,short lcl_arg0) + { + by_week_no[ix] = lcl_arg0; + } + public short[] getBy_week_no() + { + return by_week_no; + } + public short getBy_week_noIndexed(int ix) + { + return by_week_no[ix]; + } + + public void setBy_month(short[] lcl_arg0) + { + by_month = lcl_arg0; + } + + public void setBy_monthIndexed(int ix,short lcl_arg0) + { + by_month[ix] = lcl_arg0; + } + public short[] getBy_month() + { + return by_month; + } + public short getBy_monthIndexed(int ix) + { + return by_month[ix]; + } + + public void setBy_set_pos(short[] lcl_arg0) + { + by_set_pos = lcl_arg0; + } + + public void setBy_set_posIndexed(int ix,short lcl_arg0) + { + by_set_pos[ix] = lcl_arg0; + } + public short[] getBy_set_pos() + { + return by_set_pos; + } + public short getBy_set_posIndexed(int ix) + { + return by_set_pos[ix]; + } + + private native void init(long obj); + + private native static void initFIDs(); + + static { + System.loadLibrary("ical_jni"); + initFIDs(); + } + + private /* ICalRecurrenceTypeFrequency */ int freq; + private /* ICalRecurrenceTypeWeekday */ int week_start; + private int count; + private short interval; + private short[] by_second = new short[ICAL_BY_SECOND_SIZE]; // Converted from short[61] + private short[] by_minute = new short[ICAL_BY_MINUTE_SIZE]; // Converted from short[61] + private short[] by_hour = new short[ICAL_BY_HOUR_SIZE]; // Converted from short[25] + private short[] by_day = new short[ICAL_BY_DAY_SIZE]; // Converted from short[364] + private short[] by_month_day = new short[ICAL_BY_MONTHDAY_SIZE]; // Converted from short[32] + private short[] by_year_day = new short[ICAL_BY_YEARDAY_SIZE]; // Converted from short[367] + private short[] by_week_no = new short[ICAL_BY_WEEKNO_SIZE]; // Converted from short[54] + private short[] by_month = new short[ICAL_BY_MONTH_SIZE]; // Converted from short[13] + private short[] by_set_pos = new short[ICAL_BY_SETPOS_SIZE]; // Converted from short[367] + private ICalTimeType until = new ICalTimeType(); + + public static final int ICAL_BY_SECOND_SIZE = 61; + public static final int ICAL_BY_MINUTE_SIZE = 61; + public static final int ICAL_BY_HOUR_SIZE = 25; + public static final int ICAL_BY_DAY_SIZE = 364; + public static final int ICAL_BY_MONTHDAY_SIZE = 32; + public static final int ICAL_BY_YEARDAY_SIZE = 367; + public static final int ICAL_BY_WEEKNO_SIZE = 54; + public static final int ICAL_BY_MONTH_SIZE = 13; + public static final int ICAL_BY_SETPOS_SIZE = 367; +} + diff --git a/src/java/ICalTimeType.java b/src/java/ICalTimeType.java new file mode 100644 index 00000000..cf4ee407 --- /dev/null +++ b/src/java/ICalTimeType.java @@ -0,0 +1,145 @@ +/*====================================================================== + FILE: ICalTimeType.java + CREATOR: structConverter 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +/** struct icaltimetype */ +public class ICalTimeType +{ + /** + * Constructor for pre-existing native icaltimetype + * @param obj c++ pointer + */ + ICalTimeType(long obj) + { + init(obj); + } + + /** + * Constructor for default ICalTimeType + */ + public ICalTimeType() + { + } + + public void setYear(int lcl_arg0) + { + year = lcl_arg0; + } + public int getYear() + { + return year; + } + + public void setMonth(int lcl_arg0) + { + month = lcl_arg0; + } + public int getMonth() + { + return month; + } + + public void setDay(int lcl_arg0) + { + day = lcl_arg0; + } + public int getDay() + { + return day; + } + + public void setHour(int lcl_arg0) + { + hour = lcl_arg0; + } + public int getHour() + { + return hour; + } + + public void setMinute(int lcl_arg0) + { + minute = lcl_arg0; + } + public int getMinute() + { + return minute; + } + + public void setSecond(int lcl_arg0) + { + second = lcl_arg0; + } + public int getSecond() + { + return second; + } + + public void setIs_utc(boolean lcl_arg0) + { + is_utc = lcl_arg0 ? 1 : 0; + } + public boolean getIs_utc() + { + return is_utc == 0 ? false : true; + } + + public void setIs_date(boolean lcl_arg0) + { + is_date = lcl_arg0 ? 1 : 0; + } + public boolean getIs_date() + { + return is_date == 0 ? false : true; + } + + public void setZone(String lcl_arg0) + { + zone = lcl_arg0; + } + public String getZone() + { + return zone; + } + + // -------------------------------------------------------- + // Initialization + // -------------------------------------------------------- + + /** + * copy data from an existing struct. + */ + private native void init(long obj); + + /** + * optimization: init field id cache, + */ + private native static void initFIDs(); + + /** + * load the jni library for this class + */ + static { + System.loadLibrary("ical_jni"); + initFIDs(); + } + + // -------------------------------------------------------- + // Fields + // -------------------------------------------------------- + + private int month; + private int day; + private int year; + private int hour; + private int minute; + private int second; + private int is_utc; + private int is_date; + private String zone = new String(); // Converted from char* +} + diff --git a/src/java/ICalTriggerType.java b/src/java/ICalTriggerType.java new file mode 100644 index 00000000..e2ef7a72 --- /dev/null +++ b/src/java/ICalTriggerType.java @@ -0,0 +1,93 @@ +/*====================================================================== + FILE: ICalTriggerType.java + CREATOR: structConverter 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +/** struct icaltriggertype */ +public class ICalTriggerType +{ + /** + * Constructor for pre-existing native icaltriggertype + * @param obj c++ pointer + */ + ICalTriggerType(long obj) + { + init(obj); + } + + /** + * Constructor for pre-existing native icaltriggertype + * @param aTime c++ pointer + * @param aDuration c++ pointer + */ + ICalTriggerType(long aTime, long aDuration) + { + init(aTime, aDuration); + } + + /** + * Constructor for default ICalTriggerType + */ + public ICalTriggerType() + { + } + + public void setTime(ICalTimeType lcl_arg0) + { + time = lcl_arg0; + } + public ICalTimeType getTime() + { + return time; + } + + public void setDuration(ICalDurationType lcl_arg0) + { + duration = lcl_arg0; + } + public ICalDurationType getDuration() + { + return duration; + } + + // -------------------------------------------------------- + // Initialization + // -------------------------------------------------------- + + /** + * init with a native object + */ + private void init(long aTime, long aDuration) + { + time = new ICalTimeType(aTime); + duration = new ICalDurationType(aDuration); + } + + /** + * copy data from an existing struct. + */ + private native void init(long obj); + + /** + * optimization: init field id cache, + */ + private native static void initFIDs(); + + /** + * load the jni library for this class + */ + static { + System.loadLibrary("ical_jni"); + initFIDs(); + } + + // -------------------------------------------------------- + // Fields + // -------------------------------------------------------- + private ICalTimeType time = new ICalTimeType(); + private ICalDurationType duration = new ICalDurationType(); +} + diff --git a/src/java/ICalValue.java b/src/java/ICalValue.java new file mode 100644 index 00000000..dbe2b8ae --- /dev/null +++ b/src/java/ICalValue.java @@ -0,0 +1,209 @@ +/*====================================================================== + FILE: ICalValue.java + CREATOR: gnorman 01/10/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class ICalValue +{ + /** It's not typesafe, but it's simple to understand! */ + public interface ICalValueKind + { + // icalvalue_kind + int ICAL_ANY_VALUE=5000; + int ICAL_BOOLEAN_VALUE=5001; + int ICAL_UTCOFFSET_VALUE=5002; + int ICAL_RECUR_VALUE=5003; + int ICAL_METHOD_VALUE=5004; + int ICAL_CALADDRESS_VALUE=5005; + int ICAL_PERIOD_VALUE=5006; + int ICAL_STATUS_VALUE=5007; + int ICAL_BINARY_VALUE=5008; + int ICAL_TEXT_VALUE=5009; + int ICAL_DATETIMEDATE_VALUE=5010; + int ICAL_DURATION_VALUE=5011; + int ICAL_DATETIMEPERIOD_VALUE=5012; + int ICAL_INTEGER_VALUE=5013; + int ICAL_TIME_VALUE=5014; + int ICAL_URI_VALUE=5015; + int ICAL_TRIGGER_VALUE=5016; + int ICAL_ATTACH_VALUE=5017; + int ICAL_CLASS_VALUE=5018; + int ICAL_FLOAT_VALUE=5019; + int ICAL_QUERY_VALUE=5020; + int ICAL_STRING_VALUE=5021; + int ICAL_TRANSP_VALUE=5022; + int ICAL_X_VALUE=5023; + int ICAL_DATETIME_VALUE=5024; + int ICAL_GEO_VALUE=5025; + int ICAL_DATE_VALUE=5026; + int ICAL_ACTION_VALUE=5027; + int ICAL_NO_VALUE=5028; + } + + /** + * Constructor for ICalValue + * @param obj c++ pointer + */ + private ICalValue(long obj) + { + init(obj); + } + + public ICalValue() + { + init(); + } + + public ICalValue(/* ICalValueKind */ int kind) + { + init(kind); + } + + public ICalValue(/* ICalValueKind */ int kind, String str) + { + init(kind,str); + } + + public native String as_ical_string(); + //public native boolean is_valid(); + public native /* ICalValueKind */ int isa(); + public native boolean isa_value(Object value); + + /* Special, non autogenerated value accessors */ + //void set_recur(struct icalrecurrencetype v); + //struct icalrecurrencetype get_recur(); + + public native void set_trigger(ICalTriggerType v); + public native ICalTriggerType get_trigger(); + + //void set_datetimeperiod(struct icaldatetimeperiodtype v); + //struct icaldatetimeperiodtype get_datetimeperiod(); + + //public native static /* ICalParameterXLicCompareType */ int compare(ICalValue a, ICalValue b); + + /* Convert enumerations */ + //public native static /* ICalValueKind */ int string_to_kind(String str); + //public native String kind_to_string(/* ICalValueKind */ int kind); + + /* BOOLEAN */ + //public native int get_boolean(); + //public native void set_boolean(int v); + + /* UTC-OFFSET */ + //public native int get_utcoffset(); + //public native void set_utcoffset(int v); + + /* METHOD */ + public native /* ICalPropertyMethod */ int get_method(); + public native void set_method(/* ICalPropertyMethod */ int v); + + /* CAL-ADDRESS */ + //public native String get_caladdress(); + //public native void set_caladdress(String v); + + /* PERIOD */ + //struct icalperiodtype get_period(); + //void set_period(struct icalperiodtype v); + + /* STATUS */ + //public native /* ICalPropertyStatus */ int get_status(); + //public native void set_status(/* ICalPropertyStatus */ int v); + + /* BINARY */ + //public native String get_binary(); + //public native void set_binary(String v); + + /* TEXT */ + public native String get_text(); + public native void set_text(String v); + + /* DATE-TIME-DATE */ + //ICalTimeType get_datetimedate(); + //void set_datetimedate(ICalTimeType v); + + /* DURATION */ + public native ICalDurationType get_duration(); + public native void set_duration(ICalDurationType v); + + /* INTEGER */ + //public native int get_integer(); + //public native void set_integer(int v); + + /* TIME */ + //ICalTimeType get_time(); + //void set_time(ICalTimeType v); + + /* URI */ + //public native String get_uri(); + //public native void set_uri(String v); + + /* ATTACH */ + //struct icalattachtype get_attach(); + //void set_attach(struct icalattachtype v); + + /* CLASS */ + //public native /* ICalPropertyClass */ int get_class(); + //public native void set_class(/* ICalPropertyClass */ int v); + + /* FLOAT */ + //public native float get_float(); + //public native void set_float(float v); + + /* QUERY */ + public native String get_query(); + public native void set_query(String v); + + /* STRING */ + //public native String get_string(); + //public native void set_string(String v); + + /* TRANSP */ + //public native /* ICalPropertyTransp */ int get_transp(); + //public native void set_transp(/* ICalPropertyTransp */ int v); + + /* DATE-TIME */ + public native ICalTimeType get_datetime(); + public native void set_datetime(ICalTimeType v); + + /* GEO */ + //struct icalgeotype get_geo(); + //void set_geo(struct icalgeotype v); + + /* DATE */ + //ICalTimeType get_date(); + //void set_date(ICalTimeType v); + + /* ACTION */ + public native /* ICalPropertyAction */ int get_action(); + public native void set_action(/* ICalPropertyAction */ int v); + + /** + * init the native class + */ + private void init(long obj) + { + m_Obj = obj; + } + + private native void init(); + private native void init(/* ICalValueKind */ int kind, String str); + private native void init(/* ICalValueKind */ int kind); + + /** + * load the jni library for this class + */ + static { + System.loadLibrary("ical_jni"); + } + + public static void main(String[] args) + { + System.out.println("*** ICalValue main called ok."); + } + + /** pointer to C++ object */ + private long m_Obj = 0; +} diff --git a/src/java/VAgenda.java b/src/java/VAgenda.java new file mode 100644 index 00000000..8b85fe11 --- /dev/null +++ b/src/java/VAgenda.java @@ -0,0 +1,24 @@ +/*====================================================================== + FILE: VAgenda.java + CREATOR: fnguyen 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class VAgenda extends VComponent { + public VAgenda() + { + super(ICalComponentKind.ICAL_VAGENDA_COMPONENT); + } + + public VAgenda(long obj) + { + super(obj); + } + + public VAgenda(String str) + { + super(str); + } +} diff --git a/src/java/VAlarm.java b/src/java/VAlarm.java new file mode 100644 index 00000000..d7693f76 --- /dev/null +++ b/src/java/VAlarm.java @@ -0,0 +1,24 @@ +/*====================================================================== + FILE: VAlarm.java + CREATOR: fnguyen 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class VAlarm extends VComponent { + public VAlarm() + { + super(ICalComponentKind.ICAL_VALARM_COMPONENT); + } + + public VAlarm(long obj) + { + super(obj); + } + + public VAlarm(String str) + { + super(str); + } +} diff --git a/src/java/VCalendar.java b/src/java/VCalendar.java new file mode 100644 index 00000000..4cfcad27 --- /dev/null +++ b/src/java/VCalendar.java @@ -0,0 +1,24 @@ +/*====================================================================== + FILE: VCalendar.java + CREATOR: echoi 01/28/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class VCalendar extends VComponent { + public VCalendar() + { + super(ICalComponentKind.ICAL_VCALENDAR_COMPONENT); + } + + public VCalendar(long obj) + { + super(obj); + } + + public VCalendar(String str) + { + super(str); + } +} diff --git a/src/java/VComponent.java b/src/java/VComponent.java new file mode 100644 index 00000000..70c5915c --- /dev/null +++ b/src/java/VComponent.java @@ -0,0 +1,199 @@ +/*====================================================================== + FILE: VComponent.java + CREATOR: gnorman 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class VComponent +{ + /** It's not typesafe, but it's simple to understand! */ + public interface ICalComponentKind + { + // icalcomponent_kind + int ICAL_NO_COMPONENT = 0; + int ICAL_ANY_COMPONENT = 1; + int ICAL_XROOT_COMPONENT = 2; + int ICAL_XATTACH_COMPONENT = 3; + int ICAL_VEVENT_COMPONENT = 4; + int ICAL_VTODO_COMPONENT = 5; + int ICAL_VJOURNAL_COMPONENT = 6; + int ICAL_VCALENDAR_COMPONENT = 7; + int ICAL_VAGENDA_COMPONENT = 8; + int ICAL_VFREEBUSY_COMPONENT = 9; + int ICAL_VALARM_COMPONENT = 10; + int ICAL_XAUDIOALARM_COMPONENT = 11; + int ICAL_XDISPLAYALARM_COMPONENT = 12; + int ICAL_XEMAILALARM_COMPONENT = 13; + int ICAL_XPROCEDUREALARM_COMPONENT = 14; + int ICAL_VTIMEZONE_COMPONENT = 15; + int ICAL_XSTANDARD_COMPONENT = 16; + int ICAL_XDAYLIGHT_COMPONENT = 17; + int ICAL_X_COMPONENT = 18; + int ICAL_VSCHEDULE_COMPONENT = 19; + int ICAL_VQUERY_COMPONENT = 20; + int ICAL_VCOMMAND_COMPONENT = 21; + int ICAL_XLICINVALID_COMPONENT = 22; + int ICAL_XLICMIMEPART_COMPONENT = 23; + int ICAL_XPREFERENCES_COMPONENT = 24; + } + + /** + * Constructor for VComponent + * @param obj c++ pointer + */ + protected VComponent(long obj) + { + init(obj); + } + + public VComponent() + { + init(); + } + + public VComponent(/* ICalComponentKind */ int kind) + { + init(kind); + } + + public VComponent(String str) + { + init(str); + } + + public native String as_ical_string(); + //public native boolean is_valid(); + public native /* ICalComponentKind */ int isa(); + public native boolean isa_component(Object component); + + /* Working with properties */ + public native void add_property(ICalProperty property); + public native void remove_property(ICalProperty property); + public native int count_properties(/* ICalPropertyKind */ int kind); + + /* Iterate through the properties */ + public native ICalProperty get_current_property(); + public native ICalProperty get_first_property(/* ICalPropertyKind */ int kind); + public native ICalProperty get_next_property(/* ICalPropertyKind */ int kind); + + /* Working with components */ + + /* Return the first VEVENT, VTODO or VJOURNAL sub-component if it is one of those types */ + public native VComponent get_inner(); + + public native void add_component(VComponent child); + public native void remove_component(VComponent child); + public native int count_components(/* ICalComponentKind */ int kind); + + /* Iteration Routines. There are two forms of iterators, internal and + external. The internal ones came first, and are almost completely + sufficient, but they fail badly when you want to construct a loop that + removes components from the container. + */ + + /* Iterate through components */ + public native VComponent get_current_component(); + public native VComponent get_first_component(/* ICalComponentKind */ int kind); + public native VComponent get_next_component(/* ICalComponentKind */ int kind); + + /* Using external iterators */ + //public native icalcompiter begin_component(/* ICalComponentKind */ int kind); + //public native icalcompiter end_component(/* ICalComponentKind */ int kind); + //public native VComponent next(icalcompiter i); + //public native VComponent prev(icalcompiter i); + //public native VComponent current(icalcompiter i); + + /* Working with embedded error properties */ + //public native int count_errors(); + + /* Remove all X-LIC-ERROR properties*/ + //public native void strip_errors(); + + /* Convert some X-LIC-ERROR properties into RETURN-STATUS properties*/ + //public native void convert_errors(); + + /* Kind conversion routines */ + //public native static /* ICalComponentKind */ int string_to_kind(String str); + //public native static String kind_to_string(/* ICalComponentKind */ int kind); + + public native ICalTimeType get_dtstart(); + public native void set_dtstart(ICalTimeType v); + + /* For the icalcomponent routines only, dtend and duration are tied + together. If you call the set routine for one and the other exists, + the routine will calculate the change to the other. That is, if + there is a DTEND and you call set_duration, the routine will modify + DTEND to be the sum of DTSTART and the duration. If you call a get + routine for one and the other exists, the routine will calculate + the return value. If you call a set routine and neither exists, the + routine will create the apcompriate comperty */ + + public native ICalTimeType get_dtend(); + public native void set_dtend(ICalTimeType v); + + public native ICalDurationType get_duration(); + public native void set_duration(ICalDurationType v); + + public native /* ICalPropertyMethod */ int get_method(); + public native void set_method(/* ICalPropertyMethod */ int method); + + public native ICalTimeType get_dtstamp(); + public native void set_dtstamp(ICalTimeType v); + + public native String get_summary(); + public native void set_summary(String v); + + public native String get_location(); + public native void set_location(String v); + + public native String get_description(); + public native void set_description(String v); + + //public native String get_comment(); + //public native void set_comment(String v); + + public native String get_uid(); + public native void set_uid(String v); + + public native String get_relcalid(); + public native void set_relcalid(String v); + + public native ICalTimeType get_recurrenceid(); + public native void set_recurrenceid(ICalTimeType v); + + /* For VCOMPONENT: Return a reference to the first VEVENT, VTODO, or VJOURNAL */ + public native VComponent get_first_real_component(); + + /* For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end + times of an event in UTC */ + //public native virtual struct icaltime_span get_span(); + + /** + * init the native class + */ + private void init(long obj) + { + m_Obj = obj; + } + + private native void init(); + private native void init(String str); + private native void init(/* ICalComponentKind */ int kind); + + /** + * load the jni library for this class + */ + static { + System.loadLibrary("ical_jni"); + } + + public static void main(String[] args) + { + System.out.println("*** VComponent main called ok."); + } + + /** pointer to C++ object */ + private long m_Obj = 0; +} diff --git a/src/java/VEvent.java b/src/java/VEvent.java new file mode 100644 index 00000000..2017aa58 --- /dev/null +++ b/src/java/VEvent.java @@ -0,0 +1,24 @@ +/*====================================================================== + FILE: VEvent.java + CREATOR: fnguyen 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class VEvent extends VComponent { + public VEvent() + { + super(ICalComponentKind.ICAL_VEVENT_COMPONENT); + } + + public VEvent(long obj) + { + super(obj); + } + + public VEvent(String str) + { + super(str); + } +} diff --git a/src/java/VFreeBusy.java b/src/java/VFreeBusy.java new file mode 100644 index 00000000..a781edc5 --- /dev/null +++ b/src/java/VFreeBusy.java @@ -0,0 +1,18 @@ +package net.cp.jlibical; + +public class VFreeBusy extends VComponent { + public VFreeBusy() + { + super(ICalComponentKind.ICAL_VFREEBUSY_COMPONENT); + } + + public VFreeBusy(long obj) + { + super(obj); + } + + public VFreeBusy(String str) + { + super(str); + } +} diff --git a/src/java/VQuery.java b/src/java/VQuery.java new file mode 100644 index 00000000..e94a0732 --- /dev/null +++ b/src/java/VQuery.java @@ -0,0 +1,24 @@ +/*====================================================================== + FILE: VQuery.java + CREATOR: fnguyen 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class VQuery extends VComponent { + public VQuery() + { + super(ICalComponentKind.ICAL_VQUERY_COMPONENT); + } + + public VQuery(long obj) + { + super(obj); + } + + public VQuery(String str) + { + super(str); + } +} diff --git a/src/java/VToDo.java b/src/java/VToDo.java new file mode 100644 index 00000000..9e4a06e1 --- /dev/null +++ b/src/java/VToDo.java @@ -0,0 +1,24 @@ +/*====================================================================== + FILE: VToDo.java + CREATOR: fnguyen 01/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +package net.cp.jlibical; + +public class VToDo extends VComponent { + public VToDo() + { + super(ICalComponentKind.ICAL_VTODO_COMPONENT); + } + + public VToDo(long obj) + { + super(obj); + } + + public VToDo(String str) + { + super(str); + } +} diff --git a/src/java/jlibical_consts_cxx.h b/src/java/jlibical_consts_cxx.h new file mode 100644 index 00000000..2cdf1f8b --- /dev/null +++ b/src/java/jlibical_consts_cxx.h @@ -0,0 +1,42 @@ + +/*====================================================================== + FILE: jlibical_consts_cxx/h + CREATOR: Srinivasa Boppana/George Norman + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef JLIBICAL_CONSTS_CXX_H +#define JLIBICAL_CONSTS_CXX_H + +/* + * Error code constants. + */ +#define JLIBICAL_OK 0 /* good return code */ + +/* system/API errors */ +#define JLIBICAL_ERR_NETWORK 100 /* general network error */ +#define JLIBICAL_ERR_SERVER_INTERNAL 101 /* internal server error (database, file system, etc.) */ +#define JLIBICAL_ERR_CLIENT_INTERNAL 102 /* internal error in client API (memory, parsing errors, etc.)*/ +#define JLIBICAL_ERR_ILLEGAL_ARGUMENT 103 /* incorrect API use */ +#define JLIBICAL_ERR_API_NOT_INITED 104 /* either the InitModule API call was called prior to use of the API or it failed to initialize correctly */ +#define JLIBICAL_ERR_HOST_INVALID 105 /* the host name specified cannot be resolved */ + +/* Java classes */ +#define JLIBICAL_CLASS_ICALVALUE "net/cp/jlibical/ICalValue" +#define JLIBICAL_CLASS_VCOMPONENT "net/cp/jlibical/VComponent" +#define JLIBICAL_CLASS_VALARM "net/cp/jlibical/VAlarm" +#define JLIBICAL_CLASS_VCALENDAR "net/cp/jlibical/VCalendar" +#define JLIBICAL_CLASS_VAGENDA "net/cp/jlibical/VAgenda" +#define JLIBICAL_CLASS_VEVENT "net/cp/jlibical/VEvent" +#define JLIBICAL_CLASS_VQUERY "net/cp/jlibical/VQuery" +#define JLIBICAL_CLASS_VTODO "net/cp/jlibical/VToDo" +#define JLIBICAL_CLASS_ICALPARAMETER "net/cp/jlibical/ICalParameter" +#define JLIBICAL_CLASS_ICALPROPERTY "net/cp/jlibical/ICalProperty" + +#define JLIBICAL_CLASS_ICALDURATIONTYPE "net/cp/jlibical/ICalDurationType" +#define JLIBICAL_CLASS_ICALTIMETYPE "net/cp/jlibical/ICalTimeType" +#define JLIBICAL_CLASS_ICALTRIGGERTYPE "net/cp/jlibical/ICalTriggerType" +#define JLIBICAL_CLASS_ICALRECURRENCETYPE "net/cp/jlibical/ICalRecurrenceType" +#define JLIBICAL_CLASS_ICALPERIODTYPE "net/cp/jlibical/ICalPeriodType" + +#endif /* JLIBICAL_CONSTS_CXX_H */ diff --git a/src/java/jlibical_utils_cxx.cpp b/src/java/jlibical_utils_cxx.cpp new file mode 100644 index 00000000..d06d4ba0 --- /dev/null +++ b/src/java/jlibical_utils_cxx.cpp @@ -0,0 +1,458 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: jlibical_utils_cxx.cpp + CREATOR: Srinivasa Boppana/George Norman + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef JLIBICAL_UTILS_CXX_H +#include "jlibical_utils_cxx.h" +#endif + +#ifndef JLIBICAL_CONSTS_CXX_H +#include "jlibical_consts_cxx.h" +#endif + +#ifndef ICALPARAMETER_CXX_H +#include "icalparameter_cxx.h" +#endif + +#ifndef VCOMPONENT_CXX_H +#include "vcomponent.h" +#endif + +#ifndef ICALPROPERTY_CXX_H +#include "icalproperty_cxx.h" +#endif + +#ifndef ICALVALUE_CXX_H +#include "icalvalue_cxx.h" +#endif + +#ifndef _jni_ICalTimeType_H +#include "jniICalTimeType_cxx.h" +#endif + +#ifndef _jni_ICalTriggerType_H +#include "jniICalTriggerType_cxx.h" +#endif + +#ifndef _jni_ICalDurationType_H +#include "jniICalDurationType_cxx.h" +#endif + +#ifndef _jni_ICalRecurrenceType_H +#include "jniICalRecurrenceType_cxx.h" +#endif + +#ifndef _jni_ICalPeriodType_H +#include "jniICalPeriodType_cxx.h" +#endif + +//------------------------------------------------------- +// Returns a pointer to the subject (a c++ object) for the given surrogate (a java object) +//------------------------------------------------------- +void* getCObjectPtr(JNIEnv *env, jobject surrogate) +{ + void* result = 0; + jclass jcls = env->GetObjectClass(surrogate); + jfieldID fid = env->GetFieldID(jcls,"m_Obj","J"); + + if (fid == NULL) + { + // this should never happen. + throwException( env, JLIBICAL_ERR_CLIENT_INTERNAL ); + return(NULL); + } + + result = (void*)env->GetLongField(surrogate,fid); + if (result == NULL) + { + // the proxy object (java) has no subject (c++ object) + throwException( env, JLIBICAL_ERR_CLIENT_INTERNAL ); + return(NULL); + } + + return(result); +} + +//------------------------------------------------------- +// Set the subject (a c++ object) for the given surrogate (a java object). +// Throws exception if the m_Obj field can not be found. +//------------------------------------------------------- +void setCObjectPtr(JNIEnv *env, jobject surrogate, void* subject) +{ + jclass jcls = env->GetObjectClass(surrogate); + jfieldID fid = env->GetFieldID(jcls,"m_Obj","J"); + + if (fid == NULL) + { + throwException( env, JLIBICAL_ERR_CLIENT_INTERNAL ); + return; + } + + env->SetLongField(surrogate,fid,(long)subject); +} + +//------------------------------------------------------- +// Return the pointer to the subject (as an VComponent*) from the given surrogate. +// If the subject is not an VComponent type, or if the subject is NULL, then return NULL. +//------------------------------------------------------- +VComponent* getSubjectAsVComponent(JNIEnv *env, jobject surrogateComponent, int exceptionType) +{ + VComponent* result = (VComponent*)(getCObjectPtr(env,surrogateComponent)); + + if (result == NULL) + { + throwException(env, exceptionType ); + } + + return(result); +} + +//------------------------------------------------------- +// Return the pointer to the subject (as an ICalProperty*) from the given surrogate. +// If the subject is not an ICalProperty type, or if the subject is NULL, then return NULL. +//------------------------------------------------------- +ICalProperty* getSubjectAsICalProperty(JNIEnv *env, jobject surrogateProperty, int exceptionType) +{ + ICalProperty* result = (ICalProperty*)(getCObjectPtr(env,surrogateProperty)); + + if (result == NULL) + { + throwException(env, exceptionType ); + } + + return(result); +} + +//------------------------------------------------------- +// Return the pointer to the subject (as an ICalValue*) from the given surrogate. +// If the subject is not an ICalValue type, or if the subject is NULL, then return NULL. +//------------------------------------------------------- +ICalValue* getSubjectAsICalValue(JNIEnv *env, jobject surrogateValue, int exceptionType) +{ + ICalValue* result = (ICalValue*)(getCObjectPtr(env,surrogateValue)); + + if (result == NULL) + { + throwException( env, exceptionType ); + } + + return(result); +} + +//------------------------------------------------------- +// Return the pointer to the subject (as an ICalParameter*) from the given surrogate. +// If the subject is not an ICalParameter type, or if the subject is NULL, then return NULL. +//------------------------------------------------------- +ICalParameter* getSubjectAsICalParameter(JNIEnv *env, jobject surrogateParameter, int exceptionType) +{ + ICalParameter* result = (ICalParameter*)(getCObjectPtr(env,surrogateParameter)); + + if (result == NULL) + { + throwException( env, exceptionType ); + } + + return(result); +} + +//------------------------------------------------------- +// Copy the data from the src (a java ICalTimeType object) +// to the dest (a c struct icaltimetype*). +// Returns true if success. False if exception is thrown: +// - the src java object is not an ICalTimeType type +// - the dest c struct is null. +//------------------------------------------------------- +bool copyObjToicaltimetype(JNIEnv *env, jobject src, icaltimetype* dest) +{ + bool result = false; + + if (dest != NULL && env->IsInstanceOf(src,env->FindClass(JLIBICAL_CLASS_ICALTIMETYPE))) + { + jni_GetAll_from_ICalTimeType(dest, env, src); + result = true; + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } + + return(result); +} + +//------------------------------------------------------- +// Copy the data from the src (a java ICalTriggerType object) +// to the dest (a c struct icaltriggertype*). +// Returns true if success. False if exception is thrown: +// - the src java object is not an ICalTriggerType type +// - the dest c struct is null. +//------------------------------------------------------- +bool copyObjToicaltriggertype(JNIEnv *env, jobject src, icaltriggertype* dest) +{ + bool result = false; + + if (dest != NULL && env->IsInstanceOf(src,env->FindClass(JLIBICAL_CLASS_ICALTRIGGERTYPE))) + { + jni_GetAll_from_ICalTriggerType(dest, env, src); + result = true; + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } + + return(result); +} + +//------------------------------------------------------- +// Copy the data from the src (a java ICalDurationType object) +// to the dest (a c struct icaldurationtype*). +// Returns true if success. False if exception is thrown: +// - the src java object is not an ICalDurationType type +// - the dest c struct is null. +//------------------------------------------------------- +bool copyObjToicaldurationtype(JNIEnv *env, jobject src, icaldurationtype* dest) +{ + bool result = false; + + if (dest != NULL && env->IsInstanceOf(src,env->FindClass(JLIBICAL_CLASS_ICALDURATIONTYPE))) + { + jni_GetAll_from_ICalDurationType(dest, env, src); + result = true; + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } + + return(result); +} + +//------------------------------------------------------- +// Copy the data from the src (a java ICalRecurrenceType object) +// to the dest (a c struct icalrecurrencetype*). +// Returns true if success. False if exception is thrown: +// - the src java object is not an ICalRecurrenceType type +// - the dest c struct is null. +//------------------------------------------------------- +bool copyObjToicalrecurrencetype(JNIEnv *env, jobject src, icalrecurrencetype* dest) +{ + bool result = false; + + if (dest != NULL && env->IsInstanceOf(src,env->FindClass(JLIBICAL_CLASS_ICALRECURRENCETYPE))) + { + jni_GetAll_from_ICalRecurrenceType(dest, env, src); + result = true; + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } + + return(result); +} + +//------------------------------------------------------- +// Copy the data from the src (a java ICalPeriodType object) +// to the dest (a c struct icalperiodtype*). +// Returns true if success. False if exception is thrown: +// - the src java object is not an ICalPeriodType type +// - the dest c struct is null. +//------------------------------------------------------- +bool copyObjToicalperiodtype(JNIEnv *env, jobject src, icalperiodtype* dest) +{ + bool result = false; + + if (dest != NULL && env->IsInstanceOf(src,env->FindClass(JLIBICAL_CLASS_ICALPERIODTYPE))) + { + jni_GetAll_from_ICalPeriodType(dest, env, src); + result = true; + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } + + return(result); +} + +//------------------------------------------------------- +// Create a new VComponent surrogate for given subject. +// If subject is NULL, then returns NULL (will not create a +// surrogate to a NULL subject); +//------------------------------------------------------- +jobject createNewVComponentSurrogate(JNIEnv *env, VComponent* subject) +{ + char* classname = JLIBICAL_CLASS_VCOMPONENT; + if (dynamic_cast<VAlarm*>(subject)) + classname = JLIBICAL_CLASS_VALARM; + else if (dynamic_cast<VCalendar*>(subject)) + classname = JLIBICAL_CLASS_VCALENDAR; + else if (dynamic_cast<VEvent*>(subject)) + classname = JLIBICAL_CLASS_VEVENT; + else if (dynamic_cast<VQuery*>(subject)) + classname = JLIBICAL_CLASS_VQUERY; + else if (dynamic_cast<VToDo*>(subject)) + classname = JLIBICAL_CLASS_VTODO; + else if (dynamic_cast<VAgenda*>(subject)) + classname = JLIBICAL_CLASS_VAGENDA; + + return(doCreateNewSurrogate(env,env->FindClass(classname),(jlong)subject)); +} + +//------------------------------------------------------- +// Create a new ICalProperty surrogate for given subject. +// If subject is NULL, then returns NULL (will not create a +// surrogate to a NULL subject); +//------------------------------------------------------- +jobject createNewICalPropertySurrogate(JNIEnv *env, ICalProperty* subject) +{ + return(doCreateNewSurrogate(env,env->FindClass(JLIBICAL_CLASS_ICALPROPERTY),(jlong)subject)); +} + +//------------------------------------------------------- +// Create a new ICalValue surrogate for given subject. +// If subject is NULL, then returns NULL (will not create a +// surrogate to a NULL subject); +//------------------------------------------------------- +jobject createNewICalValueSurrogate(JNIEnv *env, ICalValue* subject) +{ + return(doCreateNewSurrogate(env,env->FindClass(JLIBICAL_CLASS_ICALVALUE),(jlong)subject)); +} + +//------------------------------------------------------- +// Create a new ICalParameter surrogate for given subject. +// If subject is NULL, then returns NULL (will not create a +// surrogate to a NULL subject); +//------------------------------------------------------- +jobject createNewICalParameterSurrogate(JNIEnv *env, ICalParameter* subject) +{ + return(doCreateNewSurrogate(env,env->FindClass(JLIBICAL_CLASS_ICALPARAMETER),(jlong)subject)); +} + +//------------------------------------------------------- +// Create a new ICalTimeType object from the given source struct. +// A copy is made, . +// If source is NULL, then returns NULL (will not create an +// object to a NULL source); +//------------------------------------------------------- +jobject createNewICalTimeType(JNIEnv *env, icaltimetype* source) +{ + return(doCreateNewSurrogate(env,env->FindClass(JLIBICAL_CLASS_ICALTIMETYPE),(jlong)source)); +} + +//------------------------------------------------------- +// Create a new ICalTriggerType object from the given source struct. +// A copy is made, . +// If source is NULL, then returns NULL (will not create an +// object to a NULL source); +//------------------------------------------------------- +jobject createNewICalTriggerType(JNIEnv *env, icaltriggertype* source) +{ + return(doCreateNewSurrogate(env,env->FindClass(JLIBICAL_CLASS_ICALTRIGGERTYPE),(jlong)source)); +} + +//------------------------------------------------------- +// Create a new ICalDurationType object from the given source struct. +// A copy is made, . +// If source is NULL, then returns NULL (will not create an +// object to a NULL source); +//------------------------------------------------------- +jobject createNewICalDurationType(JNIEnv *env, icaldurationtype* source) +{ + return(doCreateNewSurrogate(env,env->FindClass(JLIBICAL_CLASS_ICALDURATIONTYPE),(jlong)source)); +} + +//------------------------------------------------------- +// Create a new ICalRecurrenceType object from the given source struct. +// A copy is made, . +// If source is NULL, then returns NULL (will not create an +// object to a NULL source); +//------------------------------------------------------- +jobject createNewICalRecurrenceType(JNIEnv *env, icalrecurrencetype* source) +{ + return(doCreateNewSurrogate(env,env->FindClass(JLIBICAL_CLASS_ICALRECURRENCETYPE),(jlong)source)); +} + +//------------------------------------------------------- +// Create a new ICalPeriodType object from the given source struct. +// A copy is made, . +// If source is NULL, then returns NULL (will not create an +// object to a NULL source); +//------------------------------------------------------- +jobject createNewICalPeriodType(JNIEnv *env, icalperiodtype* source) +{ + return(doCreateNewSurrogate(env,env->FindClass(JLIBICAL_CLASS_ICALPERIODTYPE),(jlong)source)); +} + +//------------------------------------------------------- +// Creat a new surrogate of the given type for the given subject. +//------------------------------------------------------- +jobject doCreateNewSurrogate(JNIEnv *env, jclass surrogateClass, jlong subject) +{ + jobject result = NULL; + + if (subject != NULL) + { + jmethodID jconstructorID = env->GetMethodID(surrogateClass, "<init>", "(J)V"); + + result = env->NewObject(surrogateClass, jconstructorID, subject); + } + + return(result); +} + + +//------------------------------------------------------- +// For the given cpErr, create a new Exception and send it to env. +// Note: Throw does not throw anything. It only sets the state. +// The JVM will check this and throw an exception later. +//------------------------------------------------------- +void throwException(JNIEnv *env, int cpErr) +{ + jclass jexceptionClass; + jthrowable jexceptionObj; + jmethodID jconstructorID; + const char* exClassName; + + if (env->ExceptionOccurred()) + { + return; + } + + switch ( cpErr ) + { + case JLIBICAL_ERR_NETWORK: + exClassName = "net.cp.jlibical/JLCNetworkException"; + break; + + case JLIBICAL_ERR_SERVER_INTERNAL: + exClassName = "net.cp.jlibical/JLCServerInternalException"; + break; + + case JLIBICAL_ERR_CLIENT_INTERNAL: + exClassName = "net.cp.jlibical/JLCClientInternalException"; + break; + + case JLIBICAL_ERR_ILLEGAL_ARGUMENT: + exClassName = "net.cp.jlibical/JLCIllegalArgumentException"; + break; + + case JLIBICAL_ERR_API_NOT_INITED: + exClassName = "net.cp.jlibical/JLCNotInitedException"; + break; + + case JLIBICAL_ERR_HOST_INVALID: + exClassName = "net.cp.jlibical/JLCHostInvalidException"; + break; + + default: + exClassName = "net.cp.jlibical/JLCClientInternalException"; + printf("*** JLIBICAL JNI throwException: unknown error code: %d\n", cpErr ); + break; + } + + env->ThrowNew(env->FindClass(exClassName),""); +} diff --git a/src/java/jlibical_utils_cxx.h b/src/java/jlibical_utils_cxx.h new file mode 100644 index 00000000..a6cdbc56 --- /dev/null +++ b/src/java/jlibical_utils_cxx.h @@ -0,0 +1,59 @@ + +/*====================================================================== + FILE: jlibical_utils_cxx.h + CREATOR: Srinivasa Boppana/George Norman + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef TEST_CXX_H +#define TEST_CXX_H + +#ifndef JNI_H +#include <jni.h> +#endif + +class VComponent; +class ICalProperty; +class ICalValue; +class ICalParameter; +struct icaltimetype; +struct icaltriggertype; +struct icaldurationtype; +struct icalrecurrencetype; +struct icalperiodtype; + +// get & set +void* getCObjectPtr(JNIEnv *env, jobject anObj); +void setCObjectPtr(JNIEnv *env, jobject anObj, void* val); + +// type-safe getters +VComponent* getSubjectAsVComponent(JNIEnv *env, jobject surrogateComponent, int exceptionType); +ICalProperty* getSubjectAsICalProperty(JNIEnv *env, jobject surrogateProperty, int exceptionType); +ICalValue* getSubjectAsICalValue(JNIEnv *env, jobject surrogateValue, int exceptionType); +ICalParameter* getSubjectAsICalParameter(JNIEnv *env, jobject surrogateParameter, int exceptionType); + +bool copyObjToicaltimetype(JNIEnv *env, jobject src, icaltimetype* dest); +bool copyObjToicaltriggertype(JNIEnv *env, jobject src, icaltriggertype* dest); +bool copyObjToicaldurationtype(JNIEnv *env, jobject src, icaldurationtype* dest); +bool copyObjToicalrecurrencetype(JNIEnv *env, jobject src, icalrecurrencetype* dest); +bool copyObjToicalperiodtype(JNIEnv *env, jobject src, icalperiodtype* dest); + +// exception handling +void throwException( JNIEnv *env, int cpErr ); + +// create objects +jobject createNewVComponentSurrogate(JNIEnv *env, VComponent* subject); +jobject createNewICalPropertySurrogate(JNIEnv *env, ICalProperty* subject); +jobject createNewICalValueSurrogate(JNIEnv *env, ICalValue* subject); +jobject createNewICalParameterSurrogate(JNIEnv *env, ICalParameter* subject); + +jobject createNewICalTimeType(JNIEnv *env, icaltimetype* source); +jobject createNewICalTriggerType(JNIEnv *env, icaltriggertype* source); +jobject createNewICalDurationType(JNIEnv *env, icaldurationtype* source); +jobject createNewICalRecurrenceType(JNIEnv *env, icalrecurrencetype* source); +jobject createNewICalPeriodType(JNIEnv *env, icalperiodtype* source); + +jobject doCreateNewSurrogate(JNIEnv *env, jclass surrogateClass, jlong subject); + + +#endif /*TEST_CXX_H*/ diff --git a/src/java/jniICalDurationType_cxx.cpp b/src/java/jniICalDurationType_cxx.cpp new file mode 100644 index 00000000..e1e0204c --- /dev/null +++ b/src/java/jniICalDurationType_cxx.cpp @@ -0,0 +1,130 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: jniICalDurationType_cxx.cpp + CREATOR: structConverter + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#include <jni.h> + +#include "jniICalDurationType_cxx.h" + +static jfieldID ICalDurationType_Is_neg_FID; +static jfieldID ICalDurationType_Days_FID; +static jfieldID ICalDurationType_Weeks_FID; +static jfieldID ICalDurationType_Hours_FID; +static jfieldID ICalDurationType_Minutes_FID; +static jfieldID ICalDurationType_Seconds_FID; + + +void initICalDurationTypeFieldIDs(JNIEnv* env, jclass clazz) +{ + ICalDurationType_Is_neg_FID = env->GetFieldID(clazz, "is_neg", "I"); + ICalDurationType_Days_FID = env->GetFieldID(clazz, "days", "J"); + ICalDurationType_Weeks_FID = env->GetFieldID(clazz, "weeks", "J"); + ICalDurationType_Hours_FID = env->GetFieldID(clazz, "hours", "J"); + ICalDurationType_Minutes_FID = env->GetFieldID(clazz, "minutes", "J"); + ICalDurationType_Seconds_FID = env->GetFieldID(clazz, "seconds", "J"); +} + +void jni_SetIs_neg_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + env->SetIntField(thisICalDurationType, ICalDurationType_Is_neg_FID, (jint) __ICalDurationType_->is_neg); +} + +void jni_GetIs_neg_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + __ICalDurationType_->is_neg = env->GetIntField(thisICalDurationType, ICalDurationType_Is_neg_FID); +} + +void jni_SetDays_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + env->SetLongField(thisICalDurationType, ICalDurationType_Days_FID, (jlong) __ICalDurationType_->days); +} + +void jni_GetDays_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + __ICalDurationType_->days = env->GetLongField(thisICalDurationType, ICalDurationType_Days_FID); +} + +void jni_SetWeeks_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + env->SetLongField(thisICalDurationType, ICalDurationType_Weeks_FID, (jlong) __ICalDurationType_->weeks); +} + +void jni_GetWeeks_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + __ICalDurationType_->weeks = env->GetLongField(thisICalDurationType, ICalDurationType_Weeks_FID); +} + +void jni_SetHours_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + env->SetLongField(thisICalDurationType, ICalDurationType_Hours_FID, (jlong) __ICalDurationType_->hours); +} + +void jni_GetHours_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + __ICalDurationType_->hours = env->GetLongField(thisICalDurationType, ICalDurationType_Hours_FID); +} + +void jni_SetMinutes_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + env->SetLongField(thisICalDurationType, ICalDurationType_Minutes_FID, (jlong) __ICalDurationType_->minutes); +} + +void jni_GetMinutes_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + __ICalDurationType_->minutes = env->GetLongField(thisICalDurationType, ICalDurationType_Minutes_FID); +} + +void jni_SetSeconds_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + env->SetLongField(thisICalDurationType, ICalDurationType_Seconds_FID, (jlong) __ICalDurationType_->seconds); +} + +void jni_GetSeconds_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType) +{ + __ICalDurationType_->seconds = env->GetLongField(thisICalDurationType, ICalDurationType_Seconds_FID); +} + +// copy all fields from the c struct (ICalDurationType) to the java object (thisICalDurationType). +void jni_SetAll_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv* env, jobject thisICalDurationType) +{ + jni_SetIs_neg_in_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_SetDays_in_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_SetWeeks_in_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_SetHours_in_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_SetMinutes_in_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_SetSeconds_in_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); +} + +// copy all fields from the java object (thisICalDurationType) to the c struct (__ICalDurationType_). +void jni_GetAll_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv* env, jobject thisICalDurationType) +{ + jni_GetIs_neg_from_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_GetDays_from_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_GetWeeks_from_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_GetHours_from_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_GetMinutes_from_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); + jni_GetSeconds_from_ICalDurationType(__ICalDurationType_, env, thisICalDurationType); +} +/* + * Class: net_cp_jlibical_ICalDurationType + * Method: init + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalDurationType_init__J + (JNIEnv *env, jobject thisICalDurationType, jlong data) +{ + // copy all fields from the c struct (data) to the java object (thisICalDurationType). + jni_SetAll_in_ICalDurationType((ICalDurationType*)data,env,thisICalDurationType); +} + +/* + * Class: net_cp_jlibical_ICalDurationType + * Method: initFIDs + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalDurationType_initFIDs(JNIEnv *env, jclass clazz) { + initICalDurationTypeFieldIDs(env, clazz); +} diff --git a/src/java/jniICalDurationType_cxx.h b/src/java/jniICalDurationType_cxx.h new file mode 100644 index 00000000..6ef1de1a --- /dev/null +++ b/src/java/jniICalDurationType_cxx.h @@ -0,0 +1,47 @@ + +/*====================================================================== + FILE: jniICalDurationType_cxx.h + CREATOR: structConverter + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef _jni_ICalDurationType_H +#define _jni_ICalDurationType_H +#include <jni.h> + +// I forgot how to do this using a typedef in c++!!!! +#define ICalDurationType icaldurationtype + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ical.h" + +static void initICalDurationTypeFieldIDs(JNIEnv* env, jclass clazz); + +void jni_SetIs_neg_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_GetIs_neg_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_SetDays_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_GetDays_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_SetWeeks_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_GetWeeks_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_SetHours_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_GetHours_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_SetMinutes_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_GetMinutes_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_SetSeconds_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_GetSeconds_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv *env, jobject thisICalDurationType); +void jni_SetAll_in_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv* env, jobject thisICalDurationType); + +void jni_GetAll_from_ICalDurationType(struct ICalDurationType* __ICalDurationType_, JNIEnv* env, jobject thisICalDurationType); +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalDurationType_initFIDs(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalDurationType_init__J(JNIEnv *env, jobject thisICalDurationType, jlong data); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/java/jniICalPeriodType_cxx.cpp b/src/java/jniICalPeriodType_cxx.cpp new file mode 100644 index 00000000..398bc4b2 --- /dev/null +++ b/src/java/jniICalPeriodType_cxx.cpp @@ -0,0 +1,144 @@ +/* -*- Mode: C -*- */
+/*======================================================================
+ FILE: jniICalPeriodType_cxx.cpp
+ CREATOR: structConverter
+======================================================================*/
+
+#include <jni.h>
+
+#include "jniICalPeriodType_cxx.h"
+#include "jniICalTimeType_cxx.h"
+#include "jniICalDurationType_cxx.h"
+
+static jfieldID ICalPeriodType_Start_FID;
+static jfieldID ICalPeriodType_End_FID;
+static jfieldID ICalPeriodType_Duration_FID;
+
+
+void initICalPeriodTypeFieldIDs(JNIEnv* env, jclass clazz)
+{
+ ICalPeriodType_Start_FID = env->GetFieldID(clazz, "start", "Lnet/cp/jlibical/ICalTimeType;");
+ ICalPeriodType_End_FID = env->GetFieldID(clazz, "end", "Lnet/cp/jlibical/ICalTimeType;");
+ ICalPeriodType_Duration_FID = env->GetFieldID(clazz, "duration", "Lnet/cp/jlibical/ICalDurationType;");
+}
+
+void jni_SetStart_in_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType)
+{
+ jobject lcl_jobj0;
+ lcl_jobj0 = env->GetObjectField(thisICalPeriodType, ICalPeriodType_Start_FID);
+ jni_SetYear_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_SetMonth_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_SetDay_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_SetHour_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_SetMinute_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_SetSecond_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_SetIs_utc_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_SetIs_date_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_SetZone_in_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+}
+
+void jni_GetStart_from_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType)
+{
+ jobject lcl_jobj0;
+ lcl_jobj0 = env->GetObjectField(thisICalPeriodType, ICalPeriodType_Start_FID);
+ jni_GetYear_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_GetMonth_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_GetDay_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_GetHour_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_GetMinute_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_GetSecond_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_GetIs_utc_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_GetIs_date_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+ jni_GetZone_from_ICalTimeType(&(__ICalPeriodType_->start), env, lcl_jobj0);
+}
+
+void jni_SetEnd_in_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType)
+{
+ jobject lcl_jobj0;
+ lcl_jobj0 = env->GetObjectField(thisICalPeriodType, ICalPeriodType_End_FID);
+ jni_SetYear_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_SetMonth_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_SetDay_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_SetHour_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_SetMinute_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_SetSecond_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_SetIs_utc_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_SetIs_date_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_SetZone_in_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+}
+
+void jni_GetEnd_from_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType)
+{
+ jobject lcl_jobj0;
+ lcl_jobj0 = env->GetObjectField(thisICalPeriodType, ICalPeriodType_End_FID);
+ jni_GetYear_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_GetMonth_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_GetDay_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_GetHour_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_GetMinute_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_GetSecond_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_GetIs_utc_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_GetIs_date_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+ jni_GetZone_from_ICalTimeType(&(__ICalPeriodType_->end), env, lcl_jobj0);
+}
+
+void jni_SetDuration_in_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType)
+{
+ jobject lcl_jobj0;
+ lcl_jobj0 = env->GetObjectField(thisICalPeriodType, ICalPeriodType_Duration_FID);
+ jni_SetIs_neg_in_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_SetDays_in_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_SetWeeks_in_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_SetHours_in_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_SetMinutes_in_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_SetSeconds_in_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+}
+
+void jni_GetDuration_from_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType)
+{
+ jobject lcl_jobj0;
+ lcl_jobj0 = env->GetObjectField(thisICalPeriodType, ICalPeriodType_Duration_FID);
+ jni_GetIs_neg_from_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_GetDays_from_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_GetWeeks_from_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_GetHours_from_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_GetMinutes_from_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+ jni_GetSeconds_from_ICalDurationType(&(__ICalPeriodType_->duration), env, lcl_jobj0);
+}
+
+// copy all fields from the c struct (__ICalPeriodType_) to the java object (thisICalPeriodType).
+void jni_SetAll_in_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv* env, jobject thisICalPeriodType)
+{
+ jni_SetStart_in_ICalPeriodType(__ICalPeriodType_, env, thisICalPeriodType);
+ jni_SetEnd_in_ICalPeriodType(__ICalPeriodType_, env, thisICalPeriodType);
+ jni_SetDuration_in_ICalPeriodType(__ICalPeriodType_, env, thisICalPeriodType);
+}
+
+// copy all fields from the java object (thisICalPeriodType) to the c struct (__ICalPeriodType_).
+void jni_GetAll_from_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv* env, jobject thisICalPeriodType)
+{
+ jni_GetStart_from_ICalPeriodType(__ICalPeriodType_, env, thisICalPeriodType);
+ jni_GetEnd_from_ICalPeriodType(__ICalPeriodType_, env, thisICalPeriodType);
+ jni_GetDuration_from_ICalPeriodType(__ICalPeriodType_, env, thisICalPeriodType);
+}
+
+/*
+ * Class: net_cp_jlibical_ICalPeriodType
+ * Method: init
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalPeriodType_init__J
+ (JNIEnv* env, jobject thisICalPeriodType, jlong data)
+{
+ // copy all fields from the c struct (data) to the java object (thisICalTimeType).
+ jni_SetAll_in_ICalPeriodType((ICalPeriodType*)data,env,thisICalPeriodType);
+}
+
+/*
+ * Class: net_cp_jlibical_ICalPeriodType
+ * Method: initFIDs
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalPeriodType_initFIDs(JNIEnv *env, jclass clazz) {
+ initICalPeriodTypeFieldIDs(env, clazz);
+}
diff --git a/src/java/jniICalPeriodType_cxx.h b/src/java/jniICalPeriodType_cxx.h new file mode 100644 index 00000000..f3635c84 --- /dev/null +++ b/src/java/jniICalPeriodType_cxx.h @@ -0,0 +1,42 @@ +
+/*======================================================================
+ FILE: jniICalPeriodType_cxx.h
+ CREATOR: structConverter
+ (C) COPYRIGHT 2002, Critical Path
+======================================================================*/
+
+#ifndef _jni_ICalPeriodType_H
+#define _jni_ICalPeriodType_H
+#include <jni.h>
+
+// I forgot how to do this using a typedef in c++!!!!
+#define ICalPeriodType icalperiodtype
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "ical.h"
+
+static void initICalPeriodTypeFieldIDs(JNIEnv* env, jclass clazz);
+
+void jni_SetStart_in_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType);
+void jni_GetStart_from_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType);
+void jni_SetEnd_in_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType);
+void jni_GetEnd_from_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType);
+void jni_SetDuration_in_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType);
+void jni_GetDuration_from_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv *env, jobject thisICalPeriodType);
+
+void jni_SetAll_in_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv* env, jobject thisICalPeriodType);
+void jni_GetAll_from_ICalPeriodType(struct ICalPeriodType* __ICalPeriodType_, JNIEnv* env, jobject thisICalPeriodType);
+
+JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalPeriodType_init__J(JNIEnv* env, jobject thisICalPeriodType, jlong data);
+JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalPeriodType_initFIDs(JNIEnv *env, jclass clazz);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/java/jniICalRecurrenceType_cxx.cpp b/src/java/jniICalRecurrenceType_cxx.cpp new file mode 100644 index 00000000..48698b90 --- /dev/null +++ b/src/java/jniICalRecurrenceType_cxx.cpp @@ -0,0 +1,347 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: jniICalRecurrenceType_cxx.cpp + CREATOR: structConverter +======================================================================*/ + +#include <jni.h> + +#include "jniICalRecurrenceType_cxx.h" +#include "jniICalTimeType_cxx.h" + +static jfieldID ICalRecurrenceType_Until_FID; +static jfieldID ICalRecurrenceType_Freq_FID; +static jfieldID ICalRecurrenceType_Week_start_FID; + +static jfieldID ICalRecurrenceType_Count_FID; +static jfieldID ICalRecurrenceType_Interval_FID; +static jfieldID ICalRecurrenceType_By_second_FID; +static jfieldID ICalRecurrenceType_By_minute_FID; +static jfieldID ICalRecurrenceType_By_hour_FID; +static jfieldID ICalRecurrenceType_By_day_FID; +static jfieldID ICalRecurrenceType_By_month_day_FID; +static jfieldID ICalRecurrenceType_By_year_day_FID; +static jfieldID ICalRecurrenceType_By_week_no_FID; +static jfieldID ICalRecurrenceType_By_month_FID; +static jfieldID ICalRecurrenceType_By_set_pos_FID; + + +void initICalRecurrenceTypeFieldIDs(JNIEnv* env, jclass clazz) +{ + ICalRecurrenceType_Until_FID = env->GetFieldID(clazz, "until", "Lnet/cp/jlibical/ICalTimeType;"); + ICalRecurrenceType_Freq_FID = env->GetFieldID(clazz, "freq", "I"); + ICalRecurrenceType_Week_start_FID = env->GetFieldID(clazz, "week_start", "I"); + ICalRecurrenceType_Count_FID = env->GetFieldID(clazz, "count", "I"); + ICalRecurrenceType_Interval_FID = env->GetFieldID(clazz, "interval", "S"); + ICalRecurrenceType_By_second_FID = env->GetFieldID(clazz, "by_second", "[S"); + ICalRecurrenceType_By_minute_FID = env->GetFieldID(clazz, "by_minute", "[S"); + ICalRecurrenceType_By_hour_FID = env->GetFieldID(clazz, "by_hour", "[S"); + ICalRecurrenceType_By_day_FID = env->GetFieldID(clazz, "by_day", "[S"); + ICalRecurrenceType_By_month_day_FID = env->GetFieldID(clazz, "by_month_day", "[S"); + ICalRecurrenceType_By_year_day_FID = env->GetFieldID(clazz, "by_year_day", "[S"); + ICalRecurrenceType_By_week_no_FID = env->GetFieldID(clazz, "by_week_no", "[S"); + ICalRecurrenceType_By_month_FID = env->GetFieldID(clazz, "by_month", "[S"); + ICalRecurrenceType_By_set_pos_FID = env->GetFieldID(clazz, "by_set_pos", "[S"); +} + +void jni_SetUntil_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jobject lcl_jobj0; + lcl_jobj0 = env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_Until_FID); + jni_SetYear_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_SetMonth_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_SetDay_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_SetHour_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_SetMinute_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_SetSecond_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_SetIs_utc_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_SetIs_date_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_SetZone_in_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); +} + +void jni_GetUntil_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jobject lcl_jobj0; + lcl_jobj0 = env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_Until_FID); + jni_GetYear_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_GetMonth_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_GetDay_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_GetHour_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_GetMinute_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_GetSecond_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_GetIs_utc_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_GetIs_date_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); + jni_GetZone_from_ICalTimeType(&(__ICalRecurrenceType_->until), env, lcl_jobj0); +} + +void jni_SetFreq_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + env->SetIntField(thisICalRecurrenceType, ICalRecurrenceType_Freq_FID, (jint) __ICalRecurrenceType_->freq); +} + +void jni_GetFreq_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + __ICalRecurrenceType_->freq = (icalrecurrencetype_frequency) env->GetIntField(thisICalRecurrenceType, ICalRecurrenceType_Freq_FID); +} + +void jni_SetWeek_start_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + env->SetIntField(thisICalRecurrenceType, ICalRecurrenceType_Week_start_FID, (jint) __ICalRecurrenceType_->week_start); +} + +void jni_GetWeek_start_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + __ICalRecurrenceType_->week_start = (icalrecurrencetype_weekday) env->GetIntField(thisICalRecurrenceType, ICalRecurrenceType_Week_start_FID); +} + +void jni_SetCount_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + env->SetIntField(thisICalRecurrenceType, ICalRecurrenceType_Count_FID, (jint) __ICalRecurrenceType_->count); +} + +void jni_GetCount_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + __ICalRecurrenceType_->count = env->GetIntField(thisICalRecurrenceType, ICalRecurrenceType_Count_FID); +} + +void jni_SetInterval_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + env->SetShortField(thisICalRecurrenceType, ICalRecurrenceType_Interval_FID, (jshort) __ICalRecurrenceType_->interval); +} + +void jni_GetInterval_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + __ICalRecurrenceType_->interval = env->GetShortField(thisICalRecurrenceType, ICalRecurrenceType_Interval_FID); +} + +void jni_SetBy_second_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_second_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,61, (jshort*)&(__ICalRecurrenceType_->by_second[0])); +} + +void jni_GetBy_second_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_second_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,61, (jshort*)&(__ICalRecurrenceType_->by_second[0])); +} + +void jni_SetBy_minute_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_minute_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,61, (jshort*)&(__ICalRecurrenceType_->by_minute[0])); +} + +void jni_GetBy_minute_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_minute_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,61, (jshort*)&(__ICalRecurrenceType_->by_minute[0])); +} + +void jni_SetBy_hour_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_hour_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,25, (jshort*)&(__ICalRecurrenceType_->by_hour[0])); +} + +void jni_GetBy_hour_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_hour_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,25, (jshort*)&(__ICalRecurrenceType_->by_hour[0])); +} + +void jni_SetBy_day_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_day_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,364, (jshort*)&(__ICalRecurrenceType_->by_day[0])); +} + +void jni_GetBy_day_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_day_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,364, (jshort*)&(__ICalRecurrenceType_->by_day[0])); +} + +void jni_SetBy_month_day_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_month_day_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,32, (jshort*)&(__ICalRecurrenceType_->by_month_day[0])); +} + +void jni_GetBy_month_day_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_month_day_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,32, (jshort*)&(__ICalRecurrenceType_->by_month_day[0])); +} + +void jni_SetBy_year_day_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_year_day_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,367, (jshort*)&(__ICalRecurrenceType_->by_year_day[0])); +} + +void jni_GetBy_year_day_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_year_day_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,367, (jshort*)&(__ICalRecurrenceType_->by_year_day[0])); +} + +void jni_SetBy_week_no_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_week_no_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,54, (jshort*)&(__ICalRecurrenceType_->by_week_no[0])); +} + +void jni_GetBy_week_no_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_week_no_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,54, (jshort*)&(__ICalRecurrenceType_->by_week_no[0])); +} + +void jni_SetBy_month_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_month_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,13, (jshort*)&(__ICalRecurrenceType_->by_month[0])); +} + +void jni_GetBy_month_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_month_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,13, (jshort*)&(__ICalRecurrenceType_->by_month[0])); +} + +void jni_SetBy_set_pos_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_set_pos_FID); + env->SetShortArrayRegion((jshortArray)lcl_jobjA0, 0,367, (jshort*)&(__ICalRecurrenceType_->by_set_pos[0])); +} + +void jni_GetBy_set_pos_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType) +{ + jclass elem_clazz; + jboolean isCopy; + int ix0; + jobject lcl_jobj0; + jarray lcl_jobjA0; + lcl_jobjA0 = (jarray) env->GetObjectField(thisICalRecurrenceType, ICalRecurrenceType_By_set_pos_FID); + env->GetShortArrayRegion((jshortArray)lcl_jobjA0, 0,367, (jshort*)&(__ICalRecurrenceType_->by_set_pos[0])); +} +void jni_SetAll_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv* env, jobject thisICalRecurrenceType) +{ + jni_SetUntil_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetFreq_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetWeek_start_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetCount_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetInterval_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_second_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_minute_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_hour_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_day_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_month_day_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_year_day_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_week_no_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_month_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_SetBy_set_pos_in_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); +} +void jni_GetAll_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv* env, jobject thisICalRecurrenceType) +{ + jni_GetUntil_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetFreq_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetWeek_start_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetCount_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetInterval_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_second_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_minute_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_hour_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_day_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_month_day_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_year_day_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_week_no_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_month_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + jni_GetBy_set_pos_from_ICalRecurrenceType(__ICalRecurrenceType_, env, thisICalRecurrenceType); + +} + +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalRecurrenceType_init__J(JNIEnv* env, jobject thisICalRecurrenceType, jlong data) { + jni_SetAll_in_ICalRecurrenceType((ICalRecurrenceType*)data,env,thisICalRecurrenceType); +} + +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalRecurrenceType_initFIDs(JNIEnv *env, jclass clazz) { + initICalRecurrenceTypeFieldIDs(env, clazz); +} diff --git a/src/java/jniICalRecurrenceType_cxx.h b/src/java/jniICalRecurrenceType_cxx.h new file mode 100644 index 00000000..2f0bf4ba --- /dev/null +++ b/src/java/jniICalRecurrenceType_cxx.h @@ -0,0 +1,60 @@ + +/*====================================================================== + FILE: jniICalRecurrenceType_cxx.h + CREATOR: structConverter +======================================================================*/ + +#ifndef _jni_ICalRecurrenceType_H_ +#define _jni_ICalRecurrenceType_H_ +#include <jni.h> + +#define ICalRecurrenceType icalrecurrencetype + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ical.h" + +static void initICalRecurrenceTypeFieldIDs(JNIEnv* env, jclass clazz); + +void jni_SetUntil_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetUntil_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetFreq_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetFreq_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetWeek_start_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetWeek_start_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetCount_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetCount_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetInterval_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetInterval_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_second_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_second_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_minute_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_minute_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_hour_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_hour_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_day_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_day_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_month_day_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_month_day_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_year_day_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_year_day_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_week_no_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_week_no_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_month_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_month_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetBy_set_pos_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_GetBy_set_pos_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv *env, jobject thisICalRecurrenceType); +void jni_SetAll_in_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv* env, jobject thisICalRecurrenceType); + +void jni_GetAll_from_ICalRecurrenceType(struct ICalRecurrenceType* __ICalRecurrenceType_, JNIEnv* env, jobject thisICalRecurrenceType); +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalRecurrenceType_init__J(JNIEnv* env, jobject thisICalRecurrenceType, jlong data); +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalRecurrenceType_initFIDs(JNIEnv *env, jclass clazz); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/java/jniICalTimeType_cxx.cpp b/src/java/jniICalTimeType_cxx.cpp new file mode 100644 index 00000000..341ded7e --- /dev/null +++ b/src/java/jniICalTimeType_cxx.cpp @@ -0,0 +1,176 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: jniICalTimeType_cxx.cpp + CREATOR: structConverter + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#include <jni.h> + +#ifndef _jni_ICalTimeType_H +#include "jniICalTimeType_cxx.h" +#endif + +static jfieldID ICalTimeType_Year_FID; +static jfieldID ICalTimeType_Month_FID; +static jfieldID ICalTimeType_Day_FID; +static jfieldID ICalTimeType_Hour_FID; +static jfieldID ICalTimeType_Minute_FID; +static jfieldID ICalTimeType_Second_FID; +static jfieldID ICalTimeType_Is_utc_FID; +static jfieldID ICalTimeType_Is_date_FID; +static jfieldID ICalTimeType_Zone_FID; + + +void initICalTimeTypeFieldIDs(JNIEnv* env, jclass clazz) +{ + ICalTimeType_Year_FID = env->GetFieldID(clazz, "year", "I"); + ICalTimeType_Month_FID = env->GetFieldID(clazz, "month", "I"); + ICalTimeType_Day_FID = env->GetFieldID(clazz, "day", "I"); + ICalTimeType_Hour_FID = env->GetFieldID(clazz, "hour", "I"); + ICalTimeType_Minute_FID = env->GetFieldID(clazz, "minute", "I"); + ICalTimeType_Second_FID = env->GetFieldID(clazz, "second", "I"); + ICalTimeType_Is_utc_FID = env->GetFieldID(clazz, "is_utc", "I"); + ICalTimeType_Is_date_FID = env->GetFieldID(clazz, "is_date", "I"); + ICalTimeType_Zone_FID = env->GetFieldID(clazz, "zone", "Ljava/lang/String;"); +} + +void jni_SetYear_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetIntField(thisICalTimeType, ICalTimeType_Year_FID, (jint) __ICalTimeType_->year); +} + +void jni_GetYear_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->year = env->GetIntField(thisICalTimeType, ICalTimeType_Year_FID); +} + +void jni_SetMonth_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetIntField(thisICalTimeType, ICalTimeType_Month_FID, (jint) __ICalTimeType_->month); +} + +void jni_GetMonth_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->month = env->GetIntField(thisICalTimeType, ICalTimeType_Month_FID); +} + +void jni_SetDay_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetIntField(thisICalTimeType, ICalTimeType_Day_FID, (jint) __ICalTimeType_->day); +} + +void jni_GetDay_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->day = env->GetIntField(thisICalTimeType, ICalTimeType_Day_FID); +} + +void jni_SetHour_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetIntField(thisICalTimeType, ICalTimeType_Hour_FID, (jint) __ICalTimeType_->hour); +} + +void jni_GetHour_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->hour = env->GetIntField(thisICalTimeType, ICalTimeType_Hour_FID); +} + +void jni_SetMinute_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetIntField(thisICalTimeType, ICalTimeType_Minute_FID, (jint) __ICalTimeType_->minute); +} + +void jni_GetMinute_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->minute = env->GetIntField(thisICalTimeType, ICalTimeType_Minute_FID); +} + +void jni_SetSecond_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetIntField(thisICalTimeType, ICalTimeType_Second_FID, (jint) __ICalTimeType_->second); +} + +void jni_GetSecond_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->second = env->GetIntField(thisICalTimeType, ICalTimeType_Second_FID); +} + +void jni_SetIs_utc_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetIntField(thisICalTimeType, ICalTimeType_Is_utc_FID, (jint) __ICalTimeType_->is_utc); +} + +void jni_GetIs_utc_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->is_utc = env->GetIntField(thisICalTimeType, ICalTimeType_Is_utc_FID); +} + +void jni_SetIs_date_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetIntField(thisICalTimeType, ICalTimeType_Is_date_FID, (jint) __ICalTimeType_->is_date); +} + +void jni_GetIs_date_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->is_date = env->GetIntField(thisICalTimeType, ICalTimeType_Is_date_FID); +} + +void jni_SetZone_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + env->SetObjectField(thisICalTimeType, ICalTimeType_Zone_FID, env->NewStringUTF(icaltime_get_tzid(*__ICalTimeType_))); +} + +void jni_GetZone_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType) +{ + __ICalTimeType_->zone = icaltimezone_get_builtin_timezone_from_tzid((char*) env->GetStringUTFChars((jstring) env->GetObjectField(thisICalTimeType, ICalTimeType_Zone_FID), NULL)); +} + +// copy all fields from the c struct (__ICalTimeType_) to the java object (thisICalTimeType). +void jni_SetAll_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv* env, jobject thisICalTimeType) +{ + jni_SetYear_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_SetMonth_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_SetDay_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_SetHour_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_SetMinute_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_SetSecond_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_SetIs_utc_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_SetIs_date_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_SetZone_in_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); +} + +// copy all fields from the java object (thisICalTimeType) to the c struct (__ICalTimeType_). +void jni_GetAll_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv* env, jobject thisICalTimeType) +{ + jni_GetYear_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_GetMonth_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_GetDay_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_GetHour_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_GetMinute_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_GetSecond_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_GetIs_utc_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_GetIs_date_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); + jni_GetZone_from_ICalTimeType(__ICalTimeType_, env, thisICalTimeType); +} + +/* + * Class: net_cp_jlibical_ICalTimeType + * Method: init + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalTimeType_init__J + (JNIEnv* env, jobject thisICalTimeType, jlong data) +{ + // copy all fields from the c struct (data) to the java object (thisICalTimeType). + jni_SetAll_in_ICalTimeType((ICalTimeType*)data,env,thisICalTimeType); +} + +/* + * Class: net_cp_jlibical_ICalTimeType + * Method: initFIDs + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalTimeType_initFIDs(JNIEnv *env, jclass clazz) +{ + initICalTimeTypeFieldIDs(env, clazz); +} diff --git a/src/java/jniICalTimeType_cxx.h b/src/java/jniICalTimeType_cxx.h new file mode 100644 index 00000000..5d6f84ce --- /dev/null +++ b/src/java/jniICalTimeType_cxx.h @@ -0,0 +1,52 @@ + +/*====================================================================== + FILE: jniICalTimeType_cxx.h + CREATOR: structConverter + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef _jni_ICalTimeType_H +#define _jni_ICalTimeType_H +#include <jni.h> + +// I forgot how to do this using a typedef in c++!!!! +#define ICalTimeType icaltimetype + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ical.h" + +static void initICalTimeTypeFieldIDs(JNIEnv* env, jclass clazz); + +void jni_SetYear_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetYear_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetMonth_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetMonth_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetDay_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetDay_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetHour_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetHour_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetMinute_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetMinute_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetSecond_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetSecond_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetIs_utc_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetIs_utc_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetIs_date_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetIs_date_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetZone_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_GetZone_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv *env, jobject thisICalTimeType); +void jni_SetAll_in_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv* env, jobject thisICalTimeType); + +void jni_GetAll_from_ICalTimeType(struct ICalTimeType* __ICalTimeType_, JNIEnv* env, jobject thisICalTimeType); +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalTimeType_initFIDs(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalTimeType_init__J(JNIEnv* env, jobject thisICalTimeType, jlong data); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/java/jniICalTriggerType_cxx.cpp b/src/java/jniICalTriggerType_cxx.cpp new file mode 100644 index 00000000..b4140c8f --- /dev/null +++ b/src/java/jniICalTriggerType_cxx.cpp @@ -0,0 +1,111 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: jniICalTriggerType_cxx.cpp + CREATOR: structConverter + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#include <jni.h> + +#include "jniICalTriggerType_cxx.h" +#include "jniICalTimeType_cxx.h" +#include "jniICalDurationType_cxx.h" + +static jfieldID ICalTriggerType_Time_FID; +static jfieldID ICalTriggerType_Duration_FID; + + +void initICalTriggerTypeFieldIDs(JNIEnv* env, jclass clazz) +{ + ICalTriggerType_Time_FID = env->GetFieldID(clazz, "time", "Lnet/cp/jlibical/ICalTimeType;"); + ICalTriggerType_Duration_FID = env->GetFieldID(clazz, "duration", "Lnet/cp/jlibical/ICalDurationType;"); +} + +void jni_SetTime_in_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv *env, jobject thisICalTriggerType) +{ + jobject lcl_jobj0; + lcl_jobj0 = env->GetObjectField(thisICalTriggerType, ICalTriggerType_Time_FID); + jni_SetYear_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_SetMonth_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_SetDay_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_SetHour_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_SetMinute_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_SetSecond_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_SetIs_utc_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_SetIs_date_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_SetZone_in_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); +} + +void jni_GetTime_from_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv *env, jobject thisICalTriggerType) +{ + jobject lcl_jobj0; + lcl_jobj0 = env->GetObjectField(thisICalTriggerType, ICalTriggerType_Time_FID); + jni_GetYear_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_GetMonth_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_GetDay_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_GetHour_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_GetMinute_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_GetSecond_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_GetIs_utc_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_GetIs_date_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); + jni_GetZone_from_ICalTimeType(&(__ICalTriggerType_->time), env, lcl_jobj0); +} + +void jni_SetDuration_in_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv *env, jobject thisICalTriggerType) +{ + jobject lcl_jobj0; + lcl_jobj0 = env->GetObjectField(thisICalTriggerType, ICalTriggerType_Duration_FID); + jni_SetIs_neg_in_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_SetDays_in_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_SetWeeks_in_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_SetHours_in_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_SetMinutes_in_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_SetSeconds_in_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); +} + +void jni_GetDuration_from_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv *env, jobject thisICalTriggerType) +{ + jobject lcl_jobj0; + lcl_jobj0 = env->GetObjectField(thisICalTriggerType, ICalTriggerType_Duration_FID); + jni_GetIs_neg_from_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_GetDays_from_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_GetWeeks_from_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_GetHours_from_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_GetMinutes_from_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); + jni_GetSeconds_from_ICalDurationType(&(__ICalTriggerType_->duration), env, lcl_jobj0); +} + +// copy all fields from the c struct (__ICalTriggerType_) to the java object (thisICalTriggerType). +void jni_SetAll_in_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv* env, jobject thisICalTriggerType) +{ + jni_SetTime_in_ICalTriggerType(__ICalTriggerType_, env, thisICalTriggerType); + jni_SetDuration_in_ICalTriggerType(__ICalTriggerType_, env, thisICalTriggerType); +} + +// copy all fields from the java object (thisICalTriggerType) to the c struct (__ICalTriggerType_). +void jni_GetAll_from_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv* env, jobject thisICalTriggerType) +{ + jni_GetTime_from_ICalTriggerType(__ICalTriggerType_, env, thisICalTriggerType); + jni_GetDuration_from_ICalTriggerType(__ICalTriggerType_, env, thisICalTriggerType); +} + +/* + * Class: net_cp_jlibical_ICalTriggerType + * Method: init + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalTriggerType_init__J + (JNIEnv* env, jobject thisICalTriggerType, jlong data) +{ + // copy all fields from the c struct (data) to the java object (thisICalTimeType). + jni_SetAll_in_ICalTriggerType((ICalTriggerType*)data,env,thisICalTriggerType); +} + +/* + * Class: net_cp_jlibical_ICalTriggerType + * Method: initFIDs + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalTriggerType_initFIDs(JNIEnv *env, jclass clazz) { + initICalTriggerTypeFieldIDs(env, clazz); +} diff --git a/src/java/jniICalTriggerType_cxx.h b/src/java/jniICalTriggerType_cxx.h new file mode 100644 index 00000000..62d6ec3e --- /dev/null +++ b/src/java/jniICalTriggerType_cxx.h @@ -0,0 +1,39 @@ + +/*====================================================================== + FILE: jniICalTriggerType_cxx.h + CREATOR: structConverter + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef _jni_ICalTriggerType_H +#define _jni_ICalTriggerType_H +#include <jni.h> + +// I forgot how to do this using a typedef in c++!!!! +#define ICalTriggerType icaltriggertype + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ical.h" + +static void initICalTriggerTypeFieldIDs(JNIEnv* env, jclass clazz); + +void jni_SetTime_in_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv *env, jobject thisICalTriggerType); +void jni_GetTime_from_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv *env, jobject thisICalTriggerType); +void jni_SetDuration_in_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv *env, jobject thisICalTriggerType); +void jni_GetDuration_from_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv *env, jobject thisICalTriggerType); +void jni_SetAll_in_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv* env, jobject thisICalTriggerType); + +void jni_GetAll_from_ICalTriggerType(struct ICalTriggerType* __ICalTriggerType_, JNIEnv* env, jobject thisICalTriggerType); +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalTriggerType_init__J(JNIEnv* env, jobject thisICalTriggerType, jlong data); +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalTriggerType_initFIDs(JNIEnv *env, jclass clazz); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/java/net_cp_jlibical_ICalParameter_cxx.cpp b/src/java/net_cp_jlibical_ICalParameter_cxx.cpp new file mode 100644 index 00000000..21574739 --- /dev/null +++ b/src/java/net_cp_jlibical_ICalParameter_cxx.cpp @@ -0,0 +1,310 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: net_cp_jlibical_ICalParameter_cxx.cpp + CREATOR: gnorman 1/10/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef NET_CP_JLIBICAL_ICALPARAMETER_CXX_H +#include "net_cp_jlibical_ICalParameter_cxx.h" +#endif + +#ifndef JLIBICAL_CONSTS_CXX_H +#include "jlibical_consts_cxx.h" +#endif + +#ifndef JLIBICAL_UTILS_CXX_H +#include "jlibical_utils_cxx.h" +#endif + +#ifndef ICALPARAMETER_CXX_H +#include "icalparameter_cxx.h" +#endif + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: as_ical_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalParameter_as_1ical_1string + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->as_ical_string(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: isa + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_isa + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->isa(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: isa_parameter + * Signature: (Ljava/lang/Object;)Z + */ +JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalParameter_isa_1parameter + (JNIEnv *env, jobject jobj, jobject arg) +{ + jboolean result = 0; + + // get the c++ object from the jobj + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the c++ object from the arg + void* argObjPtr = 0; + + if (arg != NULL) + { + argObjPtr = getCObjectPtr(env,arg); + } + + // get the result from the c++ object (candidateValue can be 0, it's cObj's responsibility to handle this if an error). + result = cObj->isa_parameter(argObjPtr) != 0; + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: get_language + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalParameter_get_1language + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_language(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: set_language + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1language + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_language((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: get_encoding + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_get_1encoding + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_encoding(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: set_encoding + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1encoding + (JNIEnv *env, jobject jobj, jint value) +{ + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_encoding((icalparameter_encoding)value); + } +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: get_role + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_get_1role + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_role(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: set_role + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1role + (JNIEnv *env, jobject jobj, jint value) +{ + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_role((icalparameter_role)value); + } +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: get_partstat + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_get_1partstat + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_partstat(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: set_partstat + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1partstat + (JNIEnv *env, jobject jobj, jint value) +{ + ICalParameter* cObj = getSubjectAsICalParameter(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_partstat((icalparameter_partstat)value); + } +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_init__ + (JNIEnv *env, jobject jobj) +{ + setCObjectPtr(env,jobj,new ICalParameter()); +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: init + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_init__Ljava_lang_String_2 + (JNIEnv *env, jobject jobj, jstring str) +{ + if (str != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + setCObjectPtr(env,jobj,new ICalParameter((char*)szTemp)); + env->ReleaseStringUTFChars(str,szTemp); + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: init + * Signature: (ILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_init__ILjava_lang_String_2 + (JNIEnv *env, jobject jobj, jint kind, jstring str) +{ + if (str != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + setCObjectPtr(env,jobj,new ICalParameter((icalparameter_kind)kind,(char*)szTemp)); + env->ReleaseStringUTFChars(str,szTemp); + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } +} + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: init + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_init__I + (JNIEnv *env, jobject jobj, jint kind) +{ + setCObjectPtr(env,jobj,new ICalParameter((icalparameter_kind)kind)); +} diff --git a/src/java/net_cp_jlibical_ICalParameter_cxx.h b/src/java/net_cp_jlibical_ICalParameter_cxx.h new file mode 100644 index 00000000..f2fef299 --- /dev/null +++ b/src/java/net_cp_jlibical_ICalParameter_cxx.h @@ -0,0 +1,143 @@ + +/*====================================================================== + FILE: net_cp_jlibical_ICalParameter_cxx.h + CREATOR: javah 1/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef _Included_net_cp_jlibical_ICalParameter +#define _Included_net_cp_jlibical_ICalParameter + +#ifndef JNI_H +#include <jni.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: as_ical_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalParameter_as_1ical_1string + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: isa + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_isa + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: isa_parameter + * Signature: (Ljava/lang/Object;)Z + */ +JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalParameter_isa_1parameter + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: get_language + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalParameter_get_1language + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: set_language + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1language + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: get_encoding + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_get_1encoding + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: set_encoding + * Signature: (I)V + */ + +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1encoding + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: get_role + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_get_1role + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: set_role + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1role + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: get_partstat + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalParameter_get_1partstat + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: set_partstat + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_set_1partstat + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_init__ + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: init + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_init__Ljava_lang_String_2 + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: init + * Signature: (ILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_init__ILjava_lang_String_2 + (JNIEnv *, jobject, jint, jstring); + +/* + * Class: net_cp_jlibical_ICalParameter + * Method: init + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalParameter_init__I + (JNIEnv *, jobject, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/java/net_cp_jlibical_ICalProperty_cxx.cpp b/src/java/net_cp_jlibical_ICalProperty_cxx.cpp new file mode 100644 index 00000000..4334354b --- /dev/null +++ b/src/java/net_cp_jlibical_ICalProperty_cxx.cpp @@ -0,0 +1,1690 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: net_cp_jlibical_ICalProperty_cxx.cpp + CREATOR: gnorman 1/10/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef NET_CP_JLIBICAL_ICALPROPERTY_CXX_H +#include "net_cp_jlibical_ICalProperty_cxx.h" +#endif + +#ifndef JLIBICAL_CONSTS_CXX_H +#include "jlibical_consts_cxx.h" +#endif + +#ifndef JLIBICAL_UTILS_CXX_H +#include "jlibical_utils_cxx.h" +#endif + +#ifndef ICALPROPERTY_CXX_H +#include "icalproperty_cxx.h" +#endif + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: as_ical_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_as_1ical_1string + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->as_ical_string(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: isa + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_isa + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->isa(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: isa_property + * Signature: (Ljava/lang/Object;)I + */ +JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalProperty_isa_1property + (JNIEnv *env, jobject jobj, jobject arg) +{ + jboolean result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + void* argObjPtr = 0; + + if (arg != NULL) + { + argObjPtr = getCObjectPtr(env,arg); + } + + // get the result from the c++ object (argObjPtr can be 0, it's cObj's responsibility to handle this if an error). + result = cObj->isa_property(argObjPtr) != 0; + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: add_parameter + * Signature: (Lnet/cp/jlibical/ICalParameter;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_add_1parameter + (JNIEnv *env, jobject jobj, jobject arg) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + ICalParameter* icalparameter = getSubjectAsICalParameter(env,arg,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + + if (icalparameter != NULL) + { + cObj->add_parameter(*icalparameter); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_parameter + * Signature: (Lnet/cp/jlibical/ICalParameter;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1parameter + (JNIEnv *env, jobject jobj, jobject arg) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + ICalParameter* icalparameter = getSubjectAsICalParameter(env,arg,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + + if (icalparameter != NULL) + { + cObj->set_parameter(*icalparameter); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_parameter_from_string + * Signature: (Ljava/lang/String;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1parameter_1from_1string + (JNIEnv *env, jobject jobj, jstring name, jstring value) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szName = env->GetStringUTFChars(name,NULL); + const char* szValue = env->GetStringUTFChars(value,NULL); + + if (szName != NULL && szValue != NULL) + { + cObj->set_parameter_from_string((string)szName, (string)szValue); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_parameter_as_string + * Signature: (Ljava/lang/String;)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1parameter_1as_1string + (JNIEnv *env, jobject jobj, jstring name) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szName = env->GetStringUTFChars(name,NULL); + + if (szName != NULL) + { + char* szValue = cObj->get_parameter_as_string((string)szName); + + if (szValue == NULL) + { + szValue = ""; + } + + result = env->NewStringUTF(szValue); + } + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: remove_parameter + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_remove_1parameter + (JNIEnv *env, jobject jobj, jint kind) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->remove_parameter((icalparameter_kind)kind); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: count_parameters + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_count_1parameters + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->count_parameters(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_first_parameter + * Signature: (I)Lnet/cp/jlibical/ICalParameter; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1first_1parameter + (JNIEnv *env, jobject jobj, jint kind) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the first parameter from CObj + ICalParameter* aParameter = cObj->get_first_parameter((icalparameter_kind)kind); + + // create a new surrogate, using aParameter as the subject (returns NULL if subject is NULL). + result = createNewICalParameterSurrogate(env,aParameter); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_next_parameter + * Signature: (I)Lnet/cp/jlibical/ICalParameter; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1next_1parameter + (JNIEnv *env, jobject jobj, jint kind) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the first parameter from CObj + ICalParameter* aParameter = cObj->get_next_parameter((icalparameter_kind)kind); + + // create a new surrogate, using aParameter as the subject (returns NULL if subject is NULL). + result = createNewICalParameterSurrogate(env,aParameter); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_value + * Signature: (Lnet/cp/jlibical/ICalValue;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1value + (JNIEnv *env, jobject jobj, jobject arg) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + ICalValue* aValue = getSubjectAsICalValue(env,arg,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + cObj->set_value(*aValue); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_value_from_string + * Signature: (Ljava/lang/String;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1value_1from_1string + (JNIEnv *env, jobject jobj, jstring name, jstring value) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szName = env->GetStringUTFChars(name,NULL); + const char* szValue = env->GetStringUTFChars(value,NULL); + + if (szName != NULL && szValue != NULL) + { + cObj->set_value_from_string((string)szName, (string)szValue); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_value + * Signature: ()Lnet/cp/jlibical/ICalValue; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1value + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the first value from CObj + ICalValue* aValue = cObj->get_value(); + + // create a new surrogate, using aValue as the subject (returns NULL if subject is NULL). + result = createNewICalValueSurrogate(env,aValue); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_value_as_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1value_1as_1string + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_value_as_string(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_name + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1name + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_name(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_action + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1action + (JNIEnv *env, jobject jobj, jint value) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_action((icalproperty_action)value); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_action + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_get_1action + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_action(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_attendee + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1attendee + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_attendee((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_attendee + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1attendee + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_attendee(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_comment + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1comment + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_comment((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_comment + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1comment + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* commentStr = cObj->get_comment(); + + if (commentStr == NULL) + { + commentStr = ""; + } + + result = env->NewStringUTF(commentStr); + } + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_description + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1description + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_description((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_description + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1description + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_description(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_dtend + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1dtend + (JNIEnv *env, jobject jobj, jobject arg) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aTime; + + if (copyObjToicaltimetype(env,arg,&aTime)) + { + cObj->set_dtend(aTime); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_dtend + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1dtend + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the dtend time from CObj + icaltimetype aTime = cObj->get_dtend(); + + // create a new surrogate, using aTime as the subject. + result = createNewICalTimeType(env,&aTime); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_dtstamp + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1dtstamp + (JNIEnv *env, jobject jobj, jobject dtstamp) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aDTStamp; + + if (copyObjToicaltimetype(env,dtstamp,&aDTStamp)) + { + cObj->set_dtstamp(aDTStamp); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_dtstamp + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1dtstamp + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the dtstamp time from CObj + icaltimetype aDTStamp = cObj->get_dtstamp(); + + // create a new surrogate, using aDTStamp as the subject. + result = createNewICalTimeType(env,&aDTStamp); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_dtstart + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1dtstart + (JNIEnv *env, jobject jobj, jobject arg) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aTime; + + if (copyObjToicaltimetype(env,arg,&aTime)) + { + cObj->set_dtstart(aTime); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_dtstart + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1dtstart + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the dtend time from CObj + icaltimetype aTime = cObj->get_dtstart(); + + // create a new surrogate, using aTime as the subject. + result = createNewICalTimeType(env,&aTime); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_due + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1due + (JNIEnv *env, jobject jobj, jobject arg) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aTime; + + if (copyObjToicaltimetype(env,arg,&aTime)) + { + cObj->set_due(aTime); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_due + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1due + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the dtend time from CObj + icaltimetype aTime = cObj->get_due(); + + // create a new surrogate, using aTime as the subject. + result = createNewICalTimeType(env,&aTime); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_duration + * Signature: (Lnet/cp/jlibical/ICalDurationType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1duration + (JNIEnv *env, jobject jobj, jobject arg) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaldurationtype aDuration; + + if (copyObjToicaldurationtype(env,arg,&aDuration)) + { + cObj->set_duration(aDuration); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_duration + * Signature: ()Lnet/cp/jlibical/ICalDurationType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1duration + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the dtend time from CObj + icaldurationtype aDuration = cObj->get_duration(); + + // create a new surrogate, using aTime as the subject. + result = createNewICalDurationType(env,&aDuration); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_location + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1location + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_location((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_location + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1location + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_location(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_method + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1method + (JNIEnv *env, jobject jobj, jint value) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_method((icalproperty_method)value); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_method + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_get_1method + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_method(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_organizer + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1organizer + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_organizer((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_organizer + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1organizer + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* organizerStr = cObj->get_organizer(); + + if (organizerStr == NULL) + { + organizerStr = ""; + } + + result = env->NewStringUTF(organizerStr); + } + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_owner + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1owner + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_owner((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_owner + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1owner + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_owner(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_prodid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1prodid + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_prodid((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_prodid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1prodid + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_prodid(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_query + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1query + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_query((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_query + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1query + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_query(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_queryname + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1queryname + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_queryname((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_queryname + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1queryname + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_queryname(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_repeat + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1repeat + (JNIEnv *env, jobject jobj, jint value) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_repeat(value); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_repeat + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_get_1repeat + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_repeat(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_summary + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1summary + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_summary((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_summary + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1summary + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_summary(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_target + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1target + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_target((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_target + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1target + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_target(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_trigger + * Signature: (Lnet/cp/jlibical/ICalTriggerType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1trigger + (JNIEnv *env, jobject jobj, jobject arg) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltriggertype aTrigger; + + if (copyObjToicaltriggertype(env,arg,&aTrigger)) + { + cObj->set_trigger(aTrigger); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_trigger + * Signature: ()Lnet/cp/jlibical/ICalTriggerType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1trigger + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the dtend time from CObj + icaltriggertype aTrigger = cObj->get_trigger(); + + // create a new surrogate, using aTime as the subject. + result = createNewICalTriggerType(env,&aTrigger); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_tzid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1tzid + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_tzid((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_tzid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1tzid + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_tzid(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_uid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1uid + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_uid((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_uid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1uid + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_uid(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_init__ + (JNIEnv *env, jobject jobj) +{ + setCObjectPtr(env,jobj,new ICalProperty()); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: init + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_init__Ljava_lang_String_2 + (JNIEnv *env, jobject jobj, jstring str) +{ + if (str != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + setCObjectPtr(env,jobj,new ICalProperty((char*)szTemp)); + env->ReleaseStringUTFChars(str,szTemp); + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: init + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_init__I + (JNIEnv *env, jobject jobj, jint kind) +{ + setCObjectPtr(env,jobj,new ICalProperty((icalproperty_kind)kind)); +} + + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_status + * Signature: (I)V + */ + +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1status + (JNIEnv *env, jobject jobj, jint value) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_status((icalproperty_status)value); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_status + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_get_1status + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_status(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_relcalid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1relcalid + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_relcalid((char *)szTemp); + + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_relcalid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1relcalid + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_relcalid(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_exdate + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1exdate + (JNIEnv *env, jobject jobj, jobject exdate) +{ + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aExDate; + + if (copyObjToicaltimetype(env,exdate,&aExDate)) + { + cObj->set_exdate(aExDate); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_exdate + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1exdate + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the exdate from CObj + icaltimetype aExDate = cObj->get_exdate(); + + // create a new surrogate, using aRecurrenceId as the subject. + result = createNewICalTimeType(env,&aExDate); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_exrule + * Signature: (Lnet/cp/jlibical/ICalRecurrenceType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1exrule + (JNIEnv *env, jobject jobj, jobject exrule) +{ + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + icalrecurrencetype aExRule; + if (copyObjToicalrecurrencetype(env,exrule,&aExRule)) + { + cObj->set_exrule(aExRule); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_exrule + * Signature: ()Lnet/cp/jlibical/ICalRecurrenceType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1exrule + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the exrule from CObj + icalrecurrencetype aExRule = cObj->get_exrule(); + + // create a new surrogate, using aExRule as the subject. + result = createNewICalRecurrenceType(env,&aExRule); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_freebusy + * Signature: (Lnet/cp/jlibical/ICalPeriodType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1freebusy + (JNIEnv *env, jobject jobj, jobject period) +{ + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icalperiodtype aPeriod; + + if (copyObjToicalperiodtype(env,period,&aPeriod)) + { + cObj->set_freebusy(aPeriod); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_freebusy + * Signature: ()Lnet/cp/jlibical/ICalPeriodType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1freebusy + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the period from CObj + icalperiodtype aPeriod = cObj->get_freebusy(); + + // create a new surrogate, using aPeriod as the subject. + result = createNewICalPeriodType(env,&aPeriod); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_recurrenceid + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1recurrenceid + (JNIEnv *env, jobject jobj, jobject recurrenceid) +{ + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aRecurrenceId; + + if (copyObjToicaltimetype(env,recurrenceid,&aRecurrenceId)) + { + cObj->set_recurrenceid(aRecurrenceId); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_recurrenceid + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1recurrenceid + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the exdate from CObj + icaltimetype aRecurrenceId = cObj->get_recurrenceid(); + + // create a new surrogate, using aRecurrenceId as the subject. + result = createNewICalTimeType(env,&aRecurrenceId); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_rrule + * Signature: (Lnet/cp/jlibical/ICalRecurrenceType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1rrule + (JNIEnv *env, jobject jobj, jobject rrule) +{ + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icalrecurrencetype aRRule; + + if (copyObjToicalrecurrencetype(env,rrule,&aRRule)) + { + cObj->set_rrule(aRRule); + } + } +} + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_rrule + * Signature: ()Lnet/cp/jlibical/ICalRecurrenceType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1rrule + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the ICalProperty c++ object from jobj + ICalProperty* cObj = getSubjectAsICalProperty(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the rrule from CObj + icalrecurrencetype aRRule = cObj->get_rrule(); + + // create a new surrogate, using aExRule as the subject. + result = createNewICalRecurrenceType(env,&aRRule); + } + + return(result); +} diff --git a/src/java/net_cp_jlibical_ICalProperty_cxx.h b/src/java/net_cp_jlibical_ICalProperty_cxx.h new file mode 100644 index 00000000..686ae9a0 --- /dev/null +++ b/src/java/net_cp_jlibical_ICalProperty_cxx.h @@ -0,0 +1,654 @@ + +/*====================================================================== + FILE: net_cp_jlibical_ICalProperty_cxx.h + CREATOR: javah 1/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef _Included_net_cp_jlibical_ICalProperty +#define _Included_net_cp_jlibical_ICalProperty + +#ifndef JNI_H +#include <jni.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: as_ical_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_as_1ical_1string + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: isa + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_isa + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: isa_property + * Signature: (Ljava/lang/Object;)I + */ +JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalProperty_isa_1property + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: add_parameter + * Signature: (Lnet/cp/jlibical/ICalParameter;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_add_1parameter + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_parameter + * Signature: (Lnet/cp/jlibical/ICalParameter;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1parameter + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_parameter_from_string + * Signature: (Ljava/lang/String;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1parameter_1from_1string + (JNIEnv *, jobject, jstring, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_parameter_as_string + * Signature: (Ljava/lang/String;)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1parameter_1as_1string + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: remove_parameter + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_remove_1parameter + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: count_parameters + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_count_1parameters + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_first_parameter + * Signature: (I)Lnet/cp/jlibical/ICalParameter; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1first_1parameter + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_next_parameter + * Signature: (I)Lnet/cp/jlibical/ICalParameter; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1next_1parameter + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_value + * Signature: (Lnet/cp/jlibical/ICalValue;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1value + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_value_from_string + * Signature: (Ljava/lang/String;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1value_1from_1string + (JNIEnv *, jobject, jstring, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_value + * Signature: ()Lnet/cp/jlibical/ICalValue; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1value + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_value_as_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1value_1as_1string + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_name + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1name + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: icalparameter_value_to_value_kind + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_icalparameter_1value_1to_1value_1kind + (JNIEnv *, jclass, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_action + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1action + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_action + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_get_1action + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_attendee + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1attendee + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_attendee + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1attendee + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_comment + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1comment + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_comment + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1comment + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_description + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1description + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_description + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1description + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_dtend + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1dtend + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_dtend + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1dtend + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_dtstamp + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1dtstamp + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_dtstamp + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1dtstamp + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_dtstart + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1dtstart + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_dtstart + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1dtstart + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_due + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1due + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_due + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1due + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_duration + * Signature: (Lnet/cp/jlibical/ICalDurationType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1duration + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_duration + * Signature: ()Lnet/cp/jlibical/ICalDurationType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1duration + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_location + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1location + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_location + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1location + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_method + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1method + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_method + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_get_1method + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_organizer + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1organizer + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_organizer + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1organizer + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_owner + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1owner + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_owner + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1owner + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_prodid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1prodid + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_prodid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1prodid + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_query + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1query + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_query + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1query + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_queryname + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1queryname + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_queryname + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1queryname + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_repeat + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1repeat + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_repeat + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_get_1repeat + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_summary + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1summary + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_summary + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1summary + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_target + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1target + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_target + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1target + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_trigger + * Signature: (Lnet/cp/jlibical/ICalTriggerType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1trigger + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_trigger + * Signature: ()Lnet/cp/jlibical/ICalTriggerType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1trigger + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_tzid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1tzid + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_tzid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1tzid + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_uid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1uid + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_uid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1uid + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_init__ + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: init + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_init__Ljava_lang_String_2 + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: init + * Signature: (ILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_init__ILjava_lang_String_2 + (JNIEnv *, jobject, jint, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: init + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_init__I + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_status + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1status + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_status + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalProperty_get_1status + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_relcalid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1relcalid + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_relcalid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalProperty_get_1relcalid + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_exdate + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1exdate + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_exdate + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1exdate + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_exrule + * Signature: (Lnet/cp/jlibical/ICalRecurrenceType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1exrule + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_exrule + * Signature: ()Lnet/cp/jlibical/ICalRecurrenceType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1exrule + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_freebusy + * Signature: (Lnet/cp/jlibical/ICalPeriodType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1freebusy + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_freebusy + * Signature: ()Lnet/cp/jlibical/ICalPeriodType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1freebusy + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_recurrenceid + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1recurrenceid + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_recurrenceid + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1recurrenceid + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: set_rrule + * Signature: (Lnet/cp/jlibical/ICalRecurrenceType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalProperty_set_1rrule + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalProperty + * Method: get_rrule + * Signature: ()Lnet/cp/jlibical/ICalRecurrenceType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalProperty_get_1rrule + (JNIEnv *, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/java/net_cp_jlibical_ICalValue_cxx.cpp b/src/java/net_cp_jlibical_ICalValue_cxx.cpp new file mode 100644 index 00000000..de2adac8 --- /dev/null +++ b/src/java/net_cp_jlibical_ICalValue_cxx.cpp @@ -0,0 +1,436 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: net_cp_jlibical_ICalValue_cxx.cpp + CREATOR: gnorman 1/10/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef NET_CP_JLIBICAL_ICALVALUE_CXX_H +#include "net_cp_jlibical_ICalValue_cxx.h" +#endif + +#ifndef JLIBICAL_CONSTS_CXX_H +#include "jlibical_consts_cxx.h" +#endif + +#ifndef JLIBICAL_UTILS_CXX_H +#include "jlibical_utils_cxx.h" +#endif + +#ifndef ICALVALUE_CXX_H +#include "icalvalue_cxx.h" +#endif + +/* + * Class: net_cp_jlibical_ICalValue + * Method: as_ical_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalValue_as_1ical_1string + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->as_ical_string(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: isa + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalValue_isa + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->isa(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: isa_value + * Signature: (Ljava/lang/Object;)Z + */ +JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalValue_isa_1value + (JNIEnv *env, jobject jobj, jobject arg) +{ + jboolean result = 0; + + // get the c++ object from the jobj + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the c++ object from arg + void* argObjPtr = 0; + + if (arg != NULL) + { + argObjPtr = getCObjectPtr(env,jobj); + } + + // get the result from the c++ object + result = cObj->isa_value(argObjPtr) != 0; + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_trigger + * Signature: (Lnet/cp/jlibical/ICalTriggerType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1trigger + (JNIEnv *env, jobject jobj, jobject arg) +{ + // get the c++ object from the jobj + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + icaltriggertype aTrigger; + + if (copyObjToicaltriggertype(env,arg,&aTrigger)) + { + cObj->set_trigger(aTrigger); + } + } +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_trigger + * Signature: ()Lnet/cp/jlibical/ICalTriggerType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalValue_get_1trigger + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + + // get the c++ object from the jobj + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the trigger from CObj + icaltriggertype aTrigger = cObj->get_trigger(); + + // create a new surrogate, using aTrigger as the subject. + result = createNewICalTriggerType(env,&aTrigger); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_method + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalValue_get_1method + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_method(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_method + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1method + (JNIEnv *env, jobject jobj, jint value) +{ + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_method((icalproperty_method)value); + } +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_text + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalValue_get_1text + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_text(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_text + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1text + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_text((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_duration + * Signature: ()Lnet/cp/jlibical/ICalDurationType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalValue_get_1duration + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + + // get the c++ object from the jobj + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the duration from CObj + icaldurationtype aDuration = cObj->get_duration(); + + // create a new surrogate, using aDuration as the subject. + result = createNewICalDurationType(env,&aDuration); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_duration + * Signature: (Lnet/cp/jlibical/ICalDurationType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1duration + (JNIEnv *env, jobject jobj, jobject arg) +{ + // get the c++ object from the jobj + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaldurationtype aDuration; + + if (copyObjToicaldurationtype(env,arg,&aDuration)) + { + cObj->set_duration(aDuration); + } + } +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_query + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalValue_get_1query + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_query(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_query + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1query + (JNIEnv *env, jobject jobj, jstring str) +{ + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_query((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_datetime + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalValue_get_1datetime + (JNIEnv *env, jobject jobj) +{ + jobject result = NULL; + + // get the c++ object from the jobj + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aTime = cObj->get_datetime(); + result = createNewICalTimeType(env,&aTime); + } + + return (result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_datetime + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1datetime + (JNIEnv *env, jobject jobj, jobject arg) +{ + // get the c++ object from the jobj + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aTime; + + if (copyObjToicaltimetype(env,arg,&aTime)) + { + cObj->set_datetime(aTime); + } + } +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_action + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalValue_get_1action + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_action(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_action + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1action + (JNIEnv *env, jobject jobj, jint value) +{ + ICalValue* cObj = getSubjectAsICalValue(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_action((icalproperty_action)value); + } +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_init__ + (JNIEnv *env, jobject jobj) +{ + setCObjectPtr(env,jobj,new ICalValue()); +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: init + * Signature: (ILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_init__ILjava_lang_String_2 + (JNIEnv *env, jobject jobj, jint kind, jstring str) +{ + if (str != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + setCObjectPtr(env,jobj,new ICalValue((icalvalue_kind)kind,(char*)szTemp)); + env->ReleaseStringUTFChars(str,szTemp); + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } +} + +/* + * Class: net_cp_jlibical_ICalValue + * Method: init + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_init__I + (JNIEnv *env, jobject jobj, jint kind) +{ + setCObjectPtr(env,jobj,new ICalValue((icalvalue_kind)kind)); +} diff --git a/src/java/net_cp_jlibical_ICalValue_cxx.h b/src/java/net_cp_jlibical_ICalValue_cxx.h new file mode 100644 index 00000000..989cf59a --- /dev/null +++ b/src/java/net_cp_jlibical_ICalValue_cxx.h @@ -0,0 +1,182 @@ + +/*====================================================================== + FILE: net_cp_jlibical_ICalValue_cxx.h + CREATOR: javah 1/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef _Included_net_cp_jlibical_ICalValue +#define _Included_net_cp_jlibical_ICalValue + +#ifndef JNI_H +#include <jni.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Class: net_cp_jlibical_ICalValue + * Method: as_ical_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalValue_as_1ical_1string + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: isa + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalValue_isa + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: isa_value + * Signature: (Ljava/lang/Object;)Z + */ +JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_ICalValue_isa_1value + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_trigger + * Signature: (Lnet/cp/jlibical/ICalTriggerType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1trigger + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_trigger + * Signature: ()Lnet/cp/jlibical/ICalTriggerType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalValue_get_1trigger + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_method + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalValue_get_1method + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_method + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1method + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_text + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalValue_get_1text + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_text + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1text + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_duration + * Signature: ()Lnet/cp/jlibical/ICalDurationType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalValue_get_1duration + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_duration + * Signature: (Lnet/cp/jlibical/ICalDurationType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1duration + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_query + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_ICalValue_get_1query + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_query + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1query + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_datetime + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_ICalValue_get_1datetime + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_datetime + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1datetime + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: get_action + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_ICalValue_get_1action + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: set_action + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_set_1action + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_init__ + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: init + * Signature: (ILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_init__ILjava_lang_String_2 + (JNIEnv *, jobject, jint, jstring); + +/* + * Class: net_cp_jlibical_ICalValue + * Method: init + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_ICalValue_init__I + (JNIEnv *, jobject, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/java/net_cp_jlibical_VComponent_cxx.cpp b/src/java/net_cp_jlibical_VComponent_cxx.cpp new file mode 100644 index 00000000..e9dc6a4c --- /dev/null +++ b/src/java/net_cp_jlibical_VComponent_cxx.cpp @@ -0,0 +1,956 @@ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: net_cp_jlibical_VComponent_cxx.cpp + CREATOR: gnorman 1/10/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef NET_CP_JLIBICAL_VCOMPONENT_CXX_H +#include "net_cp_jlibical_VComponent_cxx.h" +#endif + +#ifndef JLIBICAL_CONSTS_CXX_H +#include "jlibical_consts_cxx.h" +#endif + +#ifndef JLIBICAL_UTILS_CXX_H +#include "jlibical_utils_cxx.h" +#endif + +#ifndef VCOMPONENT_CXX_H +#include "vcomponent.h" +#endif + +#ifndef ICALPROPERTY_CXX_H +#include "icalproperty_cxx.h" +#endif + +/* + * Class: net_cp_jlibical_VComponent + * Method: as_ical_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_as_1ical_1string + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->as_ical_string(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: isa + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_isa + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->isa(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: isa_component + * Signature: (Ljava/lang/Object;)Z + */ +JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_VComponent_isa_1component + (JNIEnv *env, jobject jobj, jobject candidateObj) +{ + jboolean result = 0; + + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + void* candidateValue = 0; + + if (candidateObj != NULL) + { + // get the c++ object from candidateObj (as long) + candidateValue = getCObjectPtr(env,candidateObj); + } + + // get the result from the c++ object (candidateValue can be 0, it's cObj's responsibility to handle this if an error). + result = cObj->isa_component(candidateValue) != 0; + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: add_property + * Signature: (Lnet/cp/jlibical/ICalProperty;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_add_1property + (JNIEnv *env, jobject jobj, jobject jprop) +{ + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the ICalProperty c++ object from jprop + ICalProperty* icalProperty = getSubjectAsICalProperty(env,jprop,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + + if (icalProperty != NULL) + { + cObj->add_property(icalProperty); + } + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: remove_property + * Signature: (Lnet/cp/jlibical/ICalProperty;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_remove_1property + (JNIEnv *env, jobject jobj, jobject jprop) +{ + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the ICalProperty c++ object from jprop + ICalProperty* icalProperty = getSubjectAsICalProperty(env,jprop,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + + if (icalProperty != NULL) + { + cObj->remove_property(icalProperty); + } + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: count_properties + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_count_1properties + (JNIEnv *env, jobject jobj, jint kind) +{ + jint result = 0; + + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + result = cObj->count_properties((icalproperty_kind)kind); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_current_property + * Signature: ()Lnet/cp/jlibical/ICalProperty; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1current_1property + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the current property from CObj + ICalProperty* aProperty = cObj->get_current_property(); + + // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). + result = createNewICalPropertySurrogate(env,aProperty); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_first_property + * Signature: (I)Lnet/cp/jlibical/ICalProperty; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1property + (JNIEnv *env, jobject jobj, jint kind) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the first property from CObj + ICalProperty* aProperty = cObj->get_first_property((icalproperty_kind)kind); + + // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). + result = createNewICalPropertySurrogate(env,aProperty); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_next_property + * Signature: (I)Lnet/cp/jlibical/ICalProperty; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1next_1property + (JNIEnv *env, jobject jobj, jint kind) +{ + jobject result = 0; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the next property from CObj + ICalProperty* aProperty = cObj->get_next_property((icalproperty_kind)kind); + + // create a new surrogate, using aProperty as the subject (returns NULL if subject is NULL). + result = createNewICalPropertySurrogate(env,aProperty); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_inner + * Signature: ()Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1inner + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the next property from CObj + VComponent* inner = cObj->get_inner(); + + // create a new surrogate, using inner as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,inner); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: add_component + * Signature: (Lnet/cp/jlibical/VComponent;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_add_1component + (JNIEnv *env, jobject jobj, jobject jcomp) +{ + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the VComponent c++ object from jcomp + VComponent* aComponent = getSubjectAsVComponent(env,jcomp,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + + if (aComponent != NULL) + { + cObj->add_component(aComponent); + } + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: remove_component + * Signature: (Lnet/cp/jlibical/VComponent;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_remove_1component + (JNIEnv *env, jobject jobj, jobject jcomp) +{ + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + // get the VComponent c++ object from jcomp + VComponent* aComponent = getSubjectAsVComponent(env,jcomp,JLIBICAL_ERR_ILLEGAL_ARGUMENT); + + if (aComponent != NULL) + { + cObj->remove_component(aComponent); + } + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: count_components + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_count_1components + (JNIEnv *env, jobject jobj, jint kind) +{ + jint result = 0; + + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + if (cObj != NULL) + { + result = cObj->count_components((icalcomponent_kind)kind); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_current_component + * Signature: ()Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1current_1component + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the next property from CObj + VComponent* aComponent = cObj->get_current_component(); + + // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,aComponent); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_first_component + * Signature: (I)Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1component + (JNIEnv *env, jobject jobj, jint kind) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the first component from CObj + VComponent* aComponent = cObj->get_first_component((icalcomponent_kind)kind); + + // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,aComponent); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_next_component + * Signature: (I)Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1next_1component + (JNIEnv *env, jobject jobj, jint kind) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the first component from CObj + VComponent* aComponent = cObj->get_next_component((icalcomponent_kind)kind); + + // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,aComponent); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_dtstart + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtstart + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the dtstart time from CObj + icaltimetype aTime = cObj->get_dtstart(); + + // create a new surrogate, using aTime as the subject. + result = createNewICalTimeType(env,&aTime); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_dtstart + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtstart + (JNIEnv *env, jobject jobj, jobject dtstart) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aStartTime; + + if (copyObjToicaltimetype(env,dtstart,&aStartTime)) + { + cObj->set_dtstart(aStartTime); + } + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_dtend + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtend + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the dtend time from CObj + icaltimetype aTime = cObj->get_dtend(); + + // create a new surrogate, using aTime as the subject. + result = createNewICalTimeType(env,&aTime); + + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_dtend + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtend + (JNIEnv *env, jobject jobj, jobject dtend) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype anEndTime; + + if (copyObjToicaltimetype(env,dtend,&anEndTime)) + { + cObj->set_dtend(anEndTime); + } + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_duration + * Signature: ()Lnet/cp/jlibical/ICalDurationType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1duration + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the duration time from CObj + icaldurationtype aDuration = cObj->get_duration(); + + // create a new surrogate, using aDuration as the subject. + result = createNewICalDurationType(env,&aDuration); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_duration + * Signature: (Lnet/cp/jlibical/ICalDurationType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1duration + (JNIEnv *env, jobject jobj, jobject duration) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaldurationtype aDuration; + + if (copyObjToicaldurationtype(env,duration,&aDuration)) + { + cObj->set_duration(aDuration); + } + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_method + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_get_1method + (JNIEnv *env, jobject jobj) +{ + jint result = 0; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + result = cObj->get_method(); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_method + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1method + (JNIEnv *env, jobject jobj, jint value) +{ + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + cObj->set_method((icalproperty_method)value); + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_summary + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1summary + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_summary(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_summary + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1summary + (JNIEnv *env, jobject jobj, jstring str) +{ + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_summary((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_dtstamp + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtstamp + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the recurrenceid from CObj + icaltimetype aDTStamp = cObj->get_dtstamp(); + + // create a new surrogate, using aRecurrenceId as the subject. + result = createNewICalTimeType(env,&aDTStamp); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_dtstamp + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtstamp + (JNIEnv *env, jobject jobj, jobject dtstamp) +{ + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aDTStamp; + + if (copyObjToicaltimetype(env,dtstamp,&aDTStamp)) + { + cObj->set_dtstamp(aDTStamp); + } + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_location + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1location + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_location(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_location + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1location + (JNIEnv *env, jobject jobj, jstring str) +{ + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_summary((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_description + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1description + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_description(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_description + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1description + (JNIEnv *env, jobject jobj, jstring str) +{ + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_summary((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} +/* + * Class: net_cp_jlibical_VComponent + * Method: get_uid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1uid + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_uid(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_uid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1uid + (JNIEnv *env, jobject jobj, jstring str) +{ + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_uid((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_first_real_component + * Signature: ()Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1real_1component + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the first component from CObj + VComponent* aComponent = cObj->get_first_real_component(); + + // create a new surrogate, using aComponent as the subject (returns NULL if subject is NULL). + result = createNewVComponentSurrogate(env,aComponent); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__ + (JNIEnv *env, jobject jobj) +{ + setCObjectPtr(env,jobj,new VComponent()); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: init + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__Ljava_lang_String_2 + (JNIEnv *env, jobject jobj, jstring str) +{ + if (str != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + setCObjectPtr(env,jobj,new VComponent((char*)szTemp)); + env->ReleaseStringUTFChars(str,szTemp); + } + else + { + throwException( env, JLIBICAL_ERR_ILLEGAL_ARGUMENT ); + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: init + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__I + (JNIEnv *env, jobject jobj, jint kind) +{ + setCObjectPtr(env,jobj,new VComponent((icalcomponent_kind)kind)); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_relcalid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1relcalid + (JNIEnv *env, jobject jobj, jstring str) +{ + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + const char* szTemp = env->GetStringUTFChars(str,NULL); + + cObj->set_relcalid((char*)szTemp); + env->ReleaseStringUTFChars(str,szTemp); + } +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_relcalid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1relcalid + (JNIEnv *env, jobject jobj) +{ + jstring result = NULL; + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + char* icalStr = cObj->get_relcalid(); + + if (icalStr == NULL) + { + icalStr = ""; + } + + result = env->NewStringUTF(icalStr); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_recurrenceid + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1recurrenceid + (JNIEnv *env, jobject jobj) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + // get the recurrenceid from CObj + icaltimetype aRecurrenceId = cObj->get_recurrenceid(); + + // create a new surrogate, using aRecurrenceId as the subject. + result = createNewICalTimeType(env,&aRecurrenceId); + } + + return(result); +} + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_recurrenceid + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1recurrenceid + (JNIEnv *env, jobject jobj, jobject recurrenceid) +{ + jobject result = 0; + // get the VComponent c++ object from jobj + VComponent* cObj = getSubjectAsVComponent(env,jobj,JLIBICAL_ERR_CLIENT_INTERNAL); + + if (cObj != NULL) + { + icaltimetype aRecurrenceId; + + if (copyObjToicaltimetype(env,recurrenceid,&aRecurrenceId)) + { + cObj->set_recurrenceid(aRecurrenceId); + } + } +} diff --git a/src/java/net_cp_jlibical_VComponent_cxx.h b/src/java/net_cp_jlibical_VComponent_cxx.h new file mode 100644 index 00000000..ad2dfb60 --- /dev/null +++ b/src/java/net_cp_jlibical_VComponent_cxx.h @@ -0,0 +1,358 @@ + +/*====================================================================== + FILE: net_cp_jlibical_VComponent_cxx.h + CREATOR: javah 1/11/02 + (C) COPYRIGHT 2002, Critical Path +======================================================================*/ + +#ifndef _Included_net_cp_jlibical_VComponent +#define _Included_net_cp_jlibical_VComponent + +#ifndef JNI_H +#include <jni.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Class: net_cp_jlibical_VComponent + * Method: as_ical_string + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_as_1ical_1string + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: isa + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_isa + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: isa_component + * Signature: (Ljava/lang/Object;)Z + */ +JNIEXPORT jboolean JNICALL Java_net_cp_jlibical_VComponent_isa_1component + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: add_property + * Signature: (Lnet/cp/jlibical/ICalProperty;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_add_1property + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: remove_property + * Signature: (Lnet/cp/jlibical/ICalProperty;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_remove_1property + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: count_properties + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_count_1properties + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_current_property + * Signature: ()Lnet/cp/jlibical/ICalProperty; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1current_1property + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_first_property + * Signature: (I)Lnet/cp/jlibical/ICalProperty; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1property + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_next_property + * Signature: (I)Lnet/cp/jlibical/ICalProperty; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1next_1property + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_inner + * Signature: ()Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1inner + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: add_component + * Signature: (Lnet/cp/jlibical/VComponent;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_add_1component + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: remove_component + * Signature: (Lnet/cp/jlibical/VComponent;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_remove_1component + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: count_components + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_count_1components + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_current_component + * Signature: ()Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1current_1component + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_first_component + * Signature: (I)Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1component + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_next_component + * Signature: (I)Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1next_1component + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_dtstart + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtstart + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_dtstart + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtstart + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_dtend + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtend + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_dtend + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtend + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_duration + * Signature: ()Lnet/cp/jlibical/ICalDurationType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1duration + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_duration + * Signature: (Lnet/cp/jlibical/ICalDurationType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1duration + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_method + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_cp_jlibical_VComponent_get_1method + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_method + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1method + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_summary + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1summary + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_summary + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1summary + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_dtstamp + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1dtstamp + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_dtstamp + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1dtstamp + (JNIEnv *, jobject, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_location + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1location + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_location + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1location + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_description + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1description + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_description + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1description + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_uid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1uid + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_uid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1uid + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_first_real_component + * Signature: ()Lnet/cp/jlibical/VComponent; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1first_1real_1component + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__ + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: init + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__Ljava_lang_String_2 + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_VComponent + * Method: init + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_init__I + (JNIEnv *, jobject, jint); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_relcalid + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_cp_jlibical_VComponent_get_1relcalid + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_relcalid + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1relcalid + (JNIEnv *, jobject, jstring); + +/* + * Class: net_cp_jlibical_VComponent + * Method: get_recurrenceid + * Signature: ()Lnet/cp/jlibical/ICalTimeType; + */ +JNIEXPORT jobject JNICALL Java_net_cp_jlibical_VComponent_get_1recurrenceid + (JNIEnv *, jobject); + +/* + * Class: net_cp_jlibical_VComponent + * Method: set_recurrenceid + * Signature: (Lnet/cp/jlibical/ICalTimeType;)V + */ +JNIEXPORT void JNICALL Java_net_cp_jlibical_VComponent_set_1recurrenceid + (JNIEnv *, jobject, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/java/testjni.java b/src/java/testjni.java new file mode 100644 index 00000000..a7eb5886 --- /dev/null +++ b/src/java/testjni.java @@ -0,0 +1,377 @@ +package net.cp.jlibical; + +import java.lang.String; + +public class testjni +{ + static final String content = "BEGIN:VCALENDAR\nVERSION:2.1\nBEGIN:VEVENT\nUID:abcd12345\nDTSTART:20020307T180000Z\nDTEND:20020307T190000Z\nSUMMARY:Important Meeting\nEND:VEVENT\nEND:VCALENDAR"; + public static void main(String[] args) + { + // VAGENDA test case + + ICalProperty calidProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_RELCALID_PROPERTY); + ICalProperty ownerProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_OWNER_PROPERTY); + + calidProp.set_relcalid("1212"); + ownerProp.set_owner("Bill Smith"); + + VAgenda vAgenda = new VAgenda(); + vAgenda.add_property(calidProp); + vAgenda.add_property(ownerProp); + + System.out.println("VAgenda:\n" + vAgenda.as_ical_string()); + + // VEVENT test case + + ICalProperty summProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_SUMMARY_PROPERTY); + ICalProperty startProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_DTSTART_PROPERTY); + ICalProperty endProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_DTEND_PROPERTY); + + ICalProperty locationProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_LOCATION_PROPERTY); + ICalProperty descProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_DESCRIPTION_PROPERTY); + + ICalTimeType starttime = new ICalTimeType(); + starttime.setYear(2001); + starttime.setMonth(12); + starttime.setDay(21); + starttime.setHour(18); + starttime.setMinute(0); + starttime.setSecond(0); + starttime.setIs_utc(true); + System.out.println("done creating starttime"); + + ICalTimeType endtime = new ICalTimeType(); + endtime.setYear(2002); + endtime.setMonth(1); + endtime.setDay(1); + endtime.setHour(8); + endtime.setMinute(0); + endtime.setSecond(0); + endtime.setIs_utc(true); + System.out.println("done creating endtime"); + + + // START - get, set_exdate + ICalProperty property_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_EXDATE_PROPERTY); + property_tma.set_exdate(starttime); + ICalTimeType starttime_return = property_tma.get_exdate(); + System.out.println("****** property - exdate ******"); + System.out.println("setYear=" + starttime_return.getYear()); + System.out.println("setMonth=" + starttime_return.getMonth()); + System.out.println("setDay=" + starttime_return.getDay()); + System.out.println("setHour=" + starttime_return.getHour()); + System.out.println("setMinute=" + starttime_return.getMinute()); + System.out.println("setSecond=" + starttime_return.getSecond()); + System.out.println("******* property - exdate *****"); + + // END - get, set exdate + + // START - get, set exrule + ICalProperty property_exrule_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_EXRULE_PROPERTY); + ICalRecurrenceType exrule_tma = new ICalRecurrenceType(); + exrule_tma.setUntil(starttime); + exrule_tma.setFreq(ICalRecurrenceType.ICalRecurrenceTypeFrequency.ICAL_MINUTELY_RECURRENCE); + exrule_tma.setWeek_start(ICalRecurrenceType.ICalRecurrenceTypeWeekday.ICAL_SUNDAY_WEEKDAY); + short test_tma[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61}; + + exrule_tma.setBy_second(test_tma); + exrule_tma.setBy_minute(test_tma); + property_exrule_tma.set_exrule(exrule_tma); + + ICalRecurrenceType recurence_tma_return = property_exrule_tma.get_exrule(); + System.out.println("****** property - exrule ******"); + System.out.println("setFreq=" + recurence_tma_return.getFreq()); + System.out.println("setWeek_start=" + recurence_tma_return.getWeek_start()); + System.out.println("setBy_second[30]=" + recurence_tma_return.getBy_secondIndexed(30)); + System.out.println("setBy_minute[28]=" + recurence_tma_return.getBy_minuteIndexed(28)); + System.out.println("****** property - exrule ******"); + + // END - get, set exrule + + // START - get, set recurrenceid + ICalProperty property_recurrenceid_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_RECURRENCEID_PROPERTY); + property_recurrenceid_tma.set_recurrenceid(starttime); + ICalTimeType recurrenceid_return = property_recurrenceid_tma.get_recurrenceid(); + System.out.println("****** property - recurrenceid ******"); + System.out.println("setYear=" + recurrenceid_return.getYear()); + System.out.println("setMonth=" + recurrenceid_return.getMonth()); + System.out.println("setDay=" + recurrenceid_return.getDay()); + System.out.println("setHour=" + recurrenceid_return.getHour()); + System.out.println("setMinute=" + recurrenceid_return.getMinute()); + System.out.println("setSecond=" + recurrenceid_return.getSecond()); + System.out.println("******* property - recurrenceid *****"); + + // END - get, set recurrenceid + + // START - get, set rrule + ICalProperty property_rrule_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_RRULE_PROPERTY); + ICalRecurrenceType rrule_tma = new ICalRecurrenceType(); + rrule_tma.setUntil(starttime); + rrule_tma.setFreq(ICalRecurrenceType.ICalRecurrenceTypeFrequency.ICAL_MINUTELY_RECURRENCE); + rrule_tma.setWeek_start(ICalRecurrenceType.ICalRecurrenceTypeWeekday.ICAL_SUNDAY_WEEKDAY); + short test_hour_tma[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25}; + rrule_tma.setBy_hour(test_hour_tma); + property_rrule_tma.set_rrule(rrule_tma); + + ICalRecurrenceType rrule_tma_return = property_rrule_tma.get_rrule(); + System.out.println("****** property - rrule ******"); + System.out.println("setFreq=" + rrule_tma_return.getFreq()); + System.out.println("setWeek_start=" + rrule_tma_return.getWeek_start()); + System.out.println("setBy_hour[11]=" + rrule_tma_return.getBy_hourIndexed(11)); + System.out.println("****** property - rrule ******"); + // END - get, set rrule + + // START - get, set freebusy + ICalProperty property_freebusy_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_FREEBUSY_PROPERTY); + ICalPeriodType period_tma = new ICalPeriodType(); + ICalDurationType duration_tma = new ICalDurationType(); + duration_tma.setDays((long) 0); + duration_tma.setHours((long) 10); + duration_tma.setMinutes((long) 15); + + period_tma.setStart(starttime); + period_tma.setEnd(endtime); + period_tma.setDuration(duration_tma); + + property_freebusy_tma.set_freebusy(period_tma); + + ICalPeriodType period_tma_return = property_freebusy_tma.get_freebusy(); + ICalTimeType start_tma_return = period_tma_return.getStart(); + ICalTimeType end_tma_return = period_tma_return.getEnd(); + ICalDurationType duration_tma_return = period_tma_return.getDuration(); + + System.out.println("****** property - freebusy - start ******"); + System.out.println("setYear=" + start_tma_return.getYear()); + System.out.println("setMonth=" + start_tma_return.getMonth()); + System.out.println("setDay=" + start_tma_return.getDay()); + System.out.println("setHour=" + start_tma_return.getHour()); + System.out.println("setMinute=" + start_tma_return.getMinute()); + System.out.println("setSecond=" + start_tma_return.getSecond()); + System.out.println("******* property - freebusy - start *****"); + + System.out.println("****** property - freebusy - end ******"); + System.out.println("setYear=" + end_tma_return.getYear()); + System.out.println("setMonth=" + end_tma_return.getMonth()); + System.out.println("setDay=" + end_tma_return.getDay()); + System.out.println("setHour=" + end_tma_return.getHour()); + System.out.println("setMinute=" + end_tma_return.getMinute()); + System.out.println("setSecond=" + end_tma_return.getSecond()); + System.out.println("******* property - freebusy - end *****"); + + System.out.println("****** property - freebusy - duration ******"); + System.out.println("setYear=" + duration_tma_return.getDays()); + System.out.println("setMonth=" + duration_tma_return.getHours()); + System.out.println("setDay=" + duration_tma_return.getMinutes()); + System.out.println("******* property - freebusy - duration *****"); + + // END - get, set freebusy + + // START - get, set dtstamp + ICalProperty property_dtstamp_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_DTSTAMP_PROPERTY); + property_dtstamp_tma.set_dtstamp(starttime); + ICalTimeType dtstamp_tma_return = property_dtstamp_tma.get_dtstamp(); + System.out.println("****** property - dtstamp ******"); + System.out.println("setYear=" + dtstamp_tma_return.getYear()); + System.out.println("setMonth=" + dtstamp_tma_return.getMonth()); + System.out.println("setDay=" + dtstamp_tma_return.getDay()); + System.out.println("setHour=" + dtstamp_tma_return.getHour()); + System.out.println("setMinute=" + dtstamp_tma_return.getMinute()); + System.out.println("setSecond=" + dtstamp_tma_return.getSecond()); + System.out.println("******* property - dtstamp *****"); + // END - get, set dtstamp + // START - get, set attendee + ICalProperty property_attendee_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_ATTENDEE_PROPERTY); + property_attendee_tma.set_attendee("John"); + String attendee_tma_return = property_attendee_tma.get_attendee(); + System.out.println("****** property - attendee ******"); + System.out.println("setAttendee=" + attendee_tma_return); + System.out.println("****** property - attendee ******"); + // END - get, set attendee + // START - get, set comment + ICalProperty property_comment_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_COMMENT_PROPERTY); + property_comment_tma.set_comment("John"); + String comment_tma_return = property_comment_tma.get_comment(); + System.out.println("****** property - comment ******"); + System.out.println("setComment=" + comment_tma_return); + System.out.println("****** property - comment ******"); + // END - get, set comment + // START - get, set organizer + ICalProperty property_organizer_tma = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_ORGANIZER_PROPERTY); + property_organizer_tma.set_organizer("John"); + String organizer_tma_return = property_organizer_tma.get_organizer(); + System.out.println("****** property - organizer ******"); + System.out.println("setOrganizer=" + organizer_tma_return); + System.out.println("****** property - organizer ******"); + // END - get, set organizer + + summProp.set_summary("New Year's Eve Party, and more"); + System.out.println("done setting summProp"); + startProp.set_dtstart(starttime); + System.out.println("done setting startProp"); + endProp.set_dtend(endtime); + System.out.println("done setting endProp"); + locationProp.set_location("Bothin, Marin County, CA, USA"); + System.out.println("done setting locationProp\n"); + descProp.set_description("Drive carefully; come to have fun!"); + System.out.println("done setting descProp\n"); + + VEvent vEvent = new VEvent(); + vEvent.add_property(summProp); + vEvent.add_property(startProp); + vEvent.add_property(endProp); + vEvent.add_property(locationProp); + vEvent.add_property(descProp); + + ICalTimeType sTime = vEvent.get_dtstart(); + ICalTimeType eTime = vEvent.get_dtend(); + + //System.out.println("VEvent:\n" + vEvent.as_ical_string()); + System.out.println("Summary: \n" + vEvent.get_summary()); + System.out.println("DTSTART: \n" + sTime.getYear() + sTime.getMonth() + sTime.getDay() + + sTime.getHour() + sTime.getMinute() + sTime.getSecond()); + System.out.println("DTEND: \n" + eTime.getYear() + eTime.getMonth() + eTime.getDay() + + eTime.getHour() + eTime.getMinute() + eTime.getSecond()); + System.out.println("Location: \n" + vEvent.get_location()); + System.out.println("Description: \n" +vEvent.get_description()); + + VComponent ic = new VComponent(content); + if (ic == null) + System.err.println("Failed to parse component"); + System.out.println("VComponent:\n" + ic.as_ical_string()); + + // component is wrapped within BEGIN:VCALENDAR END:VCALENDAR + // we need to unwrap it. + VEvent sub_ic = (VEvent)ic.get_first_component(VComponent.ICalComponentKind.ICAL_VEVENT_COMPONENT); + if (sub_ic == null) + System.out.println("Failed to get subcomponent"); + while (sub_ic != null) + { + System.out.println("subcomponent:\n" + sub_ic.as_ical_string()); + sub_ic = (VEvent)ic.get_next_component(VComponent.ICalComponentKind.ICAL_VEVENT_COMPONENT); + } + + // START - get, set recurrenceid + ICalTimeType time_tma = new ICalTimeType(); + time_tma.setYear(2002); + time_tma.setMonth(2); + time_tma.setDay(2); + time_tma.setHour(2); + time_tma.setMinute(2); + time_tma.setSecond(2); + time_tma.setIs_utc(true); + + ic.set_recurrenceid(time_tma); + + ICalTimeType time_tma_return = new ICalTimeType(); + time_tma_return = ic.get_recurrenceid(); + System.out.println("****** vcomponent - recurrenceid ******"); + System.out.println("setYear=" + time_tma_return.getYear()); + System.out.println("setMonth=" + time_tma_return.getMonth()); + System.out.println("setDay=" + time_tma_return.getDay()); + System.out.println("setHour=" + time_tma_return.getHour()); + System.out.println("setMinute=" + time_tma_return.getMinute()); + System.out.println("setSecond=" + time_tma_return.getSecond()); + System.out.println("****** vcomponent - recurrenceid ******"); + // END - get, set recurrenceid + // START - get, set dtstamp + ic.set_dtstamp(time_tma); + ICalTimeType vcomponent_dtstamp_tma_return = ic.get_dtstamp(); + System.out.println("****** vcomponent - dtstamp ******"); + System.out.println("setYear=" + vcomponent_dtstamp_tma_return.getYear()); + System.out.println("setMonth=" + vcomponent_dtstamp_tma_return.getMonth()); + System.out.println("setDay=" + vcomponent_dtstamp_tma_return.getDay()); + System.out.println("setHour=" + vcomponent_dtstamp_tma_return.getHour()); + System.out.println("setMinute=" + vcomponent_dtstamp_tma_return.getMinute()); + System.out.println("setSecond=" + vcomponent_dtstamp_tma_return.getSecond()); + System.out.println("****** vcomponent - dtstamp ******"); + + // END - get, set dtstamp + + // VTODO test cases + + ICalProperty statusProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_STATUS_PROPERTY); + ICalProperty dueProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_DUE_PROPERTY); + + ICalTimeType duetime = new ICalTimeType(); + duetime.setYear(2002); + duetime.setMonth(12); + duetime.setDay(21); + duetime.setHour(18); + duetime.setMinute(0); + duetime.setSecond(0); + duetime.setIs_utc(true); + System.out.println("done creating duetime"); + + statusProp.set_status(ICalProperty.ICalPropertyStatus.ICAL_STATUS_COMPLETED); + dueProp.set_due(duetime); + + VToDo vtodo = new VToDo(); + + vtodo.add_property(statusProp); + vtodo.add_property(dueProp); + + System.out.println("VToDo:\n" + vtodo.as_ical_string()); + + // VALARM test cases + + VAlarm valarm = new VAlarm(); + System.out.println("created valarm"); + + // 1. Create a ICAL_DURATION_PROPERTY using the TimePeriod. + ICalDurationType duration = new ICalDurationType(); + duration.setDays((long) 0); + duration.setHours((long) 0); + duration.setMinutes((long) 15); + System.out.println("created duration object"); + + // Since we want to trigger before the event or task, + // we always want to set this to 1. If we say this is not + // a negative duration, that means the alarm will trigger + // AFTER the event or task start or due date, which is useless. + duration.setIs_neg(1); + + // 2. Create a ICalTriggerType oject and set the duration on it. + ICalTriggerType trigger = new ICalTriggerType(); + trigger.setDuration(duration); + System.out.println("set trigger to duration object"); + + // 3. Create a trigger ICalProperty and set the trigger on it. + ICalProperty triggerProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_TRIGGER_PROPERTY); + System.out.println("created trigger property"); + triggerProp.set_trigger(trigger); + System.out.println("set trigger property"); + trigger = triggerProp.get_trigger(); + System.out.println("get trigger property"); + + // 4. set the trigger property on the Valarm object. + valarm.add_property(triggerProp); + System.out.println("VAlarm:\n" + valarm.as_ical_string()); + + // 5. create attendee property + String userEmail = "userid@domain"; + ICalProperty attendeeProp = new ICalProperty(ICalProperty.ICalPropertyKind.ICAL_ATTENDEE_PROPERTY); + attendeeProp.set_attendee("MAILTO:" + userEmail); + System.out.println("set attendee property"); + userEmail = attendeeProp.get_attendee(); + System.out.println("get attendee property"); + valarm.add_property(attendeeProp); + System.out.println("VAlarm:\n" + valarm.as_ical_string()); + + // START - get, set_role + ICalParameter parameter_role_tma = new ICalParameter(ICalParameter.ICalParameterKind.ICAL_ROLE_PARAMETER); + parameter_role_tma.set_role(ICalParameter.ICalParameterRole.ICAL_ROLE_REQPARTICIPANT); + int role_tma_return = parameter_role_tma.get_role(); + System.out.println("******* parameter - role *****"); + System.out.println("setRole=" + role_tma_return); + System.out.println("******* parameter - role *****"); + // END - get, set_role + // START - get, set_partstat + ICalParameter parameter_partstat_tma = new ICalParameter(ICalParameter.ICalParameterKind.ICAL_PARTSTAT_PARAMETER); + parameter_partstat_tma.set_partstat(ICalParameter.ICalParameterPartStat.ICAL_PARTSTAT_DECLINED); + int partstat_tma_return = parameter_partstat_tma.get_partstat(); + System.out.println("******* parameter - partstat *****"); + System.out.println("setPartstat=" + partstat_tma_return); + System.out.println("******* parameter - partstat *****"); + // END - get, set_partstat + } +} |