9#ifndef VCARDCOMPONENT_H
10#define VCARDCOMPONENT_H
12#include "libical_sentinel.h"
13#include "libical_vcard_export.h"
18typedef enum vcardcomponent_kind
22 VCARD_XROOT_COMPONENT,
23 VCARD_VCARD_COMPONENT,
25 VCARD_NUM_COMPONENT_TYPES
28typedef struct vcardcomponent_impl vcardcomponent;
32LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_new(vcardcomponent_kind kind);
39LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_clone(
const vcardcomponent *old);
43LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_new_from_string(
const char *str);
47LIBICAL_VCARD_EXPORT LIBICAL_SENTINEL vcardcomponent *vcardcomponent_vanew(vcardcomponent_kind kind, ...);
51LIBICAL_VCARD_EXPORT
void vcardcomponent_free(vcardcomponent *comp);
53LIBICAL_VCARD_EXPORT
char *vcardcomponent_as_vcard_string(vcardcomponent *comp);
55LIBICAL_VCARD_EXPORT
char *vcardcomponent_as_vcard_string_r(vcardcomponent *comp);
57LIBICAL_VCARD_EXPORT
bool vcardcomponent_is_valid(
const vcardcomponent *comp);
59LIBICAL_VCARD_EXPORT vcardcomponent_kind vcardcomponent_isa(
const vcardcomponent *comp);
61LIBICAL_VCARD_EXPORT
bool vcardcomponent_isa_component(
const void *comp);
65LIBICAL_VCARD_EXPORT
void vcardcomponent_add_property(vcardcomponent *comp,
66 vcardproperty *property);
68LIBICAL_VCARD_EXPORT
void vcardcomponent_remove_property(vcardcomponent *comp,
69 vcardproperty *property);
71LIBICAL_VCARD_EXPORT
int vcardcomponent_count_properties(vcardcomponent *comp,
72 vcardproperty_kind kind,
77LIBICAL_VCARD_EXPORT
void vcardcomponent_add_component(vcardcomponent *parent, vcardcomponent *child);
79LIBICAL_VCARD_EXPORT
void vcardcomponent_remove_component(vcardcomponent *parent,
80 vcardcomponent *child);
82LIBICAL_VCARD_EXPORT
int vcardcomponent_count_components(vcardcomponent *comp,
83 vcardcomponent_kind kind);
87LIBICAL_VCARD_EXPORT
bool vcardcomponent_kind_is_valid(
const vcardcomponent_kind kind);
89LIBICAL_VCARD_EXPORT vcardcomponent_kind vcardcomponent_string_to_kind(
const char *
string);
91LIBICAL_VCARD_EXPORT
const char *vcardcomponent_kind_to_string(vcardcomponent_kind kind);
99LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_get_current_component(vcardcomponent *comp);
101LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_get_first_component(vcardcomponent *comp,
102 vcardcomponent_kind kind);
103LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_get_next_component(vcardcomponent *comp,
104 vcardcomponent_kind kind);
110LIBICAL_VCARD_EXPORT
void vcardproperty_set_parent(vcardproperty *property,
111 vcardcomponent *comp);
116LIBICAL_VCARD_EXPORT vcardcomponent *vcardproperty_get_parent(
const vcardproperty *property);
119LIBICAL_VCARD_EXPORT vcardproperty *vcardcomponent_get_current_property(vcardcomponent *comp);
121LIBICAL_VCARD_EXPORT vcardproperty *vcardcomponent_get_first_property(vcardcomponent *comp,
122 vcardproperty_kind kind);
123LIBICAL_VCARD_EXPORT vcardproperty *vcardcomponent_get_next_property(vcardcomponent *comp,
124 vcardproperty_kind kind);
130LIBICAL_VCARD_EXPORT
int vcardcomponent_check_restrictions(vcardcomponent *comp);
137LIBICAL_VCARD_EXPORT
int vcardcomponent_count_errors(vcardcomponent *comp);
140LIBICAL_VCARD_EXPORT
void vcardcomponent_strip_errors(vcardcomponent *comp);
146LIBICAL_VCARD_EXPORT
void vcardcomponent_normalize(vcardcomponent *comp);
148LIBICAL_VCARD_EXPORT
void vcardcomponent_transform(vcardcomponent *impl,
149 vcardproperty_version version);
153LIBICAL_VCARD_EXPORT
enum vcardproperty_version vcardcomponent_get_version(vcardcomponent *comp);
154LIBICAL_VCARD_EXPORT
const char *vcardcomponent_get_uid(vcardcomponent *comp);
155LIBICAL_VCARD_EXPORT
const char *vcardcomponent_get_fn(vcardcomponent *comp);