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

package pt.gov.cartaodecidadao;

public class PTEID_Card extends PTEID_Object {
  private long swigCPtr;

  protected PTEID_Card(long cPtr, boolean cMemoryOwn) {
    super(pteidlibJava_WrapperJNI.PTEID_Card_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(PTEID_Card obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        pteidlibJava_WrapperJNI.delete_PTEID_Card(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public PTEID_CardType getType() throws PTEID_Exception {
    return PTEID_CardType.swigToEnum(pteidlibJava_WrapperJNI.PTEID_Card_getType(swigCPtr, this));
  }

  public PTEID_XMLDoc getDocument(PTEID_DocumentType type) throws PTEID_Exception {
    return new PTEID_XMLDoc(pteidlibJava_WrapperJNI.PTEID_Card_getDocument(swigCPtr, this, type.swigValue()), false);
  }

  public PTEID_ByteArray getRawData(PTEID_RawDataType type) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_Card_getRawData(swigCPtr, this, type.swigValue()), false);
  }

  public PTEID_ByteArray sendAPDU(PTEID_ByteArray cmd) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_Card_sendAPDU(swigCPtr, this, PTEID_ByteArray.getCPtr(cmd), cmd), true);
  }

  public PTEID_ByteArray Sign(PTEID_ByteArray data, boolean signatureKey) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_Card_Sign__SWIG_0(swigCPtr, this, PTEID_ByteArray.getCPtr(data), data, signatureKey), true);
  }

  public PTEID_ByteArray Sign(PTEID_ByteArray data) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_Card_Sign__SWIG_1(swigCPtr, this, PTEID_ByteArray.getCPtr(data), data), true);
  }

  public PTEID_ByteArray readFile(String fileID, long ulOffset, long ulMaxLength) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_Card_readFile__SWIG_0(swigCPtr, this, fileID, ulOffset, ulMaxLength), true);
  }

  public PTEID_ByteArray readFile(String fileID, long ulOffset) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_Card_readFile__SWIG_1(swigCPtr, this, fileID, ulOffset), true);
  }

  public PTEID_ByteArray readFile(String fileID) throws PTEID_Exception {
    return new PTEID_ByteArray(pteidlibJava_WrapperJNI.PTEID_Card_readFile__SWIG_2(swigCPtr, this, fileID), true);
  }

  public boolean writeFile(String fileID, PTEID_ByteArray oData, long ulOffset) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Card_writeFile__SWIG_0(swigCPtr, this, fileID, PTEID_ByteArray.getCPtr(oData), oData, ulOffset);
  }

  public boolean writeFile(String fileID, PTEID_ByteArray oData) throws PTEID_Exception {
    return pteidlibJava_WrapperJNI.PTEID_Card_writeFile__SWIG_1(swigCPtr, this, fileID, PTEID_ByteArray.getCPtr(oData), oData);
  }

}
