libpurple/connection.h

branch
cpw.resiak.disconnectreason
changeset 20430
bb30dff3da21
parent 20429
0e840b026c82
child 20431
49979e453876
equal deleted inserted replaced
20429:0e840b026c82 20430:bb30dff3da21
117 { 117 {
118 /** When an account is connecting, this operation is called to notify 118 /** When an account is connecting, this operation is called to notify
119 * the UI of what is happening, as well as which @a step out of @a 119 * the UI of what is happening, as well as which @a step out of @a
120 * step_count has been reached (which might be displayed as a progress 120 * step_count has been reached (which might be displayed as a progress
121 * bar). 121 * bar).
122 * @see #purple_connection_update_progress
122 */ 123 */
123 void (*connect_progress)(PurpleConnection *gc, 124 void (*connect_progress)(PurpleConnection *gc,
124 const char *text, 125 const char *text,
125 size_t step, 126 size_t step,
126 size_t step_count); 127 size_t step_count);
128
127 /** Called when a connection is established (just before the 129 /** Called when a connection is established (just before the
128 * @ref signed-on signal). 130 * @ref signed-on signal).
129 */ 131 */
130 void (*connected)(PurpleConnection *gc); 132 void (*connected)(PurpleConnection *gc);
131 /** Called when a connection is ended (between the @ref signing-off 133 /** Called when a connection is ended (between the @ref signing-off
132 * and @ref signed-off signals). 134 * and @ref signed-off signals).
133 */ 135 */
134 void (*disconnected)(PurpleConnection *gc); 136 void (*disconnected)(PurpleConnection *gc);
137
135 /** Used to display connection-specific notices. (Pidgin's Gtk user 138 /** Used to display connection-specific notices. (Pidgin's Gtk user
136 * interface implements this as a no-op; #purple_connection_notice(), 139 * interface implements this as a no-op; #purple_connection_notice(),
137 * which uses this operation, is not used by any of the protocols 140 * which uses this operation, is not used by any of the protocols
138 * shipped with libpurple.) 141 * shipped with libpurple.)
139 */ 142 */
140 void (*notice)(PurpleConnection *gc, const char *text); 143 void (*notice)(PurpleConnection *gc, const char *text);
144
141 /** Called when an error causes a connection to be disconnected. 145 /** Called when an error causes a connection to be disconnected.
142 * Called before #disconnected. 146 * Called before #disconnected.
143 * @param text a localized error message. 147 * @param text a localized error message.
148 * @see #purple_connection_error
149 * @deprecated in favour of
150 * #PurpleConnectionUiOps.report_disconnect_reason.
144 */ 151 */
145 void (*report_disconnect)(PurpleConnection *gc, const char *text); 152 void (*report_disconnect)(PurpleConnection *gc, const char *text);
153
146 /** Called when libpurple discovers that the computer's network 154 /** Called when libpurple discovers that the computer's network
147 * connection is active. On Linux, this uses Network Manager if 155 * connection is active. On Linux, this uses Network Manager if
148 * available; on Windows, it uses Win32's network change notification 156 * available; on Windows, it uses Win32's network change notification
149 * infrastructure. 157 * infrastructure.
150 */ 158 */
152 /** Called when libpurple discovers that the computer's network 160 /** Called when libpurple discovers that the computer's network
153 * connection has gone away. 161 * connection has gone away.
154 */ 162 */
155 void (*network_disconnected)(); 163 void (*network_disconnected)();
156 164
165 /** Called when a connection is disconnected, whether due to an
166 * error or to user request. Called before #disconnected.
167 * @param reason why the connection ended, if known, or
168 * PURPLE_REASON_OTHER_ERROR, if not.
169 * @param text a localized message describing the disconnection
170 * in more detail to the user.
171 * @see #purple_connection_error_reason
172 */
173 void (*report_disconnect_reason)(PurpleConnection *gc,
174 PurpleDisconnectReason reason,
175 const char *text);
176
157 void (*_purple_reserved1)(void); 177 void (*_purple_reserved1)(void);
158 void (*_purple_reserved2)(void); 178 void (*_purple_reserved2)(void);
159 void (*_purple_reserved3)(void); 179 void (*_purple_reserved3)(void);
160 void (*_purple_reserved4)(void);
161 } PurpleConnectionUiOps; 180 } PurpleConnectionUiOps;
162 181
163 struct _PurpleConnection 182 struct _PurpleConnection
164 { 183 {
165 PurplePlugin *prpl; /**< The protocol plugin. */ 184 PurplePlugin *prpl; /**< The protocol plugin. */
333 /** 352 /**
334 * Closes a connection with an error. 353 * Closes a connection with an error.
335 * 354 *
336 * @param gc The connection. 355 * @param gc The connection.
337 * @param reason The error text. 356 * @param reason The error text.
357 * @deprecated in favour of #purple_connection_error_reason. Calling
358 * @c purple_connection_error(gc, text) is equivalent to calling
359 * @c purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, text).
338 */ 360 */
339 void purple_connection_error(PurpleConnection *gc, const char *reason); 361 void purple_connection_error(PurpleConnection *gc, const char *reason);
362
363 /**
364 * Closes a connection with an error and an optional description of the
365 * error.
366 *
367 * @param reason why the connection is closing.
368 * @param description a localized description of the error.
369 */
370 void
371 purple_connection_error_reason (PurpleConnection *gc,
372 PurpleDisconnectReason reason,
373 const char *description);
340 374
341 /*@}*/ 375 /*@}*/
342 376
343 /**************************************************************************/ 377 /**************************************************************************/
344 /** @name Connections API */ 378 /** @name Connections API */

mercurial