/***************************************************************************
                            qt_QSqlQuery.cpp -  description
                             -------------------
    begin                : Tue Nov 20 20:51:20 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Tue Nov 20 20:51:20 2001, using kalyptus 0.9.
 ***************************************************************************/

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

extern "C" {
#include "qt_QSqlQuery.h"
}

#include <qsqlquery.h>

class QSqlQueryBridge : public QSqlQuery
{
public:
	QSqlQueryBridge(QSqlResult* r) : QSqlQuery(r) {}
	QSqlQueryBridge(const QString& query, QSqlDatabase* db) : QSqlQuery(query, db) {}
	QSqlQueryBridge(const QSqlQuery& other) : QSqlQuery(other) {}
	~QSqlQueryBridge() {}
	void protected_beforeSeek() {
		QSqlQuery::beforeSeek();
		return;
	}
	void protected_afterSeek() {
		QSqlQuery::afterSeek();
		return;
	}
};

qt_QSqlQuery * qt_new_QSqlQuery(qt_QSqlResult* r){
	return (qt_QSqlQuery *) new QSqlQueryBridge((QSqlResult*)r);
}
qt_QSqlQuery * qt_new_QSqlQuery1(qt_QString * query, qt_QSqlDatabase* db){
	return (qt_QSqlQuery *) new QSqlQueryBridge((QString&)* (QString*)query, (QSqlDatabase*)db);
}
qt_QSqlQuery * qt_new_QSqlQuery2(qt_QSqlQuery* other){
	return (qt_QSqlQuery *) new QSqlQueryBridge((QSqlQuery&)* (QSqlQuery*)other);
}
void qt_del_QSqlQuery( qt_QSqlQuery* p ){
	delete (QSqlQueryBridge*) p;
}
int qt_QSqlQuery_isValid( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->isValid();
}
int qt_QSqlQuery_isActive( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->isActive();
}
int qt_QSqlQuery_isNull( qt_QSqlQuery* instPointer,int field){
	return (int) ((QSqlQueryBridge*)instPointer)->isNull((int)field);
}
int qt_QSqlQuery_at( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->at();
}
qt_QString * qt_QSqlQuery_lastQuery( qt_QSqlQuery* instPointer){
	return (qt_QString *)new QString(((QSqlQueryBridge*)instPointer)->lastQuery());
}
int qt_QSqlQuery_numRowsAffected( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->numRowsAffected();
}
qt_QSqlError* qt_QSqlQuery_lastError( qt_QSqlQuery* instPointer){
	return (qt_QSqlError*)new QSqlError(((QSqlQueryBridge*)instPointer)->lastError());
}
int qt_QSqlQuery_isSelect( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->isSelect();
}
int qt_QSqlQuery_size( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->size();
}
qt_QSqlDriver* qt_QSqlQuery_driver( qt_QSqlQuery* instPointer){
	return (qt_QSqlDriver*) ((QSqlQueryBridge*)instPointer)->driver();
}
qt_QSqlResult* qt_QSqlQuery_result( qt_QSqlQuery* instPointer){
	return (qt_QSqlResult*) ((QSqlQueryBridge*)instPointer)->result();
}
int qt_QSqlQuery_exec( qt_QSqlQuery* instPointer,qt_QString * query){
	return (int) ((QSqlQueryBridge*)instPointer)->exec((QString&)* (QString*)query);
}
qt_QVariant * qt_QSqlQuery_value( qt_QSqlQuery* instPointer,int i){
	return (qt_QVariant *)new QVariant(((QSqlQueryBridge*)instPointer)->value((int)i));
}
int qt_QSqlQuery_seek( qt_QSqlQuery* instPointer,int i, int relative){
	return (int) ((QSqlQueryBridge*)instPointer)->seek((int)i, (bool)relative);
}
int qt_QSqlQuery_next( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->next();
}
int qt_QSqlQuery_prev( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->prev();
}
int qt_QSqlQuery_first( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->first();
}
int qt_QSqlQuery_last( qt_QSqlQuery* instPointer){
	return (int) ((QSqlQueryBridge*)instPointer)->last();
}
void qt_QSqlQuery_beforeSeek( qt_QSqlQuery* instPointer){
	((QSqlQueryBridge*)instPointer)->protected_beforeSeek();
	return;
}
void qt_QSqlQuery_afterSeek( qt_QSqlQuery* instPointer){
	((QSqlQueryBridge*)instPointer)->protected_afterSeek();
	return;
}
