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

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

        //
        // Events
        //

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

        [OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/LightsEvents/DirectIOEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/LightsEvents/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/LightsEvents/ErrorEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/LightsEvents/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/LightsEvents/OutputCompleteEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/LightsEvents/OutputCompleteEventResponse")]
        //void OutputCompleteEvent(string ConsumerID, string Source, int EventID, DateTime TimeStamp, int OutputID);

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

    //
    // Common Data Types
    //

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/LightsEvents/")]
    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/LightsEvents/")]
    //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/LightsEvents/")]
    //public enum ErrorLocus
    //{
    //    [EnumMember]
    //    Input,
    //    [EnumMember]
    //    InputData,
    //    [EnumMember]
    //    Output,
    //}

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

    //
    // Specific Data Types
    //

    //
    // Specific Enumerations
    //

    //
    // Constants
    //

    //public class ExtendedError
    //{
    //    public const int EFIRMWARE_BAD_FILE = 281;
    //    public const int Statistics = 280;
    //    public const int ESTATS_DEPENDENCY = 282;
    //}

    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;
    }
}
