bump to 1.0.0 and clean up spec file
[platform/upstream/libical.git] / src / libical / icaltypes.h
1 /* -*- Mode: C -*- */
2 /*======================================================================
3  FILE: icaltypes.h
4  CREATOR: eric 20 March 1999
5
6
7  (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
8      http://www.softwarestudio.org
9
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of either: 
12
13     The LGPL as published by the Free Software Foundation, version
14     2.1, available at: http://www.fsf.org/copyleft/lesser.html
15
16   Or:
17
18     The Mozilla Public License Version 1.0. You may obtain a copy of
19     the License at http://www.mozilla.org/MPL/
20
21   The original code is icaltypes.h
22
23 ======================================================================*/
24
25 #ifndef ICALTYPES_H
26 #define ICALTYPES_H
27
28 #include <time.h>
29 #include "icalenums.h"
30 #include "icaltime.h"
31 #include "icalduration.h"
32 #include "icalperiod.h"
33
34
35 struct icalgeotype 
36 {
37         double lat;
38         double lon;
39 };
40
41
42 struct icaldatetimeperiodtype 
43 {
44         struct icaltimetype time;
45         struct icalperiodtype period;
46 };
47
48
49 struct icaltriggertype 
50 {
51         struct icaltimetype time; 
52         struct icaldurationtype duration;
53 };
54
55 struct icaltriggertype icaltriggertype_from_int(const int reltime);
56 struct icaltriggertype icaltriggertype_from_string(const char* str);
57
58 int icaltriggertype_is_null_trigger(struct icaltriggertype tr);
59 int icaltriggertype_is_bad_trigger(struct icaltriggertype tr);
60
61 /* struct icalreqstattype. This struct contains two string pointers,
62 but don't try to free either of them. The "desc" string is a pointer
63 to a static table inside the library.  Don't try to free it. The
64 "debug" string is a pointer into the string that the called passed
65 into to icalreqstattype_from_string. Don't try to free it either, and
66 don't use it after the original string has been freed.
67
68 BTW, you would get that original string from
69 *icalproperty_get_requeststatus() or icalvalue_get_text(), when
70 operating on the value of a request_status property. */
71
72 struct icalreqstattype {
73
74         icalrequeststatus code;
75         const char* desc;
76         const char* debug;
77 };
78
79 struct icalreqstattype icalreqstattype_from_string(const char* str);
80 const char* icalreqstattype_as_string(struct icalreqstattype);
81 char* icalreqstattype_as_string_r(struct icalreqstattype);
82
83
84
85 struct icaltimezonephase {
86     const char* tzname;
87     int is_stdandard; /* 1 = standard tme, 0 = daylight savings time */
88     struct icaltimetype dtstart;
89     int offsetto;
90     int tzoffsetfrom;
91     const char* comment;
92     struct icaldatetimeperiodtype rdate;
93     const char* rrule;    
94 };
95
96
97 struct icaltimezonetype {
98     const char* tzid;
99     struct icaltimetype last_mod;
100     const char* tzurl;
101     
102     /* Array of phases. The end of the array is a phase with tzname == 0 */
103     struct icaltimezonephase *phases;
104 };
105
106 void icaltimezonetype_free(struct icaltimezonetype tzt);
107
108 /* ical_unknown_token_handling :
109  *    How should the ICAL library handle components, properties and parameters with
110  *    unknown names?
111  *    FIXME:  Currently only affects parameters.  Extend to components and properties.
112  */
113 typedef enum ical_unknown_token_handling {
114     ICAL_ASSUME_IANA_TOKEN = 1, 
115     ICAL_DISCARD_TOKEN = 2,
116     ICAL_TREAT_AS_ERROR = 3 
117 } ical_unknown_token_handling;
118
119 ical_unknown_token_handling ical_get_unknown_token_handling_setting(void);
120 void ical_set_unknown_token_handling_setting(ical_unknown_token_handling newSetting);
121
122 #endif /* !ICALTYPES_H */