2
/* Ekiga -- A VoIP and Video-Conferencing application
3
* Copyright (C) 2000-2006 Damien Sandras
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.
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.
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 Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20
* Ekiga is licensed under the GPL license and as a special exception,
21
* you have permission to link or otherwise combine this program with the
22
* programs OPAL, OpenH323 and PWLIB, and distribute the combination,
23
* without applying the requirements of the GNU GPL to the OPAL, OpenH323
24
* and PWLIB programs, as long as you do follow the requirements of the
25
* GNU GPL for all the rest of the software thus combined.
30
* gmcontacts.h - description
31
* ---------------------------
32
* begin : Mon Apr 12 2004
33
* copyright : (C) 2000-2006 by Damien Sandras
34
* description : Declaration of the addressbooks functions.
41
#ifndef _GM_CONTACTS_H_
42
#define _GM_CONTACTS_H_
58
/* A Contact is identified by his UID. The UID must be unique.
62
char *uid; /* Unique UID */
63
char *fullname; /* User Full Name */
64
char *url; /* URL to use when calling the user */
65
char *speeddial; /* Speed dial for that user */
66
char *categories; /* Categories the user belongs to,
68
char *location; /* Location of the user */
69
char *comment; /* Comment about the user */
70
char *software; /* Software he is using */
71
char *email; /* E-mail address of the user */
72
ContactState state; /* Status of the user */
73
gboolean video_capable; /* Endpoint can send video */
77
/* An Address Book is identified by its aid.
78
* The UID must be unique.
79
* An Address Book can be local or remote
81
struct GmAddressbook_ {
83
char *aid; /* Addressbook ID */
84
char *name; /* Addressbook Name */
85
char *url; /* Unique ID. Must be the URL in case
86
of a remote address book */
87
char *call_attribute; /* The attribute to use when calling somebody,
88
only used in case of remote address books */
92
typedef struct GmContact_ GmContact;
93
typedef struct GmAddressbook_ GmAddressbook;
96
#define GM_CONTACT(x) (GmContact *) (x)
97
#define GM_ADDRESSBOOK(x) (GmAddressbook *) (x)
104
* BEHAVIOR : Returns an empty GmContact. Only the UID field has a unique
108
GmContact *gmcontact_new ();
112
* BEHAVIOR : Returns a copy of the given GmContact
115
GmContact *gmcontact_copy (GmContact *);
119
* BEHAVIOR : Deletes the contact given as argument and frees the
120
* corresponding memory.
123
void gmcontact_delete (GmContact *);
127
* BEHAVIOR : Enumerates the categories a contact belongs to in a
128
* GSList of gchar*'s, or NULL if no category or error
129
* Takes care of "empty" categories, e.g.
130
* ``Friends,Ekiga Roster,,Coders'' (the ",," part)
131
* PRE : a valid pointer to a GmContact
133
GSList* gmcontact_enum_categories (const GmContact *);
137
* BEHAVIOR : checks if a contact has a specific category entry
138
* PRE : a valid pointer to a GmContact, a string (category)
140
gboolean gmcontact_is_in_category (const GmContact *,
144
* BEHAVIOR : Returns an empty GmAddressBook. Only the UID field has
148
GmAddressbook *gm_addressbook_new ();
152
* BEHAVIOR : Deletes the addressbook given as argument and frees the
153
* corresponding memory.
156
void gm_addressbook_delete (GmAddressbook *);
161
* BEHAVIOR : Returns a GSList of GmAddressbook elements corresponding
162
* to the local address books.
165
GSList *gnomemeeting_get_local_addressbooks ();
169
* BEHAVIOR : Returns a GSList of GmAddressbook elements corresponding
170
* to the remote address books (ils, ldap).
173
GSList *gnomemeeting_get_remote_addressbooks ();
177
* BEHAVIOR : Returns a GSList of GmContact elements members of a given
178
* GmAddressbook. Only return the elements corresponding to the
179
* given filter (full name, url, categorie, location,
180
* speed dial). The second parameter contains the number of
181
* registered users, or -1 in case of error. The
182
* speed dial is ignored on remote address books. If not
183
* GmAddressbook is given, then the search is done on all
184
* local address books. Searching for speed dial "*" will return
185
* all contacts with a speed dial. If you specify a full name
186
* and an url, all contacts with the specified full name OR url
187
* will be returned. If you specify a full name, an url and a
188
* speed dial, all contacts with that full name OR that url
189
* and the given speed dial will be returned. If the boolean
190
* is set to TRUE, the search will check for partial matches
191
* except for the speed dial where an exact match is always
192
* queried. The int parameter is filled with the number of
193
* contacts in the address book. It can be bigger than the
194
* number of returned contacts if there are hidden or offline
196
* PRE : Only one filter at a time.
198
GSList *gnomemeeting_addressbook_get_contacts (GmAddressbook *addressbook,
200
gboolean partial_match,
201
const gchar *fullname,
203
const gchar *categorie,
204
const gchar *location,
205
const gchar *speeddial);
209
* BEHAVIOR : Add the given GmAddressbook in the address books list.
210
* Return TRUE on success and FALSE on failure.
213
gboolean gnomemeeting_addressbook_add (GmAddressbook *);
217
* BEHAVIOR : Deletes the given GmAddressbook from the address books list.
218
* Return TRUE on success and FALSE on failure.
219
* PRE : The uri field of the GmAddressbook must exist.
221
gboolean gnomemeeting_addressbook_delete (GmAddressbook *);
225
* BEHAVIOR : Modifies the given GmAddressbook from the address books list.
226
* Return TRUE on success and FALSE on failure.
229
gboolean gnomemeeting_addressbook_modify (GmAddressbook *);
233
* BEHAVIOR : Returns TRUE if the given address book is local, FALSE
235
* PRE : The uri field of the GmAddressbook must exist.
237
gboolean gnomemeeting_addressbook_is_local (GmAddressbook *);
241
* BEHAVIOR : Add the given GmContact to the given GmAddressbook.
242
* Return TRUE on success and FALSE on failure.
243
* PRE : The uri field of the GmAddressbook must exist.
245
gboolean gnomemeeting_addressbook_add_contact (GmAddressbook *,
250
* BEHAVIOR : Deletes the given GmContact from the given GmAddressbook.
251
* Return TRUE on success and FALSE on failure.
252
* PRE : The uri field of the GmAddressbook must exist.
254
gboolean gnomemeeting_addressbook_delete_contact (GmAddressbook *,
259
* BEHAVIOR : Modify the given GmContact to the given GmAddressbook.
260
* Return TRUE on success and FALSE on failure.
261
* PRE : The uri field of the GmAddressbook must exist. The contact
262
* must already exist.
264
gboolean gnomemeeting_addressbook_modify_contact (GmAddressbook *,
269
* BEHAVIOR : Returns TRUE if the given address book properties can
270
* be edited, FALSE if it is a "static" address book.
271
* PRE : The uri field of the GmAddressbook must exist.
273
gboolean gnomemeeting_addressbook_is_editable (GmAddressbook *);
277
* BEHAVIOR : Creates the initial addressbooks if none are found,
278
* do nothing otherwise.
279
* PRE : Non-Null group name and address book name.
281
void gnomemeeting_addressbook_init (gchar *, gchar *);
285
* BEHAVIOR : Returns TRUE if the address book is able to give information
286
* about the given field.
287
* PRE : Non-Null address book.
289
gboolean gnomemeeting_addressbook_has_fullname (GmAddressbook *);
290
gboolean gnomemeeting_addressbook_has_url (GmAddressbook *);
291
gboolean gnomemeeting_addressbook_has_speeddial (GmAddressbook *);
292
gboolean gnomemeeting_addressbook_has_categories (GmAddressbook *);
293
gboolean gnomemeeting_addressbook_has_location (GmAddressbook *);
294
gboolean gnomemeeting_addressbook_has_comment (GmAddressbook *);
295
gboolean gnomemeeting_addressbook_has_software (GmAddressbook *);
296
gboolean gnomemeeting_addressbook_has_email (GmAddressbook *);
297
gboolean gnomemeeting_addressbook_has_state (GmAddressbook *);
302
/* supplementary apis */
303
#define _GM_CONTACTS_H_INSIDE__
304
#include "gmcontacts-dnd.h"
305
#undef _GM_CONTACTS_H_INSIDE__