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.Bundle;
     20 import android.os.IBinder;
     21 import android.os.IInterface;
     22 import 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  */
     31 public interface IBulkCursor extends IInterface  {
     32     /**
     33      * Gets a cursor window that contains the specified position.
     34      * The window will contain a range of rows around the specified position.
     35      */
     36     public CursorWindow getWindow(int position) throws RemoteException;
     37 
     38     /**
     39      * Notifies the cursor that the position has changed.
     40      * Only called when {@link #getWantsAllOnMoveCalls()} returns true.
     41      *
     42      * @param position The new position
     43      */
     44     public void onMove(int position) throws RemoteException;
     45 
     46     public void deactivate() throws RemoteException;
     47 
     48     public void close() throws RemoteException;
     49 
     50     public int requery(IContentObserver observer) throws RemoteException;
     51 
     52     Bundle getExtras() throws RemoteException;
     53 
     54     Bundle respond(Bundle extras) throws RemoteException;
     55 
     56     /* IPC constants */
     57     static final String descriptor = "android.content.IBulkCursor";
     58 
     59     static final int GET_CURSOR_WINDOW_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION;
     60     static final int DEACTIVATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 1;
     61     static final int REQUERY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 2;
     62     static final int ON_MOVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 3;
     63     static final int GET_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 4;
     64     static final int RESPOND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 5;
     65     static final int CLOSE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 6;
     66 }
     67