1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _CONNECTIVITY_EVOAB_EVOLUTION_API_HXX_
32 #define _CONNECTIVITY_EVOAB_EVOLUTION_API_HXX_
33 #include <glib-object.h>
35 // Initializes the API below, returns false if not available
40 // This header defined all the API methods as
41 // function pointers instead of real functions
42 // this will all evaporate as it is compiled generating
43 // no symbol lookups or relocations, but giving code
46 // We attempt to define a minimum API that we use:
49 #ifdef DECLARE_FN_POINTERS
52 #define EAPI_EXTERN extern
56 typedef void EContact
;
57 #define E_CONTACT(a) ((EContact *)(a))
58 #define E_TYPE_CONTACT (e_contact_get_type())
59 typedef int EContactField
;
61 EAPI_EXTERN
const char *(*e_contact_field_name
) ( EContactField field_id
);
62 EAPI_EXTERN
gpointer (*e_contact_get
) (EContact
*contact
, EContactField field_id
);
63 EAPI_EXTERN
gconstpointer (*e_contact_get_const
) (EContact
*contact
, EContactField field_id
);
66 #define E_SOURCE(a) ((ESource *)(a))
67 EAPI_EXTERN
const char *(*e_source_peek_name
) (ESource
*source
);
68 EAPI_EXTERN
const gchar
*(*e_source_get_property
) (ESource
*source
,
69 const gchar
*property
);
71 EAPI_EXTERN
GType (*e_contact_get_type
) (void);
72 EAPI_EXTERN
EContactField (*e_contact_field_id
) (const char *field_name
);
75 typedef void ESourceList
;
76 EAPI_EXTERN GSList
*(*e_source_list_peek_groups
) (ESourceList
*list
);
79 typedef void ESourceGroup
;
80 #define E_SOURCE_GROUP(a) ((ESourceGroup *)(a))
82 EAPI_EXTERN GSList
*(*e_source_group_peek_sources
) (ESourceGroup
*group
);
83 EAPI_EXTERN
const char *(*e_source_group_peek_base_uri
) (ESourceGroup
*group
);
87 E_BOOK_QUERY_CONTAINS
,
88 E_BOOK_QUERY_BEGINS_WITH
,
89 E_BOOK_QUERY_ENDS_WITH
,
93 typedef void EBookQuery
;
95 EAPI_EXTERN EBook
*(*e_book_new
) (ESource
*source
,
98 EAPI_EXTERN
gboolean (*e_book_open
) (EBook
*book
,
99 gboolean only_if_exists
,
102 EAPI_EXTERN
const char *(*e_book_get_uri
) (EBook
*book
);
103 EAPI_EXTERN ESource
*(*e_book_get_source
)(EBook
*book
);
105 EAPI_EXTERN
gboolean (*e_book_get_addressbooks
) (ESourceList
**addressbook_sources
,
108 EAPI_EXTERN
gboolean (*e_book_get_contacts
) (EBook
*book
,
113 EAPI_EXTERN
gboolean (*e_book_authenticate_user
) (EBook
*book
,
116 const char *auth_method
,
120 EAPI_EXTERN EBookQuery
* (*e_book_query_field_exists
) (EContactField field
);
121 EAPI_EXTERN EBookQuery
* (*e_book_query_field_test
) (EContactField field
,
124 EAPI_EXTERN EBookQuery
* (*e_book_query_and
) (int nqs
, EBookQuery
**qs
, gboolean unref
);
125 EAPI_EXTERN EBookQuery
* (*e_book_query_or
) (int nqs
, EBookQuery
**qs
, gboolean unref
);
126 EAPI_EXTERN EBookQuery
* (*e_book_query_not
) (EBookQuery
*q
, gboolean unref
);
127 EAPI_EXTERN EBookQuery
* (*e_book_query_ref
) (EBookQuery
*q
);
128 EAPI_EXTERN
void (*e_book_query_unref
) (EBookQuery
*q
);
129 EAPI_EXTERN
char* (*e_book_query_to_string
) (EBookQuery
*q
);
130 EAPI_EXTERN EBookQuery
* (*e_book_query_from_string
) (const char *query_string
);
133 char *address_format
; /* the two letter country code that
134 determines the format/meaning of the