/*======================================================================
 FILE: ICalProperty.java
 CREATOR: gnorman 01/09/02

 SPDX-FileCopyrightText: 2002, Critical Path
 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
======================================================================*/

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 = 10501;
        int ICAL_METHOD_REQUEST = 10502;
        int ICAL_METHOD_REPLY = 10503;
        int ICAL_METHOD_ADD = 10504;
        int ICAL_METHOD_CANCEL = 10505;
        int ICAL_METHOD_REFRESH = 10506;
        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 {
        int ICAL_ANY_PROPERTY = 0;
        int ICAL_ACCEPTRESPONSE_PROPERTY = 102;
        int ICAL_ACKNOWLEDGED_PROPERTY = 1;
        int ICAL_ACTION_PROPERTY = 2;
        int ICAL_ALLOWCONFLICT_PROPERTY = 3;
        int ICAL_ATTACH_PROPERTY = 4;
        int ICAL_ATTENDEE_PROPERTY = 5;
        int ICAL_BUSYTYPE_PROPERTY = 101;
        int ICAL_CALENDARADDRESS_PROPERTY = 130;
        int ICAL_CALID_PROPERTY = 6;
        int ICAL_CALMASTER_PROPERTY = 7;
        int ICAL_CALSCALE_PROPERTY = 8;
        int ICAL_CAPVERSION_PROPERTY = 9;
        int ICAL_CARLEVEL_PROPERTY = 10;
        int ICAL_CARID_PROPERTY = 11;
        int ICAL_CATEGORIES_PROPERTY = 12;
        int ICAL_CLASS_PROPERTY = 13;
        int ICAL_CMD_PROPERTY = 14;
        int ICAL_COLOR_PROPERTY = 118;
        int ICAL_COMMENT_PROPERTY = 15;
        int ICAL_COMPLETED_PROPERTY = 16;
        int ICAL_COMPONENTS_PROPERTY = 17;
        int ICAL_CONCEPT_PROPERTY = 133;
        int ICAL_CONFERENCE_PROPERTY = 120;
        int ICAL_CONTACT_PROPERTY = 18;
        int ICAL_CREATED_PROPERTY = 19;
        int ICAL_CSID_PROPERTY = 20;
        int ICAL_DATEMAX_PROPERTY = 21;
        int ICAL_DATEMIN_PROPERTY = 22;
        int ICAL_DECREED_PROPERTY = 23;
        int ICAL_DEFAULTCHARSET_PROPERTY = 24;
        int ICAL_DEFAULTLOCALE_PROPERTY = 25;
        int ICAL_DEFAULTTZID_PROPERTY = 26;
        int ICAL_DEFAULTVCARS_PROPERTY = 27;
        int ICAL_DENY_PROPERTY = 28;
        int ICAL_DESCRIPTION_PROPERTY = 29;
        int ICAL_DTEND_PROPERTY = 30;
        int ICAL_DTSTAMP_PROPERTY = 31;
        int ICAL_DTSTART_PROPERTY = 32;
        int ICAL_DUE_PROPERTY = 33;
        int ICAL_DURATION_PROPERTY = 34;
        int ICAL_ESTIMATEDDURATION_PROPERTY = 113;
        int ICAL_EXDATE_PROPERTY = 35;
        int ICAL_EXPAND_PROPERTY = 36;
        int ICAL_EXRULE_PROPERTY = 37;
        int ICAL_FREEBUSY_PROPERTY = 38;
        int ICAL_GEO_PROPERTY = 39;
        int ICAL_GRANT_PROPERTY = 40;
        int ICAL_IMAGE_PROPERTY = 119;
        int ICAL_ITIPVERSION_PROPERTY = 41;
        int ICAL_LASTMODIFIED_PROPERTY = 42;
        int ICAL_LINK_PROPERTY = 134;
        int ICAL_LOCATION_PROPERTY = 43;
        int ICAL_LOCATIONTYPE_PROPERTY = 127;
        int ICAL_MAXCOMPONENTSIZE_PROPERTY = 44;
        int ICAL_MAXDATE_PROPERTY = 45;
        int ICAL_MAXRESULTS_PROPERTY = 46;
        int ICAL_MAXRESULTSSIZE_PROPERTY = 47;
        int ICAL_METHOD_PROPERTY = 48;
        int ICAL_MINDATE_PROPERTY = 49;
        int ICAL_MULTIPART_PROPERTY = 50;
        int ICAL_NAME_PROPERTY = 115;
        int ICAL_ORGANIZER_PROPERTY = 52;
        int ICAL_OWNER_PROPERTY = 53;
        int ICAL_PARTICIPANTTYPE_PROPERTY = 128;
        int ICAL_PATCHDELETE_PROPERTY = 124;
        int ICAL_PATCHORDER_PROPERTY = 122;
        int ICAL_PATCHPARAMETER_PROPERTY = 125;
        int ICAL_PATCHTARGET_PROPERTY = 123;
        int ICAL_PATCHVERSION_PROPERTY = 121;
        int ICAL_PERCENTCOMPLETE_PROPERTY = 54;
        int ICAL_PERMISSION_PROPERTY = 55;
        int ICAL_POLLCOMPLETION_PROPERTY = 110;
        int ICAL_POLLITEMID_PROPERTY = 103;
        int ICAL_POLLMODE_PROPERTY = 104;
        int ICAL_POLLPROPERTIES_PROPERTY = 105;
        int ICAL_POLLWINNER_PROPERTY = 106;
        int ICAL_PRIORITY_PROPERTY = 56;
        int ICAL_PRODID_PROPERTY = 57;
        int ICAL_PROXIMITY_PROPERTY = 126;
        int ICAL_QUERY_PROPERTY = 58;
        int ICAL_QUERYLEVEL_PROPERTY = 59;
        int ICAL_QUERYID_PROPERTY = 60;
        int ICAL_QUERYNAME_PROPERTY = 61;
        int ICAL_RDATE_PROPERTY = 62;
        int ICAL_RECURACCEPTED_PROPERTY = 63;
        int ICAL_RECUREXPAND_PROPERTY = 64;
        int ICAL_RECURLIMIT_PROPERTY = 65;
        int ICAL_RECURRENCEID_PROPERTY = 66;
        int ICAL_REFID_PROPERTY = 135;
        int ICAL_REFRESHINTERVAL_PROPERTY = 116;
        int ICAL_RELATEDTO_PROPERTY = 67;
        int ICAL_RELCALID_PROPERTY = 68;
        int ICAL_REPEAT_PROPERTY = 69;
        int ICAL_REPLYURL_PROPERTY = 111;
        int ICAL_REQUESTSTATUS_PROPERTY = 70;
        int ICAL_RESOURCETYPE_PROPERTY = 129;
        int ICAL_RESOURCES_PROPERTY = 71;
        int ICAL_RESPONSE_PROPERTY = 112;
        int ICAL_RESTRICTION_PROPERTY = 72;
        int ICAL_RRULE_PROPERTY = 73;
        int ICAL_SCOPE_PROPERTY = 74;
        int ICAL_SEQUENCE_PROPERTY = 75;
        int ICAL_SOURCE_PROPERTY = 117;
        int ICAL_STATUS_PROPERTY = 76;
        int ICAL_STORESEXPANDED_PROPERTY = 77;
        int ICAL_STRUCTUREDDATA_PROPERTY = 132;
        int ICAL_STYLEDDESCRIPTION_PROPERTY = 131;
        int ICAL_SUMMARY_PROPERTY = 78;
        int ICAL_TARGET_PROPERTY = 79;
        int ICAL_TASKMODE_PROPERTY = 114;
        int ICAL_TRANSP_PROPERTY = 80;
        int ICAL_TRIGGER_PROPERTY = 81;
        int ICAL_TZID_PROPERTY = 82;
        int ICAL_TZIDALIASOF_PROPERTY = 108;
        int ICAL_TZNAME_PROPERTY = 83;
        int ICAL_TZOFFSETFROM_PROPERTY = 84;
        int ICAL_TZOFFSETTO_PROPERTY = 85;
        int ICAL_TZUNTIL_PROPERTY = 109;
        int ICAL_TZURL_PROPERTY = 86;
        int ICAL_UID_PROPERTY = 87;
        int ICAL_URL_PROPERTY = 88;
        int ICAL_VERSION_PROPERTY = 89;
        int ICAL_VOTER_PROPERTY = 107;
        int ICAL_X_PROPERTY = 90;
        int ICAL_XLICCLASS_PROPERTY = 91;
        int ICAL_XLICCLUSTERCOUNT_PROPERTY = 92;
        int ICAL_XLICERROR_PROPERTY = 93;
        int ICAL_XLICMIMECHARSET_PROPERTY = 94;
        int ICAL_XLICMIMECID_PROPERTY = 95;
        int ICAL_XLICMIMECONTENTTYPE_PROPERTY = 96;
        int ICAL_XLICMIMEENCODING_PROPERTY = 97;
        int ICAL_XLICMIMEFILENAME_PROPERTY = 98;
        int ICAL_XLICMIMEOPTINFO_PROPERTY = 99;
        int ICAL_NO_PROPERTY = 100;
    }

    public interface ICalPropertyStatus {
        // icalproperty_status
        int ICAL_STATUS_X = 10028;
        int ICAL_STATUS_TENTATIVE = 10901;
        int ICAL_STATUS_CONFIRMED = 10902;
        int ICAL_STATUS_COMPLETED = 10903;
        int ICAL_STATUS_NEEDSACTION = 10900;
        int ICAL_STATUS_CANCELLED = 10905;
        int ICAL_STATUS_INPROCESS = 10900;
        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_by_kind(/* 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();

    /* Returns 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 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();

    /* 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;
}
