OssoABookPresence

OssoABookPresence — Base interface for presence representation.

Synopsis

enum                OssoABookPresenceState;
                    OssoABookPresenceIface;
TpConnectionPresenceType osso_abook_presence_get_presence_type
                                                        (OssoABookPresence *presence);
const char*         osso_abook_presence_get_presence_status
                                                        (OssoABookPresence *presence);
const char*         osso_abook_presence_get_display_status
                                                        (OssoABookPresence *presence);
const char*         osso_abook_presence_get_presence_status_message
                                                        (OssoABookPresence *presence);
const char*         osso_abook_presence_get_location_string
                                                        (OssoABookPresence *presence);
const char*         osso_abook_presence_get_icon_name   (OssoABookPresence *presence);
const char*         osso_abook_presence_get_branded_icon_name
                                                        (OssoABookPresence *presence,
                                                         McProfile *profile);
OssoABookPresenceState osso_abook_presence_get_blocked  (OssoABookPresence *presence);
OssoABookPresenceState osso_abook_presence_get_published
                                                        (OssoABookPresence *presence);
OssoABookPresenceState osso_abook_presence_get_subscribed
                                                        (OssoABookPresence *presence);
guint               osso_abook_presence_get_handle      (OssoABookPresence *presence);
int                 osso_abook_presence_compare         (OssoABookPresence *a,
                                                         OssoABookPresence *b);

Description

OssoABookPresence is an interface that represents the online presence.

Details

enum OssoABookPresenceState

typedef enum {
        OSSO_ABOOK_PRESENCE_STATE_YES,
        OSSO_ABOOK_PRESENCE_STATE_NO,
        OSSO_ABOOK_PRESENCE_STATE_LOCAL_PENDING,
        OSSO_ABOOK_PRESENCE_STATE_REMOTE_PENDING,
} OssoABookPresenceState;

The various possible states of presence information. A simple boolean flag is not sufficient for representing this information, since presence state can depend on manual feedback and actual network conditions.

OSSO_ABOOK_PRESENCE_STATE_YES the condition is true
OSSO_ABOOK_PRESENCE_STATE_NO the condition is false
OSSO_ABOOK_PRESENCE_STATE_LOCAL_PENDING the state is not resolved yet and pending on some local action, e.g. some confirmation
OSSO_ABOOK_PRESENCE_STATE_REMOTE_PENDING the state is not resolved yet and pending on some remote action, e.g. network latency

OssoABookPresenceIface

typedef struct {
        TpConnectionPresenceType (* get_presence_type)           (OssoABookPresence *presence);
        const char *             (* get_presence_status)         (OssoABookPresence *presence);
        const char *             (* get_presence_status_message) (OssoABookPresence *presence);
        const char *             (* get_location_string)         (OssoABookPresence *presence);

        OssoABookPresenceState   (* get_blocked)                 (OssoABookPresence *presence);
        OssoABookPresenceState   (* get_published)               (OssoABookPresence *presence);
        OssoABookPresenceState   (* get_subscribed)              (OssoABookPresence *presence);
        guint                    (* get_handle)                  (OssoABookPresence *presence);
} OssoABookPresenceIface;

Virtual methods of the OssoABookPresence interface.

get_presence_type ()
get_presence_status ()
get_presence_status_message ()
get_location_string ()
get_blocked () virtual method for osso_abook_presence_get_blocked()
get_published () virtual method for osso_abook_presence_get_published()
get_subscribed () virtual method for osso_abook_presence_get_subscribed()
get_handle () virtual method for osso_abook_presence_get_handle()

osso_abook_presence_get_presence_type ()

TpConnectionPresenceType osso_abook_presence_get_presence_type
                                                        (OssoABookPresence *presence);

Retrieves the presence type of presence. Note that the "presence-type" property can be monitored by connecting to the GObject "notify" signal with "presence-status" as detail, i.e. "notify::presence-type".

presence : An OssoABookPresence
Returns : An TpConnectionPresenceType.

osso_abook_presence_get_presence_status ()

const char*         osso_abook_presence_get_presence_status
                                                        (OssoABookPresence *presence);

Retrieves the status of presence as string.

presence : An OssoABookPresence
Returns : The detailed presence status.

osso_abook_presence_get_display_status ()

const char*         osso_abook_presence_get_display_status
                                                        (OssoABookPresence *presence);

osso_abook_presence_get_presence_status_message ()

const char*         osso_abook_presence_get_presence_status_message
                                                        (OssoABookPresence *presence);

Retrieves the message associated with the status of presence

presence : An OssoABookPresence
Returns : The status message currently associated with presence. This string is owned by libosso-abook and should not be freed.

osso_abook_presence_get_location_string ()

const char*         osso_abook_presence_get_location_string
                                                        (OssoABookPresence *presence);

Retrieves the location associated with the status of presence as string.

presence : An OssoABookPresence
Returns : The location currently associated with presence as string. This string is owned by libosso-abook and should not be freed.

osso_abook_presence_get_icon_name ()

const char*         osso_abook_presence_get_icon_name   (OssoABookPresence *presence);

Retrieves the icon name associated with the current status of presence. The icon name can be used to look up the appropriate icon to represent presence until the "presence-status" property changes.

presence : An OssoABookPresence
Returns : The icon name currently associated with presence. This string is owned by libosso-abook and should not be freed.

osso_abook_presence_get_branded_icon_name ()

const char*         osso_abook_presence_get_branded_icon_name
                                                        (OssoABookPresence *presence,
                                                         McProfile *profile);

Retrieves the protocol-brand-specific icon name associated with the current status of presence. The icon name can be used to look up the appropriate icon to represent presence until the "presence-status" property changes.

presence : An OssoABookPresence
Returns : The icon name currently associated with presence. This string is owned by this function, so it must not be freed.

osso_abook_presence_get_blocked ()

OssoABookPresenceState osso_abook_presence_get_blocked  (OssoABookPresence *presence);

Retrieves current blocking status of presence.

presence : An OssoABookPresence
Returns : A OssoABookPresenceState.

osso_abook_presence_get_published ()

OssoABookPresenceState osso_abook_presence_get_published
                                                        (OssoABookPresence *presence);

Retrieves current publication status of presence.

presence : An OssoABookPresence
Returns : A OssoABookPresenceState.

osso_abook_presence_get_subscribed ()

OssoABookPresenceState osso_abook_presence_get_subscribed
                                                        (OssoABookPresence *presence);

Retrieves current subscription status of presence.

presence : An OssoABookPresence
Returns : A OssoABookPresenceState.

osso_abook_presence_get_handle ()

guint               osso_abook_presence_get_handle      (OssoABookPresence *presence);

Retrieves the Telepathy connection handle associated with the presence.

presence : An OssoABookPresence
Returns : The connection handle associated with presence, or 0.

osso_abook_presence_compare ()

int                 osso_abook_presence_compare         (OssoABookPresence *a,
                                                         OssoABookPresence *b);

Compares the status of presence a to the status of presence b. See TpConnectionPresenceType for the weights assigned to different statuses.

a : an OssoABookPresence
b : an OssoABookPresence
Returns : < 0 if presence a compares before presence b, 0 if they compare equal, > 0 if presence a compares after presence b.

See Also

OssoABookContactPresence, OssoABookPresence