Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icalproperty.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: icalproperty.h
3 CREATOR: eric 20 March 1999
4
5 SPDX-FileCopyrightText: 2000, Eric Busboom <eric@civicknowledge.com>
6 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7======================================================================*/
8
9#ifndef ICALPROPERTY_H
10#define ICALPROPERTY_H
11
12#include "libical_ical_export.h"
13#include "icalderivedproperty.h" /* To get icalproperty_kind enumerations */
14#include "icalpvl.h"
15
16#include <stdarg.h> /* for va_... */
17
19
20LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new(icalproperty_kind kind);
21
27LIBICAL_ICAL_EXPORT icalproperty *icalproperty_clone(const icalproperty *old);
28
29LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_from_string(const char *str);
30
31LIBICAL_ICAL_EXPORT const char *icalproperty_as_ical_string(icalproperty *prop);
32
33LIBICAL_ICAL_EXPORT char *icalproperty_as_ical_string_r(icalproperty *prop);
34
35LIBICAL_ICAL_EXPORT void icalproperty_free(icalproperty *prop);
36
37LIBICAL_ICAL_EXPORT icalproperty_kind icalproperty_isa(const icalproperty *property);
38
39LIBICAL_ICAL_EXPORT bool icalproperty_isa_property(void *property);
40
41LIBICAL_ICAL_EXPORT void icalproperty_add_parameters(struct icalproperty_impl *prop, va_list args);
42
43LIBICAL_ICAL_EXPORT void icalproperty_add_parameter(icalproperty *prop, icalparameter *parameter);
44
45LIBICAL_ICAL_EXPORT void icalproperty_set_parameter(icalproperty *prop, icalparameter *parameter);
46
47LIBICAL_ICAL_EXPORT void icalproperty_set_parameter_from_string(icalproperty *prop,
48 const char *name,
49 const char *value);
50LIBICAL_ICAL_EXPORT const char *icalproperty_get_parameter_as_string(icalproperty *prop,
51 const char *name);
52
53LIBICAL_ICAL_EXPORT char *icalproperty_get_parameter_as_string_r(icalproperty *prop,
54 const char *name);
55
65LIBICAL_ICAL_EXPORT void icalproperty_remove_parameter_by_kind(icalproperty *prop,
66 icalparameter_kind kind);
67
81LIBICAL_ICAL_EXPORT void icalproperty_remove_parameter_by_name(icalproperty *prop,
82 const char *name);
83
92LIBICAL_ICAL_EXPORT void icalproperty_remove_parameter_by_ref(icalproperty *prop,
93 icalparameter *param);
94
95LIBICAL_ICAL_EXPORT int icalproperty_count_parameters(const icalproperty *prop);
96
97/* Iterate through the parameters */
98LIBICAL_ICAL_EXPORT icalparameter *icalproperty_get_first_parameter(icalproperty *prop,
99 icalparameter_kind kind);
100LIBICAL_ICAL_EXPORT icalparameter *icalproperty_get_next_parameter(icalproperty *prop,
101 icalparameter_kind kind);
102/* Access the value of the property */
103LIBICAL_ICAL_EXPORT void icalproperty_set_value(icalproperty *prop, icalvalue *value);
104LIBICAL_ICAL_EXPORT void icalproperty_set_value_from_string(icalproperty *prop, const char *str,
105 const char *type);
106
107LIBICAL_ICAL_EXPORT icalvalue *icalproperty_get_value(const icalproperty *prop);
108LIBICAL_ICAL_EXPORT const char *icalproperty_get_value_as_string(const icalproperty *prop);
109LIBICAL_ICAL_EXPORT char *icalproperty_get_value_as_string_r(const icalproperty *prop);
110
114LIBICAL_ICAL_EXPORT void icalvalue_set_parent(icalvalue *value, icalproperty *property);
115
120LIBICAL_ICAL_EXPORT icalproperty *icalvalue_get_parent(const icalvalue *value);
121
122/* Deal with X properties */
123
124LIBICAL_ICAL_EXPORT void icalproperty_set_x_name(icalproperty *prop, const char *name);
125LIBICAL_ICAL_EXPORT const char *icalproperty_get_x_name(const icalproperty *prop);
126
127/* Deal with IANA properties */
128
136LIBICAL_ICAL_EXPORT void icalproperty_set_iana_name(icalproperty *prop, const char *name);
137
147LIBICAL_ICAL_EXPORT const char *icalproperty_get_iana_name(const icalproperty *prop);
148
153LIBICAL_ICAL_EXPORT const char *icalproperty_get_property_name(const icalproperty *prop);
154LIBICAL_ICAL_EXPORT char *icalproperty_get_property_name_r(const icalproperty *prop);
155
156LIBICAL_ICAL_EXPORT icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value);
157
162LIBICAL_ICAL_EXPORT void icalparameter_set_parent(icalparameter *param, icalproperty *property);
163
168LIBICAL_ICAL_EXPORT icalproperty *icalparameter_get_parent(const icalparameter *param);
169
170/* Convert kinds to string and get default value type */
171LIBICAL_ICAL_EXPORT icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind);
172LIBICAL_ICAL_EXPORT icalproperty_kind icalproperty_value_kind_to_kind(icalvalue_kind kind);
173LIBICAL_ICAL_EXPORT const char *icalproperty_kind_to_string(icalproperty_kind kind);
174LIBICAL_ICAL_EXPORT icalproperty_kind icalproperty_string_to_kind(const char *string);
175
177LIBICAL_ICAL_EXPORT bool icalproperty_kind_is_valid(const icalproperty_kind kind);
178
179LIBICAL_ICAL_EXPORT icalproperty_method icalproperty_string_to_method(const char *str);
180LIBICAL_ICAL_EXPORT const char *icalproperty_method_to_string(icalproperty_method method);
181
182LIBICAL_ICAL_EXPORT const char *icalproperty_enum_to_string(int e);
183LIBICAL_ICAL_EXPORT char *icalproperty_enum_to_string_r(int e);
184LIBICAL_ICAL_EXPORT int icalproperty_kind_and_string_to_enum(const int kind, const char *str);
185
186LIBICAL_ICAL_EXPORT const char *icalproperty_status_to_string(icalproperty_status);
187LIBICAL_ICAL_EXPORT icalproperty_status icalproperty_string_to_status(const char *string);
188
189LIBICAL_ICAL_EXPORT const char *icalproperty_action_to_string(icalproperty_action);
190LIBICAL_ICAL_EXPORT icalproperty_action icalproperty_string_to_action(const char *string);
191
192LIBICAL_ICAL_EXPORT const char *icalproperty_transp_to_string(icalproperty_transp);
193LIBICAL_ICAL_EXPORT icalproperty_transp icalproperty_string_to_transp(const char *string);
194
195LIBICAL_ICAL_EXPORT const char *icalproperty_class_to_string(icalproperty_class);
196LIBICAL_ICAL_EXPORT icalproperty_class icalproperty_string_to_class(const char *string);
197
198LIBICAL_ICAL_EXPORT const char *icalproperty_participanttype_to_string(icalproperty_participanttype);
199LIBICAL_ICAL_EXPORT icalproperty_participanttype icalproperty_string_to_participanttype(const char *string);
200
201LIBICAL_ICAL_EXPORT const char *icalproperty_resourcetype_to_string(icalproperty_resourcetype);
202LIBICAL_ICAL_EXPORT icalproperty_resourcetype icalproperty_string_to_resourcetype(const char *string);
203
204LIBICAL_ICAL_EXPORT bool icalproperty_enum_belongs_to_property(icalproperty_kind kind, int e);
205
210LIBICAL_ICAL_EXPORT void icalproperty_normalize(icalproperty *prop);
211
226LIBICAL_ICAL_EXPORT void icalproperty_set_allow_empty_properties(bool enable);
227
235LIBICAL_ICAL_EXPORT bool icalproperty_get_allow_empty_properties(void);
236
237/* This is exposed so that callers will not have to allocate and
238 deallocate iterators. Pretend that you can't see it. */
239typedef struct icalparamiter {
240 icalparameter_kind kind;
241 icalpvl_elem iter;
243
244LIBICAL_ICAL_EXPORT icalparamiter icalproperty_begin_parameter(icalproperty *property, icalparameter_kind kind);
245
246LIBICAL_ICAL_EXPORT icalparameter *icalparamiter_next(icalparamiter *i);
247
248LIBICAL_ICAL_EXPORT icalparameter *icalparamiter_deref(icalparamiter *i);
249
250#endif /*ICALPROPERTY_H */
icalproperty * icalvalue_get_parent(const icalvalue *value)
Definition icalvalue.c:1539
icalproperty * icalparameter_get_parent(const icalparameter *param)
Definition icalparameter.c:363
void icalproperty_remove_parameter_by_ref(icalproperty *prop, icalparameter *param)
Removes the specified parameter reference from the property.
Definition icalproperty.c:673
void icalproperty_set_allow_empty_properties(bool enable)
Definition icalproperty.c:59
void icalproperty_remove_parameter_by_name(icalproperty *prop, const char *name)
Removes all parameters with the specified name.
Definition icalproperty.c:642
void icalproperty_remove_parameter_by_kind(icalproperty *prop, icalparameter_kind kind)
Removes all parameters with the specified kind.
Definition icalproperty.c:624
const char * icalproperty_get_property_name(const icalproperty *prop)
Definition icalproperty.c:883
bool icalproperty_get_allow_empty_properties(void)
Definition icalproperty.c:64
void icalproperty_normalize(icalproperty *prop)
Definition icalproperty.c:945
void icalvalue_set_parent(icalvalue *value, icalproperty *property)
Definition icalvalue.c:1532
icalproperty * icalproperty_clone(const icalproperty *old)
Deeply clones an icalproperty.
Definition icalproperty.c:92
const char * icalproperty_get_iana_name(const icalproperty *prop)
Definition icalproperty.c:875
void icalproperty_set_iana_name(icalproperty *prop, const char *name)
Definition icalproperty.c:861
void icalparameter_set_parent(icalparameter *param, icalproperty *property)
Definition icalparameter.c:356
bool icalproperty_kind_is_valid(const icalproperty_kind kind)
Definition icalproperty.h:239