1 
2 /* -*- Mode: C -*-*/
3 /*======================================================================
4  FILE: icalenums.h
5 
6 
7 
8  (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
9      http://www.softwarestudio.org
10 
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of either:
13 
14     The LGPL as published by the Free Software Foundation, version
15     2.1, available at: http://www.fsf.org/copyleft/lesser.html
16 
17   Or:
18 
19     The Mozilla Public License Version 1.0. You may obtain a copy of
20     the License at http://www.mozilla.org/MPL/
21 
22   The original code is icalenums.h
23 
24   Contributions from:
25      Graham Davison <g.m.davison@computer.org>
26 
27 ======================================================================*/
28 
29 #ifndef ICALENUMS_H
30 #define ICALENUMS_H
31 
32 
33 
34 /***********************************************************************
35  * Component enumerations
36 **********************************************************************/
37 
38 typedef enum icalcomponent_kind {
39     ICAL_NO_COMPONENT,
40     ICAL_ANY_COMPONENT,	/* Used to select all components*/
41     ICAL_XROOT_COMPONENT,
42     ICAL_XATTACH_COMPONENT, /* MIME attached data, returned by parser. */
43     ICAL_VEVENT_COMPONENT,
44     ICAL_VTODO_COMPONENT,
45     ICAL_VJOURNAL_COMPONENT,
46     ICAL_VCALENDAR_COMPONENT,
47     ICAL_VAGENDA_COMPONENT,
48     ICAL_VFREEBUSY_COMPONENT,
49     ICAL_VALARM_COMPONENT,
50     ICAL_XAUDIOALARM_COMPONENT,
51     ICAL_XDISPLAYALARM_COMPONENT,
52     ICAL_XEMAILALARM_COMPONENT,
53     ICAL_XPROCEDUREALARM_COMPONENT,
54     ICAL_VTIMEZONE_COMPONENT,
55     ICAL_XSTANDARD_COMPONENT,
56     ICAL_XDAYLIGHT_COMPONENT,
57     ICAL_X_COMPONENT,
58     ICAL_VSCHEDULE_COMPONENT,
59     ICAL_VQUERY_COMPONENT,
60     ICAL_VREPLY_COMPONENT,
61     ICAL_VCAR_COMPONENT,
62     ICAL_VCOMMAND_COMPONENT,
63     ICAL_XLICINVALID_COMPONENT,
64     ICAL_XLICMIMEPART_COMPONENT /* a non-stardard component that mirrors
65 				structure of MIME data */
66 
67 } icalcomponent_kind;
68 
69 
70 
71 /***********************************************************************
72  * Request Status codes
73  **********************************************************************/
74 
75 typedef enum icalrequeststatus {
76     ICAL_UNKNOWN_STATUS,
77     ICAL_2_0_SUCCESS_STATUS,
78     ICAL_2_1_FALLBACK_STATUS,
79     ICAL_2_2_IGPROP_STATUS,
80     ICAL_2_3_IGPARAM_STATUS,
81     ICAL_2_4_IGXPROP_STATUS,
82     ICAL_2_5_IGXPARAM_STATUS,
83     ICAL_2_6_IGCOMP_STATUS,
84     ICAL_2_7_FORWARD_STATUS,
85     ICAL_2_8_ONEEVENT_STATUS,
86     ICAL_2_9_TRUNC_STATUS,
87     ICAL_2_10_ONETODO_STATUS,
88     ICAL_2_11_TRUNCRRULE_STATUS,
89     ICAL_3_0_INVPROPNAME_STATUS,
90     ICAL_3_1_INVPROPVAL_STATUS,
91     ICAL_3_2_INVPARAM_STATUS,
92     ICAL_3_3_INVPARAMVAL_STATUS,
93     ICAL_3_4_INVCOMP_STATUS,
94     ICAL_3_5_INVTIME_STATUS,
95     ICAL_3_6_INVRULE_STATUS,
96     ICAL_3_7_INVCU_STATUS,
97     ICAL_3_8_NOAUTH_STATUS,
98     ICAL_3_9_BADVERSION_STATUS,
99     ICAL_3_10_TOOBIG_STATUS,
100     ICAL_3_11_MISSREQCOMP_STATUS,
101     ICAL_3_12_UNKCOMP_STATUS,
102     ICAL_3_13_BADCOMP_STATUS,
103     ICAL_3_14_NOCAP_STATUS,
104     ICAL_3_15_INVCOMMAND,
105     ICAL_4_0_BUSY_STATUS,
106     ICAL_4_1_STORE_ACCESS_DENIED,
107     ICAL_4_2_STORE_FAILED,
108     ICAL_4_3_STORE_NOT_FOUND,
109     ICAL_5_0_MAYBE_STATUS,
110     ICAL_5_1_UNAVAIL_STATUS,
111     ICAL_5_2_NOSERVICE_STATUS,
112     ICAL_5_3_NOSCHED_STATUS,
113     ICAL_6_1_CONTAINER_NOT_FOUND,
114 	ICAL_9_0_UNRECOGNIZED_COMMAND
115 } icalrequeststatus;
116 
117 
118 const char* icalenum_reqstat_desc(icalrequeststatus stat);
119 short icalenum_reqstat_major(icalrequeststatus stat);
120 short icalenum_reqstat_minor(icalrequeststatus stat);
121 icalrequeststatus icalenum_num_to_reqstat(short major, short minor);
122 char* icalenum_reqstat_code(icalrequeststatus stat);
123 char* icalenum_reqstat_code_r(icalrequeststatus stat);
124 
125 /***********************************************************************
126  * Conversion functions
127 **********************************************************************/
128 
129 
130 /* Thse routines used to be in icalenums.c, but were moved into the
131    icalproperty, icalparameter, icalvalue, or icalcomponent modules. */
132 
133 /* const char* icalproperty_kind_to_string(icalproperty_kind kind);*/
134 #define icalenum_property_kind_to_string(x) icalproperty_kind_to_string(x)
135 
136 /*icalproperty_kind icalproperty_string_to_kind(const char* string)*/
137 #define icalenum_string_to_property_kind(x) icalproperty_string_to_kind(x)
138 
139 /*icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind);*/
140 #define icalenum_property_kind_to_value_kind(x) icalproperty_kind_to_value_kind(x)
141 
142 /*const char* icalenum_method_to_string(icalproperty_method);*/
143 #define icalenum_method_to_string(x) icalproperty_method_to_string(x)
144 
145 /*icalproperty_method icalenum_string_to_method(const char* string);*/
146 #define icalenum_string_to_method(x) icalproperty_string_to_method(x)
147 
148 /*const char* icalenum_status_to_string(icalproperty_status);*/
149 #define icalenum_status_to_string(x) icalproperty_status_to_string(x)
150 
151 /*icalproperty_status icalenum_string_to_status(const char* string);*/
152 #define icalenum_string_to_status(x) icalproperty_string_to_status(x)
153 
154 /*icalvalue_kind icalenum_string_to_value_kind(const char* str);*/
155 #define icalenum_string_to_value_kind(x) icalvalue_string_to_kind(x)
156 
157 /*const char* icalenum_value_kind_to_string(icalvalue_kind kind);*/
158 #define icalenum_value_kind_to_string(x) icalvalue_kind_to_string(x)
159 
160 /*const char* icalenum_component_kind_to_string(icalcomponent_kind kind);*/
161 #define icalenum_component_kind_to_string(x) icalcomponent_kind_to_string(x)
162 
163 /*icalcomponent_kind icalenum_string_to_component_kind(const char* string);*/
164 #define icalenum_string_to_component_kind(x) icalcomponent_string_to_kind(x)
165 
166 
167 #endif /* !ICALENUMS_H */
168 
169