/* ----------------------------------------------------------------------------
 * 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;

/// <summary>Abstract base class for all the documents.</summary>
public class PTEID_XMLDoc : PTEID_Object {
  private HandleRef swigCPtr;

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

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

  ~PTEID_XMLDoc() {
    Dispose();
  }

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

  /// <summary>The document is allowed</summary>
  public virtual bool isAllowed() {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_XMLDoc_isAllowed(swigCPtr);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  /// <summary>Return the document in an XML format</summary>
  public virtual PTEID_ByteArray getXML() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_XMLDoc_getXML(swigCPtr), true);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  /// <summary>Return the document in an CSV format</summary>
  public virtual PTEID_ByteArray getCSV() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_XMLDoc_getCSV(swigCPtr), true);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  /// <summary>Return the document in an TLV format</summary>
  public virtual PTEID_ByteArray getTLV() {
    PTEID_ByteArray ret = new PTEID_ByteArray(pteidlib_dotNetPINVOKE.PTEID_XMLDoc_getTLV(swigCPtr), true);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  /// <summary>Write the xml document into the file csFilePath</summary>
  /// <returns>true if succeede</returns> d
  public virtual bool writeXmlToFile(string csFilePath) {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_XMLDoc_writeXmlToFile(swigCPtr, csFilePath);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  /// <summary>Write the csv document into the file csFilePath	 </summary>
  /// <returns>true if succeeded</returns> 
  public virtual bool writeCsvToFile(string csFilePath) {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_XMLDoc_writeCsvToFile(swigCPtr, csFilePath);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  /// <summary>Write the tlv document into the file csFilePath</summary>
  /// <returns>true if succeeded </returns> 
  public virtual bool writeTlvToFile(string csFilePath) {
    bool ret = pteidlib_dotNetPINVOKE.PTEID_XMLDoc_writeTlvToFile(swigCPtr, csFilePath);
    if (pteidlib_dotNetPINVOKE.SWIGPendingException.Pending) throw pteidlib_dotNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
