/***************************************************************************
                            KDatePicker.m -  description
                             -------------------
    begin                : Fri Mar  8 13:55:08 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar  8 13:55:08 2002, 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.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <kdec/kde_KDatePicker.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KDatePicker.h>

@implementation  KDatePicker


- initWithWidget: (QWidget *)parent date: (NSDate *)arg1 name: (NSString *)name
{
static qt_QDate * _qdate_arg1 = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KDatePicker((qt_QWidget *) [parent qt], (qt_QDate *) [arg1 toQDate: (qt_QDate **)&_qdate_arg1], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- init
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KDatePicker(0, 0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parentWidget: YES] == nil) {
			kde_del_KDatePicker((kde_KDatePicker *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (QSize*) sizeHint
{
	return (QSize*) [QtSupport objectForQtKey: kde_KDatePicker_sizeHint((kde_KDatePicker *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (BOOL) setDate: (NSDate *)arg1
{
static qt_QDate * _qdate_arg1 = 0L;
	return (BOOL) kde_KDatePicker_setDate((kde_KDatePicker *)[self qt], (qt_QDate *) [arg1 toQDate: (qt_QDate **)&_qdate_arg1]);
}

- (NSDate *) getDate
{
static qt_QDate * _qdate = 0L;
	_qdate = kde_KDatePicker_getDate((kde_KDatePicker *)[self qt]);
	return (NSDate *) [[NSDate alloc] initWithQDate: _qdate];
}

- setEnabled: (BOOL)arg1
{
	kde_KDatePicker_setEnabled((kde_KDatePicker *)[self qt], (int)arg1);
	return self;
}

- setFontSize: (int)arg1
{
	kde_KDatePicker_setFontSize((kde_KDatePicker *)[self qt], (int)arg1);
	return self;
}

- (int) fontSize
{
	return (int) kde_KDatePicker_fontSize((kde_KDatePicker *)[self qt]);
}

- dateChangedSlot: (NSDate *)arg1
{
static qt_QDate * _qdate_arg1 = 0L;
	kde_KDatePicker_dateChangedSlot((kde_KDatePicker *)[self qt], (qt_QDate *) [arg1 toQDate: (qt_QDate **)&_qdate_arg1]);
	return self;
}

- tableClickedSlot
{
	kde_KDatePicker_tableClickedSlot((kde_KDatePicker *)[self qt]);
	return self;
}

- monthForwardClicked
{
	kde_KDatePicker_monthForwardClicked((kde_KDatePicker *)[self qt]);
	return self;
}

- monthBackwardClicked
{
	kde_KDatePicker_monthBackwardClicked((kde_KDatePicker *)[self qt]);
	return self;
}

- yearForwardClicked
{
	kde_KDatePicker_yearForwardClicked((kde_KDatePicker *)[self qt]);
	return self;
}

- yearBackwardClicked
{
	kde_KDatePicker_yearBackwardClicked((kde_KDatePicker *)[self qt]);
	return self;
}

- selectMonthClicked
{
	kde_KDatePicker_selectMonthClicked((kde_KDatePicker *)[self qt]);
	return self;
}

- selectYearClicked
{
	kde_KDatePicker_selectYearClicked((kde_KDatePicker *)[self qt]);
	return self;
}

- lineEnterPressed
{
	kde_KDatePicker_lineEnterPressed((kde_KDatePicker *)[self qt]);
	return self;
}

@end
