/***************************************************************************
                            qt_QSqlDatabase.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_QSqlDatabase.h"
}

#include <qsqldatabase.h>
#include <qsqlindex.h>

class QSqlDatabaseBridge : public QSqlDatabase
{
public:
	~QSqlDatabaseBridge() {}
	QSqlDatabaseBridge(const QString& type, const QString& name, QObject* parent, const char* objname) : QSqlDatabase(type, name, parent, objname) {}
	void childEvent(QChildEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "childEvent", arg1, "QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "customEvent", arg1, "QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "timerEvent", arg1, "QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
};

void qt_del_QSqlDatabase( qt_QSqlDatabase* p ){
	delete (QSqlDatabaseBridge*) p;
}
int qt_QSqlDatabase_open( qt_QSqlDatabase* instPointer){
	return (int) ((QSqlDatabaseBridge*)instPointer)->open();
}
int qt_QSqlDatabase_open1( qt_QSqlDatabase* instPointer,qt_QString * user, qt_QString * password){
	return (int) ((QSqlDatabaseBridge*)instPointer)->open((QString&)* (QString*)user, (QString&)* (QString*)password);
}
void qt_QSqlDatabase_close( qt_QSqlDatabase* instPointer){
	((QSqlDatabaseBridge*)instPointer)->close();
	return;
}
int qt_QSqlDatabase_isOpen( qt_QSqlDatabase* instPointer){
	return (int) ((QSqlDatabaseBridge*)instPointer)->isOpen();
}
int qt_QSqlDatabase_isOpenError( qt_QSqlDatabase* instPointer){
	return (int) ((QSqlDatabaseBridge*)instPointer)->isOpenError();
}
qt_QStringList* qt_QSqlDatabase_tables( qt_QSqlDatabase* instPointer){
	return (qt_QStringList*)new QStringList(((QSqlDatabaseBridge*)instPointer)->tables());
}
qt_QSqlIndex* qt_QSqlDatabase_primaryIndex( qt_QSqlDatabase* instPointer,qt_QString * tablename){
	return (qt_QSqlIndex*)new QSqlIndex(((QSqlDatabaseBridge*)instPointer)->primaryIndex((QString&)* (QString*)tablename));
}
qt_QSqlRecord* qt_QSqlDatabase_record( qt_QSqlDatabase* instPointer,qt_QString * tablename){
	return (qt_QSqlRecord*)new QSqlRecord(((QSqlDatabaseBridge*)instPointer)->record((QString&)* (QString*)tablename));
}
qt_QSqlRecord* qt_QSqlDatabase_record1( qt_QSqlDatabase* instPointer,qt_QSqlQuery* query){
	return (qt_QSqlRecord*)new QSqlRecord(((QSqlDatabaseBridge*)instPointer)->record((QSqlQuery&)* (QSqlQuery*)query));
}
//qt_QSqlRecordInfo* qt_QSqlDatabase_recordInfo( qt_QSqlDatabase* instPointer,qt_QString * tablename){
//	return (qt_QSqlRecordInfo*)new QSqlRecordInfo(((QSqlDatabaseBridge*)instPointer)->recordInfo((QString&)* (QString*)tablename));
//}
//qt_QSqlRecordInfo* qt_QSqlDatabase_recordInfo1( qt_QSqlDatabase* instPointer,qt_QSqlQuery* query){
//	return (qt_QSqlRecordInfo*)new QSqlRecordInfo(((QSqlDatabaseBridge*)instPointer)->recordInfo((QSqlQuery&)* (QSqlQuery*)query));
//}
qt_QSqlQuery* qt_QSqlDatabase_exec( qt_QSqlDatabase* instPointer,qt_QString * query){
	return (qt_QSqlQuery*)new QSqlQuery(((QSqlDatabaseBridge*)instPointer)->exec((QString&)* (QString*)query));
}
qt_QSqlError* qt_QSqlDatabase_lastError( qt_QSqlDatabase* instPointer){
	return (qt_QSqlError*)new QSqlError(((QSqlDatabaseBridge*)instPointer)->lastError());
}
int qt_QSqlDatabase_transaction( qt_QSqlDatabase* instPointer){
	return (int) ((QSqlDatabaseBridge*)instPointer)->transaction();
}
int qt_QSqlDatabase_commit( qt_QSqlDatabase* instPointer){
	return (int) ((QSqlDatabaseBridge*)instPointer)->commit();
}
int qt_QSqlDatabase_rollback( qt_QSqlDatabase* instPointer){
	return (int) ((QSqlDatabaseBridge*)instPointer)->rollback();
}
void qt_QSqlDatabase_setDatabaseName( qt_QSqlDatabase* instPointer,qt_QString * name){
	((QSqlDatabaseBridge*)instPointer)->setDatabaseName((QString&)* (QString*)name);
	return;
}
void qt_QSqlDatabase_setUserName( qt_QSqlDatabase* instPointer,qt_QString * name){
	((QSqlDatabaseBridge*)instPointer)->setUserName((QString&)* (QString*)name);
	return;
}
void qt_QSqlDatabase_setPassword( qt_QSqlDatabase* instPointer,qt_QString * password){
	((QSqlDatabaseBridge*)instPointer)->setPassword((QString&)* (QString*)password);
	return;
}
void qt_QSqlDatabase_setHostName( qt_QSqlDatabase* instPointer,qt_QString * host){
	((QSqlDatabaseBridge*)instPointer)->setHostName((QString&)* (QString*)host);
	return;
}
void qt_QSqlDatabase_setPort( qt_QSqlDatabase* instPointer,int p){
	((QSqlDatabaseBridge*)instPointer)->setPort((int)p);
	return;
}
qt_QString * qt_QSqlDatabase_databaseName( qt_QSqlDatabase* instPointer){
	return (qt_QString *)new QString(((QSqlDatabaseBridge*)instPointer)->databaseName());
}
qt_QString * qt_QSqlDatabase_userName( qt_QSqlDatabase* instPointer){
	return (qt_QString *)new QString(((QSqlDatabaseBridge*)instPointer)->userName());
}
qt_QString * qt_QSqlDatabase_password( qt_QSqlDatabase* instPointer){
	return (qt_QString *)new QString(((QSqlDatabaseBridge*)instPointer)->password());
}
qt_QString * qt_QSqlDatabase_hostName( qt_QSqlDatabase* instPointer){
	return (qt_QString *)new QString(((QSqlDatabaseBridge*)instPointer)->hostName());
}
qt_QString * qt_QSqlDatabase_driverName( qt_QSqlDatabase* instPointer){
	return (qt_QString *)new QString(((QSqlDatabaseBridge*)instPointer)->driverName());
}
int qt_QSqlDatabase_port( qt_QSqlDatabase* instPointer){
	return (int) ((QSqlDatabaseBridge*)instPointer)->port();
}
qt_QSqlDriver* qt_QSqlDatabase_driver( qt_QSqlDatabase* instPointer){
	return (qt_QSqlDriver*) ((QSqlDatabaseBridge*)instPointer)->driver();
}
qt_QSqlDatabase* qt_QSqlDatabase_addDatabase( qt_QString * type, qt_QString * connectionName){
	return (qt_QSqlDatabase*) QSqlDatabaseBridge::addDatabase((QString&)* (QString*)type, (QString&)* (QString*)connectionName);
}
qt_QSqlDatabase* qt_QSqlDatabase_database( qt_QString * connectionName, int open){
	return (qt_QSqlDatabase*) QSqlDatabaseBridge::database((QString&)* (QString*)connectionName, (bool)open);
}
void qt_QSqlDatabase_removeDatabase( qt_QString * connectionName){
	QSqlDatabaseBridge::removeDatabase((QString&)* (QString*)connectionName);
	return;
}
int qt_QSqlDatabase_contains( qt_QString * connectionName){
	return (int) QSqlDatabaseBridge::contains((QString&)* (QString*)connectionName);
}
qt_QStringList* qt_QSqlDatabase_drivers( ){
	return (qt_QStringList*)new QStringList(QSqlDatabaseBridge::drivers());
}
void qt_QSqlDatabase_registerSqlDriver( qt_QString * name, qt_QSqlDriverCreatorBase* dcb){
	QSqlDatabaseBridge::registerSqlDriver((QString&)* (QString*)name, (QSqlDriverCreatorBase*)dcb);
	return;
}
qt_QSqlDatabase * qt_new_QSqlDatabase(qt_QString * type, qt_QString * name, qt_QObject * parent, char* objname){
	return (qt_QSqlDatabase *) new QSqlDatabaseBridge((QString&)* (QString*)type, (QString&)* (QString*)name, (QObject*)parent, (char*)objname);
}
