]> git.datanom.net - vcard-parser.git/blob - src/parser/vcard.h
All features added
[vcard-parser.git] / src / parser / vcard.h
1 /*
2 * vcard.h
3 *
4 * Copyright 2019 Michael Rasmussen <mir@datanom.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22 #ifndef __VCARD_H__
23 #define __VCARD_H__
24
25 #include <glib.h>
26
27 G_BEGIN_DECLS
28
29 #include <stdio.h>
30 #include <globals.h>
31
32 #define DEFAULT_VCARD_VERSION VCARD_VERSION_3_0
33
34 VCard* VCard_version_new(VCardVersion version, gboolean init);
35 VCard* VCard_new();
36 GSList* VCard_new_from_text(const gchar* text, VCardVersion version, gboolean skip_broken);
37 GSList* VCard_new_from_file(FILE* file, VCardVersion version, gboolean skip_broken);
38 void VCard_free(VCard* object);
39
40 void VCard_print_list(GSList* list);
41 void VCard_print_list_fd(GSList* list, int fd);
42 void VCard_print(VCard* object);
43 void VCard_print_fd(VCard* object, int fd);
44 gchar* VCard_get_state(VCard* object);
45 GSList* VCard_get_property(VCard* object, const gchar* property);
46 void VCard_set_property(VCard* object, const gchar* property, GSList* props);
47 void vcard_property_free(gpointer data);
48 void vcard_slist_property_free(gpointer data);
49
50 void VCard_set_name(VCard* vcard, const gchar* firstname, const gchar* lastname);
51 void VCard_set_company(VCard* vcard, const gchar* company);
52 void VCard_set_telefon(VCard* vcard, TelefonType type, const gchar* number);
53 void VCard_set_address(VCard* vcard, AddressType type, const gchar* address, const gchar* state, const gchar* city, const gchar* zip, const gchar* country);
54 void VCard_set_photo_uri(VCard* vcard, PhotoType type, const gchar* uri);
55 void VCard_set_photo_image(VCard* vcard, PhotoType type, const gchar* image);
56 void VCard_set_email(VCard* vcard, EmailType type, const gchar* email);
57 void VCard_set_etag(VCard* vcard, const gchar* etag);
58
59 gchar* VCard_get_name(VCard* vcard);
60 gchar* VCard_get_company(VCard* vcard);
61 GSList* VCard_get_telefon(VCard* vcard, TelefonType type);
62 GSList* VCard_get_address(VCard* vcard, AddressType type);
63 gchar* VCard_get_photo(VCard* vcard);
64 GSList* VCard_get_email(VCard* vcard, EmailType type);
65 gchar* VCard_get_as_string(VCard* object);
66 gchar* VCard_get_etag(VCard* vcard);
67
68 void print_slist(GSList* list);
69
70 G_END_DECLS
71
72 #endif
This page took 0.563497 seconds and 6 git commands to generate.