update dev300-m58
[ooovba.git] / connectivity / source / drivers / evoab2 / EApi.h
blob9ed2a4259886f506a6abaf547b32afc97462d7d6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: EApi.h,v $
10 * $Revision: 1.5 $
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
36 bool EApiInit();
38 G_BEGIN_DECLS
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
44 // clarity.
46 // We attempt to define a minimum API that we use:
48 // e-contact.h
49 #ifdef DECLARE_FN_POINTERS
50 #define EAPI_EXTERN
51 #else
52 #define EAPI_EXTERN extern
53 #endif
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);
64 // e-source.h
65 typedef void ESource;
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);
74 // e-source-list.h
75 typedef void ESourceList;
76 EAPI_EXTERN GSList *(*e_source_list_peek_groups) (ESourceList *list);
78 // e-source-group.h
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);
84 // e-book.h
85 typedef enum {
86 E_BOOK_QUERY_IS,
87 E_BOOK_QUERY_CONTAINS,
88 E_BOOK_QUERY_BEGINS_WITH,
89 E_BOOK_QUERY_ENDS_WITH,
90 } EBookQueryTest;
92 typedef void EBook;
93 typedef void EBookQuery;
95 EAPI_EXTERN EBook *(*e_book_new) (ESource *source,
96 GError **error);
98 EAPI_EXTERN gboolean (*e_book_open) (EBook *book,
99 gboolean only_if_exists,
100 GError **error);
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,
106 GError **error);
108 EAPI_EXTERN gboolean (*e_book_get_contacts) (EBook *book,
109 EBookQuery *query,
110 GList **contacts,
111 GError **error);
113 EAPI_EXTERN gboolean (*e_book_authenticate_user) (EBook *book,
114 const char *user,
115 const char *passwd,
116 const char *auth_method,
117 GError **error);
119 // e-book-query.h
120 EAPI_EXTERN EBookQuery* (*e_book_query_field_exists) (EContactField field);
121 EAPI_EXTERN EBookQuery* (*e_book_query_field_test) (EContactField field,
122 EBookQueryTest test,
123 const char *value);
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);
132 typedef struct {
133 char *address_format; /* the two letter country code that
134 determines the format/meaning of the
135 following fields */
136 char *po;
137 char *ext;
138 char *street;
139 char *locality;
140 char *region;
141 char *code;
142 char *country;
143 } EContactAddress;
144 G_END_DECLS
145 #endif