summaryrefslogtreecommitdiff
path: root/src/vcard.h
diff options
context:
space:
mode:
authorSimeon Simeonov2018-02-26 11:23:00 +0100
committerSimeon Simeonov2018-02-26 11:23:00 +0100
commit0b3cbf57875fd692e4ba0b336fefa4bee1ed00dc (patch)
treeaf916a30553c78ce9d4f2d8658656a175c5b6921 /src/vcard.h
Initial commit for sylpheed 3.7.0
Diffstat (limited to 'src/vcard.h')
-rw-r--r--src/vcard.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/src/vcard.h b/src/vcard.h
new file mode 100644
index 0000000..889949f
--- /dev/null
+++ b/src/vcard.h
@@ -0,0 +1,105 @@
1/*
2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2001 Match Grun
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20/*
21 * Definitions necessary to access vCard files. vCard files are used
22 * by GnomeCard for addressbook, and Netscape for sending business
23 * card information. Refer to RFC2426 for more information.
24 */
25
26#ifndef __VCARD_H__
27#define __VCARD_H__
28
29#include <stdio.h>
30#include <glib.h>
31
32#include "addritem.h"
33#include "addrcache.h"
34
35#define VCARDBUFSIZE 1024
36
37#define VCARD_TAG_START "begin"
38#define VCARD_TAG_END "end"
39#define VCARD_NAME "vcard"
40
41#define VCARD_TAG_FULLNAME "fn"
42#define VCARD_TAG_NAME "n"
43#define VCARD_TAG_EMAIL "email"
44#define VCARD_TAG_UID "uid"
45
46#define VCARD_TYPE_QP "quoted-printable"
47
48#define VCARD_SEP_TAG ':'
49#define VCARD_SEP_TYPE ';'
50
51/*
52// Typical vCard entry:
53//
54// BEGIN:VCARD
55// FN:Axle Rose
56// N:Rose;Axle;D;Ms;Jnr
57// REV:2001-04-22T03:52:05
58// ADR;HOME:;;777 Lexington Avenue;Denver;CO;80299;USA
59// ADR;POSTAL:P O Box 777;;;Denver;CO;80298;Usa
60// TEL;HOME:303-555-1234
61// EMAIL;AOL:axlerose@aol.com
62// EMAIL;INTERNET:axlerose@netscape.net
63// TITLE:Janitor
64// ORG:The Company
65// URL:http://www.axlerose.com
66// END:VCARD
67*/
68
69/* vCard object */
70typedef struct _VCardFile VCardFile;
71struct _VCardFile {
72 gchar *name;
73 FILE *file;
74 gchar *path;
75 gchar buffer[ VCARDBUFSIZE ];
76 gchar *bufptr;
77 AddressCache *addressCache;
78 gint retVal;
79 gboolean accessFlag;
80};
81
82/* Function prototypes */
83VCardFile *vcard_create ( void );
84VCardFile *vcard_create_path ( const gchar *path );
85void vcard_set_name ( VCardFile* cardFile, const gchar *value );
86void vcard_set_file ( VCardFile* cardFile, const gchar *value );
87void vcard_set_modified ( VCardFile *vcardFile, const gboolean value );
88void vcard_set_accessed ( VCardFile *vcardFile, const gboolean value );
89gboolean vcard_get_modified ( VCardFile *vcardFile );
90gboolean vcard_get_accessed ( VCardFile *vcardFile );
91gboolean vcard_get_read_flag ( VCardFile *vcardFile );
92gint vcard_get_status ( VCardFile *cardFile );
93ItemFolder *vcard_get_root_folder ( VCardFile *cardFile );
94gchar *vcard_get_name ( VCardFile *cardFile );
95void vcard_free ( VCardFile *cardFile );
96void vcard_force_refresh ( VCardFile *cardFile );
97gint vcard_read_data ( VCardFile *cardFile );
98GList *vcard_get_list_person ( VCardFile *cardFile );
99GList *vcard_get_list_folder ( VCardFile *cardFile );
100GList *vcard_get_all_persons ( VCardFile *cardFile );
101gboolean vcard_validate ( const VCardFile *cardFile );
102gchar *vcard_find_gnomecard ( void );
103gint vcard_test_read_file ( const gchar *fileSpec );
104
105#endif /* __VCARD_H__ */