14 #ifndef VCARDCOMPONENT_H
15 #define VCARDCOMPONENT_H
17 #include "libical_sentinel.h"
18 #include "libical_vcard_export.h"
23 typedef enum vcardcomponent_kind
27 VCARD_XROOT_COMPONENT,
28 VCARD_VCARD_COMPONENT,
29 VCARD_NUM_COMPONENT_TYPES
30 } vcardcomponent_kind;
32 typedef struct vcardcomponent_impl vcardcomponent;
51 LIBICAL_VCARD_EXPORT LIBICAL_SENTINEL vcardcomponent *
vcardcomponent_vanew(vcardcomponent_kind kind, ...);
55 LIBICAL_VCARD_EXPORT
void vcardcomponent_free(vcardcomponent *comp);
57 LIBICAL_VCARD_EXPORT
char *vcardcomponent_as_vcard_string(vcardcomponent *comp);
59 LIBICAL_VCARD_EXPORT
char *vcardcomponent_as_vcard_string_r(vcardcomponent *comp);
61 LIBICAL_VCARD_EXPORT
bool vcardcomponent_is_valid(
const vcardcomponent *comp);
63 LIBICAL_VCARD_EXPORT vcardcomponent_kind vcardcomponent_isa(
const vcardcomponent *comp);
65 LIBICAL_VCARD_EXPORT
bool vcardcomponent_isa_component(
const void *comp);
69 LIBICAL_VCARD_EXPORT
void vcardcomponent_add_property(vcardcomponent *comp,
70 vcardproperty *property);
72 LIBICAL_VCARD_EXPORT
void vcardcomponent_remove_property(vcardcomponent *comp,
73 vcardproperty *property);
75 LIBICAL_VCARD_EXPORT
int vcardcomponent_count_properties(vcardcomponent *comp,
76 vcardproperty_kind kind,
81 LIBICAL_VCARD_EXPORT
void vcardcomponent_add_component(vcardcomponent *parent, vcardcomponent *child);
83 LIBICAL_VCARD_EXPORT
void vcardcomponent_remove_component(vcardcomponent *parent,
84 vcardcomponent *child);
86 LIBICAL_VCARD_EXPORT
int vcardcomponent_count_components(vcardcomponent *comp,
87 vcardcomponent_kind kind);
91 LIBICAL_VCARD_EXPORT
bool vcardcomponent_kind_is_valid(
const vcardcomponent_kind kind);
93 LIBICAL_VCARD_EXPORT vcardcomponent_kind vcardcomponent_string_to_kind(
const char *
string);
95 LIBICAL_VCARD_EXPORT
const char *vcardcomponent_kind_to_string(vcardcomponent_kind kind);
103 LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_get_current_component(vcardcomponent *comp);
105 LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_get_first_component(vcardcomponent *comp,
106 vcardcomponent_kind kind);
107 LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_get_next_component(vcardcomponent *comp,
108 vcardcomponent_kind kind);
115 vcardcomponent *comp);
123 LIBICAL_VCARD_EXPORT vcardproperty *vcardcomponent_get_current_property(vcardcomponent *comp);
125 LIBICAL_VCARD_EXPORT vcardproperty *vcardcomponent_get_first_property(vcardcomponent *comp,
126 vcardproperty_kind kind);
127 LIBICAL_VCARD_EXPORT vcardproperty *vcardcomponent_get_next_property(vcardcomponent *comp,
128 vcardproperty_kind kind);
134 LIBICAL_VCARD_EXPORT
int vcardcomponent_check_restrictions(vcardcomponent *comp);
152 LIBICAL_VCARD_EXPORT
void vcardcomponent_transform(vcardcomponent *impl,
153 vcardproperty_version version);
157 LIBICAL_VCARD_EXPORT
enum vcardproperty_version vcardcomponent_get_version(vcardcomponent *comp);
158 LIBICAL_VCARD_EXPORT
const char *vcardcomponent_get_uid(vcardcomponent *comp);
159 LIBICAL_VCARD_EXPORT
const char *vcardcomponent_get_fn(vcardcomponent *comp);
vcardcomponent * vcardcomponent_clone(const vcardcomponent *old)
Deeply clones an vcard. Returns a pointer to the memory for the newly cloned vcard.
vcardcomponent * vcardcomponent_new(vcardcomponent_kind kind)
Constructor.
void vcardcomponent_normalize(vcardcomponent *comp)
Normalizes (reorders and sorts the properties) the specified vcard comp.
void vcardcomponent_strip_errors(vcardcomponent *comp)
Removes all X-LIC-ERROR properties.
LIBICAL_SENTINEL vcardcomponent * vcardcomponent_vanew(vcardcomponent_kind kind,...)
Constructor.
Defines the data structure representing vCard properties.
int vcardcomponent_count_errors(vcardcomponent *comp)
Returns the number of errors encountered parsing the data.
void vcardproperty_set_parent(vcardproperty *property, vcardcomponent *comp)
Sets the parent vcard for the specified vcardproperty property.
vcardcomponent * vcardproperty_get_parent(const vcardproperty *property)
Returns the parent vcard for the specified property.
vcardcomponent * vcardcomponent_new_from_string(const char *str)
Constructor.