Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
vcardproperty.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: vcardproperty.h
3 CREATOR: Ken Murchison 24 Aug 2022
4
5 SPDX-FileCopyrightText: 2022, Fastmail Pty. Ltd. (https://fastmail.com)
6 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7 ======================================================================*/
8
9#ifndef VCARDPROPERTY_H
10#define VCARDPROPERTY_H
11
12#include "libical_vcard_export.h"
13#include "vcardderivedproperty.h" /* To get vcardproperty_kind enumerations */
14
15#include <stdarg.h> /* for va_... */
16
18
19LIBICAL_VCARD_EXPORT vcardproperty *vcardproperty_new(vcardproperty_kind kind);
20
26LIBICAL_VCARD_EXPORT vcardproperty *vcardproperty_clone(const vcardproperty *old);
27
28LIBICAL_VCARD_EXPORT vcardproperty *vcardproperty_new_from_string(const char *str);
29
30LIBICAL_VCARD_EXPORT const char *vcardproperty_as_vcard_string(vcardproperty *prop);
31
32LIBICAL_VCARD_EXPORT char *vcardproperty_as_vcard_string_r(vcardproperty *prop);
33
34LIBICAL_VCARD_EXPORT void vcardproperty_free(vcardproperty *prop);
35
36LIBICAL_VCARD_EXPORT vcardproperty_kind vcardproperty_isa(const vcardproperty *property);
37
38LIBICAL_VCARD_EXPORT bool vcardproperty_isa_property(void *property);
39
40LIBICAL_VCARD_EXPORT void vcardproperty_add_parameters(struct vcardproperty_impl *prop, va_list args);
41
42LIBICAL_VCARD_EXPORT void vcardproperty_add_parameter(vcardproperty *prop, vcardparameter *parameter);
43
44LIBICAL_VCARD_EXPORT void vcardproperty_set_parameter(vcardproperty *prop, vcardparameter *parameter);
45
46LIBICAL_VCARD_EXPORT void vcardproperty_set_parameter_from_string(vcardproperty *prop,
47 const char *name,
48 const char *value);
49LIBICAL_VCARD_EXPORT const char *vcardproperty_get_parameter_as_string(vcardproperty *prop,
50 const char *name);
51
52LIBICAL_VCARD_EXPORT char *vcardproperty_get_parameter_as_string_r(vcardproperty *prop,
53 const char *name);
54
64LIBICAL_VCARD_EXPORT void vcardproperty_remove_parameter_by_kind(vcardproperty *prop,
65 vcardparameter_kind kind);
66
80LIBICAL_VCARD_EXPORT void vcardproperty_remove_parameter_by_name(vcardproperty *prop,
81 const char *name);
82
91LIBICAL_VCARD_EXPORT void vcardproperty_remove_parameter_by_ref(vcardproperty *prop,
92 vcardparameter *param);
93
94LIBICAL_VCARD_EXPORT int vcardproperty_count_parameters(const vcardproperty *prop);
95
96/* Iterate through the parameters */
97LIBICAL_VCARD_EXPORT vcardparameter *vcardproperty_get_first_parameter(vcardproperty *prop,
98 vcardparameter_kind kind);
99LIBICAL_VCARD_EXPORT vcardparameter *vcardproperty_get_next_parameter(vcardproperty *prop,
100 vcardparameter_kind kind);
101/* Access the value of the property */
102LIBICAL_VCARD_EXPORT void vcardproperty_set_value(vcardproperty *prop, vcardvalue *value);
103LIBICAL_VCARD_EXPORT void vcardproperty_set_value_from_string(vcardproperty *prop, const char *str,
104 const char *type);
105
106LIBICAL_VCARD_EXPORT vcardvalue *vcardproperty_get_value(const vcardproperty *prop);
107LIBICAL_VCARD_EXPORT const char *vcardproperty_get_value_as_string(const vcardproperty *prop);
108LIBICAL_VCARD_EXPORT char *vcardproperty_get_value_as_string_r(const vcardproperty *prop);
109
113LIBICAL_VCARD_EXPORT void vcardvalue_set_parent(vcardvalue *value, vcardproperty *property);
114
119LIBICAL_VCARD_EXPORT vcardproperty *vcardvalue_get_parent(const vcardvalue *value);
120
121/* Deal with X properties */
122
123LIBICAL_VCARD_EXPORT void vcardproperty_set_x_name(vcardproperty *prop, const char *name);
124LIBICAL_VCARD_EXPORT const char *vcardproperty_get_x_name(const vcardproperty *prop);
125
126/* Deal with grouped properties */
127
128LIBICAL_VCARD_EXPORT void vcardproperty_set_group(vcardproperty *prop, const char *group);
129LIBICAL_VCARD_EXPORT const char *vcardproperty_get_group(const vcardproperty *prop);
130
135LIBICAL_VCARD_EXPORT const char *vcardproperty_get_property_name(const vcardproperty *prop);
136LIBICAL_VCARD_EXPORT char *vcardproperty_get_property_name_r(const vcardproperty *prop);
137
138LIBICAL_VCARD_EXPORT vcardvalue_kind vcardparameter_value_to_value_kind(vcardparameter_value value);
139
144LIBICAL_VCARD_EXPORT void vcardparameter_set_parent(vcardparameter *param, vcardproperty *property);
145
150LIBICAL_VCARD_EXPORT vcardproperty *vcardparameter_get_parent(const vcardparameter *param);
151
152/* Convert kinds to string and get default value type */
153LIBICAL_VCARD_EXPORT vcardvalue_kind vcardproperty_kind_to_value_kind(vcardproperty_kind kind);
154LIBICAL_VCARD_EXPORT vcardproperty_kind vcardproperty_value_kind_to_kind(vcardvalue_kind kind);
155LIBICAL_VCARD_EXPORT const char *vcardproperty_kind_to_string(vcardproperty_kind kind);
156LIBICAL_VCARD_EXPORT vcardproperty_kind vcardproperty_string_to_kind(const char *string);
157
159LIBICAL_VCARD_EXPORT bool vcardproperty_kind_is_valid(const vcardproperty_kind kind);
160
161LIBICAL_VCARD_EXPORT const char *vcardproperty_enum_to_string(int e);
162LIBICAL_VCARD_EXPORT char *vcardproperty_enum_to_string_r(int e);
163LIBICAL_VCARD_EXPORT int vcardproperty_kind_and_string_to_enum(const int kind, const char *str);
164
165LIBICAL_VCARD_EXPORT bool vcardproperty_enum_belongs_to_property(vcardproperty_kind kind, int e);
166
171LIBICAL_VCARD_EXPORT void vcardproperty_normalize(vcardproperty *prop);
172
173LIBICAL_VCARD_EXPORT bool vcardproperty_is_structured(vcardproperty_kind pkind);
174LIBICAL_VCARD_EXPORT bool vcardproperty_is_multivalued(vcardproperty_kind pkind);
175
176LIBICAL_VCARD_EXPORT void vcardproperty_add_type_parameter(vcardproperty *prop,
177 vcardenumarray_element *type);
178
179#endif /*VCARDPROPERTY_H */
void vcardproperty_remove_parameter_by_ref(vcardproperty *prop, vcardparameter *param)
Removes the specified parameter reference from the property.
Definition vcardproperty.c:736
const char * vcardproperty_get_property_name(const vcardproperty *prop)
Definition vcardproperty.c:951
vcardproperty * vcardvalue_get_parent(const vcardvalue *value)
Definition vcardvalue.c:1023
bool vcardproperty_kind_is_valid(const vcardproperty_kind kind)
void vcardproperty_normalize(vcardproperty *prop)
Definition vcardproperty.c:1012
void vcardproperty_remove_parameter_by_name(vcardproperty *prop, const char *name)
Removes all parameters with the specified name.
Definition vcardproperty.c:706
void vcardparameter_set_parent(vcardparameter *param, vcardproperty *property)
Definition vcardparameter.c:378
void vcardvalue_set_parent(vcardvalue *value, vcardproperty *property)
Definition vcardvalue.c:1016
vcardproperty * vcardparameter_get_parent(const vcardparameter *param)
Definition vcardparameter.c:385
vcardproperty * vcardproperty_clone(const vcardproperty *old)
Deeply clones an vcardproperty.
Definition vcardproperty.c:82
void vcardproperty_remove_parameter_by_kind(vcardproperty *prop, vcardparameter_kind kind)
Removes all parameters with the specified kind.
Definition vcardproperty.c:689