using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace UnifiedPOS.POSPowerEvents.V1_4
{
    [ServiceContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/")]
    public interface POSPowerEvent
    {

        //
        // Events
        //

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/DataEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/DataEventResponse")]
        //void DataEvent(string ConsumerID, string Source, int EventID, DateTime TimeStamp, int Status);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/DirectIOEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/DirectIOEventResponse")]
        DirectIOData DirectIOEvent(string ConsumerID, string Source, int EventID, DateTime TimeStamp, int EventNumber, int Data, object Obj);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/ErrorEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/ErrorEventResponse")]
        //ErrorResponse ErrorEvent(string ConsumerID, string Source, int EventID, DateTime TimeStamp, ErrorCode ErrorCode, int ErrorCodeExtended, ErrorLocus ErrorLocus, ErrorResponse ErrorResponse);

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/OutputCompleteEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/OutputCompleteEventResponse")]
        //void OutputCompleteEvent(string ConsumerID, string Source, int EventID, DateTime TimeStamp, int OutputID);

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/StatusUpdateEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/StatusUpdateEventResponse")]
        void StatusUpdateEvent(string ConsumerID, string Source, int EventID, DateTime TimeStamp, int Status);
    }

    //
    // Common Data Types
    //

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/")]
    public class DirectIOData
    {
        [DataMember]
        public int Data { get; set; }
        [DataMember]
        public object Obj { get; set; }
    }

    //
    // Common Enumerations
    //

//    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/")]
//    public enum ErrorCode
//    {
//        [EnumMember]
//        Busy,
//        [EnumMember]
//        Claimed,
//        [EnumMember]
//        Closed,
//        [EnumMember]
//        Deprecated,
//        [EnumMember]
//        Disabled,
//        [EnumMember]
//        Exists,
//        [EnumMember]
//        Extended,
//        [EnumMember]
//        Failure,
//        [EnumMember]
//        Illegal,
//        [EnumMember]
//        NoExist,
//        [EnumMember]
//        NoHardware,
//        [EnumMember]
//        NoService,
//       [EnumMember]
//        NotClaimed,
//        [EnumMember]
//        Offline,
//        [EnumMember]
//        Success,
//        [EnumMember]
//        Timeout,
//    }

//    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/")]
//    public enum ErrorLocus
//    {
//        [EnumMember]
//        Input,
//        [EnumMember]
//        InputData,
//        [EnumMember]
//        Output,
//    }

//    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/POSPowerEvents/")]
//    public enum ErrorResponse
//    {
//        [EnumMember]
//        Clear,
//        [EnumMember]
//        ContinueInput,
//        [EnumMember]
//        Retry,
//    }

    //
    // Specific Data Types
    //

    //
    // Specific Enumerations
    //

    //
    // Constants
    //

    public class Status
    {
        public const int SUE_POWER_ONLINE = 2001;
        public const int SUE_POWER_OFF = 2002;
        public const int SUE_POWER_OFFLINE = 2003;
        public const int SUE_POWER_OFF_OFFLINE = 2004;
        public const int SUE_UF_COMPLETE = 2200;
        public const int SUE_UF_PROGRESS = 2100;
        public const int SUE_UF_FAILED_DEV_OK = 2201;
        public const int SUE_UF_FAILED_DEV_UNRECOVERABLE = 2202;
        public const int SUE_UF_FAILED_DEV_UNKNOWN = 2204;
        public const int SUE_UF_COMPLETE_DEV_NOT_RESTORED = 2205;
        public const int SUE_UF_FAILED_DEV_NEEDS_FIRMWARE = 2203;

        public const int PWR_SUE_UPS_FULL = 11;
        public const int PWR_SUE_UPS_WARNING = 12;
        public const int PWR_SUE_UPS_LOW = 13;
        public const int PWR_SUE_UPS_CRITICAL = 14;
        public const int PWR_SUE_FAN_STOPPED = 15;
        public const int PWR_SUE_FAN_RUNNING = 16;
        public const int PWR_SUE_TEMPERATURE_HIGH = 17;
        public const int PWR_SUE_TEMPERATURE_OK = 18;
        public const int PWR_SUE_SHUTDOWN = 19;
        public const int PWR_SUE_BAT_LOW = 20;
        public const int PWR_SUE_BAT_CRITICAL = 21;
        public const int PWR_SUE_BAT_CAPACITY_REMAINING = 22;
        public const int PWR_SUE_RESTART = 23;
        public const int PWR_SUE_STANDBY = 24;
        public const int PWR_SUE_USER_STANDBY = 25;
        public const int PWR_SUE_SUSPEND = 26;
        public const int PWR_SUE_USER_SUSPEND = 27;
        public const int PWR_SUE_PWR_SOURCE = 28;
        public const int PWR_SUE_BAT_CAPACITY_REMAINING_IN_SECONDS = 29;
    }
}
