FolksPresenceDetails

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

Functions

Properties

GStrv client-types Read / Write
gchar * presence-message Read / Write
gchar * presence-status Read / Write
FolksPresenceType presence-type Read / Write

Types and Values

Object Hierarchy

    GEnum
    ╰── FolksPresenceType
    GInterface
    ╰── FolksPresenceDetails

Prerequisites

FolksPresenceDetails requires GObject.

Known Implementations

FolksPresenceDetails is implemented by FolksIndividual.

Description

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

Functions

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 FOLKS_PRESENCE_TYPE_OFFLINE, as determined by folks_presence_details_typecmp().

Parameters

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);

Get and return the current value of the "presence-type" property.

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 FOLKS_PRESENCE_TYPE_UNSET.

Parameters

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);

Set the value of the "presence-type" property to value .

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 FOLKS_PRESENCE_TYPE_UNSET.

Parameters

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);

Get and return the current value of the "presence-message" property.

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.

Parameters

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);

Set the value of the "presence-message" property to value .

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.

Parameters

self

the FolksPresenceDetails instance to modify

 

value

the new value of the "presence-message" property

 

folks_presence_details_get_client_types ()

gchar **
folks_presence_details_get_client_types
                               (FolksPresenceDetails *self,
                                int *result_length1);

Get and return the current value of the "client-types" property.

The contact's client types.

One can connect to instant messaging networks on a huge variety of devices, from PCs, to phones to consoles. The client types are represented in strings, using the values documented by the XMPP registrar

Parameters

self

the FolksPresenceDetails instance to query

 

Returns

the value of the "client-types" property

Since 0.9.5


folks_presence_details_set_client_types ()

void
folks_presence_details_set_client_types
                               (FolksPresenceDetails *self,
                                gchar **value,
                                int value_length1);

Set the value of the "client-types" property to value .

The contact's client types.

One can connect to instant messaging networks on a huge variety of devices, from PCs, to phones to consoles. The client types are represented in strings, using the values documented by the XMPP registrar

Parameters

self

the FolksPresenceDetails instance to modify

 

value

the new value of the "client-types" property

 

Since 0.9.5


folks_presence_details_get_presence_status ()

const gchar *
folks_presence_details_get_presence_status
                               (FolksPresenceDetails *self);

Get and return the current value of the "presence-status" property.

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

Parameters

self

the FolksPresenceDetails instance to query

 

Returns

the value of the "presence-status" property

Since 0.6.0


folks_presence_details_set_presence_status ()

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

Set the value of the "presence-status" property to value .

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

Parameters

self

the FolksPresenceDetails instance to modify

 

value

the new value of the "presence-status" property

 

Since 0.6.0


folks_presence_details_get_default_message_from_type ()

const gchar *
folks_presence_details_get_default_message_from_type
                               (FolksPresenceType type);

The default message for a presence type.

Parameters

type

 .

a FolksPresenceType for which to retrieve a translated display string

.

[in]

Returns

a default translated display string for the given FolksPresenceType

.

[transfer none]

Since 0.7.1


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.

Parameters

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

Types and Values

enum FolksPresenceType

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

These closely follow the SimplePresence interface in the Telepathy specification.

Members

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

 

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 FOLKS_PRESENCE_TYPE_UNSET and their presence_message will be an empty string.


struct FolksPresenceDetailsIface

struct FolksPresenceDetailsIface {
	GTypeInterface parent_iface;
	FolksPresenceType (*get_presence_type) (FolksPresenceDetails* self);
	void (*set_presence_type) (FolksPresenceDetails* self, FolksPresenceType value);
	const gchar* (*get_presence_message) (FolksPresenceDetails* self);
	void (*set_presence_message) (FolksPresenceDetails* self, const gchar* value);
	gchar** (*get_client_types) (FolksPresenceDetails* self, int* result_length1);
	void (*set_client_types) (FolksPresenceDetails* self, gchar** value, int value_length1);
	const gchar* (*get_presence_status) (FolksPresenceDetails* self);
	void (*set_presence_status) (FolksPresenceDetails* self, const gchar* value);
};

Interface for creating FolksPresenceDetails implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

get_presence_type ()

getter method for the abstract property "presence-type"

 

set_presence_type ()

setter method for the abstract property "presence-type"

 

get_presence_message ()

getter method for the abstract property "presence-message"

 

set_presence_message ()

setter method for the abstract property "presence-message"

 

get_client_types ()

getter method for the abstract property "client-types"

 

set_client_types ()

setter method for the abstract property "client-types"

 

get_presence_status ()

getter method for the abstract property "presence-status"

 

set_presence_status ()

setter method for the abstract property "presence-status"

 

Property Details

The “client-types” property

  “client-types”             GStrv

The contact's client types.

One can connect to instant messaging networks on a huge variety of devices, from PCs, to phones to consoles. The client types are represented in strings, using the values documented by the XMPP registrar

Flags: Read / Write

Since 0.9.5


The “presence-message” property

  “presence-message”         gchar *

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.

Flags: Read / Write

Default value: NULL


The “presence-status” property

  “presence-status”          gchar *

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

Flags: Read / Write

Default value: NULL

Since 0.6.0


The “presence-type” property

  “presence-type”            FolksPresenceType

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 FOLKS_PRESENCE_TYPE_UNSET.

Flags: Read / Write

Default value: FOLKS_PRESENCE_TYPE_UNSET