1 /* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.database; 18 19 import android.os.RemoteException; 20 import android.os.IBinder; 21 import android.os.IInterface; 22 import android.os.Bundle; 23 24 import java.util.Map; 25 26 /** 27 * This interface provides a low-level way to pass bulk cursor data across 28 * both process and language boundries. Application code should use the Cursor 29 * interface directly. 30 * 31 * {@hide} 32 */ 33 public interface IBulkCursor extends IInterface 34 { 35 /** 36 * Returns a BulkCursorWindow, which either has a reference to a shared 37 * memory segment with the rows, or an array of JSON strings. 38 */ getWindow(int startPos)39 public CursorWindow getWindow(int startPos) throws RemoteException; 40 onMove(int position)41 public void onMove(int position) throws RemoteException; 42 43 /** 44 * Returns the number of rows in the cursor. 45 * 46 * @return the number of rows in the cursor. 47 */ count()48 public int count() throws RemoteException; 49 50 /** 51 * Returns a string array holding the names of all of the columns in the 52 * cursor in the order in which they were listed in the result. 53 * 54 * @return the names of the columns returned in this query. 55 */ getColumnNames()56 public String[] getColumnNames() throws RemoteException; 57 updateRows(Map<? extends Long, ? extends Map<String, Object>> values)58 public boolean updateRows(Map<? extends Long, ? extends Map<String, Object>> values) throws RemoteException; 59 deleteRow(int position)60 public boolean deleteRow(int position) throws RemoteException; 61 deactivate()62 public void deactivate() throws RemoteException; 63 close()64 public void close() throws RemoteException; 65 requery(IContentObserver observer, CursorWindow window)66 public int requery(IContentObserver observer, CursorWindow window) throws RemoteException; 67 getWantsAllOnMoveCalls()68 boolean getWantsAllOnMoveCalls() throws RemoteException; 69 getExtras()70 Bundle getExtras() throws RemoteException; 71 respond(Bundle extras)72 Bundle respond(Bundle extras) throws RemoteException; 73 74 /* IPC constants */ 75 static final String descriptor = "android.content.IBulkCursor"; 76 77 static final int GET_CURSOR_WINDOW_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION; 78 static final int COUNT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 1; 79 static final int GET_COLUMN_NAMES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 2; 80 static final int UPDATE_ROWS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 3; 81 static final int DELETE_ROW_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 4; 82 static final int DEACTIVATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 5; 83 static final int REQUERY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 6; 84 static final int ON_MOVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 7; 85 static final int WANTS_ON_MOVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 8; 86 static final int GET_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 9; 87 static final int RESPOND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 10; 88 static final int CLOSE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 11; 89 } 90 91