/*
 * This file is auto-generated.  DO NOT MODIFY.
 */
package com.xcheng.printerservice;
// Declare any non-default types here with import statements

public interface IPrinterCallback extends android.os.IInterface
{
  /** Default implementation for IPrinterCallback. */
  public static class Default implements com.xcheng.printerservice.IPrinterCallback
  {
    @Override public void onException(int code, java.lang.String msg) throws android.os.RemoteException
    {
    }
    @Override public void onLength(long current, long total) throws android.os.RemoteException
    {
    }
    @Override public void onComplete() throws android.os.RemoteException
    {
    }
    @Override
    public android.os.IBinder asBinder() {
      return null;
    }
  }
  /** Local-side IPC implementation stub class. */
  public static abstract class Stub extends android.os.Binder implements com.xcheng.printerservice.IPrinterCallback
  {
    private static final java.lang.String DESCRIPTOR = "com.xcheng.printerservice.IPrinterCallback";
    /** Construct the stub at attach it to the interface. */
    public Stub()
    {
      this.attachInterface(this, DESCRIPTOR);
    }
    /**
     * Cast an IBinder object into an com.xcheng.printerservice.IPrinterCallback interface,
     * generating a proxy if needed.
     */
    public static com.xcheng.printerservice.IPrinterCallback asInterface(android.os.IBinder obj)
    {
      if ((obj==null)) {
        return null;
      }
      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
      if (((iin!=null)&&(iin instanceof com.xcheng.printerservice.IPrinterCallback))) {
        return ((com.xcheng.printerservice.IPrinterCallback)iin);
      }
      return new com.xcheng.printerservice.IPrinterCallback.Stub.Proxy(obj);
    }
    @Override public android.os.IBinder asBinder()
    {
      return this;
    }
    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
    {
      java.lang.String descriptor = DESCRIPTOR;
      switch (code)
      {
        case INTERFACE_TRANSACTION:
        {
          reply.writeString(descriptor);
          return true;
        }
        case TRANSACTION_onException:
        {
          data.enforceInterface(descriptor);
          int _arg0;
          _arg0 = data.readInt();
          java.lang.String _arg1;
          _arg1 = data.readString();
          this.onException(_arg0, _arg1);
          return true;
        }
        case TRANSACTION_onLength:
        {
          data.enforceInterface(descriptor);
          long _arg0;
          _arg0 = data.readLong();
          long _arg1;
          _arg1 = data.readLong();
          this.onLength(_arg0, _arg1);
          return true;
        }
        case TRANSACTION_onComplete:
        {
          data.enforceInterface(descriptor);
          this.onComplete();
          return true;
        }
        default:
        {
          return super.onTransact(code, data, reply, flags);
        }
      }
    }
    private static class Proxy implements com.xcheng.printerservice.IPrinterCallback
    {
      private android.os.IBinder mRemote;
      Proxy(android.os.IBinder remote)
      {
        mRemote = remote;
      }
      @Override public android.os.IBinder asBinder()
      {
        return mRemote;
      }
      public java.lang.String getInterfaceDescriptor()
      {
        return DESCRIPTOR;
      }
      @Override public void onException(int code, java.lang.String msg) throws android.os.RemoteException
      {
        android.os.Parcel _data = android.os.Parcel.obtain();
        try {
          _data.writeInterfaceToken(DESCRIPTOR);
          _data.writeInt(code);
          _data.writeString(msg);
          boolean _status = mRemote.transact(Stub.TRANSACTION_onException, _data, null, android.os.IBinder.FLAG_ONEWAY);
          if (!_status && getDefaultImpl() != null) {
            getDefaultImpl().onException(code, msg);
            return;
          }
        }
        finally {
          _data.recycle();
        }
      }
      @Override public void onLength(long current, long total) throws android.os.RemoteException
      {
        android.os.Parcel _data = android.os.Parcel.obtain();
        try {
          _data.writeInterfaceToken(DESCRIPTOR);
          _data.writeLong(current);
          _data.writeLong(total);
          boolean _status = mRemote.transact(Stub.TRANSACTION_onLength, _data, null, android.os.IBinder.FLAG_ONEWAY);
          if (!_status && getDefaultImpl() != null) {
            getDefaultImpl().onLength(current, total);
            return;
          }
        }
        finally {
          _data.recycle();
        }
      }
      @Override public void onComplete() throws android.os.RemoteException
      {
        android.os.Parcel _data = android.os.Parcel.obtain();
        try {
          _data.writeInterfaceToken(DESCRIPTOR);
          boolean _status = mRemote.transact(Stub.TRANSACTION_onComplete, _data, null, android.os.IBinder.FLAG_ONEWAY);
          if (!_status && getDefaultImpl() != null) {
            getDefaultImpl().onComplete();
            return;
          }
        }
        finally {
          _data.recycle();
        }
      }
      public static com.xcheng.printerservice.IPrinterCallback sDefaultImpl;
    }
    static final int TRANSACTION_onException = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
    static final int TRANSACTION_onLength = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
    static final int TRANSACTION_onComplete = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
    public static boolean setDefaultImpl(com.xcheng.printerservice.IPrinterCallback impl) {
      // Only one user of this interface can use this function
      // at a time. This is a heuristic to detect if two different
      // users in the same process use this function.
      if (Stub.Proxy.sDefaultImpl != null) {
        throw new IllegalStateException("setDefaultImpl() called twice");
      }
      if (impl != null) {
        Stub.Proxy.sDefaultImpl = impl;
        return true;
      }
      return false;
    }
    public static com.xcheng.printerservice.IPrinterCallback getDefaultImpl() {
      return Stub.Proxy.sDefaultImpl;
    }
  }
  public void onException(int code, java.lang.String msg) throws android.os.RemoteException;
  public void onLength(long current, long total) throws android.os.RemoteException;
  public void onComplete() throws android.os.RemoteException;
}
