/***************************************************************************
                            KPanelExtension.m -  description
                             -------------------
    begin                : Thu Mar 21 01:01:29 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Thu Mar 21 01:01:29 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_KPanelExtension.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KPanelExtension.h>
#include <qtobjc/QSize.h>


@implementation  KPanelExtension


- initWithText: (NSString *)configFile t: (int)t actions: (int)actions parent: (QWidget *)parent name: (NSString *)name
{
static qt_QString * _qstring_configFile = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KPanelExtension((qt_QString *) [configFile toQString: &_qstring_configFile], (int)t, (int)actions, (qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)configFile 
{
static qt_QString * _qstring_configFile = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KPanelExtension((qt_QString *) [configFile toQString: &_qstring_configFile], [KPanelExtension Normal], 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_KPanelExtension((kde_KPanelExtension *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (QSize*) sizeHint: (int)arg1 maxsize: (QSize *)maxsize
{
	return (QSize*) [QtSupport objectForQtKey: kde_KPanelExtension_sizeHint((kde_KPanelExtension *)[self qt], (int)arg1, (qt_QSize *) [maxsize qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (KConfig*) config
{
	return (KConfig*) [QtSupport objectForQtKey: kde_KPanelExtension_config((kde_KPanelExtension *)[self qt]) withClass: [KConfig class] allocatedInObjcWorld: YES];
}

- (int) type
{
	return (int) kde_KPanelExtension_type((kde_KPanelExtension *)[self qt]);
}

- (int) actions
{
	return (int) kde_KPanelExtension_actions((kde_KPanelExtension *)[self qt]);
}

- action: (int)a
{
	kde_KPanelExtension_action((kde_KPanelExtension *)[self qt], (int)a);
	return self;
}

- (int) preferedPosition
{
	return (int) kde_KPanelExtension_preferedPosition((kde_KPanelExtension *)[self qt]);
}

- setPosition: (int)p
{
	kde_KPanelExtension_setPosition((kde_KPanelExtension *)[self qt], (int)p);
	return self;
}

- setAlignment: (int)a
{
	kde_KPanelExtension_setAlignment((kde_KPanelExtension *)[self qt], (int)a);
	return self;
}

- about
{
	kde_KPanelExtension_about((kde_KPanelExtension *)[self qt]);
	return self;
}

- help
{
	kde_KPanelExtension_help((kde_KPanelExtension *)[self qt]);
	return self;
}

- preferences
{
	kde_KPanelExtension_preferences((kde_KPanelExtension *)[self qt]);
	return self;
}

- reportBug
{
	kde_KPanelExtension_reportBug((kde_KPanelExtension *)[self qt]);
	return self;
}

- (int) position
{
	return (int) kde_KPanelExtension_position((kde_KPanelExtension *)[self qt]);
}

- (int) alignment
{
	return (int) kde_KPanelExtension_alignment((kde_KPanelExtension *)[self qt]);
}

- (int) orientation
{
	return (int) kde_KPanelExtension_orientation((kde_KPanelExtension *)[self qt]);
}

- positionChange: (int)arg1
{
	kde_KPanelExtension_positionChange((kde_KPanelExtension *)[self qt], (int)arg1);
	return self;
}

- alignmentChange: (int)arg1
{
	kde_KPanelExtension_alignmentChange((kde_KPanelExtension *)[self qt], (int)arg1);
	return self;
}

- virtual_hook: (int)identifier data: (void*)data
{
	kde_KPanelExtension_virtual_hook((kde_KPanelExtension *)[self qt], (int)identifier, (void*)data);
	return self;
}

+ (int) Normal
{
	return (int) KPANELEXTENSION_Normal;
}

+ (int) Stretch
{
	return (int) KPANELEXTENSION_Stretch;
}

+ (int) About
{
	return (int) KPANELEXTENSION_About;
}

+ (int) Help
{
	return (int) KPANELEXTENSION_Help;
}

+ (int) Preferences
{
	return (int) KPANELEXTENSION_Preferences;
}

+ (int) ReportBug
{
	return (int) KPANELEXTENSION_ReportBug;
}

+ (int) Left
{
	return (int) KPANELEXTENSION_Left;
}

+ (int) Right
{
	return (int) KPANELEXTENSION_Right;
}

+ (int) Top
{
	return (int) KPANELEXTENSION_Top;
}

+ (int) Bottom
{
	return (int) KPANELEXTENSION_Bottom;
}

+ (int) LeftTop
{
	return (int) KPANELEXTENSION_LeftTop;
}

+ (int) Center
{
	return (int) KPANELEXTENSION_Center;
}

+ (int) RightBottom
{
	return (int) KPANELEXTENSION_RightBottom;
}

@end
