Galago - desktop presence framework

galago-status.h

Go to the documentation of this file.
00001 
00021 #ifndef _GALAGO_STATUS_H_
00022 #define _GALAGO_STATUS_H_
00023 
00024 typedef struct _GalagoStatus        GalagoStatus;
00025 typedef struct _GalagoStatusClass   GalagoStatusClass;
00026 typedef struct _GalagoStatusPrivate GalagoStatusPrivate;
00027 typedef struct _GalagoStatusAttr    GalagoStatusAttr;
00028 
00029 typedef enum
00030 {
00031     GALAGO_STATUS_UNSET = 0,
00032     GALAGO_STATUS_OFFLINE,
00033     GALAGO_STATUS_AVAILABLE,
00034     GALAGO_STATUS_AWAY,
00035     GALAGO_STATUS_EXTENDED_AWAY,
00036     GALAGO_STATUS_HIDDEN
00037 
00038 } GalagoStatusType;
00039 
00040 typedef enum
00041 {
00042     GALAGO_STATUS_ATTR_UNSET = -1,
00043     GALAGO_STATUS_ATTR_BOOL  = 0,
00044     GALAGO_STATUS_ATTR_STRING,
00045     GALAGO_STATUS_ATTR_INT,
00046     GALAGO_STATUS_ATTR_DOUBLE
00047 
00048 } GalagoStatusAttrType;
00049 
00050 #include <libgalago/galago-presence.h>
00051 #include <libgalago/galago-object.h>
00052 #include <libgalago/galago-types.h>
00053 
00054 /**************************************************************************/
00056 /**************************************************************************/
00059 #define GALAGO_STATUS_ID_AVAILABLE       "available"
00060 #define GALAGO_STATUS_ID_AWAY            "away"
00061 #define GALAGO_STATUS_ID_BRB             "brb"
00062 #define GALAGO_STATUS_ID_BUSY            "busy"
00063 #define GALAGO_STATUS_ID_DND             "dnd"
00064 #define GALAGO_STATUS_ID_EXTENDED_AWAY   "xa"
00065 #define GALAGO_STATUS_ID_HIDDEN          "hidden"
00066 #define GALAGO_STATUS_ID_OFFLINE         "offline"
00067 
00070 /**************************************************************************/
00072 /**************************************************************************/
00078 struct _GalagoStatus
00079 {
00080     GalagoObject parent_object;
00081 
00082     GalagoStatusPrivate *priv;
00083 
00084     void (*reserved_1)(void);
00085     void (*reserved_2)(void);
00086     void (*reserved_3)(void);
00087     void (*reserved_4)(void);
00088 };
00089 
00093 struct _GalagoStatusClass
00094 {
00095     GalagoObjectClass parent_class;
00096 
00097     void (*reserved_1)(void);
00098     void (*reserved_2)(void);
00099     void (*reserved_3)(void);
00100     void (*reserved_4)(void);
00101 };
00102 
00103 #define GALAGO_CLASS_STATUS (galago_status_get_class())
00104 #define GALAGO_IS_STATUS(obj) (GALAGO_IS_OBJECT(obj) && galago_object_check_cast((obj), GALAGO_CLASS_STATUS))
00105 
00106 #ifdef __cplusplus
00107 extern "C" {
00108 #endif
00109 
00110 /**************************************************************************/
00112 /**************************************************************************/
00120 GalagoObjectClass *galago_status_get_class(void);
00121 
00139 GalagoStatus *galago_status_new(GalagoStatusType type, const char *id,
00140                                 const char *name, galago_bool exclusive);
00141 
00149 GalagoStatus *galago_status_duplicate(const GalagoStatus *status);
00150 
00159 void galago_status_set_presence(GalagoStatus *status,
00160                                 GalagoPresence *presence);
00161 
00169 GalagoPresence *galago_status_get_presence(const GalagoStatus *status);
00170 
00178 GalagoStatusType galago_status_get_type(const GalagoStatus *status);
00179 
00187 const char *galago_status_get_id(const GalagoStatus *status);
00188 
00196 const char *galago_status_get_name(const GalagoStatus *status);
00197 
00205 galago_bool galago_status_is_exclusive(const GalagoStatus *status);
00206 
00214 galago_bool galago_status_is_available(const GalagoStatus *status);
00215 
00223 void galago_status_set_attr_bool(GalagoStatus *status, const char *attr_id,
00224                                  galago_bool value);
00225 
00233 void galago_status_set_attr_string(GalagoStatus *status, const char *attr_id,
00234                                    const char *value);
00235 
00243 void galago_status_set_attr_int(GalagoStatus *status, const char *attr_id,
00244                                 dbus_int32_t value);
00245 
00253 void galago_status_set_attr_double(GalagoStatus *status, const char *attr_id,
00254                                    double value);
00255 
00262 void galago_status_remove_attr(GalagoStatus *status, const char *attr_id);
00263 
00272 galago_bool galago_status_get_attr_bool(const GalagoStatus *status,
00273                                         const char *attr_id);
00274 
00283 const char *galago_status_get_attr_string(const GalagoStatus *status,
00284                                           const char *attr_id);
00285 
00294 dbus_int32_t galago_status_get_attr_int(const GalagoStatus *status,
00295                                         const char *attr_id);
00296 
00305 double galago_status_get_attr_double(const GalagoStatus *status,
00306                                      const char *attr_id);
00307 
00316 galago_bool galago_status_attr_exists(const GalagoStatus *status,
00317                                       const char *attr_id);
00318 
00326 const GalagoList *galago_status_get_attributes(const GalagoStatus *status);
00327 
00330 /**************************************************************************/
00332 /**************************************************************************/
00342 GalagoStatusAttrType galago_status_attr_get_type(const GalagoStatusAttr *attr);
00343 
00351 const char *galago_status_attr_get_id(const GalagoStatusAttr *attr);
00352 
00360 galago_bool galago_status_attr_get_bool(const GalagoStatusAttr *attr);
00361 
00369 const char *galago_status_attr_get_string(const GalagoStatusAttr *attr);
00370 
00378 dbus_int32_t galago_status_attr_get_int(const GalagoStatusAttr *attr);
00379 
00387 double galago_status_attr_get_double(const GalagoStatusAttr *attr);
00388 
00391 #ifdef __cplusplus
00392 }
00393 #endif
00394 
00395 #endif /* _GALAGO_STATUS_H_ */