![]() |
![]() |
![]() |
UPower Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define UP_DEVICE_ERROR #define UP_DEVICE_TYPE_ERROR void (*_up_device_reserved1) (void
); void (*_up_device_reserved2) (void
); void (*_up_device_reserved3) (void
); void (*_up_device_reserved4) (void
); void (*_up_device_reserved5) (void
); void (*_up_device_reserved6) (void
); void (*_up_device_reserved7) (void
); void (*_up_device_reserved8) (void
); UpDevice * up_device_new (void
); gchar * up_device_to_text (UpDevice *device
); gboolean up_device_refresh_sync (UpDevice *device
,GCancellable *cancellable
,GError **error
); gboolean up_device_set_object_path_sync (UpDevice *device
,const gchar *object_path
,GCancellable *cancellable
,GError **error
); GPtrArray * up_device_get_history_sync (UpDevice *device
,const gchar *type
,guint timespec
,guint resolution
,GCancellable *cancellable
,GError **error
); GPtrArray * up_device_get_statistics_sync (UpDevice *device
,const gchar *type
,GCancellable *cancellable
,GError **error
); const gchar * up_device_get_object_path (UpDevice *device
);
A helper GObject to use for accessing UPower devices, and to be notified when it is changed.
See also: UpClient
UpDevice * up_device_new (void
);
Creates a new UpDevice object.
Returns : |
a new UpDevice object. |
Since 0.9.0
gchar * up_device_to_text (UpDevice *device
);
Converts the device to a string description.
|
a UpDevice instance. |
Returns : |
text representation of UpDevice |
Since 0.9.0
gboolean up_device_refresh_sync (UpDevice *device
,GCancellable *cancellable
,GError **error
);
Refreshes properties on the device. This function is normally not required.
|
a UpDevice instance. |
|
a GCancellable or NULL
|
|
a GError, or NULL . |
Returns : |
TRUE for success, else FALSE and error is used |
Since 0.9.0
gboolean up_device_set_object_path_sync (UpDevice *device
,const gchar *object_path
,GCancellable *cancellable
,GError **error
);
Sets the object path of the object and fills up initial properties.
|
a UpDevice instance. |
|
The UPower object path. |
|
a GCancellable or NULL
|
|
a GError, or NULL . |
Returns : |
TRUE for success, else FALSE and error is used |
Since 0.9.0
GPtrArray * up_device_get_history_sync (UpDevice *device
,const gchar *type
,guint timespec
,guint resolution
,GCancellable *cancellable
,GError **error
);
Gets the device history.
|
a UpDevice instance. |
|
The type of history, known values are "rate" and "charge". |
|
the amount of time to look back into time. |
|
the resolution of data. |
|
a GCancellable or NULL
|
|
a GError, or NULL . |
Returns : |
an array of UpHistoryItem's, with the most
recent one being first; NULL if error is set or device is
invalid. [element-type UpHistoryItem][transfer full]
|
Since 0.9.0
GPtrArray * up_device_get_statistics_sync (UpDevice *device
,const gchar *type
,GCancellable *cancellable
,GError **error
);
Gets the device current statistics.
|
a UpDevice instance. |
|
the type of statistics. |
|
a GCancellable or NULL
|
|
a GError, or NULL . |
Returns : |
an array of UpStatsItem's, else NULL and error is used. [element-type UpStatsItem][transfer full]
|
Since 0.9.0