/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.35
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace be.portugal.eid {

using System;
using System.Runtime.InteropServices;

public class PTEID_EIDCard : PTEID_SmartCard {
  private HandleRef swigCPtr;

  internal PTEID_EIDCard(IntPtr cPtr, bool cMemoryOwn) : base(pteidlib_dotNetPINVOKE.PTEID_EIDCardUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(PTEID_EIDCard obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~PTEID_EIDCard() {
    Dispose();
  }

  public override void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        pteidlib_dotNetPINVOKE.delete_PTEID_EIDCard(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public static bool isApplicationAllowed() {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_EIDCard_isApplicationAllowed();
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual bool isTestCard() {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_EIDCard_isTestCard(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual bool getAllowTestCard() {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_EIDCard_getAllowTestCard(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual void setAllowTestCard(bool allow) {
    pteidlib_dotNetPINVOKE.PTEID_EIDCard_setAllowTestCard(swigCPtr, allow);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
  }

  public override PTEID_XMLDoc getDocument(PTEID_DocumentType type) {
	switch(type)
	{
	case PTEID_DocumentType.PTEID_DOCTYPE_FULL:
		return getFullDoc();
	case PTEID_DocumentType.PTEID_DOCTYPE_ID:
		return getID();
	case PTEID_DocumentType.PTEID_DOCTYPE_ADDRESS:
		return getAddr();
	/*case PTEID_DocumentType.PTEID_DOCTYPE_PICTURE:
		return getPicture();*/
	case PTEID_DocumentType.PTEID_DOCTYPE_INFO:
		return getVersionInfo();
	case PTEID_DocumentType.PTEID_DOCTYPE_PINS:
		return getPins();
	case PTEID_DocumentType.PTEID_DOCTYPE_CERTIFICATES:
		return getCertificates();
	default:
		throw new PTEID_ExDocTypeUnknown();
	}
}

  public PTEID_EIdFullDoc getFullDoc() {
    PTEID_EIdFullDoc ret = new PTEID_EIdFullDoc(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getFullDoc(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_EId getID() {
    PTEID_EId ret = new PTEID_EId(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getID(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Address getAddr() {
    PTEID_Address ret = new PTEID_Address(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getAddr(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Sod getSod() {
    PTEID_Sod ret = new PTEID_Sod(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getSod(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_CardVersionInfo getVersionInfo() {
    PTEID_CardVersionInfo ret = new PTEID_CardVersionInfo(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getVersionInfo(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getCert(PTEID_CertifType type) {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getCert(swigCPtr, (int)type), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getRoot() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRoot(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getCA() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getCA(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getSignature() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getSignature(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_Certificate getAuthentication() {
    PTEID_Certificate ret = new PTEID_Certificate(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getAuthentication(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public override PTEID_ByteArray getRawData(PTEID_RawDataType type) {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData(swigCPtr, (int)type), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_Id() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_Id(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_IdSig() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_IdSig(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_Trace() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_Trace(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_Addr() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_Addr(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_AddrSig() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_AddrSig(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_Sod() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_Sod(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_CardInfo() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_CardInfo(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_TokenInfo() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_TokenInfo(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_Challenge() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_Challenge(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_Response() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_Response(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public PTEID_ByteArray getRawData_PersoData() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_EIDCard_getRawData_PersoData(swigCPtr), false);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
