Delta Chat Core C Interface
Public Member Functions | List of all members
dc_event_t Class Reference

#include <deltachat.h>

Public Member Functions

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

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 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
eventEvent object as returned from dc_accounts_get_next_event().
Returns
account-id belonging to the event or 0 for errors.

◆ dc_event_get_data1_int()

int dc_event_get_data1_int ( dc_event_t event)

Get a 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 a 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 a 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, 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().
Returns
None.

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