GalagoStatus

## GalagoStatus GalagoStatus — Status type in a presence. |

## Synopsis

    enum        GalagoStatusType;
    #define     GALAGO_STATUS_ID_AVAILABLE
    #define     GALAGO_STATUS_ID_AWAY
    #define     GALAGO_STATUS_ID_BRB
    #define     GALAGO_STATUS_ID_BUSY
    #define     GALAGO_STATUS_ID_DND
    #define     GALAGO_STATUS_ID_EXTENDED_AWAY
    #define     GALAGO_STATUS_ID_HIDDEN
    #define     GALAGO_STATUS_ID_OFFLINE
    #define     GALAGO_STATUS_ATTR_MESSAGE
                GalagoStatus;
    GalagoStatus* galago_status_new             (GalagoStatusType type,
                                                 const char *id,
                                                 const char *name,
                                                 gboolean exclusive);
    GalagoStatus* galago_status_duplicate       (const GalagoStatus *status);
    void        galago_status_set_presence      (GalagoStatus *status,
                                                 GalagoPresence *presence);
    GalagoPresence* galago_status_get_presence  (const GalagoStatus *status);
    GalagoStatusType galago_status_get_primitive
                                                (const GalagoStatus *status);
    const char* galago_status_get_id            (const GalagoStatus *status);
    const char* galago_status_get_name          (const GalagoStatus *status);
    gboolean    galago_status_is_exclusive      (const GalagoStatus *status);
    gboolean    galago_status_is_available      (const GalagoStatus *status);

## Object Hierarchy

      GObject
       +----GalagoObject
             +----GalagoStatus

## Properties

      "exclusive"            gboolean              : Read / Write
      "id"                   gchararray            : Read / Write / Construct Only
      "name"                 gchararray            : Read / Write / Construct Only
      "presence"             GalagoPresence        : Read / Write
      "primitive"            GalagoStatusType      : Read / Write / Construct Only

## Description

GalagoStatus represents a single status in a GalagoPresence. A status is something like "available" or "away." They may hold attributes, such as an away message.

Some statuses are exclusive. "available" and "away" would be exclusive statuses. Some are not exclusive, such as "invisible." These status types are dependent on the server that they are on.

## Details

### enum GalagoStatusType

    typedef enum
    {
    	GALAGO_STATUS_UNSET = 0,
    	GALAGO_STATUS_OFFLINE,
    	GALAGO_STATUS_AVAILABLE,
    	GALAGO_STATUS_AWAY,
    	GALAGO_STATUS_EXTENDED_AWAY,
    	GALAGO_STATUS_HIDDEN,
    	GALAGO_STATUS_PENDING

    } GalagoStatusType;

A type of status primitive. These are the most common ways to describe a status, and are used for availability determination and calculations.

`GALAGO_STATUS_UNSET` | Unset. This is never set and only used as an error return type.
`GALAGO_STATUS_OFFLINE` | Offline.
`GALAGO_STATUS_AVAILABLE` | Available.
`GALAGO_STATUS_AWAY` | Away from the computer.
`GALAGO_STATUS_EXTENDED_AWAY` | Away for a long period of time.
`GALAGO_STATUS_HIDDEN` | Hidden from view from others.
`GALAGO_STATUS_PENDING` | Status information is pending.

### GALAGO_STATUS_ID_AVAILABLE

    #define     GALAGO_STATUS_ID_AVAILABLE

Available.

### GALAGO_STATUS_ID_AWAY

    #define     GALAGO_STATUS_ID_AWAY

Away from the computer.

### GALAGO_STATUS_ID_BRB

    #define     GALAGO_STATUS_ID_BRB

Be right back.

### GALAGO_STATUS_ID_BUSY

    #define     GALAGO_STATUS_ID_BUSY

Busy.

### GALAGO_STATUS_ID_DND

    #define     GALAGO_STATUS_ID_DND

Do not disturb.

### GALAGO_STATUS_ID_EXTENDED_AWAY

    #define     GALAGO_STATUS_ID_EXTENDED_AWAY

Away for a longer period of time.

### GALAGO_STATUS_ID_HIDDEN

    #define     GALAGO_STATUS_ID_HIDDEN

Hidden from others.

### GALAGO_STATUS_ID_OFFLINE

    #define     GALAGO_STATUS_ID_OFFLINE

Offline.

### GALAGO_STATUS_ATTR_MESSAGE

    #define     GALAGO_STATUS_ATTR_MESSAGE

Message status attribute. This is used for away and available message text.

### GalagoStatus

    typedef struct _GalagoStatus GalagoStatus;

This is an opaque structure representing a status. This should not be used directly. Use the accessor functions below.

### galago_status_new ()

    GalagoStatus* galago_status_new             (GalagoStatusType type,
                                                 const char *id,
                                                 const char *name,
                                                 gboolean exclusive);

Creates a new status.

If exclusive is TRUE, the status will be exclusive. Only one exclusive status can be set at a time. If another exclusive status is set, the previously set exclusive status will be removed.

If exclusive is FALSE, the status will not be removed unless manually removed.

`type` : | The type of status.
`id` : | The status ID.
`name` : | The name of the status.
`exclusive` : | TRUE if the status is exclusive.
Returns : | The status.

### galago_status_duplicate ()

    GalagoStatus* galago_status_duplicate       (const GalagoStatus *status);

Duplicates a status.

`status` : | The status to duplicate.
Returns : | The duplicate status.

### galago_status_set_presence ()

    void        galago_status_set_presence      (GalagoStatus *status,
                                                 GalagoPresence *presence);

Sets the parent presence of a status.

This is intended for internal use only.

`status` : | The status.
`presence` : | The presence.

### galago_status_get_presence ()

    GalagoPresence* galago_status_get_presence  (const GalagoStatus *status);

Returns the parent presence of a status.

`status` : | The status.
Returns : | The presence.

### galago_status_get_primitive ()

    GalagoStatusType galago_status_get_primitive
                                                (const GalagoStatus *status);

Returns the primitive type of a status.

`status` : | The status.
Returns : | The status's primitive type.

### galago_status_get_id ()

    const char* galago_status_get_id            (const GalagoStatus *status);

Returns the status's ID.

`status` : | The status.
Returns : | The status's ID.

### galago_status_get_name ()

    const char* galago_status_get_name          (const GalagoStatus *status);

Returns the status's name.

`status` : | The status.
Returns : | The status's name.

### galago_status_is_exclusive ()

    gboolean    galago_status_is_exclusive      (const GalagoStatus *status);

Returns whether or not a status is exclusive.

`status` : | The status.
Returns : | TRUE if the status is exclusive, or FALSE.

### galago_status_is_available ()

    gboolean    galago_status_is_available      (const GalagoStatus *status);

Returns whether or not a status is considered available.

`status` : | The status.
Returns : | TRUE if the status is available, or FALSE.

## Property Details

### The "`exclusive`" property

      "exclusive"            gboolean              : Read / Write

The status's exclusive state.

Default value: FALSE

### The "`id`" property

      "id"                   gchararray            : Read / Write / Construct Only

The status's ID.

Default value: NULL

### The "`name`" property

      "name"                 gchararray            : Read / Write / Construct Only

The status's descriptive name.

Default value: NULL

### The "`presence`" property

      "presence"             GalagoPresence        : Read / Write

The presence object that this status belongs to.

### The "`primitive`" property

      "primitive"            GalagoStatusType      : Read / Write / Construct Only

The primitive type this status is based on.

Default value: GALAGO_STATUS_UNSET

## See Also

GalagoPresence