/***************************************************************************
                            QActionGroup.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_QActionGroup.h>
#include <qtobjc/QActionGroup.h>
#include <qtobjc/QIconSet.h>
#include <qtobjc/QPopupMenu.h>

#include <qtobjc/QWidget.h>

@implementation  QActionGroup


- initWithObject: (QObject *)parent name: (NSString *)name exclusive: (BOOL)exclusive
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QActionGroup((qt_QObject *) [parent qt], (char*) [name cString], (int)exclusive)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithObject: (QObject *)parent 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QActionGroup((qt_QObject *) [parent qt], 0, 1)];
		[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) {
			qt_del_QActionGroup((qt_QActionGroup *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- setExclusive: (BOOL)arg1
{
	qt_QActionGroup_setExclusive((qt_QActionGroup *)[self qt], (int)arg1);
	return self;
}

- (BOOL) isExclusive
{
	return (BOOL) qt_QActionGroup_isExclusive((qt_QActionGroup *)[self qt]);
}

- add: (QAction*)a
{
	qt_QActionGroup_add((qt_QActionGroup *)[self qt], (qt_QAction*) [a qt]);
	return self;
}

- addSeparator
{
	qt_QActionGroup_addSeparator((qt_QActionGroup *)[self qt]);
	return self;
}

- (BOOL) addTo: (QWidget *)arg1
{
	return (BOOL) qt_QActionGroup_addTo((qt_QActionGroup *)[self qt], (qt_QWidget *) [arg1 qt]);
}

- (BOOL) removeFrom: (QWidget *)arg1
{
	return (BOOL) qt_QActionGroup_removeFrom((qt_QActionGroup *)[self qt], (qt_QWidget *) [arg1 qt]);
}

- setEnabled: (BOOL)arg1
{
	qt_QActionGroup_setEnabled((qt_QActionGroup *)[self qt], (int)arg1);
	return self;
}

- setUsesDropDown: (BOOL)enable
{
	qt_QActionGroup_setUsesDropDown((qt_QActionGroup *)[self qt], (int)enable);
	return self;
}

- (BOOL) usesDropDown
{
	return (BOOL) qt_QActionGroup_usesDropDown((qt_QActionGroup *)[self qt]);
}

- setIconSet: (QIconSet*)arg1
{
	qt_QActionGroup_setIconSet((qt_QActionGroup *)[self qt], (qt_QIconSet*) [arg1 qt]);
	return self;
}

- setText: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	qt_QActionGroup_setText((qt_QActionGroup *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return self;
}

- setMenuText: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	qt_QActionGroup_setMenuText((qt_QActionGroup *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return self;
}

- setToolTip: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	qt_QActionGroup_setToolTip((qt_QActionGroup *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return self;
}

- setWhatsThis: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	qt_QActionGroup_setWhatsThis((qt_QActionGroup *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return self;
}

- insert: (QAction*)a
{
	qt_QActionGroup_insert((qt_QActionGroup *)[self qt], (qt_QAction*) [a qt]);
	return self;
}

- addedTo: (QWidget *)actionWidget container: (QWidget *)container a: (QAction*)a
{
	qt_QActionGroup_addedTo((qt_QActionGroup *)[self qt], (qt_QWidget *) [actionWidget qt], (qt_QWidget *) [container qt], (qt_QAction*) [a qt]);
	return self;
}

- addedTo: (int)index menu: (QPopupMenu*)menu a: (QAction*)a
{
	qt_QActionGroup_addedTo1((qt_QActionGroup *)[self qt], (int)index, (qt_QPopupMenu*) [menu qt], (qt_QAction*) [a qt]);
	return self;
}

- addedTo: (QWidget *)actionWidget container: (QWidget *)container
{
	qt_QActionGroup_addedTo2((qt_QActionGroup *)[self qt], (qt_QWidget *) [actionWidget qt], (qt_QWidget *) [container qt]);
	return self;
}

- addedTo: (int)index menu: (QPopupMenu*)menu
{
	qt_QActionGroup_addedTo3((qt_QActionGroup *)[self qt], (int)index, (qt_QPopupMenu*) [menu qt]);
	return self;
}

@end
