/***************************************************************************
                            qt_QDateTime.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_QDateTime.h"
}

#include <qdatetime.h>

class QDateTimeBridge : public QDateTime
{
public:
	QDateTimeBridge() : QDateTime() {}
	QDateTimeBridge(const QDate& arg1) : QDateTime(arg1) {}
	QDateTimeBridge(const QDate& arg1, const QTime& arg2) : QDateTime(arg1, arg2) {}
};

qt_QDateTime * qt_new_QDateTime(){
	return (qt_QDateTime *) new QDateTimeBridge();
}
qt_QDateTime * qt_new_QDateTime1(qt_QDate * arg1){
	return (qt_QDateTime *) new QDateTimeBridge((QDate&)* (QDate*)arg1);
}
qt_QDateTime * qt_new_QDateTime2(qt_QDate * arg1, qt_QTime * arg2){
	return (qt_QDateTime *) new QDateTimeBridge((QDate&)* (QDate*)arg1, (QTime&)* (QTime*)arg2);
}
int qt_QDateTime_isNull( qt_QDateTime* instPointer){
	return (int) ((QDateTimeBridge*)instPointer)->isNull();
}
int qt_QDateTime_isValid( qt_QDateTime* instPointer){
	return (int) ((QDateTimeBridge*)instPointer)->isValid();
}
qt_QDate * qt_QDateTime_date( qt_QDateTime* instPointer){
	QDate _d= ((QDateTimeBridge*)instPointer)->date();
	return (qt_QDate *)new QDate(_d.year(),_d.month(),_d.day());
}
qt_QTime * qt_QDateTime_time( qt_QDateTime* instPointer){
	QTime _t= ((QDateTimeBridge*)instPointer)->time();
	return (qt_QTime *)new QTime(_t.hour(),_t.minute(),_t.second(),_t.msec());
}
void qt_QDateTime_setDate( qt_QDateTime* instPointer,qt_QDate * date){
	((QDateTimeBridge*)instPointer)->setDate((QDate&)* (QDate*)date);
	return;
}
void qt_QDateTime_setTime( qt_QDateTime* instPointer,qt_QTime * time){
	((QDateTimeBridge*)instPointer)->setTime((QTime&)* (QTime*)time);
	return;
}
void qt_QDateTime_setTime_t( qt_QDateTime* instPointer,unsigned int secsSince1Jan1970UTC){
	((QDateTimeBridge*)instPointer)->setTime_t((uint)secsSince1Jan1970UTC);
	return;
}
qt_QString * qt_QDateTime_toString( qt_QDateTime* instPointer,int f){
	return (qt_QString *)new QString(((QDateTimeBridge*)instPointer)->toString((Qt::DateFormat)f));
}
qt_QString * qt_QDateTime_toString1( qt_QDateTime* instPointer,qt_QString * format){
	return (qt_QString *)new QString(((QDateTimeBridge*)instPointer)->toString((QString&)* (QString*)format));
}
qt_QDateTime * qt_QDateTime_addDays( qt_QDateTime* instPointer,int days){
	QDateTime _dt= ((QDateTimeBridge*)instPointer)->addDays((int)days);
	return (qt_QDateTime *)new QDateTime (_dt.date(),_dt.time());
}
qt_QDateTime * qt_QDateTime_addMonths( qt_QDateTime* instPointer,int months){
	QDateTime _dt= ((QDateTimeBridge*)instPointer)->addMonths((int)months);
	return (qt_QDateTime *)new QDateTime (_dt.date(),_dt.time());
}
qt_QDateTime * qt_QDateTime_addYears( qt_QDateTime* instPointer,int years){
	QDateTime _dt= ((QDateTimeBridge*)instPointer)->addYears((int)years);
	return (qt_QDateTime *)new QDateTime (_dt.date(),_dt.time());
}
qt_QDateTime * qt_QDateTime_addSecs( qt_QDateTime* instPointer,int secs){
	QDateTime _dt= ((QDateTimeBridge*)instPointer)->addSecs((int)secs);
	return (qt_QDateTime *)new QDateTime (_dt.date(),_dt.time());
}
int qt_QDateTime_daysTo( qt_QDateTime* instPointer,qt_QDateTime * arg1){
	return (int) ((QDateTimeBridge*)instPointer)->daysTo((QDateTime&)* (QDateTime*)arg1);
}
int qt_QDateTime_secsTo( qt_QDateTime* instPointer,qt_QDateTime * arg1){
	return (int) ((QDateTimeBridge*)instPointer)->secsTo((QDateTime&)* (QDateTime*)arg1);
}
qt_QDateTime * qt_QDateTime_currentDateTime( ){
	QDateTime _dt= QDateTimeBridge::currentDateTime();
	return (qt_QDateTime *)new QDateTime (_dt.date(),_dt.time());
}
qt_QDateTime * qt_QDateTime_fromString( qt_QString * s, int f){
	QDateTime _dt= QDateTimeBridge::fromString((QString&)* (QString*)s, (Qt::DateFormat)f);
	return (qt_QDateTime *)new QDateTime (_dt.date(),_dt.time());
}
