1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/thirdparty/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,147 @@ 1.4 +/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +package com.googlecode.eyesfree.braille.selfbraille; 1.10 + 1.11 +/** 1.12 + * Interface for a client to control braille output for a part of the 1.13 + * accessibility node tree. 1.14 + */ 1.15 +public interface ISelfBrailleService extends android.os.IInterface { 1.16 + /** Local-side IPC implementation stub class. */ 1.17 + public static abstract class Stub extends android.os.Binder implements 1.18 + com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService { 1.19 + private static final java.lang.String DESCRIPTOR = "com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService"; 1.20 + 1.21 + /** Construct the stub at attach it to the interface. */ 1.22 + public Stub() { 1.23 + this.attachInterface(this, DESCRIPTOR); 1.24 + } 1.25 + 1.26 + /** 1.27 + * Cast an IBinder object into an 1.28 + * com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService 1.29 + * interface, generating a proxy if needed. 1.30 + */ 1.31 + public static com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService asInterface( 1.32 + android.os.IBinder obj) { 1.33 + if ((obj == null)) { 1.34 + return null; 1.35 + } 1.36 + android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); 1.37 + if (((iin != null) && (iin instanceof com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService))) { 1.38 + return ((com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService) iin); 1.39 + } 1.40 + return new com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService.Stub.Proxy( 1.41 + obj); 1.42 + } 1.43 + 1.44 + @Override 1.45 + public android.os.IBinder asBinder() { 1.46 + return this; 1.47 + } 1.48 + 1.49 + @Override 1.50 + public boolean onTransact(int code, android.os.Parcel data, 1.51 + android.os.Parcel reply, int flags) 1.52 + throws android.os.RemoteException { 1.53 + switch (code) { 1.54 + case INTERFACE_TRANSACTION: { 1.55 + reply.writeString(DESCRIPTOR); 1.56 + return true; 1.57 + } 1.58 + case TRANSACTION_write: { 1.59 + data.enforceInterface(DESCRIPTOR); 1.60 + android.os.IBinder _arg0; 1.61 + _arg0 = data.readStrongBinder(); 1.62 + com.googlecode.eyesfree.braille.selfbraille.WriteData _arg1; 1.63 + if ((0 != data.readInt())) { 1.64 + _arg1 = com.googlecode.eyesfree.braille.selfbraille.WriteData.CREATOR 1.65 + .createFromParcel(data); 1.66 + } else { 1.67 + _arg1 = null; 1.68 + } 1.69 + this.write(_arg0, _arg1); 1.70 + reply.writeNoException(); 1.71 + return true; 1.72 + } 1.73 + case TRANSACTION_disconnect: { 1.74 + data.enforceInterface(DESCRIPTOR); 1.75 + android.os.IBinder _arg0; 1.76 + _arg0 = data.readStrongBinder(); 1.77 + this.disconnect(_arg0); 1.78 + return true; 1.79 + } 1.80 + } 1.81 + return super.onTransact(code, data, reply, flags); 1.82 + } 1.83 + 1.84 + private static class Proxy implements 1.85 + com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService { 1.86 + private android.os.IBinder mRemote; 1.87 + 1.88 + Proxy(android.os.IBinder remote) { 1.89 + mRemote = remote; 1.90 + } 1.91 + 1.92 + @Override 1.93 + public android.os.IBinder asBinder() { 1.94 + return mRemote; 1.95 + } 1.96 + 1.97 + public java.lang.String getInterfaceDescriptor() { 1.98 + return DESCRIPTOR; 1.99 + } 1.100 + 1.101 + @Override 1.102 + public void write( 1.103 + android.os.IBinder clientToken, 1.104 + com.googlecode.eyesfree.braille.selfbraille.WriteData writeData) 1.105 + throws android.os.RemoteException { 1.106 + android.os.Parcel _data = android.os.Parcel.obtain(); 1.107 + android.os.Parcel _reply = android.os.Parcel.obtain(); 1.108 + try { 1.109 + _data.writeInterfaceToken(DESCRIPTOR); 1.110 + _data.writeStrongBinder(clientToken); 1.111 + if ((writeData != null)) { 1.112 + _data.writeInt(1); 1.113 + writeData.writeToParcel(_data, 0); 1.114 + } else { 1.115 + _data.writeInt(0); 1.116 + } 1.117 + mRemote.transact(Stub.TRANSACTION_write, _data, _reply, 0); 1.118 + _reply.readException(); 1.119 + } finally { 1.120 + _reply.recycle(); 1.121 + _data.recycle(); 1.122 + } 1.123 + } 1.124 + 1.125 + @Override 1.126 + public void disconnect(android.os.IBinder clientToken) 1.127 + throws android.os.RemoteException { 1.128 + android.os.Parcel _data = android.os.Parcel.obtain(); 1.129 + try { 1.130 + _data.writeInterfaceToken(DESCRIPTOR); 1.131 + _data.writeStrongBinder(clientToken); 1.132 + mRemote.transact(Stub.TRANSACTION_disconnect, _data, null, 1.133 + android.os.IBinder.FLAG_ONEWAY); 1.134 + } finally { 1.135 + _data.recycle(); 1.136 + } 1.137 + } 1.138 + } 1.139 + 1.140 + static final int TRANSACTION_write = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); 1.141 + static final int TRANSACTION_disconnect = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); 1.142 + } 1.143 + 1.144 + public void write(android.os.IBinder clientToken, 1.145 + com.googlecode.eyesfree.braille.selfbraille.WriteData writeData) 1.146 + throws android.os.RemoteException; 1.147 + 1.148 + public void disconnect(android.os.IBinder clientToken) 1.149 + throws android.os.RemoteException; 1.150 +}