/***************************************************************************
                            QMenuItem.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_QMenuItem.h>
#include <qtobjc/QMenuItem.h>

@implementation  QMenuItem

- (void *) qt
{
	return _qt;
}

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

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

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


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

//- (void) dealloc
//{
//	if ([self qt] != 0L) {
//		if ([self allocatedInObjcWorld]) {
//			qt_del_QMenuItem((qt_QMenuItem *)[self qt]);
//		}
//		[QtSupport removeQtKey: [self qt]];
//		[self setQt: 0L];
//	}
//	[super dealloc];
//}

- (int) id
{
	return (int) qt_QMenuItem_id((qt_QMenuItem *)[self qt]);
}

- (QIconSet*) iconSet
{
	return (QIconSet*) [QtSupport objectForQtKey: qt_QMenuItem_iconSet((qt_QMenuItem *)[self qt]) withClass: [QIconSet class] allocatedInObjcWorld: YES];
}

- (NSString *) text
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QMenuItem_text((qt_QMenuItem *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) whatsThis
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QMenuItem_whatsThis((qt_QMenuItem *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (QPixmap*) pixmap
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QMenuItem_pixmap((qt_QMenuItem *)[self qt]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPopupMenu*) popup
{
	return (QPopupMenu*) [QtSupport objectForQtKey: qt_QMenuItem_popup((qt_QMenuItem *)[self qt]) withClass: [QPopupMenu class] allocatedInObjcWorld: YES];
}

- (QWidget*) widget
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QMenuItem_widget((qt_QMenuItem *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- (QCustomMenuItem*) custom
{
	return (QCustomMenuItem*) [QtSupport objectForQtKey: qt_QMenuItem_custom((qt_QMenuItem *)[self qt]) withClass: [QCustomMenuItem class] allocatedInObjcWorld: YES];
}

- (QKeySequence*) key
{
	return (QKeySequence*) [QtSupport objectForQtKey: qt_QMenuItem_key((qt_QMenuItem *)[self qt]) withClass: [QKeySequence class] allocatedInObjcWorld: YES];
}

- (QSignal*) signal
{
	return (QSignal*) [QtSupport objectForQtKey: qt_QMenuItem_signal((qt_QMenuItem *)[self qt]) withClass: [QSignal class] allocatedInObjcWorld: YES];
}

- (BOOL) isSeparator
{
	return (BOOL) qt_QMenuItem_isSeparator((qt_QMenuItem *)[self qt]);
}

- (BOOL) isEnabled
{
	return (BOOL) qt_QMenuItem_isEnabled((qt_QMenuItem *)[self qt]);
}

- (BOOL) isChecked
{
	return (BOOL) qt_QMenuItem_isChecked((qt_QMenuItem *)[self qt]);
}

- (BOOL) isDirty
{
	return (BOOL) qt_QMenuItem_isDirty((qt_QMenuItem *)[self qt]);
}

- setText: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QMenuItem_setText((qt_QMenuItem *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

- setDirty: (BOOL)dirty
{
	qt_QMenuItem_setDirty((qt_QMenuItem *)[self qt], (int)dirty);
	return self;
}

- setWhatsThis: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QMenuItem_setWhatsThis((qt_QMenuItem *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

@end
