~ubuntu-branches/ubuntu/maverick/ekiga/maverick

« back to all changes in this revision

Viewing changes to lib/gmcontacts/gmcontacts.h

  • Committer: Bazaar Package Importer
  • Author(s): Eugen Dedu, Eugen Dedu, Loic Minier
  • Date: 2008-09-27 10:00:00 UTC
  • mfrom: (1.1.8 upstream)
  • mto: (1.4.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20080927100000-l5k5werb6czr5b3h
Tags: 3.0.1-1
[ Eugen Dedu ]
* New version.  (Closes: #500089).
* Add our own changelog file in /usr/share/doc.
* Remove gnomemeeting transitional package.
* Discover new interfaces.  (Closes: #488199).
* Compile with dbus support.  (Closes: #467212).
* Numeric keypad inserts digits at correct position.  (Closes: #440159).
* Use libnotify upon call.  (Closes: #412604).
* Symlink identical GNOME help files, to reduce size.  (Closes: #505536).
* Explicitely build-depends on a few dev packages, even if they were
  pulled out anyway by the other dependencies.

[ Loic Minier ]
* Use clean:: instead of clean: in rules.
* Don't disable Uploaders: generation for control.in -> control generation
  in rules.
* Fix some tabs which were size 4 anyway.
* Generate a PO template during build by calling intltool-update -p in
  install; thanks Ubuntu and Martin Pitt; closes: #505535.
* Also let the -dbg depend on ${misc:Depends}.
* Cleanup rules; in particular, use dpkg-parsechangelog and honor
  distclean/clean failures, remove old clean rules, commented out stuff,
  gtk-only stuff.
* Pass -s to dh_* in binary-arch.
* Use debian/*.links and debian/*.manpages instead of symlink manually or
  passing files to dh_installman.
* Use ftp.gnome.org in copyright.
* Switch to quilt and fix target deps in the process; build-dep on quilt
  instead of dpatch; rename news.dpatch to 00_news.patch and refresh;
  replace 00list with series.
* Install autotools-dev config.guess and .sub after patching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/* Ekiga -- A VoIP and Video-Conferencing application
3
 
 * Copyright (C) 2000-2006 Damien Sandras
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 Foundation,
17
 
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18
 
 *
19
 
 *
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.
26
 
 */
27
 
 
28
 
 
29
 
/*
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.
35
 
 *
36
 
 */
37
 
 
38
 
 
39
 
#include <gtk/gtk.h>
40
 
 
41
 
#ifndef _GM_CONTACTS_H_
42
 
#define _GM_CONTACTS_H_
43
 
 
44
 
 
45
 
G_BEGIN_DECLS
46
 
 
47
 
typedef enum {
48
 
 
49
 
  CONTACT_AVAILABLE,
50
 
  CONTACT_BUSY,
51
 
  CONTACT_AUTOANSWER,
52
 
  CONTACT_FORWARD,
53
 
  CONTACT_CALLED,
54
 
  CONTACT_OFFLINE,
55
 
  CONTACT_LAST_STATE
56
 
} ContactState;
57
 
 
58
 
/* A Contact is identified by his UID. The UID must be unique.
59
 
 */
60
 
struct GmContact_ {
61
 
 
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, 
67
 
                                   comma separated */
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 */
74
 
};
75
 
 
76
 
 
77
 
/* An Address Book is identified by its aid.
78
 
 * The UID must be unique.
79
 
 * An Address Book can be local or remote 
80
 
 */
81
 
struct GmAddressbook_ {
82
 
 
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 */
89
 
};
90
 
 
91
 
 
92
 
typedef struct GmContact_ GmContact;
93
 
typedef struct GmAddressbook_ GmAddressbook;
94
 
 
95
 
 
96
 
#define GM_CONTACT(x)     (GmContact *) (x)
97
 
#define GM_ADDRESSBOOK(x) (GmAddressbook *) (x)
98
 
 
99
 
 
100
 
/* The API */
101
 
 
102
 
 
103
 
/* DESCRIPTION  : /
104
 
 * BEHAVIOR     : Returns an empty GmContact. Only the UID field has a unique
105
 
 *                value.
106
 
 * PRE          : /
107
 
 */
108
 
GmContact *gmcontact_new ();
109
 
 
110
 
 
111
 
/* DESCRIPTION  : /
112
 
 * BEHAVIOR     : Returns a copy of the given GmContact
113
 
 * PRE          : /
114
 
 */
115
 
GmContact *gmcontact_copy (GmContact *);
116
 
 
117
 
 
118
 
/* DESCRIPTION  : /
119
 
 * BEHAVIOR     : Deletes the contact given as argument and frees the 
120
 
 *                corresponding memory.
121
 
 * PRE          : /
122
 
 */
123
 
void gmcontact_delete (GmContact *);
124
 
 
125
 
 
126
 
/* DESCRIPTION  : /
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
132
 
 */
133
 
GSList* gmcontact_enum_categories (const GmContact *);
134
 
 
135
 
 
136
 
/* DESCRIPTION  : /
137
 
 * BEHAVIOR     : checks if a contact has a specific category entry
138
 
 * PRE          : a valid pointer to a GmContact, a string (category)
139
 
 */
140
 
gboolean gmcontact_is_in_category (const GmContact *,
141
 
                                   const gchar*);
142
 
 
143
 
/* DESCRIPTION  : /
144
 
 * BEHAVIOR     : Returns an empty GmAddressBook. Only the UID field has
145
 
 *                a unique value.
146
 
 * PRE          : /
147
 
 */
148
 
GmAddressbook *gm_addressbook_new ();
149
 
 
150
 
 
151
 
/* DESCRIPTION  : /
152
 
 * BEHAVIOR     : Deletes the addressbook given as argument and frees the 
153
 
 *                corresponding memory.
154
 
 * PRE          : /
155
 
 */
156
 
void gm_addressbook_delete (GmAddressbook *);
157
 
 
158
 
 
159
 
 
160
 
/* DESCRIPTION  : /
161
 
 * BEHAVIOR     : Returns a GSList of GmAddressbook elements corresponding
162
 
 *                to the local address books.
163
 
 * PRE          : /
164
 
 */
165
 
GSList *gnomemeeting_get_local_addressbooks ();
166
 
 
167
 
 
168
 
/* DESCRIPTION  : /
169
 
 * BEHAVIOR     : Returns a GSList of GmAddressbook elements corresponding
170
 
 *                to the remote address books (ils, ldap).
171
 
 * PRE          : /
172
 
 */
173
 
GSList *gnomemeeting_get_remote_addressbooks ();
174
 
 
175
 
 
176
 
/* DESCRIPTION  : /
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
195
 
 *                contacts.
196
 
 * PRE          : Only one filter at a time.
197
 
 */
198
 
GSList *gnomemeeting_addressbook_get_contacts (GmAddressbook *addressbook,
199
 
                                               int &nbr,
200
 
                                               gboolean partial_match,
201
 
                                               const gchar *fullname,
202
 
                                               const gchar *url,
203
 
                                               const gchar *categorie,
204
 
                                               const gchar *location,
205
 
                                               const gchar *speeddial);
206
 
 
207
 
 
208
 
/* DESCRIPTION  : /
209
 
 * BEHAVIOR     : Add the given GmAddressbook in the address books list.
210
 
 *                Return TRUE on success and FALSE on failure.
211
 
 * PRE          : /
212
 
 */
213
 
gboolean gnomemeeting_addressbook_add (GmAddressbook *);
214
 
 
215
 
 
216
 
/* DESCRIPTION  : /
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.
220
 
 */
221
 
gboolean gnomemeeting_addressbook_delete (GmAddressbook *);
222
 
 
223
 
 
224
 
/* DESCRIPTION  : /
225
 
 * BEHAVIOR     : Modifies the given GmAddressbook from the address books list.
226
 
 *                Return TRUE on success and FALSE on failure.
227
 
 * PRE          : /
228
 
 */
229
 
gboolean gnomemeeting_addressbook_modify (GmAddressbook *);
230
 
 
231
 
 
232
 
/* DESCRIPTION  : /
233
 
 * BEHAVIOR     : Returns TRUE if the given address book is local, FALSE 
234
 
 *               otherwise.
235
 
 * PRE          : The uri field of the GmAddressbook must exist.
236
 
 */
237
 
gboolean gnomemeeting_addressbook_is_local (GmAddressbook *);
238
 
 
239
 
 
240
 
/* DESCRIPTION  : /
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.
244
 
 */
245
 
gboolean gnomemeeting_addressbook_add_contact (GmAddressbook *,
246
 
                                               GmContact *);
247
 
 
248
 
 
249
 
/* DESCRIPTION  : /
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.
253
 
 */
254
 
gboolean gnomemeeting_addressbook_delete_contact (GmAddressbook *,
255
 
                                                  GmContact *);
256
 
 
257
 
 
258
 
/* DESCRIPTION  : /
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.
263
 
 */
264
 
gboolean gnomemeeting_addressbook_modify_contact (GmAddressbook *,
265
 
                                                  GmContact *);
266
 
 
267
 
 
268
 
/* DESCRIPTION  : /
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. 
272
 
 */
273
 
gboolean gnomemeeting_addressbook_is_editable (GmAddressbook *);
274
 
 
275
 
        
276
 
/* DESCRIPTION  : /
277
 
 * BEHAVIOR     : Creates the initial addressbooks if none are found, 
278
 
 *                do nothing otherwise.
279
 
 * PRE          : Non-Null group name and address book name.
280
 
 */
281
 
void gnomemeeting_addressbook_init (gchar *, gchar *);
282
 
 
283
 
 
284
 
/* DESCRIPTION  : /
285
 
 * BEHAVIOR     : Returns TRUE if the address book is able to give information
286
 
 *                about the given field.
287
 
 * PRE          : Non-Null address book.
288
 
 */
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 *);
298
 
 
299
 
G_END_DECLS
300
 
 
301
 
 
302
 
/* supplementary apis */
303
 
#define _GM_CONTACTS_H_INSIDE__
304
 
#include "gmcontacts-dnd.h"
305
 
#undef _GM_CONTACTS_H_INSIDE__
306
 
 
307
 
#endif
308