~noskcaj/ubuntu/trusty/ekiga/ftbfs

« back to all changes in this revision

Viewing changes to src/gui/accounts.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-01-28 18:49:20 UTC
  • Revision ID: james.westby@ubuntu.com-20060128184920-v525ihmiv7id40xs
Tags: upstream-1.99.0
ImportĀ upstreamĀ versionĀ 1.99.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* GnomeMeeting -- A 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
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 *
 
19
 *
 
20
 * GnomeMeeting 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 OpenH323 and Pwlib, and distribute the combination, without
 
23
 * applying the requirements of the GNU GPL to the OpenH323 program, as long
 
24
 * as you do follow the requirements of the GNU GPL for all the rest of the
 
25
 * software thus combined.
 
26
 */
 
27
 
 
28
 
 
29
/*
 
30
 *                         accounts.h  -  description
 
31
 *                         --------------------------
 
32
 *   begin                : Sun Feb 13 2005
 
33
 *   copyright            : (C) 2000-2006 by Damien Sandras
 
34
 *   description          : This file contains all the functions needed to
 
35
 *                          manipulate H.323/SIP/... provider accounts.
 
36
 */
 
37
 
 
38
 
 
39
#ifndef _ACCOUNTS_H_
 
40
#define _ACCOUNTS_H_
 
41
 
 
42
#include "common.h"
 
43
 
 
44
class GMManager;
 
45
 
 
46
 
 
47
/* An account is uniquely identified by its Account ID */
 
48
struct GmAccount_ {
 
49
 
 
50
  gchar *aid;                   /* Account ID */
 
51
  gchar *account_name;          /* Account Name */
 
52
  gchar *protocol_name;         /* Protocol for the account */
 
53
  gchar *host;                  /* Host to register to */
 
54
  gchar *domain;                /* Registration domain/realm */
 
55
  gchar *username;              /* Username */
 
56
  gchar *auth_username;         /* Authentication username */
 
57
  gchar *password;              /* Password */
 
58
  gboolean enabled;             /* Account active or not */
 
59
  gboolean default_account;     /* Default account or not */
 
60
  int timeout;                  /* Registration timeout */
 
61
  int method;                   /* Registration method */
 
62
}; 
 
63
 
 
64
typedef GmAccount_ GmAccount;
 
65
 
 
66
 
 
67
#define GM_ACCOUNT(x)     (GmAccount *) (x)
 
68
 
 
69
 
 
70
/* The API */
 
71
 
 
72
 
 
73
/* DESCRIPTION  : /
 
74
 * BEHAVIOR     : Returns an empty GmAccount. Only the UID field has a unique
 
75
 *                value.
 
76
 * PRE          : /
 
77
 */
 
78
GmAccount *gm_account_new ();
 
79
 
 
80
 
 
81
/* DESCRIPTION  : /
 
82
 * BEHAVIOR     : Deletes the given account and frees the associated memory.
 
83
 * PRE          : /
 
84
 */
 
85
void gm_account_delete (GmAccount *account);
 
86
 
 
87
 
 
88
/* DESCRIPTION  : /
 
89
 * BEHAVIOR     : Makes a copy of the given account, keeps the same ID.
 
90
 * PRE          : /
 
91
 */
 
92
GmAccount *gm_account_copy (GmAccount *account);
 
93
 
 
94
 
 
95
/* DESCRIPTION  : /
 
96
 * BEHAVIOR     : Adds the given account to the accounts list. The given 
 
97
 *                account and its ID must not exist yet in the list.
 
98
 *                Returns TRUE on success, FALSE on failure.
 
99
 *                If there is no default account for that protocol yet,
 
100
 *                then the added account becomes the new default.
 
101
 * PRE          : /
 
102
 */
 
103
gboolean gnomemeeting_account_add (GmAccount *account);
 
104
 
 
105
 
 
106
/* DESCRIPTION  : /
 
107
 * BEHAVIOR     : Deletes the given account from the accounts list. 
 
108
 *                Returns TRUE on success, FALSE on failure.
 
109
 *                If that account was the default account for that protocol,
 
110
 *                then the first account of the same protocol will become
 
111
 *                the new default account.
 
112
 * PRE          : /
 
113
 */
 
114
gboolean gnomemeeting_account_delete (GmAccount *account);
 
115
 
 
116
 
 
117
/* DESCRIPTION  : /
 
118
 * BEHAVIOR     : Modifies the given account in the accounts list. 
 
119
 *                Returns TRUE on success, FALSE on failure.
 
120
 * PRE          : /
 
121
 */
 
122
gboolean gnomemeeting_account_modify (GmAccount *account);
 
123
 
 
124
 
 
125
/* DESCRIPTION  : /
 
126
 * BEHAVIOR     : Returns the list of configured GmAccounts.
 
127
 * PRE          : /
 
128
 */
 
129
GSList *gnomemeeting_get_accounts_list ();
 
130
 
 
131
 
 
132
/* DESCRIPTION  : /
 
133
 * BEHAVIOR     : Returns the account for the given domain or host.
 
134
 * PRE          : /
 
135
 */
 
136
GmAccount *gnomemeeting_get_account (const char *);
 
137
 
 
138
 
 
139
/* DESCRIPTION  : /
 
140
 * BEHAVIOR     : Returns the default account for the given protocol (if any).
 
141
 * PRE          : /
 
142
 */
 
143
GmAccount *gnomemeeting_get_default_account (gchar *protocol);
 
144
 
 
145
        
 
146
/* DESCRIPTION  : /
 
147
 * BEHAVIOR     : Toggles the active state of the given account.
 
148
 *                Returns TRUE on success, FALSE on failure.
 
149
 * PRE          : /
 
150
 */
 
151
gboolean gnomemeeting_account_toggle_active (GmAccount *account);
 
152
 
 
153
 
 
154
/* DESCRIPTION  : /
 
155
 * BEHAVIOR     : Sets the account as default or not.
 
156
 *                Returns TRUE on success, FALSE on failure.
 
157
 * PRE          : /
 
158
 */
 
159
gboolean gnomemeeting_account_set_default (GmAccount *account,
 
160
                                           gboolean default_account);
 
161
 
 
162
 
 
163
/* DESCRIPTION  : /
 
164
 * BEHAVIOR     : Builds the GMAccounts window GMObject.
 
165
 * PRE          : /
 
166
 */
 
167
GtkWidget *gm_accounts_window_new ();
 
168
 
 
169
 
 
170
/* DESCRIPTION  :  /
 
171
 * BEHAVIOR     :  Update the account corresponding to the given domain, and
 
172
 *                 username with the given status message. Enables or not
 
173
 *                 the refreshing state for that account (see below for
 
174
 *                 the implications).
 
175
 * PRE          :  /
 
176
 */
 
177
 
 
178
void gm_accounts_window_update_account_state (GtkWidget *accounts_window,
 
179
                                              gboolean refreshing,
 
180
                                              const gchar *domain,
 
181
                                              const gchar *username,
 
182
                                              const gchar *status,
 
183
                                              const gchar *voicemails);
 
184
 
 
185
 
 
186
/* DESCRIPTION  :  /
 
187
 * BEHAVIOR     :  Refreshes the accounts list in the GUI to update them from
 
188
 *                 the accounts list in the GmConf user configuration.
 
189
 *                 If one of the account is in "refreshing state", then all
 
190
 *                 other accounts are unsensitive and the busy cursor is 
 
191
 *                 displayed for the accounts list box.
 
192
 * PRE          :  /
 
193
 */
 
194
void gm_accounts_window_update_accounts_list (GtkWidget *accounts_window);
 
195
 
 
196
 
 
197
#endif