FolksPresenceDetails

FolksPresenceDetails — Interface exposing a FolksPersona's or FolksIndividual's presence; their current availability, such as for chatting.

Synopsis

enum                FolksPresenceType;
gboolean            folks_presence_details_is_online    (FolksPresenceDetails *self);
FolksPresenceType   folks_presence_details_get_presence_type
                                                        (FolksPresenceDetails *self);
void                folks_presence_details_set_presence_type
                                                        (FolksPresenceDetails *self,
                                                         FolksPresenceType value);
const gchar *       folks_presence_details_get_presence_message
                                                        (FolksPresenceDetails *self);
void                folks_presence_details_set_presence_message
                                                        (FolksPresenceDetails *self,
                                                         const gchar *value);
const gchar *       folks_presence_details_get_presence_status
                                                        (FolksPresenceDetails *self);
void                folks_presence_details_set_presence_status
                                                        (FolksPresenceDetails *self,
                                                         const gchar *value);
gint                folks_presence_details_typecmp      (FolksPresenceType type_a,
                                                         FolksPresenceType type_b);
                    FolksPresenceDetails;

Object Hierarchy

  GEnum
   +----FolksPresenceType
  GInterface
   +----FolksPresenceDetails

Prerequisites

FolksPresenceDetails requires GObject.

Known Implementations

FolksPresenceDetails is implemented by FolksIndividual.

Properties

  "presence-message"         gchar*                : Read / Write
  "presence-status"          gchar*                : Read / Write
  "presence-type"            FolksPresenceType     : Read / Write

Description

If the FolksBackend providing the FolksPersona doesn't support presence, the FolksPersona's `presence_type` will be set to PresenceType.UNSET and their `presence_message` will be an empty string.

Details

enum FolksPresenceType

typedef enum {
	FOLKS_PRESENCE_TYPE_UNSET,
	FOLKS_PRESENCE_TYPE_OFFLINE,
	FOLKS_PRESENCE_TYPE_AVAILABLE,
	FOLKS_PRESENCE_TYPE_AWAY,
	FOLKS_PRESENCE_TYPE_EXTENDED_AWAY,
	FOLKS_PRESENCE_TYPE_HIDDEN,
	FOLKS_PRESENCE_TYPE_BUSY,
	FOLKS_PRESENCE_TYPE_UNKNOWN,
	FOLKS_PRESENCE_TYPE_ERROR
} FolksPresenceType;

The possible presence states an object implementing FolksPresenceDetails could be in.

These closely follow the SimplePresence interface in the Telepathy specification.

FOLKS_PRESENCE_TYPE_UNSET

never set

FOLKS_PRESENCE_TYPE_OFFLINE

offline

FOLKS_PRESENCE_TYPE_AVAILABLE

available

FOLKS_PRESENCE_TYPE_AWAY

away from keyboard

FOLKS_PRESENCE_TYPE_EXTENDED_AWAY

away from keyboard for an extended period of time

FOLKS_PRESENCE_TYPE_HIDDEN

also known as "invisible" or "appear offline"

FOLKS_PRESENCE_TYPE_BUSY

at keyboard, but too busy to chat

FOLKS_PRESENCE_TYPE_UNKNOWN

presence not received from server

FOLKS_PRESENCE_TYPE_ERROR

an error occurred with fetching the presence

folks_presence_details_is_online ()

gboolean            folks_presence_details_is_online    (FolksPresenceDetails *self);

Whether the contact is online.

This will be `true` if the contact's presence type is higher than PresenceType.OFFLINE, as determined by folks_presence_details_typecmp().

self :

the FolksPresenceDetails instance

Returns :

`true` if the contact is online, `false` otherwise

folks_presence_details_get_presence_type ()

FolksPresenceType   folks_presence_details_get_presence_type
                                                        (FolksPresenceDetails *self);

self :

the FolksPresenceDetails instance to query

Returns :

the value of the "presence-type" property

folks_presence_details_set_presence_type ()

void                folks_presence_details_set_presence_type
                                                        (FolksPresenceDetails *self,
                                                         FolksPresenceType value);

self :

the FolksPresenceDetails instance to modify

value :

the new value of the "presence-type" property

folks_presence_details_get_presence_message ()

const gchar *       folks_presence_details_get_presence_message
                                                        (FolksPresenceDetails *self);

self :

the FolksPresenceDetails instance to query

Returns :

the value of the "presence-message" property

folks_presence_details_set_presence_message ()

void                folks_presence_details_set_presence_message
                                                        (FolksPresenceDetails *self,
                                                         const gchar *value);

self :

the FolksPresenceDetails instance to modify

value :

the new value of the "presence-message" property

folks_presence_details_get_presence_status ()

const gchar *       folks_presence_details_get_presence_status
                                                        (FolksPresenceDetails *self);

self :

the FolksPresenceDetails instance to query

Returns :

the value of the "presence-status" property

folks_presence_details_set_presence_status ()

void                folks_presence_details_set_presence_status
                                                        (FolksPresenceDetails *self,
                                                         const gchar *value);

self :

the FolksPresenceDetails instance to modify

value :

the new value of the "presence-status" property

folks_presence_details_typecmp ()

gint                folks_presence_details_typecmp      (FolksPresenceType type_a,
                                                         FolksPresenceType type_b);

Compare two FolksPresenceTypes.

`0` will be returned if the types are equal, a positive number will be returned if `type_a` is more available than `type_b`, and a negative number will be returned if the opposite is true.

type_a :

the first FolksPresenceType to compare. [in]

type_b :

the second FolksPresenceType to compare. [in]

Returns :

a number representing the similarity of the two types

Since 0.1.11


FolksPresenceDetails

typedef struct _FolksPresenceDetails FolksPresenceDetails;

Interface exposing a FolksPersona's or FolksIndividual's presence; their current availability, such as for chatting.

If the FolksBackend providing the FolksPersona doesn't support presence, the FolksPersona's `presence_type` will be set to PresenceType.UNSET and their `presence_message` will be an empty string.

Property Details

The "presence-message" property

  "presence-message"         gchar*                : Read / Write

The contact's presence message.

This is a short message written by the contact to add detail to their presence type ("presence-type"). If the contact hasn't set a message, it will be an empty string.

Default value: NULL


The "presence-status" property

  "presence-status"          gchar*                : Read / Write

The contact's detailed presence status.

This is a more detailed representation of the contact's presence than "presence-type". It may be empty, or one of a well-known set of strings, as defined in the Telepathy specification: Telepathy Specification

Default value: NULL

Since 0.6.0


The "presence-type" property

  "presence-type"            FolksPresenceType     : Read / Write

The contact's presence type.

Each contact can have one and only one presence type at any one time, representing their availability for communication. The default presence type is PresenceType.UNSET.

Default value: FOLKS_PRESENCE_TYPE_UNSET