/***************************************************************************
                            QDataTable.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;

/**
 See {@link QDataTableSignals} for signals emitted by QDataTable.

 See {@link QDataTableEventHandling} for event handlers to override in subclasses of QDataTable.

*/
public class QDataTable extends QTable  {
	protected QDataTable(Class dummy){super((Class) null);}

	private native void newQDataTable( QWidget parent, String name);
	public QDataTable( QWidget parent, String name) {
		super((Class) null);
		newQDataTable( parent, name);
	}
	private native void newQDataTable();
	public QDataTable() {
		super((Class) null);
		newQDataTable();
	}
	private native void newQDataTable( QSqlCursor cursor, boolean autoPopulate, QWidget parent, String name);
	public QDataTable( QSqlCursor cursor, boolean autoPopulate, QWidget parent, String name) {
		super((Class) null);
		newQDataTable( cursor, autoPopulate, parent, name);
	}
	private native void newQDataTable( QSqlCursor cursor);
	public QDataTable( QSqlCursor cursor) {
		super((Class) null);
		newQDataTable( cursor);
	}
	protected native void finalize() throws InternalError;
	public native void addColumn( String fieldName, String label, int width, QIconSet iconset);
	public void addColumn( String fieldName, String label, int width) {
		addColumn(fieldName, label, width, new QIconSet());
		return;
	}
	public void addColumn( String fieldName, String label) {
		addColumn(fieldName, label, -1, new QIconSet());
		return;
	}
	public native void addColumn( String fieldName);
	public native void removeColumn( int col);
	public native void setColumn( int col, String fieldName, String label, int width, QIconSet iconset);
	public void setColumn( int col, String fieldName, String label, int width) {
		setColumn(col, fieldName, label, width, new QIconSet());
		return;
	}
	public void setColumn( int col, String fieldName, String label) {
		setColumn(col, fieldName, label, -1, new QIconSet());
		return;
	}
	public native void setColumn( int col, String fieldName);
	public native String nullText();
	public native String trueText();
	public native String falseText();
	public native int dateFormat();
	public native boolean confirmEdits();
	public native boolean confirmInsert();
	public native boolean confirmUpdate();
	public native boolean confirmDelete();
	public native boolean confirmCancels();
	public native boolean autoDelete();
	public native boolean autoEdit();
	public native String filter();
	public native ArrayList sort();
	public native void setSqlCursor( QSqlCursor cursor, boolean autoPopulate, boolean autoDelete);
	public void setSqlCursor( QSqlCursor cursor, boolean autoPopulate) {
		setSqlCursor(cursor, autoPopulate, false);
		return;
	}
	public void setSqlCursor( QSqlCursor cursor) {
		setSqlCursor(cursor, false, false);
		return;
	}
	public native void setSqlCursor();
	public native QSqlCursor sqlCursor();
	public native void setNullText( String nullText);
	public native void setTrueText( String trueText);
	public native void setFalseText( String falseText);
	public native void setDateFormat( int f);
	public native void setConfirmEdits( boolean confirm);
	public native void setConfirmInsert( boolean confirm);
	public native void setConfirmUpdate( boolean confirm);
	public native void setConfirmDelete( boolean confirm);
	public native void setConfirmCancels( boolean confirm);
	public native void setAutoDelete( boolean enable);
	public native void setAutoEdit( boolean autoEdit);
	public native void setFilter( String filter);
	public native void setSort( String[] sort);
	public native void setSort( QSqlIndex sort);
	public native void refresh( int mode);
	public native void sortColumn( int col, boolean ascending, boolean wholeRows);
	public void sortColumn( int col, boolean ascending) {
		sortColumn(col, ascending, false);
		return;
	}
	public native void sortColumn( int col);
	public native String text( int row, int col);
	public native QVariant value( int row, int col);
	public native QSqlRecord currentRecord();
	public native void installEditorFactory( QSqlEditorFactory f);
	public native void installPropertyMap( QSqlPropertyMap m);
	public native int numCols();
	public native int numRows();
	public native void setNumCols( int c);
	public native void setNumRows( int r);
	public native boolean findBuffer( QSqlIndex idx, int atHint);
	public native boolean findBuffer( QSqlIndex idx);
	public native void find( String str, boolean caseSensitive, boolean backwards);
	public native void sortAscending( int col);
	public native void sortDescending( int col);
	public native void refresh();
	public native void setColumnWidth( int col, int w);
	protected native boolean insertCurrent();
	protected native boolean updateCurrent();
	protected native boolean deleteCurrent();
	protected native int confirmEdit( int m);
	protected native int confirmCancel( int m);
	protected native void handleError( QSqlError e);
	protected native boolean beginInsert();
	protected native QWidget beginUpdate( int row, int col, boolean replace);
	public native boolean eventFilter( QObject o, QEvent e);
	protected native void endEdit( int row, int col, boolean accept, boolean replace);
	protected native QWidget createEditor( int row, int col, boolean initFromCell);
	protected native void activateNextCell();
	protected native int indexOf( int i);
	protected native void reset();
	protected native void setSize( QSqlCursor sql);
	protected native void repaintCell( int row, int col);
	public native void paintCell( QPainter p, int row, int col, QRect cr, boolean selected, QColorGroup cg);
	protected native void paintField( QPainter p, QSqlField field, QRect cr, boolean selected);
	protected native int fieldAlignment( QSqlField field);
	protected native void columnClicked( int col);
	protected native void resizeData( int len);
	public native QTableItem item( int row, int col);
	public native void setItem( int row, int col, QTableItem item);
	public native void clearCell( int row, int col);
	public native void setPixmap( int row, int col, QPixmap pix);
	public native void takeItem( QTableItem i);
	public static final int RefreshData = 1;
	public static final int RefreshColumns = 2;
	public static final int RefreshAll = 3;
}
