/***************************************************************************
                            KJavaAppletContext.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_KJavaAppletContext.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KJavaAppletContext.h>
#include <kdeobjc/KJavaApplet.h>


@implementation  KJavaAppletContext


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

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parent] == nil) {
			kde_del_KJavaAppletContext((kde_KJavaAppletContext *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (int) contextId
{
	return (int) kde_KJavaAppletContext_contextId((kde_KJavaAppletContext *)[self qt]);
}

- setContextId: (int)identifier
{
	kde_KJavaAppletContext_setContextId((kde_KJavaAppletContext *)[self qt], (int)identifier);
	return self;
}

- create: (KJavaApplet*)arg1
{
	kde_KJavaAppletContext_create((kde_KJavaAppletContext *)[self qt], (kde_KJavaApplet*) [arg1 qt]);
	return self;
}

- destroy: (KJavaApplet*)arg1
{
	kde_KJavaAppletContext_destroy((kde_KJavaAppletContext *)[self qt], (kde_KJavaApplet*) [arg1 qt]);
	return self;
}

- init: (KJavaApplet*)arg1
{
	kde_KJavaAppletContext_init((kde_KJavaAppletContext *)[self qt], (kde_KJavaApplet*) [arg1 qt]);
	return self;
}

- start: (KJavaApplet*)arg1
{
	kde_KJavaAppletContext_start((kde_KJavaAppletContext *)[self qt], (kde_KJavaApplet*) [arg1 qt]);
	return self;
}

- stop: (KJavaApplet*)arg1
{
	kde_KJavaAppletContext_stop((kde_KJavaAppletContext *)[self qt], (kde_KJavaApplet*) [arg1 qt]);
	return self;
}

- processCmd: (NSString *)cmd args: (NSArray *)args
{
static qt_QStringList * _qlist_args = 0L;
static qt_QString * _qstring_cmd = 0L;
	kde_KJavaAppletContext_processCmd((kde_KJavaAppletContext *)[self qt], (qt_QString *) [cmd toQString: &_qstring_cmd], (qt_QStringList*) [args toQStringList: (void *)&_qlist_args]);
	return self;
}

- received: (NSString *)cmd arg: (NSArray *)arg
{
static qt_QStringList * _qlist_arg = 0L;
static qt_QString * _qstring_cmd = 0L;
	kde_KJavaAppletContext_received((kde_KJavaAppletContext *)[self qt], (qt_QString *) [cmd toQString: &_qstring_cmd], (qt_QStringList*) [arg toQStringList: (void *)&_qlist_arg]);
	return self;
}

@end
