/***************************************************************************
                            QDropEvent.m -  description
                             -------------------
    begin                : Wed Nov 21 12:08:37 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 12:08:37 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.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <qtc/qt_QDropEvent.h>
#include <qtc/qt_QMimeSource.h>
#include <qtobjc/QDropEvent.h>
#include <qtobjc/QPoint.h>

@implementation  QDropEvent


- initWithPoint: (QPoint*)pos typ: (int)typ
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QDropEvent((qt_QPoint*) [pos qt], (int)typ)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithPoint: (QPoint*)pos 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QDropEvent((qt_QPoint*) [pos qt], [QDropEvent Drop])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (QPoint*) pos
{
	return (QPoint*) [QtSupport objectForQtKey: qt_QDropEvent_pos((qt_QDropEvent *)[self qt]) withClass: [QPoint class] allocatedInObjcWorld: YES];
}

- (BOOL) isAccepted
{
	return (BOOL) qt_QDropEvent_isAccepted((qt_QDropEvent *)[self qt]);
}

- accept: (BOOL)y
{
	qt_QDropEvent_accept((qt_QDropEvent *)[self qt], (int)y);
	return self;
}

- accept
{
	qt_QDropEvent_accept((qt_QDropEvent *)[self qt], 1);
	return self;
}

- ignore
{
	qt_QDropEvent_ignore((qt_QDropEvent *)[self qt]);
	return self;
}

- (BOOL) isActionAccepted
{
	return (BOOL) qt_QDropEvent_isActionAccepted((qt_QDropEvent *)[self qt]);
}

- acceptAction: (BOOL)y
{
	qt_QDropEvent_acceptAction((qt_QDropEvent *)[self qt], (int)y);
	return self;
}

- acceptAction
{
	qt_QDropEvent_acceptAction((qt_QDropEvent *)[self qt], 1);
	return self;
}

- setAction: (int)a
{
	qt_QDropEvent_setAction((qt_QDropEvent *)[self qt], (int)a);
	return self;
}

- (int) action
{
	return (int) qt_QDropEvent_action((qt_QDropEvent *)[self qt]);
}

- (QWidget*) source
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QDropEvent_source((qt_QDropEvent *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- (NSString *) format: (int)n
{
	return (NSString *) [NSString stringWithCString: qt_QDropEvent_format((qt_QDropEvent *)[self qt], (int)n)];
}

- (QByteArray*) encodedData: (NSString *)arg1
{
	return (QByteArray*) [QtSupport objectForQtKey: qt_QDropEvent_encodedData((qt_QDropEvent *)[self qt], (char*) [arg1 cString]) withClass: [QByteArray class] allocatedInObjcWorld: YES];
}

- (BOOL) provides: (NSString *)arg1
{
	return (BOOL) qt_QDropEvent_provides((qt_QDropEvent *)[self qt], (char*) [arg1 cString]);
}

- (QByteArray*) data: (NSString *)f
{
	return (QByteArray*) [QtSupport objectForQtKey: qt_QDropEvent_data((qt_QDropEvent *)[self qt], (char*) [f cString]) withClass: [QByteArray class] allocatedInObjcWorld: YES];
}

- setPoint: (QPoint*)np
{
	qt_QDropEvent_setPoint((qt_QDropEvent *)[self qt], (qt_QPoint*) [np qt]);
	return self;
}

+ (int) Copy
{
	return (int) QDROPEVENT_Copy;
}

+ (int) Link
{
	return (int) QDROPEVENT_Link;
}

+ (int) Move
{
	return (int) QDROPEVENT_Move;
}

+ (int) Private
{
	return (int) QDROPEVENT_Private;
}

+ (int) UserAction
{
	return (int) QDROPEVENT_UserAction;
}

@end

@implementation QDropEvent (QMimeSourceImplementation)
- (NSString *) format: (int)n
{
	return (NSString *) [NSString stringWithCString: qt_QMimeSource_format(qt_QDropEvent_QMimeSource([self qt]), (int)n)];
}

- (BOOL) provides: (NSString *)arg1
{
	return (BOOL) qt_QMimeSource_provides(qt_QDropEvent_QMimeSource([self qt]), (char*) [arg1 cString]);
}

- (QByteArray*) encodedData: (NSString *)arg1
{
	return (QByteArray*) [QtSupport objectForQtKey: qt_QMimeSource_encodedData(qt_QDropEvent_QMimeSource([self qt]), (char*) [arg1 cString]) withClass: [QByteArray class] allocatedInObjcWorld: YES];
}

- (int) serialNumber
{
	return (int) qt_QMimeSource_serialNumber(qt_QDropEvent_QMimeSource([self qt]));
}

@end
