#include <time.h>
#include "account.h"
#include "plugin.h"
#include "status.h"
Include dependency graph for connection.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | PurpleConnectionUiOps |
Connection UI operations. More... | |
struct | _PurpleConnection |
Connection API | |
#define | PURPLE_CONNECTION_IS_CONNECTED(gc) (gc->state == PURPLE_CONNECTED) |
Returns TRUE if the account is connected, otherwise returns FALSE. | |
void | purple_connection_new (PurpleAccount *account, gboolean regist, const char *password) |
This function should only be called by purple_account_connect() in account.c. | |
void | purple_connection_new_unregister (PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data) |
This function should only be called by purple_account_unregister() in account.c. | |
void | purple_connection_destroy (PurpleConnection *gc) |
Disconnects and destroys a PurpleConnection. | |
void | purple_connection_set_state (PurpleConnection *gc, PurpleConnectionState state) |
Sets the connection state. | |
void | purple_connection_set_account (PurpleConnection *gc, PurpleAccount *account) |
Sets the connection's account. | |
void | purple_connection_set_display_name (PurpleConnection *gc, const char *name) |
Sets the connection's displayed name. | |
PurpleConnectionState | purple_connection_get_state (const PurpleConnection *gc) |
Returns the connection state. | |
PurpleAccount * | purple_connection_get_account (const PurpleConnection *gc) |
Returns the connection's account. | |
const char * | purple_connection_get_password (const PurpleConnection *gc) |
Returns the connection's password. | |
const char * | purple_connection_get_display_name (const PurpleConnection *gc) |
Returns the connection's displayed name. | |
void | purple_connection_update_progress (PurpleConnection *gc, const char *text, size_t step, size_t count) |
Updates the connection progress. | |
void | purple_connection_notice (PurpleConnection *gc, const char *text) |
Displays a connection-specific notice. | |
void | purple_connection_error (PurpleConnection *gc, const char *reason) |
Closes a connection with an error. | |
Connections API | |
#define | PURPLE_CONNECTION_IS_VALID(gc) (g_list_find(purple_connections_get_all(), (gc)) != NULL) |
Checks if gc is still a valid pointer to a gc. | |
void | purple_connections_disconnect_all (void) |
Disconnects from all connections. | |
GList * | purple_connections_get_all (void) |
Returns a list of all active connections. | |
GList * | purple_connections_get_connecting (void) |
Returns a list of all connections in the process of connecting. | |
Typedefs | |
typedef _PurpleConnection | PurpleConnection |
Enumerations | |
enum | PurpleConnectionFlags { PURPLE_CONNECTION_HTML = 0x0001, PURPLE_CONNECTION_NO_BGCOLOR = 0x0002, PURPLE_CONNECTION_AUTO_RESP = 0x0004, PURPLE_CONNECTION_FORMATTING_WBFO = 0x0008, PURPLE_CONNECTION_NO_NEWLINES = 0x0010, PURPLE_CONNECTION_NO_FONTSIZE = 0x0020, PURPLE_CONNECTION_NO_URLDESC = 0x0040, PURPLE_CONNECTION_NO_IMAGES = 0x0080, PURPLE_CONNECTION_HTML = 0x0001, PURPLE_CONNECTION_NO_BGCOLOR = 0x0002, PURPLE_CONNECTION_AUTO_RESP = 0x0004, PURPLE_CONNECTION_FORMATTING_WBFO = 0x0008, PURPLE_CONNECTION_NO_NEWLINES = 0x0010, PURPLE_CONNECTION_NO_FONTSIZE = 0x0020, PURPLE_CONNECTION_NO_URLDESC = 0x0040, PURPLE_CONNECTION_NO_IMAGES = 0x0080 } |
Flags to change behavior of the client for a given connection. More... | |
enum | PurpleConnectionState { PURPLE_DISCONNECTED = 0, PURPLE_CONNECTED, PURPLE_CONNECTING, PURPLE_DISCONNECTED = 0, PURPLE_CONNECTED, PURPLE_CONNECTING } |
Functions | |
UI Registration Functions | |
void | purple_connections_set_ui_ops (PurpleConnectionUiOps *ops) |
Sets the UI operations structure to be used for connections. | |
PurpleConnectionUiOps * | purple_connections_get_ui_ops (void) |
Returns the UI operations structure used for connections. | |
Connections Subsystem | |
void | purple_connections_init (void) |
Initializes the connections subsystem. | |
void | purple_connections_uninit (void) |
Uninitializes the connections subsystem. | |
void * | purple_connections_get_handle (void) |
Returns the handle to the connections subsystem. |
Definition in file connection.h.
#define PURPLE_CONNECTION_IS_CONNECTED | ( | gc | ) | (gc->state == PURPLE_CONNECTED) |
Returns TRUE if the account is connected, otherwise returns FALSE.
Definition at line 239 of file connection.h.
#define PURPLE_CONNECTION_IS_VALID | ( | gc | ) | (g_list_find(purple_connections_get_all(), (gc)) != NULL) |
Checks if gc is still a valid pointer to a gc.
TRUE
if gc is valid. Definition at line 332 of file connection.h.
Flags to change behavior of the client for a given connection.
Definition at line 36 of file connection.h.
PURPLE_DISCONNECTED |
Disconnected.
|
PURPLE_CONNECTED |
Connected.
|
PURPLE_CONNECTING |
Connecting.
|
Definition at line 50 of file connection.h.
void purple_connection_destroy | ( | PurpleConnection * | gc | ) |
Disconnects and destroys a PurpleConnection.
This function should only be called by purple_account_disconnect() in account.c. If you're trying to sign off an account, use that function instead.
gc | The purple connection to destroy. |
void purple_connection_error | ( | PurpleConnection * | gc, | |
const char * | reason | |||
) |
Closes a connection with an error.
gc | The connection. | |
reason | The error text. |
PurpleAccount* purple_connection_get_account | ( | const PurpleConnection * | gc | ) |
Returns the connection's account.
gc | The connection. |
const char* purple_connection_get_display_name | ( | const PurpleConnection * | gc | ) |
Returns the connection's displayed name.
gc | The connection. |
const char* purple_connection_get_password | ( | const PurpleConnection * | gc | ) |
Returns the connection's password.
gc | The connection. |
PurpleConnectionState purple_connection_get_state | ( | const PurpleConnection * | gc | ) |
Returns the connection state.
gc | The connection. |
void purple_connection_new | ( | PurpleAccount * | account, | |
gboolean | regist, | |||
const char * | password | |||
) |
This function should only be called by purple_account_connect() in account.c.
If you're trying to sign on an account, use that function instead.
Creates a connection to the specified account and either connects or attempts to register a new account. If you are logging in, the connection uses the current active status for this account. So if you want to sign on as "away," for example, you need to have called purple_account_set_status(account, "away"). (And this will call purple_account_connect() automatically).
account | The account the connection should be connecting to. | |
regist | Whether we are registering a new account or just trying to do a normal signon. | |
password | The password to use. |
void purple_connection_new_unregister | ( | PurpleAccount * | account, | |
const char * | password, | |||
PurpleAccountUnregistrationCb | cb, | |||
void * | user_data | |||
) |
This function should only be called by purple_account_unregister() in account.c.
Tries to unregister the account on the server. If the account is not connected, also creates a new connection.
account | The account to unregister | |
password | The password to use. |
void purple_connection_notice | ( | PurpleConnection * | gc, | |
const char * | text | |||
) |
Displays a connection-specific notice.
gc | The connection. | |
text | The notice text. |
void purple_connection_set_account | ( | PurpleConnection * | gc, | |
PurpleAccount * | account | |||
) |
Sets the connection's account.
gc | The connection. | |
account | The account. |
void purple_connection_set_display_name | ( | PurpleConnection * | gc, | |
const char * | name | |||
) |
Sets the connection's displayed name.
gc | The connection. | |
name | The displayed name. |
void purple_connection_set_state | ( | PurpleConnection * | gc, | |
PurpleConnectionState | state | |||
) |
Sets the connection state.
PRPLs should call this and pass in the state "PURPLE_CONNECTED" when the account is completely signed on. What does it mean to be completely signed on? If the core can call prpl->set_status, and it successfully changes your status, then the account is online.
gc | The connection. | |
state | The connection state. |
void purple_connection_update_progress | ( | PurpleConnection * | gc, | |
const char * | text, | |||
size_t | step, | |||
size_t | count | |||
) |
Updates the connection progress.
gc | The connection. | |
text | Information on the current step. | |
step | The current step. | |
count | The total number of steps. |
GList* purple_connections_get_all | ( | void | ) |
Returns a list of all active connections.
This does not include connections that are in the process of connecting.
A list of all active connections.
GList* purple_connections_get_connecting | ( | void | ) |
Returns a list of all connections in the process of connecting.
A list of connecting connections.
void* purple_connections_get_handle | ( | void | ) |
Returns the handle to the connections subsystem.
PurpleConnectionUiOps* purple_connections_get_ui_ops | ( | void | ) |
Returns the UI operations structure used for connections.
void purple_connections_set_ui_ops | ( | PurpleConnectionUiOps * | ops | ) |
Sets the UI operations structure to be used for connections.
ops | The UI operations structure. |