SQLiteCursorDriver.java (1910B)
1 /* 2 * Copyright (C) 2007 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 ** Modified to support SQLite extensions by the SQLite developers: 18 ** sqlite-dev@sqlite.org. 19 */ 20 21 package org.sqlite.database.sqlite; 22 23 import android.database.Cursor; 24 import org.sqlite.database.sqlite.SQLiteDatabase.CursorFactory; 25 26 /** 27 * A driver for SQLiteCursors that is used to create them and gets notified 28 * by the cursors it creates on significant events in their lifetimes. 29 */ 30 public interface SQLiteCursorDriver { 31 /** 32 * Executes the query returning a Cursor over the result set. 33 * 34 * @param factory The CursorFactory to use when creating the Cursors, or 35 * null if standard SQLiteCursors should be returned. 36 * @return a Cursor over the result set 37 */ 38 Cursor query(CursorFactory factory, String[] bindArgs); 39 40 /** 41 * Called by a SQLiteCursor when it is released. 42 */ 43 void cursorDeactivated(); 44 45 /** 46 * Called by a SQLiteCursor when it is requeried. 47 */ 48 void cursorRequeried(Cursor cursor); 49 50 /** 51 * Called by a SQLiteCursor when it it closed to destroy this object as well. 52 */ 53 void cursorClosed(); 54 55 /** 56 * Set new bind arguments. These will take effect in cursorRequeried(). 57 * @param bindArgs the new arguments 58 */ 59 public void setBindArguments(String[] bindArgs); 60 }