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 17package android.database; 18 19import android.os.Bundle; 20import android.os.IBinder; 21import android.os.IInterface; 22import android.os.RemoteException; 23 24/** 25 * This interface provides a low-level way to pass bulk cursor data across 26 * both process and language boundaries. Application code should use the Cursor 27 * interface directly. 28 * 29 * {@hide} 30 */ 31public interface IBulkCursor extends IInterface { 32 /** 33 * Returns a BulkCursorWindow, which either has a reference to a shared 34 * memory segment with the rows, or an array of JSON strings. 35 */ 36 public CursorWindow getWindow(int startPos) throws RemoteException; 37 38 public void onMove(int position) throws RemoteException; 39 40 /** 41 * Returns the number of rows in the cursor. 42 * 43 * @return the number of rows in the cursor. 44 */ 45 public int count() throws RemoteException; 46 47 /** 48 * Returns a string array holding the names of all of the columns in the 49 * cursor in the order in which they were listed in the result. 50 * 51 * @return the names of the columns returned in this query. 52 */ 53 public String[] getColumnNames() throws RemoteException; 54 55 public void deactivate() throws RemoteException; 56 57 public void close() throws RemoteException; 58 59 public int requery(IContentObserver observer) throws RemoteException; 60 61 boolean getWantsAllOnMoveCalls() throws RemoteException; 62 63 Bundle getExtras() throws RemoteException; 64 65 Bundle respond(Bundle extras) throws RemoteException; 66 67 /* IPC constants */ 68 static final String descriptor = "android.content.IBulkCursor"; 69 70 static final int GET_CURSOR_WINDOW_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION; 71 static final int COUNT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 1; 72 static final int GET_COLUMN_NAMES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 2; 73 static final int DEACTIVATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 5; 74 static final int REQUERY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 6; 75 static final int ON_MOVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 7; 76 static final int WANTS_ON_MOVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 8; 77 static final int GET_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 9; 78 static final int RESPOND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 10; 79 static final int CLOSE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 11; 80} 81