/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Core Library
 *
 * 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 __IWEAR_MODULE_ENUMS_H
#define __IWEAR_MODULE_ENUMS_H

#include "iwear/cstdint.h"
#include <ostream>

namespace iwear
{

enum power_state
{
    active,   ///< Module Fully operational
    standby,  ///< Module is currently in a standby state (possibly powersaving)
    suspend,  ///< Module is currently in a suspend state (should be powersaving)
    poweroff, ///< Module is Physically inactive, activation might require user intervention
    poweron,  /**
              *  Same as active, but when issuing as a command to the
              *  activate_power_state() the resulting state may be one of active,
              *  standby or suspend. This is to just power on a device, but
              *  don't care about standby or real activits state.
              */
    num_power_state,
};

enum energy_state
{
    ac_online, ///< A device which is currently attache to a (wired) power supply
    ac_offline, ///< The device is currently running on battery
    ac_unknown, ///< The devices state is unknown or the device does not have a battery
    num_energy_state,	
};

enum module_type
{
    sensor_module, ///< The Module belongs to the sensor layer and should be handled by the sensormanager
    input_module,  ///< The Module belongs to the input layer and should be handled by the inputmanager
    output_module,  ///< The Module belongs to the output layer and should be handled by the outputmanager
    num_module_type,
};

inline const char* to_string( module_type st )
{    
    switch(st)
    {
	case sensor_module:
	    return "module_type::sensor_module";
	case input_module:
	    return "module_type::input_module";
	case output_module:
	    return "module_type::output_module";
	default:
	    return "module_type::<invalid_value>";
    }
}
/**
 * @addtogroup Output_Operators
 * @{
 */
inline std::ostream& operator<<(std::ostream& o, module_type st)
{
    o << to_string(st);
    o << "(";
    o << static_cast<uint32_t>(st) << ")";
    return o;
}
/** @} */
}
#endif

