/***************************************************************************
                            KRFCDate.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_KRFCDate.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KRFCDate.h>

@implementation  KRFCDate

- (void *) qt
{
	return _qt;
}

- setQt: (void *) qt
{
	_qt = qt;
	return self;
}

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

- setAllocatedInObjcWorld: (BOOL) yn
{
	_allocatedInObjcWorld = yn;
	return self;
}


+ (long) parseDate: (NSString *)date
{
static qt_QString * _qstring_date = 0L;
	return (long) kde_KRFCDate_parseDate((qt_QString *) [date toQString: &_qstring_date]);
}

+ (long) parseDateISO8601: (NSString *)date
{
static qt_QString * _qstring_date = 0L;
	return (long) kde_KRFCDate_parseDateISO8601((qt_QString *) [date toQString: &_qstring_date]);
}

+ (int) localUTCOffset
{
	return (int) kde_KRFCDate_localUTCOffset();
}

+ (NSString *) rfc2822DateString: (long)utcTime utcOffset: (int)utcOffset
{
static qt_QCString * _qcstring = 0L;
	_qcstring = kde_KRFCDate_rfc2822DateString((long)utcTime, (int)utcOffset);
	return [NSString fromQCString: _qcstring];
}

+ (NSString *) rfc2822DateString: (long)utcTime
{
static qt_QCString * _qcstring = 0L;
	_qcstring = kde_KRFCDate_rfc2822DateString1((long)utcTime);
	return [NSString fromQCString: _qcstring];
}

@end
