Back to index

indicator-power  12.10.0
device.h
Go to the documentation of this file.
00001 /*
00002 
00003 A simple Device structure used internally by indicator-power
00004 
00005 Copyright 2012 Canonical Ltd.
00006 
00007 Authors:
00008     Charles Kerr <charles.kerr@canonical.com>
00009 
00010 This library is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 version 3.0 as published by the Free Software Foundation.
00013 
00014 This library is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License version 3.0 for more details.
00018 
00019 You should have received a copy of the GNU General Public
00020 License along with this library. If not, see
00021 <http://www.gnu.org/licenses/>.
00022 */
00023 
00024 #ifndef __INDICATOR_POWER_DEVICE_H__
00025 #define __INDICATOR_POWER_DEVICE_H__
00026 
00027 #include <glib-object.h>
00028 #include <libupower-glib/upower.h>
00029 
00030 G_BEGIN_DECLS
00031 
00032 #define INDICATOR_POWER_DEVICE_TYPE            (indicator_power_device_get_type ())
00033 #define INDICATOR_POWER_DEVICE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_POWER_DEVICE_TYPE, IndicatorPowerDevice))
00034 #define INDICATOR_POWER_DEVICE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  INDICATOR_POWER_DEVICE_TYPE, IndicatorPowerDeviceClass))
00035 #define INDICATOR_IS_POWER_DEVICE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_POWER_DEVICE_TYPE))
00036 #define INDICATOR_IS_POWER_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  INDICATOR_POWER_DEVICE_TYPE))
00037 #define INDICATOR_POWER_DEVICE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  INDICATOR_POWER_DEVICE_TYPE, IndicatorPowerDeviceClass))
00038 
00039 typedef struct _IndicatorPowerDevice IndicatorPowerDevice;
00040 typedef struct _IndicatorPowerDeviceClass IndicatorPowerDeviceClass;
00041 typedef struct _IndicatorPowerDevicePrivate IndicatorPowerDevicePrivate;
00042 
00043 #define INDICATOR_POWER_DEVICE_KIND         "kind"
00044 #define INDICATOR_POWER_DEVICE_STATE        "state"
00045 #define INDICATOR_POWER_DEVICE_OBJECT_PATH  "object-path"
00046 #define INDICATOR_POWER_DEVICE_PERCENTAGE   "percentage"
00047 #define INDICATOR_POWER_DEVICE_TIME         "time"
00048 
00053 struct _IndicatorPowerDeviceClass
00054 {
00055   GObjectClass parent_class;
00056 };
00057 
00063 struct _IndicatorPowerDevice
00064 {
00065   GObject parent;
00066   IndicatorPowerDevicePrivate * priv;
00067 };
00068 
00069 /***
00070 ****
00071 ***/
00072 
00073 GType indicator_power_device_get_type (void);
00074 
00075 IndicatorPowerDevice* indicator_power_device_new (const gchar    * object_path,
00076                                                   UpDeviceKind     kind,
00077                                                   gdouble          percentage,
00078                                                   UpDeviceState    state,
00079                                                   time_t           time);
00080 
00085 IndicatorPowerDevice* indicator_power_device_new_from_variant (GVariant * variant);
00086 
00087 
00088 UpDeviceKind  indicator_power_device_get_kind        (const IndicatorPowerDevice * device);
00089 UpDeviceState indicator_power_device_get_state       (const IndicatorPowerDevice * device);
00090 const gchar * indicator_power_device_get_object_path (const IndicatorPowerDevice * device);
00091 gdouble       indicator_power_device_get_percentage  (const IndicatorPowerDevice * device);
00092 time_t        indicator_power_device_get_time        (const IndicatorPowerDevice * device);
00093 
00094 GStrv         indicator_power_device_get_icon_names  (const IndicatorPowerDevice * device);
00095 GIcon       * indicator_power_device_get_gicon       (const IndicatorPowerDevice * device);
00096 
00097 void          indicator_power_device_get_time_details (const IndicatorPowerDevice * device,
00098                                                        gchar ** short_details,
00099                                                        gchar ** details,
00100                                                        gchar ** accessible_name);
00101 
00102 
00103 
00104 
00105 G_END_DECLS
00106 
00107 #endif