Imported Upstream version 0.48
[platform/upstream/libical.git] / src / java / ICalValue.java
1 /*======================================================================
2  FILE: ICalValue.java
3  CREATOR: gnorman 01/10/02
4  (C) COPYRIGHT 2002, Critical Path
5 ======================================================================*/
6
7 package net.cp.jlibical;
8
9 public class ICalValue 
10 {
11         /** It's not typesafe, but it's simple to understand! */
12         public interface ICalValueKind 
13         {
14                 // icalvalue_kind
15                 int ICAL_ANY_VALUE=5000;
16                 int ICAL_BOOLEAN_VALUE=5001;
17                 int ICAL_UTCOFFSET_VALUE=5002;
18                 int ICAL_RECUR_VALUE=5003;
19                 int ICAL_METHOD_VALUE=5004;
20                 int ICAL_CALADDRESS_VALUE=5005;
21                 int ICAL_PERIOD_VALUE=5006;
22                 int ICAL_STATUS_VALUE=5007;
23                 int ICAL_BINARY_VALUE=5008;
24                 int ICAL_TEXT_VALUE=5009;
25                 int ICAL_DATETIMEDATE_VALUE=5010;
26                 int ICAL_DURATION_VALUE=5011;
27                 int ICAL_DATETIMEPERIOD_VALUE=5012;
28                 int ICAL_INTEGER_VALUE=5013;
29                 int ICAL_TIME_VALUE=5014;
30                 int ICAL_URI_VALUE=5015;
31                 int ICAL_TRIGGER_VALUE=5016;
32                 int ICAL_ATTACH_VALUE=5017;
33                 int ICAL_CLASS_VALUE=5018;
34                 int ICAL_FLOAT_VALUE=5019;
35                 int ICAL_QUERY_VALUE=5020;
36                 int ICAL_STRING_VALUE=5021;
37                 int ICAL_TRANSP_VALUE=5022;
38                 int ICAL_X_VALUE=5023;
39                 int ICAL_DATETIME_VALUE=5024;
40                 int ICAL_GEO_VALUE=5025;
41                 int ICAL_DATE_VALUE=5026;
42                 int ICAL_ACTION_VALUE=5027;
43                 int ICAL_NO_VALUE=5028;
44         }
45
46         /**
47         * Constructor for ICalValue
48         * @param obj c++ pointer
49         */
50         private ICalValue(long obj)
51         {
52                 init(obj);
53         }
54
55         public ICalValue()
56         {
57                 init();
58         }
59
60         public ICalValue(/* ICalValueKind */ int kind)
61         {
62                 init(kind);
63         }
64
65         public ICalValue(/* ICalValueKind */ int kind, String  str)
66         {
67                 init(kind,str);
68         }
69
70         public native String as_ical_string();
71         //public native boolean is_valid();
72         public native /* ICalValueKind */ int isa();
73         public native boolean isa_value(Object value);
74
75         /* Special, non autogenerated value accessors */
76         //void set_recur(struct icalrecurrencetype v);
77         //struct icalrecurrencetype get_recur();
78
79         public native void set_trigger(ICalTriggerType v);
80         public native ICalTriggerType get_trigger();
81
82         //void set_datetimeperiod(struct icaldatetimeperiodtype v);
83         //struct icaldatetimeperiodtype get_datetimeperiod();
84
85         //public native static /* ICalParameterXLicCompareType */ int compare(ICalValue a, ICalValue b);
86
87         /* Convert enumerations */
88         //public native static /* ICalValueKind */ int string_to_kind(String str);
89         //public native String kind_to_string(/* ICalValueKind */ int kind);
90
91         /* BOOLEAN */
92         //public native int get_boolean();
93         //public native void set_boolean(int v);
94
95         /* UTC-OFFSET */
96         //public native int get_utcoffset();
97         //public native void set_utcoffset(int v);
98
99         /* METHOD */
100         public native /* ICalPropertyMethod */ int get_method();
101         public native void set_method(/* ICalPropertyMethod */ int v);
102
103         /* CAL-ADDRESS */
104         //public native String get_caladdress();
105         //public native void set_caladdress(String  v);
106
107         /* PERIOD */
108         //struct icalperiodtype get_period();
109         //void set_period(struct icalperiodtype v);
110
111         /* STATUS */
112         //public native /* ICalPropertyStatus */ int get_status();
113         //public native void set_status(/* ICalPropertyStatus */ int v);
114
115         /* BINARY */
116         //public native String get_binary();
117         //public native void set_binary(String  v);
118
119         /* TEXT */
120         public native String get_text();
121         public native void set_text(String  v);
122
123         /* DATE-TIME-DATE */
124         //ICalTimeType get_datetimedate();
125         //void set_datetimedate(ICalTimeType v);
126
127         /* DURATION */
128         public native ICalDurationType get_duration();
129         public native void set_duration(ICalDurationType v);
130
131         /* INTEGER */
132         //public native int get_integer();
133         //public native void set_integer(int v);
134
135         /* TIME */
136         //ICalTimeType get_time();
137         //void set_time(ICalTimeType v);
138
139         /* URI */
140         //public native String get_uri();
141         //public native void set_uri(String  v);
142
143         /* ATTACH */
144         //struct icalattachtype get_attach();
145         //void set_attach(struct icalattachtype v);
146
147         /* CLASS */
148         //public native /* ICalPropertyClass */ int get_class();
149         //public native void set_class(/* ICalPropertyClass */ int v);
150
151         /* FLOAT */
152         //public native float get_float();
153         //public native void set_float(float v);
154
155         /* QUERY */
156         public native String get_query();
157         public native void set_query(String  v);
158
159         /* STRING */
160         //public native String get_string();
161         //public native void set_string(String  v);
162
163         /* TRANSP */
164         //public native /* ICalPropertyTransp */ int get_transp();
165         //public native void set_transp(/* ICalPropertyTransp */ int v);
166
167         /* DATE-TIME */
168         public native ICalTimeType get_datetime();
169         public native void set_datetime(ICalTimeType v);
170
171         /* GEO */
172         //struct icalgeotype get_geo();
173         //void set_geo(struct icalgeotype v);
174
175         /* DATE */
176         //ICalTimeType get_date();
177         //void set_date(ICalTimeType v);
178
179         /* ACTION */
180         public native /* ICalPropertyAction */ int get_action();
181         public native void set_action(/* ICalPropertyAction */ int v);
182
183         /**
184          * init the native class
185          */
186         private void init(long obj)
187         {
188                 m_Obj = obj;
189         }
190
191         private native void init();
192         private native void init(/* ICalValueKind */ int kind, String str);
193         private native void init(/* ICalValueKind */ int kind);
194
195         /**
196          * load the jni library for this class
197          */
198         static {
199                 System.loadLibrary("ical_jni");
200         }
201
202         public static void main(String[] args)
203         {
204                 System.out.println("*** ICalValue main called ok.");
205         }
206
207         /** pointer to C++ object  */
208         private long    m_Obj = 0;
209 }