LibreOffice Module connectivity (master) 1
EApi.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21#include <glib-object.h>
22
23// Initializes the API below, returns false if not available
24bool EApiInit();
25
26G_BEGIN_DECLS
27
28// This header defined all the API methods as
29// function pointers instead of real functions
30// this will all evaporate as it is compiled generating
31// no symbol lookups or relocations, but giving code
32// clarity.
33
34// We attempt to define a minimum API that we use:
35
36// e-contact.h
37#ifdef DECLARE_FN_POINTERS
38#define EAPI_EXTERN
39#else
40#define EAPI_EXTERN extern
41#endif
42
43
44typedef void EContact;
45#define E_CONTACT(a) ((EContact *)(a))
46#define E_TYPE_CONTACT (e_contact_get_type())
47typedef int EContactField;
48
49EAPI_EXTERN const char *(*e_contact_field_name) ( EContactField field_id);
50EAPI_EXTERN gpointer (*e_contact_get) (EContact *contact, EContactField field_id);
51EAPI_EXTERN gconstpointer (*e_contact_get_const) (EContact *contact, EContactField field_id);
52// e-source.h
53typedef void ESource;
54#define E_SOURCE(a) ((ESource *)(a))
55EAPI_EXTERN const char *(*e_source_peek_name) (ESource *source);
56EAPI_EXTERN const gchar *(*e_source_get_property) (ESource *source,
57 const gchar *property);
58
60EAPI_EXTERN EContactField (*e_contact_field_id) (const char *field_name);
61
62// e-source-list.h
63typedef void ESourceList;
64EAPI_EXTERN GSList *(*e_source_list_peek_groups) (ESourceList *list);
65
66// e-source-group.h
67typedef void ESourceGroup;
68#define E_SOURCE_GROUP(a) ((ESourceGroup *)(a))
69
70EAPI_EXTERN GSList *(*e_source_group_peek_sources) (ESourceGroup *group);
71EAPI_EXTERN const char *(*e_source_group_peek_base_uri) (ESourceGroup *group);
72// e-book.h
73typedef enum {
79
80typedef void EBook;
81typedef void EBookQuery;
82
83EAPI_EXTERN EBook *(*e_book_new) (ESource *source,
84 GError **error);
85
86EAPI_EXTERN gboolean (*e_book_open) (EBook *book,
87 gboolean only_if_exists,
88 GError **error);
89
90EAPI_EXTERN const char *(*e_book_get_uri) (EBook *book);
91EAPI_EXTERN ESource *(*e_book_get_source)(EBook *book);
92
93EAPI_EXTERN gboolean (*e_book_get_addressbooks) (ESourceList **addressbook_sources,
94 GError **error);
95
98 GList **contacts,
99 GError **error);
100
102 const char *user,
103 const char *passwd,
104 const char *auth_method,
105 GError **error);
106
107// e-book-query.h
108EAPI_EXTERN EBookQuery* (*e_book_query_field_exists) (EContactField field);
109EAPI_EXTERN EBookQuery* (*e_book_query_field_test) (EContactField field,
111 const char *value);
112EAPI_EXTERN EBookQuery* (*e_book_query_and) (int nqs, EBookQuery **qs, gboolean unref);
113EAPI_EXTERN EBookQuery* (*e_book_query_or) (int nqs, EBookQuery **qs, gboolean unref);
114EAPI_EXTERN EBookQuery* (*e_book_query_not) (EBookQuery *q, gboolean unref);
115EAPI_EXTERN EBookQuery* (*e_book_query_ref) (EBookQuery *q);
117EAPI_EXTERN char* (*e_book_query_to_string) (EBookQuery *q);
118EAPI_EXTERN EBookQuery* (*e_book_query_from_string) (const char *query_string);
119
120typedef struct {
121 char *address_format; /* the two letter country code that
122 determines the format/meaning of the
123 following fields */
124 char *po;
125 char *ext;
126 char *street;
127 char *locality;
128 char *region;
129 char *code;
130 char *country;
132
133#define E_SOURCE_EXTENSION_ADDRESS_BOOK "Address Book"
134typedef void ESourceRegistry;
135typedef void GCancellable;
136typedef void ESourceBackend;
137typedef void EClient;
139EAPI_EXTERN ESourceRegistry* (*e_source_registry_new_sync) (GCancellable *cancellable, GError **error);
140EAPI_EXTERN GList* (*e_source_registry_list_sources) (ESourceRegistry *registry, const gchar *extension_name);
141EAPI_EXTERN gboolean (*e_source_has_extension) (ESource *source, const gchar *extension_name);
142EAPI_EXTERN gpointer (*e_source_get_extension) (ESource *source, const gchar *extension_name);
143EAPI_EXTERN const gchar* (*e_source_backend_get_backend_name) (ESourceBackend *extension);
144EAPI_EXTERN const gchar* (*e_source_get_display_name) (ESource *source);
145EAPI_EXTERN const gchar* (*eds_check_version) (guint required_major, guint required_minor, guint required_micro);
146EAPI_EXTERN const gchar* (*e_source_get_uid) (ESource *source);
147EAPI_EXTERN ESource* (*e_source_registry_ref_source) (ESourceRegistry *registry, const gchar *uid);
148EAPI_EXTERN EBookClient* (*e_book_client_new) (ESource *source, GError **error);
149EAPI_EXTERN EBookClient* (*e_book_client_connect_direct_sync) (ESourceRegistry *registry, ESource *source, guint32 wait_for_connected_seconds, GCancellable *cancellable, GError **error);
150EAPI_EXTERN gboolean (*e_client_open_sync) (EClient *client, gboolean only_if_exists, GCancellable *cancellable, GError **error);
151EAPI_EXTERN ESource* (*e_client_get_source) (EClient *client);
152EAPI_EXTERN gboolean (*e_book_client_get_contacts_sync) (EBookClient *client, const gchar *sexp, GSList **contacts, GCancellable *cancellable, GError **error);
154
156bool isSourceBackend(ESource *pSource, const char *backendname);
157
158G_END_DECLS
159
160/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EAPI_EXTERN void(* e_client_util_free_object_slist)(GSList *objects)
Definition: EApi.h:153
EAPI_EXTERN gboolean(* e_book_get_addressbooks)(ESourceList **addressbook_sources, GError **error)
Definition: EApi.h:93
ESourceRegistry * get_e_source_registry()
Definition: EApi.cxx:129
EAPI_EXTERN gpointer(* e_source_get_extension)(ESource *source, const gchar *extension_name)
Definition: EApi.h:142
EAPI_EXTERN EContactField(* e_contact_field_id)(const char *field_name)
Definition: EApi.h:60
EAPI_EXTERN gboolean(* e_book_open)(EBook *book, gboolean only_if_exists, GError **error)
Definition: EApi.h:86
void ESourceGroup
Definition: EApi.h:67
void ESourceRegistry
Definition: EApi.h:134
void GCancellable
Definition: EApi.h:135
EAPI_EXTERN gconstpointer(* e_contact_get_const)(EContact *contact, EContactField field_id)
Definition: EApi.h:51
EBookQueryTest
Definition: EApi.h:73
@ E_BOOK_QUERY_CONTAINS
Definition: EApi.h:75
@ E_BOOK_QUERY_BEGINS_WITH
Definition: EApi.h:76
@ E_BOOK_QUERY_ENDS_WITH
Definition: EApi.h:77
@ E_BOOK_QUERY_IS
Definition: EApi.h:74
bool EApiInit()
Definition: EApi.cxx:104
void EClient
Definition: EApi.h:137
void ESourceList
Definition: EApi.h:63
EAPI_EXTERN gpointer(* e_contact_get)(EContact *contact, EContactField field_id)
Definition: EApi.h:50
EAPI_EXTERN gboolean(* e_book_authenticate_user)(EBook *book, const char *user, const char *passwd, const char *auth_method, GError **error)
Definition: EApi.h:101
EClient EBookClient
Definition: EApi.h:138
void ESource
Definition: EApi.h:53
EAPI_EXTERN gboolean(* e_source_has_extension)(ESource *source, const gchar *extension_name)
Definition: EApi.h:141
EAPI_EXTERN void(* e_book_query_unref)(EBookQuery *q)
Definition: EApi.h:116
void EContact
Definition: EApi.h:44
bool isSourceBackend(ESource *pSource, const char *backendname)
#define EAPI_EXTERN
Definition: EApi.h:40
void EBookQuery
Definition: EApi.h:81
EAPI_EXTERN gboolean(* e_book_client_get_contacts_sync)(EBookClient *client, const gchar *sexp, GSList **contacts, GCancellable *cancellable, GError **error)
Definition: EApi.h:152
EAPI_EXTERN GType(* e_contact_get_type)(void)
Definition: EApi.h:59
void ESourceBackend
Definition: EApi.h:136
void EBook
Definition: EApi.h:80
EAPI_EXTERN gboolean(* e_book_get_contacts)(EBook *book, EBookQuery *query, GList **contacts, GError **error)
Definition: EApi.h:96
EAPI_EXTERN gboolean(* e_client_open_sync)(EClient *client, gboolean only_if_exists, GCancellable *cancellable, GError **error)
Definition: EApi.h:150
int EContactField
Definition: EApi.h:47
group
store_handle_type *SAL_CALL query(OStoreObject *pHandle, store_handle_type *)
sal_Int32 value
Definition: pq_statics.cxx:68
char * locality
Definition: EApi.h:127
char * address_format
Definition: EApi.h:121
char * po
Definition: EApi.h:124
char * country
Definition: EApi.h:130
char * ext
Definition: EApi.h:125
char * code
Definition: EApi.h:129
char * region
Definition: EApi.h:128
char * street
Definition: EApi.h:126