Home | History | Annotate | Download | only in database
      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      * Returns a BulkCursorWindow, which either has a reference to a shared
     36      * memory segment with the rows, or an array of JSON strings.
     37      */
     38     public CursorWindow getWindow(int startPos) throws RemoteException;
     39 
     40     public void onMove(int position) throws RemoteException;
     41 
     42     /**
     43      * Returns the number of rows in the cursor.
     44      *
     45      * @return the number of rows in the cursor.
     46      */
     47     public int count() throws RemoteException;
     48 
     49     /**
     50      * Returns a string array holding the names of all of the columns in the
     51      * cursor in the order in which they were listed in the result.
     52      *
     53      * @return the names of the columns returned in this query.
     54      */
     55     public String[] getColumnNames() throws RemoteException;
     56 
     57     public boolean updateRows(Map<? extends Long, ? extends Map<String, Object>> values) throws RemoteException;
     58 
     59     public boolean deleteRow(int position) throws RemoteException;
     60 
     61     public void deactivate() throws RemoteException;
     62 
     63     public void close() throws RemoteException;
     64 
     65     public int requery(IContentObserver observer, CursorWindow window) throws RemoteException;
     66 
     67     boolean getWantsAllOnMoveCalls() throws RemoteException;
     68 
     69     Bundle getExtras() throws RemoteException;
     70 
     71     Bundle respond(Bundle extras) throws RemoteException;
     72 
     73     /* IPC constants */
     74     static final String descriptor = "android.content.IBulkCursor";
     75 
     76     static final int GET_CURSOR_WINDOW_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION;
     77     static final int COUNT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 1;
     78     static final int GET_COLUMN_NAMES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 2;
     79     static final int UPDATE_ROWS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 3;
     80     static final int DELETE_ROW_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 4;
     81     static final int DEACTIVATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 5;
     82     static final int REQUERY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 6;
     83     static final int ON_MOVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 7;
     84     static final int WANTS_ON_MOVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 8;
     85     static final int GET_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 9;
     86     static final int RESPOND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 10;
     87     static final int CLOSE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 11;
     88 }
     89