/***************************************************************************
                            qt_QDate.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_QDate.h"
}

#include <qdatetime.h>

class QDateBridge : public QDate
{
public:
	QDateBridge() : QDate() {}
	QDateBridge(int y, int m, int d) : QDate(y, m, d) {}
};

qt_QDate * qt_new_QDate(){
	return (qt_QDate *) new QDateBridge();
}
qt_QDate * qt_new_QDate1(int y, int m, int d){
	return (qt_QDate *) new QDateBridge((int)y, (int)m, (int)d);
}
int qt_QDate_isNull( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->isNull();
}
int qt_QDate_isValid( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->isValid();
}
int qt_QDate_year( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->year();
}
int qt_QDate_month( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->month();
}
int qt_QDate_day( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->day();
}
int qt_QDate_dayOfWeek( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->dayOfWeek();
}
int qt_QDate_dayOfYear( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->dayOfYear();
}
int qt_QDate_daysInMonth( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->daysInMonth();
}
int qt_QDate_daysInYear( qt_QDate* instPointer){
	return (int) ((QDateBridge*)instPointer)->daysInYear();
}
qt_QString * qt_QDate_toString( qt_QDate* instPointer,int f){
	return (qt_QString *)new QString(((QDateBridge*)instPointer)->toString((Qt::DateFormat)f));
}
qt_QString * qt_QDate_toString1( qt_QDate* instPointer,qt_QString * format){
	return (qt_QString *)new QString(((QDateBridge*)instPointer)->toString((QString&)* (QString*)format));
}
int qt_QDate_setYMD( qt_QDate* instPointer,int y, int m, int d){
	return (int) ((QDateBridge*)instPointer)->setYMD((int)y, (int)m, (int)d);
}
qt_QDate * qt_QDate_addDays( qt_QDate* instPointer,int days){
	QDate _d= ((QDateBridge*)instPointer)->addDays((int)days);
	return (qt_QDate *)new QDate(_d.year(),_d.month(),_d.day());
}
qt_QDate * qt_QDate_addMonths( qt_QDate* instPointer,int months){
	QDate _d= ((QDateBridge*)instPointer)->addMonths((int)months);
	return (qt_QDate *)new QDate(_d.year(),_d.month(),_d.day());
}
qt_QDate * qt_QDate_addYears( qt_QDate* instPointer,int years){
	QDate _d= ((QDateBridge*)instPointer)->addYears((int)years);
	return (qt_QDate *)new QDate(_d.year(),_d.month(),_d.day());
}
int qt_QDate_daysTo( qt_QDate* instPointer,qt_QDate * arg1){
	return (int) ((QDateBridge*)instPointer)->daysTo((QDate&)* (QDate*)arg1);
}
qt_QString * qt_QDate_monthName( int month){
	return (qt_QString *)new QString(QDateBridge::monthName((int)month));
}
qt_QString * qt_QDate_dayName( int weekday){
	return (qt_QString *)new QString(QDateBridge::dayName((int)weekday));
}
qt_QString * qt_QDate_shortMonthName( int month){
	return (qt_QString *)new QString(QDateBridge::shortMonthName((int)month));
}
qt_QString * qt_QDate_shortDayName( int weekday){
	return (qt_QString *)new QString(QDateBridge::shortDayName((int)weekday));
}
qt_QString * qt_QDate_longMonthName( int month){
	return (qt_QString *)new QString(QDateBridge::longMonthName((int)month));
}
qt_QString * qt_QDate_longDayName( int weekday){
	return (qt_QString *)new QString(QDateBridge::longDayName((int)weekday));
}
qt_QDate * qt_QDate_currentDate( ){
	QDate _d= QDateBridge::currentDate();
	return (qt_QDate *)new QDate(_d.year(),_d.month(),_d.day());
}
qt_QDate * qt_QDate_fromString( qt_QString * s, int f){
	QDate _d= QDateBridge::fromString((QString&)* (QString*)s, (Qt::DateFormat)f);
	return (qt_QDate *)new QDate(_d.year(),_d.month(),_d.day());
}
int qt_QDate_isValid1( int y, int m, int d){
	return (int) QDateBridge::isValid((int)y, (int)m, (int)d);
}
int qt_QDate_leapYear( int year){
	return (int) QDateBridge::leapYear((int)year);
}
unsigned int qt_QDate_gregorianToJulian( int y, int m, int d){
	return (unsigned int) QDateBridge::gregorianToJulian((int)y, (int)m, (int)d);
}
void qt_QDate_julianToGregorian( unsigned int jd, int y, int m, int d){
	QDateBridge::julianToGregorian((uint)jd, (int&)y, (int&)m, (int&)d);
	return;
}
