/***************************************************************************
                            QSqlCursor.java -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
***************************************************************************/

package org.kde.qt;

import java.util.*;
import java.lang.Error;

/**


 Definition of QSqlIndex class

 Created : 2000-11-03

 Copyright (C) 2000 Trolltech AS.  All rights reserved.

 This file is part of the sql module of the Qt GUI Toolkit.

 This file may be distributed under the terms of the Q Public License
 as defined by Trolltech AS of Norway and appearing in the file
 LICENSE.QPL included in the packaging of this file.

 This file may be distributed and/or modified under the terms of the
 GNU General Public License version 2 as published by the Free Software
 Foundation and appearing in the file LICENSE.GPL included in the
 packaging of this file.

 Licensees holding valid Qt Enterprise Edition licenses may use this
 file in accordance with the Qt Commercial License Agreement provided
 with the Software.

 This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

 See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
   information about Qt Commercial License Agreements.
 See http://www.trolltech.com/qpl/ for QPL licensing information.
 See http://www.trolltech.com/gpl/ for GPL licensing information.

 Contact info@trolltech.com if any conditions of this licensing are
 not clear to you.


 @short 
*
* Definition of QSqlIndex class
*
* Created : 2000-11-03
*
* Copyright (C) 2000 Trolltech AS.
*/
public class QSqlCursor extends QSqlRecord implements  QSqlQueryInterface {
	protected QSqlCursor(Class dummy){super((Class) null);}

	private native void newQSqlCursor( String name, boolean autopopulate, QSqlDatabase db);
	public QSqlCursor( String name, boolean autopopulate, QSqlDatabase db) {
		super((Class) null);
		newQSqlCursor( name, autopopulate, db);
	}
	public QSqlCursor( String name) {
		this( name, true, null);
	}
	private native void newQSqlCursor();
	public QSqlCursor() {
		super((Class) null);
		newQSqlCursor();
	}
	private native void newQSqlCursor( QSqlCursor other);
	public QSqlCursor( QSqlCursor other) {
		super((Class) null);
		newQSqlCursor( other);
	}
	protected native void finalize() throws InternalError;
	public native QVariant value( int i);
	public native QVariant value( String name);
	public native QSqlIndex primaryIndex( boolean prime);
	public native QSqlIndex index( String[] fieldNames);
	public native QSqlIndex index( String fieldName);
//	public native QSqlIndex index( String fieldName);
	public native void setPrimaryIndex( QSqlIndex idx);
	public native void append( QSqlFieldInfo fieldInfo);
	public native void insert( int pos, QSqlFieldInfo fieldInfo);
	public native void remove( int pos);
	public native void clear();
	public native void setGenerated( String name, boolean generated);
	public native void setGenerated( int i, boolean generated);
	public native QSqlRecord editBuffer( boolean copy);
	public native QSqlRecord editBuffer();
	public native QSqlRecord primeInsert();
	public native QSqlRecord primeUpdate();
	public native QSqlRecord primeDelete();
	public native int insert( boolean invalidate);
	public native int insert();
	public native int update( boolean invalidate);
	public native int update();
	public native int del( boolean invalidate);
	public native int del();
	public native void setMode( int flags);
	public native int mode();
	public native void setCalculated( String name, boolean calculated);
	public native boolean isCalculated( String name);
	public native void setTrimmed( String name, boolean trim);
	public native boolean isTrimmed( String name);
	public native boolean isReadOnly();
	public native boolean canInsert();
	public native boolean canUpdate();
	public native boolean canDelete();
	public native boolean select();
	public native boolean select( QSqlIndex sort);
	public native boolean select( QSqlIndex filter, QSqlIndex sort);
	public native boolean select( String filter, QSqlIndex sort);
	public native boolean select( String filter);
	public native void setSort( QSqlIndex sort);
	public native QSqlIndex sort();
	public native void setFilter( String filter);
	public native String filter();
	public native void setName( String name, boolean autopopulate);
	public native void setName( String name);
	public native String name();
	public native String toString( String prefix, String arg1);
	protected native void afterSeek();
	public native boolean exec( String sql);
	protected native QVariant calculateField( String name);
	protected native int update( String filter, boolean invalidate);
	protected native int update( String filter);
	protected native int del( String filter, boolean invalidate);
	protected native int del( String filter);
	protected native String toString( String prefix, QSqlField field, String fieldSep);
	protected native String toString( QSqlRecord rec, String prefix, String fieldSep, String sep);
	protected native String toString( QSqlIndex i, QSqlRecord rec, String prefix, String fieldSep, String sep);

	public native boolean isValid();
	public native boolean isActive();
//	public native boolean isNull( int field);
	public native int at();
	public native String lastQuery();
	public native int numRowsAffected();
	public native QSqlError lastError();
	public native boolean isSelect();
	public native int size();
	public native QSqlDriver driver();
	public native QSqlResult result();
	public native boolean seek( int i, boolean relative);
	public native boolean seek( int i);
	public native boolean next();
	public native boolean prev();
	public native boolean first();
	public native boolean last();
	protected native void beforeSeek();

	public static final int ReadOnly = 0;
	public static final int Insert = 1;
	public static final int Update = 2;
	public static final int Delete = 4;
	public static final int Writable = 7;
}
