using System;
using System.Runtime.Serialization;
using System.ServiceModel;

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

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

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

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

        //[OperationContract(Action = "http://www.nrf-arts.org/UnifiedPOS/VideoCaptureEvents/DataContainedEvent", ReplyAction = "http://www.nrf-arts.org/UnifiedPOS/BillAcceptorEvents/DataContainedEventResponse")]
        //DataContainedEventData DataContainedEvent(string ConsumerID, string Source, int EventID, DateTime TimeStamp, int Status, ParameterList Parameters);
    }

    //
    // Common Data Types
    //

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

        [DataMember]
        public object Obj { get; set; }
    }

    //[DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/VideoCaptureEvents/")]
    //public class DataContainedEventData
    //{
    //    [DataMember]
    //    public int EventID { get; set; }
    //    [DataMember]
    //    public bool SetDataEventEnabled { get; set; }
    //    [DataMember]
    //    public bool CallClearInputProperties { get; set; }
    //}

    //[CollectionDataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/VideoCaptureEvents/", ItemName = "Parameter")]
    //public class ParameterList : Dictionary<string, object>
    //{
    //}

    //
    // Common Enumerations
    //

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/VideoCaptureEvents/")]
    public enum ErrorCode
    {
        [EnumMember]
        E_CLOSED,

        [EnumMember]
        E_CLAIMED,

        [EnumMember]
        E_NOTCLAIMED,

        [EnumMember]
        E_NOSERVICE,

        [EnumMember]
        E_DISABLED,

        [EnumMember]
        E_ILLEGAL,

        [EnumMember]
        E_NOHARDWARE,

        [EnumMember]
        E_OFFLINE,

        [EnumMember]
        E_NOEXIST,

        [EnumMember]
        E_EXISTS,

        [EnumMember]
        E_FAILURE,

        [EnumMember]
        E_TIMEOUT,

        [EnumMember]
        E_BUSY,

        [EnumMember]
        E_EXTENDED,

        [EnumMember]
        E_DEPRECATED,
    }

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

    [DataContract(Namespace = "http://www.nrf-arts.org/UnifiedPOS/VideoCaptureEvents/")]
    public enum ErrorResponse
    {
        [EnumMember]
        ER_CLEAR,

        [EnumMember]
        ER_RETRY,
    }

    //
    // Specific Data Types
    //

    //
    // Specific Enumerations
    //

    //
    // Constants
    //

    public class ExtendedError
    {
        public const int EVCAP_NOROOM = 201;
        public const int EFIRMWARE_BAD_FILE = 281;
        public const int ESTATS_ERROR = 280;
        public const int ESTATS_DEPENDENCY = 282;
    }

    public class Status
    {
        public const int VCAP_SUE_START_PHOTO = 11;
        public const int VCAP_SUE_END_VIDEO = 12;
        public const int VCAP_SUE_START_VIDEO = 21;
        public const int VCAP_SUE_STOP_VIDEO = 12;
        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;
    }
}