Delta Chat Core C Interface
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dc_event_t Class Reference

Opaque object describing a single event. More...

#include <deltachat.h>

Public Member Functions

uint32_t dc_event_get_account_id (dc_event_t *event)
 Get the account ID this event belongs to.
 
int dc_event_get_data1_int (dc_event_t *event)
 Get data associated with an event object.
 
int dc_event_get_data2_int (dc_event_t *event)
 Get data associated with an event object.
 
char * dc_event_get_data2_str (dc_event_t *event)
 Get data associated with an event object.
 
int dc_event_get_id (dc_event_t *event)
 Get the event ID from an event object.
 
void dc_event_unref (dc_event_t *event)
 Free memory used by an event object.
 

Detailed Description

Opaque object describing a single event.

To get events, call dc_get_next_event() on an event emitter created by dc_get_event_emitter().

Member Function Documentation

◆ dc_event_get_account_id()

uint32_t dc_event_get_account_id ( dc_event_t * event)

Get the account ID this event belongs to.

The account ID is of interest only when using the dc_accounts_t account manager. To get the context object belonging to the event, use dc_accounts_get_account().

Parameters
eventThe event object as returned from dc_get_next_event().
Returns
The account ID belonging to the event, 0 for account manager errors.

◆ dc_event_get_data1_int()

int dc_event_get_data1_int ( dc_event_t * event)

Get data associated with an event object.

The meaning of the data depends on the event ID returned as DC_EVENT constants by dc_event_get_id(). See also dc_event_get_data2_int() and dc_event_get_data2_str().

Parameters
eventEvent object as returned from dc_get_next_event().
Returns
"data1" as a signed integer, at least 32bit, the meaning depends on the event type associated with this event.

◆ dc_event_get_data2_int()

int dc_event_get_data2_int ( dc_event_t * event)

Get data associated with an event object.

The meaning of the data depends on the event ID returned as DC_EVENT constants by dc_event_get_id(). See also dc_event_get_data2_int() and dc_event_get_data2_str().

Parameters
eventEvent object as returned from dc_get_next_event().
Returns
"data2" as a signed integer, at least 32bit, the meaning depends on the event type associated with this event.

◆ dc_event_get_data2_str()

char * dc_event_get_data2_str ( dc_event_t * event)

Get data associated with an event object.

The meaning of the data depends on the event ID returned as DC_EVENT constants by dc_event_get_id(). See also dc_event_get_data1_int() and dc_event_get_data2_int().

Parameters
eventEvent object as returned from dc_get_next_event().
Returns
"data2" as a string or NULL. the meaning depends on the event type associated with this event. Once you're done with the string, you have to unref it using dc_unref_str().

◆ dc_event_get_id()

int dc_event_get_id ( dc_event_t * event)

Get the event ID from an event object.

The event ID is one of the DC_EVENT constants. There may be additional data belonging to an event, to get them, use dc_event_get_data1_int(), dc_event_get_data2_int() and dc_event_get_data2_str().

Parameters
eventEvent object as returned from dc_get_next_event().
Returns
once of the DC_EVENT constants. 0 on errors.

◆ dc_event_unref()

void dc_event_unref ( dc_event_t * event)

Free memory used by an event object.

If you forget to do this for an event, this will result in memory leakage.

Parameters
eventEvent object as returned from dc_get_next_event().

The documentation for this class was generated from the following file: