1 /* -*- Mode: C -*- */
2 /*======================================================================
3   FILE: icalproperty.h
4   CREATOR: eric 20 March 1999
5 
6 
7   $Id: icalproperty.h,v 1.20 2008-01-15 23:17:41 dothebart Exp $
8   $Locker:  $
9 
10 
11 
12  (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
13      http://www.softwarestudio.org
14 
15  This program is free software; you can redistribute it and/or modify
16  it under the terms of either:
17 
18     The LGPL as published by the Free Software Foundation, version
19     2.1, available at: http://www.fsf.org/copyleft/lesser.html
20 
21   Or:
22 
23     The Mozilla Public License Version 1.0. You may obtain a copy of
24     the License at http://www.mozilla.org/MPL/
25 
26   The original code is icalparam.h
27 
28   ======================================================================*/
29 
30 
31 #ifndef ICALPROPERTY_H
32 #define ICALPROPERTY_H
33 
34 #include <time.h>
35 #include <stdarg.h>  /* for va_... */
36 
37 #include "icalderivedparameter.h"
38 
39 #include "icalvalue.h"
40 #include "icalrecur.h"
41 
42 /* Actually in icalderivedproperty.h:
43    typedef struct icalproperty_impl icalproperty; */
44 
45 #include "icalderivedproperty.h" /* To get icalproperty_kind enumerations */
46 
47 icalproperty* icalproperty_new(icalproperty_kind kind);
48 
49 icalproperty* icalproperty_new_clone(icalproperty * prop);
50 
51 icalproperty* icalproperty_new_from_string(const char* str);
52 
53 const char* icalproperty_as_ical_string(icalproperty* prop);
54 char* icalproperty_as_ical_string_r(icalproperty* prop);
55 
56 void  icalproperty_free(icalproperty* prop);
57 
58 icalproperty_kind icalproperty_isa(icalproperty* property);
59 int icalproperty_isa_property(void* property);
60 
61 void icalproperty_add_parameters(struct icalproperty_impl *prop,va_list args);
62 void icalproperty_add_parameter(icalproperty* prop,icalparameter* parameter);
63 void icalproperty_set_parameter(icalproperty* prop,icalparameter* parameter);
64 void icalproperty_set_parameter_from_string(icalproperty* prop,
65                                             const char* name, const char* value);
66 const char* icalproperty_get_parameter_as_string(icalproperty* prop,
67                                                  const char* name);
68 char* icalproperty_get_parameter_as_string_r(icalproperty* prop,
69                                                  const char* name);
70 
71 void icalproperty_remove_parameter(icalproperty* prop,
72 				   icalparameter_kind kind);
73 
74 void icalproperty_remove_parameter_by_kind(icalproperty* prop,
75 					   icalparameter_kind kind);
76 
77 void icalproperty_remove_parameter_by_name(icalproperty* prop,
78 					   const char *name);
79 
80 void icalproperty_remove_parameter_by_ref(icalproperty* prop,
81 					  icalparameter *param);
82 
83 
84 
85 int icalproperty_count_parameters(const icalproperty* prop);
86 
87 /* Iterate through the parameters */
88 icalparameter* icalproperty_get_first_parameter(icalproperty* prop,
89 						icalparameter_kind kind);
90 icalparameter* icalproperty_get_next_parameter(icalproperty* prop,
91 						icalparameter_kind kind);
92 /* Access the value of the property */
93 void icalproperty_set_value(icalproperty* prop, icalvalue* value);
94 void icalproperty_set_value_from_string(icalproperty* prop,const char* value, const char* kind);
95 
96 icalvalue* icalproperty_get_value(const icalproperty* prop);
97 const char* icalproperty_get_value_as_string(const icalproperty* prop);
98 char* icalproperty_get_value_as_string_r(const icalproperty* prop);
99 
100 /* Deal with X properties */
101 
102 void icalproperty_set_x_name(icalproperty* prop, const char* name);
103 const char* icalproperty_get_x_name(icalproperty* prop);
104 
105 /** Return the name of the property -- the type name converted to a
106  *  string, or the value of _get_x_name if the type is and X
107  *  property
108  */
109 const char* icalproperty_get_property_name (const icalproperty* prop);
110 char* icalproperty_get_property_name_r(const icalproperty* prop);
111 
112 icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value);
113 
114 /* Convert kinds to string and get default value type */
115 
116 icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind);
117 icalproperty_kind icalproperty_value_kind_to_kind(icalvalue_kind kind);
118 const char* icalproperty_kind_to_string(icalproperty_kind kind);
119 icalproperty_kind icalproperty_string_to_kind(const char* string);
120 
121 /** Check validity of a specific icalproperty_kind **/
122 int icalproperty_kind_is_valid(const icalproperty_kind kind);
123 
124 icalproperty_method icalproperty_string_to_method(const char* str);
125 const char* icalproperty_method_to_string(icalproperty_method method);
126 
127 
128 const char* icalproperty_enum_to_string(int e);
129 char* icalproperty_enum_to_string_r(int e);
130 int icalproperty_string_to_enum(const char* str);
131 int icalproperty_kind_and_string_to_enum(const int kind, const char* str);
132 
133 const char* icalproperty_status_to_string(icalproperty_status);
134 icalproperty_status icalproperty_string_to_status(const char* string);
135 
136 int icalproperty_enum_belongs_to_property(icalproperty_kind kind, int e);
137 
138 
139 
140 
141 #endif /*ICALPROPERTY_H*/
142