Tue, 31 Jul 2007 03:50:41 +0000
Implemented a callback for unregistering, mirroring the registration callback. Since this is a new API, I can do it properly by passing it right in the unregister function call, instead of having a separate function for setting it.
| 5563 | 1 | /** |
| 2 | * @file connection.h Connection API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 15884 | 5 | * purple |
| 5563 | 6 | * |
| 15884 | 7 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 8 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 9 | * source distribution. | |
|
6460
fc288e7221ca
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
10 | * |
| 5563 | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
|
6724
e1d416a4a4bc
[gaim-migrate @ 7251]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
24 | * |
|
e1d416a4a4bc
[gaim-migrate @ 7251]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
25 | * @see @ref connection-signals |
| 5563 | 26 | */ |
| 15884 | 27 | #ifndef _PURPLE_CONNECTION_H_ |
| 28 | #define _PURPLE_CONNECTION_H_ | |
| 5563 | 29 | |
| 15884 | 30 | typedef struct _PurpleConnection PurpleConnection; |
| 5563 | 31 | |
|
6622
277eb0b14653
[gaim-migrate @ 7146]
Robert McQueen <robot101@debian.org>
parents:
6605
diff
changeset
|
32 | /** |
|
277eb0b14653
[gaim-migrate @ 7146]
Robert McQueen <robot101@debian.org>
parents:
6605
diff
changeset
|
33 | * Flags to change behavior of the client for a given connection. |
|
277eb0b14653
[gaim-migrate @ 7146]
Robert McQueen <robot101@debian.org>
parents:
6605
diff
changeset
|
34 | */ |
|
277eb0b14653
[gaim-migrate @ 7146]
Robert McQueen <robot101@debian.org>
parents:
6605
diff
changeset
|
35 | typedef enum |
|
277eb0b14653
[gaim-migrate @ 7146]
Robert McQueen <robot101@debian.org>
parents:
6605
diff
changeset
|
36 | { |
| 15884 | 37 | PURPLE_CONNECTION_HTML = 0x0001, /**< Connection sends/receives in 'HTML'. */ |
| 38 | PURPLE_CONNECTION_NO_BGCOLOR = 0x0002, /**< Connection does not send/receive | |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6724
diff
changeset
|
39 | background colors. */ |
| 15884 | 40 | PURPLE_CONNECTION_AUTO_RESP = 0x0004, /**< Send auto responses when away. */ |
| 41 | PURPLE_CONNECTION_FORMATTING_WBFO = 0x0008, /**< The text buffer must be formatted as a whole */ | |
| 42 | PURPLE_CONNECTION_NO_NEWLINES = 0x0010, /**< No new lines are allowed in outgoing messages */ | |
| 43 | PURPLE_CONNECTION_NO_FONTSIZE = 0x0020, /**< Connection does not send/receive font sizes */ | |
| 44 | PURPLE_CONNECTION_NO_URLDESC = 0x0040, /**< Connection does not support descriptions with links */ | |
| 45 | PURPLE_CONNECTION_NO_IMAGES = 0x0080, /**< Connection does not support sending of images */ | |
|
10008
1de3454a0dca
[gaim-migrate @ 10925]
Mark Doliner <markdoliner@pidgin.im>
parents:
9981
diff
changeset
|
46 | |
| 15884 | 47 | } PurpleConnectionFlags; |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5733
diff
changeset
|
48 | |
| 5563 | 49 | typedef enum |
| 50 | { | |
| 15884 | 51 | PURPLE_DISCONNECTED = 0, /**< Disconnected. */ |
| 52 | PURPLE_CONNECTED, /**< Connected. */ | |
| 53 | PURPLE_CONNECTING /**< Connecting. */ | |
| 5563 | 54 | |
| 15884 | 55 | } PurpleConnectionState; |
| 5563 | 56 | |
|
10021
5aa380278a15
[gaim-migrate @ 10946]
Mark Doliner <markdoliner@pidgin.im>
parents:
10008
diff
changeset
|
57 | #include <time.h> |
|
5aa380278a15
[gaim-migrate @ 10946]
Mark Doliner <markdoliner@pidgin.im>
parents:
10008
diff
changeset
|
58 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
59 | #include "account.h" |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
60 | #include "plugin.h" |
| 10400 | 61 | #include "status.h" |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
62 | |
| 5563 | 63 | typedef struct |
| 64 | { | |
| 15884 | 65 | void (*connect_progress)(PurpleConnection *gc, const char *text, |
| 5563 | 66 | size_t step, size_t step_count); |
| 15884 | 67 | void (*connected)(PurpleConnection *gc); |
| 68 | void (*disconnected)(PurpleConnection *gc); | |
| 69 | void (*notice)(PurpleConnection *gc, const char *text); | |
| 70 | void (*report_disconnect)(PurpleConnection *gc, const char *text); | |
| 14758 | 71 | void (*network_connected)(); |
| 72 | void (*network_disconnected)(); | |
| 5563 | 73 | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
74 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
75 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
76 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
77 | void (*_purple_reserved4)(void); |
| 15884 | 78 | } PurpleConnectionUiOps; |
| 5563 | 79 | |
| 15884 | 80 | struct _PurpleConnection |
| 5563 | 81 | { |
| 15884 | 82 | PurplePlugin *prpl; /**< The protocol plugin. */ |
| 83 | PurpleConnectionFlags flags; /**< Connection flags. */ | |
| 5563 | 84 | |
| 15884 | 85 | PurpleConnectionState state; /**< The connection state. */ |
| 5563 | 86 | |
| 15884 | 87 | PurpleAccount *account; /**< The account being connected to. */ |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
88 | char *password; /**< The password used. */ |
| 5563 | 89 | int inpa; /**< The input watcher. */ |
| 90 | ||
| 91 | GSList *buddy_chats; /**< A list of active chats. */ | |
| 92 | void *proto_data; /**< Protocol-specific data. */ | |
| 93 | ||
|
14341
e67646af66ab
[gaim-migrate @ 16964]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
94 | char *display_name; /**< How you appear to other people. */ |
|
10745
04039e970a30
[gaim-migrate @ 12347]
Mark Doliner <markdoliner@pidgin.im>
parents:
10742
diff
changeset
|
95 | guint keepalive; /**< Keep-alive. */ |
| 5563 | 96 | |
| 97 | ||
|
8430
13694e7d1aaa
[gaim-migrate @ 9160]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
98 | gboolean wants_to_die; /**< Wants to Die state. This is set |
|
10272
29aff2eb9290
[gaim-migrate @ 11421]
Mark Doliner <markdoliner@pidgin.im>
parents:
10021
diff
changeset
|
99 | when the user chooses to log out, |
|
8430
13694e7d1aaa
[gaim-migrate @ 9160]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
100 | or when the protocol is |
|
13694e7d1aaa
[gaim-migrate @ 9160]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
101 | disconnected and should not be |
|
13694e7d1aaa
[gaim-migrate @ 9160]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
102 | automatically reconnected |
|
13694e7d1aaa
[gaim-migrate @ 9160]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
103 | (incorrect password, etc.) */ |
| 6393 | 104 | guint disconnect_timeout; /**< Timer used for nasty stack tricks */ |
| 5563 | 105 | }; |
| 106 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
107 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
108 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
109 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
110 | |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
111 | /**************************************************************************/ |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
112 | /** @name Connection API */ |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
113 | /**************************************************************************/ |
|
6488
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
114 | /*@{*/ |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
115 | |
| 5563 | 116 | /** |
| 15884 | 117 | * This function should only be called by purple_account_connect() |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
118 | * in account.c. If you're trying to sign on an account, use that |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
119 | * function instead. |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
120 | * |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
121 | * Creates a connection to the specified account and either connects |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
122 | * or attempts to register a new account. If you are logging in, |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
123 | * the connection uses the current active status for this account. |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
124 | * So if you want to sign on as "away," for example, you need to |
| 15884 | 125 | * have called purple_account_set_status(account, "away"). |
| 126 | * (And this will call purple_account_connect() automatically). | |
| 5563 | 127 | * |
|
10758
b4554ec8d126
[gaim-migrate @ 12361]
Mark Doliner <markdoliner@pidgin.im>
parents:
10745
diff
changeset
|
128 | * @param account The account the connection should be connecting to. |
|
b4554ec8d126
[gaim-migrate @ 12361]
Mark Doliner <markdoliner@pidgin.im>
parents:
10745
diff
changeset
|
129 | * @param regist Whether we are registering a new account or just |
|
b4554ec8d126
[gaim-migrate @ 12361]
Mark Doliner <markdoliner@pidgin.im>
parents:
10745
diff
changeset
|
130 | * trying to do a normal signon. |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
131 | * @param password The password to use. |
| 5563 | 132 | */ |
| 15884 | 133 | void purple_connection_new(PurpleAccount *account, gboolean regist, |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
134 | const char *password); |
| 5563 | 135 | |
| 136 | /** | |
|
18912
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
137 | * This function should only be called by purple_account_unregister() |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
138 | * in account.c. |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
139 | * |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
140 | * Tries to unregister the account on the server. If the account is not |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
141 | * connected, also creates a new connection. |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
142 | * |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
143 | * @param account The account to unregister |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
144 | * @param password The password to use. |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
145 | */ |
|
18994
310e9d853e2b
Implemented a callback for unregistering, mirroring the registration callback. Since this is a new API, I can do it properly by passing it right in the unregister function call, instead of having a separate function for setting it.
Andreas Monitzer <am@adiumx.com>
parents:
18912
diff
changeset
|
146 | void purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data); |
|
18912
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
147 | |
|
606597744812
Added unregistering XMPP accounts. This requires a new prpl-struct entry, but I got an ok for that on the mailing list.
Andreas Monitzer <am@adiumx.com>
parents:
18190
diff
changeset
|
148 | /** |
| 15884 | 149 | * Disconnects and destroys a PurpleConnection. |
|
13976
2543396bd00e
[gaim-migrate @ 16414]
Mark Doliner <markdoliner@pidgin.im>
parents:
12272
diff
changeset
|
150 | * |
| 15884 | 151 | * This function should only be called by purple_account_disconnect() |
|
13976
2543396bd00e
[gaim-migrate @ 16414]
Mark Doliner <markdoliner@pidgin.im>
parents:
12272
diff
changeset
|
152 | * in account.c. If you're trying to sign off an account, use that |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10665
diff
changeset
|
153 | * function instead. |
|
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10665
diff
changeset
|
154 | * |
| 15884 | 155 | * @param gc The purple connection to destroy. |
| 5563 | 156 | */ |
| 15884 | 157 | void purple_connection_destroy(PurpleConnection *gc); |
| 6581 | 158 | |
| 159 | /** | |
|
11718
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
10758
diff
changeset
|
160 | * Sets the connection state. PRPLs should call this and pass in |
| 15884 | 161 | * the state "PURPLE_CONNECTED" when the account is completely |
|
11718
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
10758
diff
changeset
|
162 | * signed on. What does it mean to be completely signed on? If |
|
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
10758
diff
changeset
|
163 | * the core can call prpl->set_status, and it successfully changes |
|
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
10758
diff
changeset
|
164 | * your status, then the account is online. |
| 5563 | 165 | * |
| 166 | * @param gc The connection. | |
| 167 | * @param state The connection state. | |
| 168 | */ | |
| 15884 | 169 | void purple_connection_set_state(PurpleConnection *gc, PurpleConnectionState state); |
| 5563 | 170 | |
| 171 | /** | |
| 172 | * Sets the connection's account. | |
| 173 | * | |
| 174 | * @param gc The connection. | |
| 175 | * @param account The account. | |
| 176 | */ | |
| 15884 | 177 | void purple_connection_set_account(PurpleConnection *gc, PurpleAccount *account); |
| 5563 | 178 | |
| 179 | /** | |
| 180 | * Sets the connection's displayed name. | |
| 181 | * | |
| 182 | * @param gc The connection. | |
| 183 | * @param name The displayed name. | |
| 184 | */ | |
| 15884 | 185 | void purple_connection_set_display_name(PurpleConnection *gc, const char *name); |
| 5563 | 186 | |
| 187 | /** | |
| 188 | * Returns the connection state. | |
| 189 | * | |
| 190 | * @param gc The connection. | |
| 191 | * | |
| 192 | * @return The connection state. | |
| 193 | */ | |
| 15884 | 194 | PurpleConnectionState purple_connection_get_state(const PurpleConnection *gc); |
| 5563 | 195 | |
| 196 | /** | |
|
9019
b9a333b36763
[gaim-migrate @ 9795]
Mark Doliner <markdoliner@pidgin.im>
parents:
8735
diff
changeset
|
197 | * Returns TRUE if the account is connected, otherwise returns FALSE. |
|
b9a333b36763
[gaim-migrate @ 9795]
Mark Doliner <markdoliner@pidgin.im>
parents:
8735
diff
changeset
|
198 | * |
|
b9a333b36763
[gaim-migrate @ 9795]
Mark Doliner <markdoliner@pidgin.im>
parents:
8735
diff
changeset
|
199 | * @return TRUE if the account is connected, otherwise returns FALSE. |
|
b9a333b36763
[gaim-migrate @ 9795]
Mark Doliner <markdoliner@pidgin.im>
parents:
8735
diff
changeset
|
200 | */ |
| 15884 | 201 | #define PURPLE_CONNECTION_IS_CONNECTED(gc) \ |
| 202 | (gc->state == PURPLE_CONNECTED) | |
|
9019
b9a333b36763
[gaim-migrate @ 9795]
Mark Doliner <markdoliner@pidgin.im>
parents:
8735
diff
changeset
|
203 | |
|
b9a333b36763
[gaim-migrate @ 9795]
Mark Doliner <markdoliner@pidgin.im>
parents:
8735
diff
changeset
|
204 | /** |
| 5563 | 205 | * Returns the connection's account. |
| 206 | * | |
| 207 | * @param gc The connection. | |
| 208 | * | |
| 209 | * @return The connection's account. | |
| 210 | */ | |
| 15884 | 211 | PurpleAccount *purple_connection_get_account(const PurpleConnection *gc); |
| 5563 | 212 | |
| 213 | /** | |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
214 | * Returns the connection's password. |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
215 | * |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
216 | * @param gc The connection. |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
217 | * |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
218 | * @return The connection's password. |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
219 | */ |
| 15884 | 220 | const char *purple_connection_get_password(const PurpleConnection *gc); |
|
10740
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
221 | |
|
a1cb6b819a21
[gaim-migrate @ 12342]
Mark Doliner <markdoliner@pidgin.im>
parents:
10738
diff
changeset
|
222 | /** |
| 5563 | 223 | * Returns the connection's displayed name. |
| 224 | * | |
| 225 | * @param gc The connection. | |
| 226 | * | |
| 227 | * @return The connection's displayed name. | |
| 228 | */ | |
| 15884 | 229 | const char *purple_connection_get_display_name(const PurpleConnection *gc); |
| 5563 | 230 | |
| 231 | /** | |
| 232 | * Updates the connection progress. | |
| 233 | * | |
| 234 | * @param gc The connection. | |
| 235 | * @param text Information on the current step. | |
| 236 | * @param step The current step. | |
| 237 | * @param count The total number of steps. | |
| 238 | */ | |
| 15884 | 239 | void purple_connection_update_progress(PurpleConnection *gc, const char *text, |
| 5563 | 240 | size_t step, size_t count); |
| 241 | ||
| 242 | /** | |
|
5571
b709464f507e
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
243 | * Displays a connection-specific notice. |
|
b709464f507e
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
244 | * |
|
b709464f507e
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
245 | * @param gc The connection. |
|
b709464f507e
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
246 | * @param text The notice text. |
|
b709464f507e
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
247 | */ |
| 15884 | 248 | void purple_connection_notice(PurpleConnection *gc, const char *text); |
|
5571
b709464f507e
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
249 | |
|
b709464f507e
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
250 | /** |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
251 | * Closes a connection with an error. |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
252 | * |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
253 | * @param gc The connection. |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
254 | * @param reason The error text. |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
255 | */ |
| 15884 | 256 | void purple_connection_error(PurpleConnection *gc, const char *reason); |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
257 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
258 | /*@}*/ |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
259 | |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
260 | /**************************************************************************/ |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
261 | /** @name Connections API */ |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
262 | /**************************************************************************/ |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
263 | /*@{*/ |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
264 | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
265 | /** |
| 5563 | 266 | * Disconnects from all connections. |
| 267 | */ | |
| 15884 | 268 | void purple_connections_disconnect_all(void); |
| 5563 | 269 | |
| 270 | /** | |
|
10352
802e7ab5b838
[gaim-migrate @ 11569]
Mark Doliner <markdoliner@pidgin.im>
parents:
10272
diff
changeset
|
271 | * Returns a list of all active connections. This does not |
|
802e7ab5b838
[gaim-migrate @ 11569]
Mark Doliner <markdoliner@pidgin.im>
parents:
10272
diff
changeset
|
272 | * include connections that are in the process of connecting. |
| 5563 | 273 | * |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
274 | * @constreturn A list of all active connections. |
| 5563 | 275 | */ |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
276 | GList *purple_connections_get_all(void); |
| 5563 | 277 | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
278 | /** |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
279 | * Returns a list of all connections in the process of connecting. |
|
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
280 | * |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
281 | * @constreturn A list of connecting connections. |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
282 | */ |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
283 | GList *purple_connections_get_connecting(void); |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
284 | |
| 9221 | 285 | /** |
| 286 | * Checks if gc is still a valid pointer to a gc. | |
| 287 | * | |
| 288 | * @return @c TRUE if gc is valid. | |
| 289 | */ | |
|
14183
bdde840e984c
[gaim-migrate @ 16755]
Mark Doliner <markdoliner@pidgin.im>
parents:
14030
diff
changeset
|
290 | /* |
|
bdde840e984c
[gaim-migrate @ 16755]
Mark Doliner <markdoliner@pidgin.im>
parents:
14030
diff
changeset
|
291 | * TODO: Eventually this bad boy will be removed, because it is |
|
bdde840e984c
[gaim-migrate @ 16755]
Mark Doliner <markdoliner@pidgin.im>
parents:
14030
diff
changeset
|
292 | * a gross fix for a crashy problem. |
|
bdde840e984c
[gaim-migrate @ 16755]
Mark Doliner <markdoliner@pidgin.im>
parents:
14030
diff
changeset
|
293 | */ |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
294 | #define PURPLE_CONNECTION_IS_VALID(gc) (g_list_find(purple_connections_get_all(), (gc)) != NULL) |
| 9221 | 295 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
296 | /*@}*/ |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
297 | |
| 5563 | 298 | /**************************************************************************/ |
|
7122
5f40c16a4ae4
[gaim-migrate @ 7689]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
299 | /** @name UI Registration Functions */ |
| 5563 | 300 | /**************************************************************************/ |
| 301 | /*@{*/ | |
| 302 | ||
| 303 | /** | |
| 304 | * Sets the UI operations structure to be used for connections. | |
| 305 | * | |
| 306 | * @param ops The UI operations structure. | |
| 307 | */ | |
| 15884 | 308 | void purple_connections_set_ui_ops(PurpleConnectionUiOps *ops); |
| 5563 | 309 | |
| 310 | /** | |
| 311 | * Returns the UI operations structure used for connections. | |
| 312 | * | |
| 313 | * @return The UI operations structure in use. | |
| 314 | */ | |
| 15884 | 315 | PurpleConnectionUiOps *purple_connections_get_ui_ops(void); |
| 5563 | 316 | |
| 317 | /*@}*/ | |
| 318 | ||
|
6488
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
319 | /**************************************************************************/ |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
320 | /** @name Connections Subsystem */ |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
321 | /**************************************************************************/ |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
322 | /*@{*/ |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
323 | |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
324 | /** |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
325 | * Initializes the connections subsystem. |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
326 | */ |
| 15884 | 327 | void purple_connections_init(void); |
|
6488
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
328 | |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
329 | /** |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
330 | * Uninitializes the connections subsystem. |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
331 | */ |
| 15884 | 332 | void purple_connections_uninit(void); |
|
6488
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
333 | |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
334 | /** |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
335 | * Returns the handle to the connections subsystem. |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
336 | * |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
337 | * @return The connections subsystem handle. |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
338 | */ |
| 15884 | 339 | void *purple_connections_get_handle(void); |
|
6488
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
340 | |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
341 | /*@}*/ |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
342 | |
|
6a47a95e4dbb
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
343 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
344 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
345 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
346 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
347 | |
| 15884 | 348 | #endif /* _PURPLE_CONNECTION_H_ */ |