/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __IWPOWER_POWER_ENUMS_H
#define __IWPOWER_POWER_ENUMS_H

namespace iwear
{
    namespace sensor
    {
	namespace power
	{

/**
 * This distinguishes what kind of power sensor type it should be. Like the
 * local computer or some external attached device. It does not distinguish
 * between access methods such as acpi, apm etc. 
 */	    
enum powersensor_type
{
    local_system,		///< Means THIS computer ur currently running on
    num_powersensor_type,
};

enum battery_state
{
    not_present,
    charging,
    discharging,
    charged,
    num_battery_state
};

enum lid_state
{
    lid_open,
    lid_close,
    num_lid_state
};

enum eh_capabilities {
    eh_ac_status,               ///< AC Adapter status
    eh_bat_status,
    eh_bat_design,
    eh_bat_last,
    eh_bat_current,
    eh_bat_rate,
    eh_bat_totalremain,
    eh_bat_remain,
    eh_bat_designvoltage,
    eh_bat_currentvoltage,
    eh_bat_model,
    eh_lid_state,
    eh_cpu_temp,
    eh_lcd_brightness,
    num_eh_capabilities
};

union psunion
{
    uint32_t ps_int;
    float ps_dbl;
    battery_state ps_bat;
    lid_state ps_lid;
    energy_state ps_egy;
    time_t ps_tim;
    /**
     * @note this is zeroed out in case not all bits of it are used, so we can
     * just memcmp() in this case, to compare the value. Of course this is only
     * valid if the same part of the union was used. But there are places were
     * we have just two unions, beein absolutely sure that theyre of the same
     * type but dont know the actual type (or its too complicated to do a
     * switch/case everytime for that)
     */
    psunion( ) { memset(this,0,sizeof(*this)); }
    /*
       psunion( uint32_t x ) : ps_int(x) { }
       psunion( time_t x) : ps_tim(x) { }
       psunion( unsigned int x) : ps_tim(x) { }
       */
};


}
}
}
#endif

