/***************************************************************************
                            KJanusWidget.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_KJanusWidget.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KJanusWidget.h>
#include <qtobjc/QFrame.h>
#include <qtobjc/QPixmap.h>


@implementation  KJanusWidget


- initWithWidget: (QWidget *)parent name: (NSString *)name face: (int)face
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KJanusWidget((qt_QWidget *) [parent qt], (char*) [name cString], (int)face)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- init
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KJanusWidget(0, 0, [KJanusWidget Plain])];
		[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_KJanusWidget((kde_KJanusWidget *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (BOOL) showPage: (int)index
{
	return (BOOL) kde_KJanusWidget_showPage((kde_KJanusWidget *)[self qt], (int)index);
}

- (int) activePageIndex
{
	return (int) kde_KJanusWidget_activePageIndex((kde_KJanusWidget *)[self qt]);
}

- (BOOL) isValid
{
	return (BOOL) kde_KJanusWidget_isValid((kde_KJanusWidget *)[self qt]);
}

- (int) face
{
	return (int) kde_KJanusWidget_face((kde_KJanusWidget *)[self qt]);
}

- (QSize*) minimumSizeHint
{
	return (QSize*) [QtSupport objectForQtKey: kde_KJanusWidget_minimumSizeHint((kde_KJanusWidget *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QSize*) sizeHint
{
	return (QSize*) [QtSupport objectForQtKey: kde_KJanusWidget_sizeHint((kde_KJanusWidget *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QFrame*) plainPage
{
	return (QFrame*) [QtSupport objectForQtKey: kde_KJanusWidget_plainPage((kde_KJanusWidget *)[self qt]) withClass: [QFrame class] allocatedInObjcWorld: YES];
}

- (QFrame*) addPage: (NSString *)item header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QString * _qstring_item = 0L;
	return (QFrame*) [QtSupport objectForQtKey: kde_KJanusWidget_addPage((kde_KJanusWidget *)[self qt], (qt_QString *) [item toQString: &_qstring_item], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]) withClass: [QFrame class] allocatedInObjcWorld: YES];
}

- (QFrame*) addPage: (NSString *)item 
{
static qt_QString * _qstring_item = 0L;
	return (QFrame*) [QtSupport objectForQtKey: kde_KJanusWidget_addPage((kde_KJanusWidget *)[self qt], (qt_QString *) [item toQString: &_qstring_item], qt_QString_null(), 0) withClass: [QFrame class] allocatedInObjcWorld: YES];
}

- (QFrame*) addPageWithStringList: (NSArray *)items header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QStringList * _qlist_items = 0L;
	return (QFrame*) [QtSupport objectForQtKey: kde_KJanusWidget_addPage1((kde_KJanusWidget *)[self qt], (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]) withClass: [QFrame class] allocatedInObjcWorld: YES];
}

- (QFrame*) addPageWithStringList: (NSArray *)items
{
static qt_QStringList * _qlist_items = 0L;
	return (QFrame*) [QtSupport objectForQtKey: kde_KJanusWidget_addPage1((kde_KJanusWidget *)[self qt], (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], qt_QString_null(), 0) withClass: [QFrame class] allocatedInObjcWorld: YES];
}

- (QVBox*) addVBoxPage: (NSString *)item header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QString * _qstring_item = 0L;
	return (QVBox*) [QtSupport objectForQtKey: kde_KJanusWidget_addVBoxPage((kde_KJanusWidget *)[self qt], (qt_QString *) [item toQString: &_qstring_item], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]) withClass: [QVBox class] allocatedInObjcWorld: YES];
}

- (QVBox*) addVBoxPage: (NSString *)item 
{
static qt_QString * _qstring_item = 0L;
	return (QVBox*) [QtSupport objectForQtKey: kde_KJanusWidget_addVBoxPage((kde_KJanusWidget *)[self qt], (qt_QString *) [item toQString: &_qstring_item], qt_QString_null(), 0) withClass: [QVBox class] allocatedInObjcWorld: YES];
}

- (QVBox*) addVBoxPageWithStringList: (NSArray *)items header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QStringList * _qlist_items = 0L;
	return (QVBox*) [QtSupport objectForQtKey: kde_KJanusWidget_addVBoxPage1((kde_KJanusWidget *)[self qt], (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]) withClass: [QVBox class] allocatedInObjcWorld: YES];
}

- (QVBox*) addVBoxPageWithStringList: (NSArray *)items
{
static qt_QStringList * _qlist_items = 0L;
	return (QVBox*) [QtSupport objectForQtKey: kde_KJanusWidget_addVBoxPage1((kde_KJanusWidget *)[self qt], (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], qt_QString_null(), 0) withClass: [QVBox class] allocatedInObjcWorld: YES];
}

- (QHBox*) addHBoxPage: (NSString *)itemName header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QString * _qstring_itemName = 0L;
	return (QHBox*) [QtSupport objectForQtKey: kde_KJanusWidget_addHBoxPage((kde_KJanusWidget *)[self qt], (qt_QString *) [itemName toQString: &_qstring_itemName], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]) withClass: [QHBox class] allocatedInObjcWorld: YES];
}

- (QHBox*) addHBoxPage: (NSString *)itemName
{
static qt_QString * _qstring_itemName = 0L;
	return (QHBox*) [QtSupport objectForQtKey: kde_KJanusWidget_addHBoxPage((kde_KJanusWidget *)[self qt], (qt_QString *) [itemName toQString: &_qstring_itemName], qt_QString_null(), 0) withClass: [QHBox class] allocatedInObjcWorld: YES];
}

- (QHBox*) addHBoxPageWithStringList: (NSArray *)items header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QStringList * _qlist_items = 0L;
	return (QHBox*) [QtSupport objectForQtKey: kde_KJanusWidget_addHBoxPage1((kde_KJanusWidget *)[self qt], (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]) withClass: [QHBox class] allocatedInObjcWorld: YES];
}

- (QHBox*) addHBoxPageWithStringList: (NSArray *)items
{
static qt_QStringList * _qlist_items = 0L;
	return (QHBox*) [QtSupport objectForQtKey: kde_KJanusWidget_addHBoxPage1((kde_KJanusWidget *)[self qt], (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], qt_QString_null(), 0) withClass: [QHBox class] allocatedInObjcWorld: YES];
}

- (QGrid*) addGridPage: (int)n dir: (int)dir itemName: (NSString *)itemName header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QString * _qstring_itemName = 0L;
	return (QGrid*) [QtSupport objectForQtKey: kde_KJanusWidget_addGridPage((kde_KJanusWidget *)[self qt], (int)n, (int)dir, (qt_QString *) [itemName toQString: &_qstring_itemName], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]) withClass: [QGrid class] allocatedInObjcWorld: YES];
}

- (QGrid*) addGridPage: (int)n dir: (int)dir itemName: (NSString *)itemName
{
static qt_QString * _qstring_itemName = 0L;
	return (QGrid*) [QtSupport objectForQtKey: kde_KJanusWidget_addGridPage((kde_KJanusWidget *)[self qt], (int)n, (int)dir, (qt_QString *) [itemName toQString: &_qstring_itemName], qt_QString_null(), 0) withClass: [QGrid class] allocatedInObjcWorld: YES];
}

- (QGrid*) addGridPage: (int)n dir: (int)dir items: (NSArray *)items header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QStringList * _qlist_items = 0L;
	return (QGrid*) [QtSupport objectForQtKey: kde_KJanusWidget_addGridPage1((kde_KJanusWidget *)[self qt], (int)n, (int)dir, (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]) withClass: [QGrid class] allocatedInObjcWorld: YES];
}

- (QGrid*) addGridPage: (int)n dir: (int)dir items: (NSArray *)items
{
static qt_QStringList * _qlist_items = 0L;
	return (QGrid*) [QtSupport objectForQtKey: kde_KJanusWidget_addGridPage1((kde_KJanusWidget *)[self qt], (int)n, (int)dir, (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], qt_QString_null(), 0) withClass: [QGrid class] allocatedInObjcWorld: YES];
}

- (int) pageIndex: (QWidget *)widget
{
	return (int) kde_KJanusWidget_pageIndex((kde_KJanusWidget *)[self qt], (qt_QWidget *) [widget qt]);
}

- (BOOL) setSwallowedWidget: (QWidget *)widget
{
	return (BOOL) kde_KJanusWidget_setSwallowedWidget((kde_KJanusWidget *)[self qt], (qt_QWidget *) [widget qt]);
}

- setTreeListAutoResize: (BOOL)state
{
	kde_KJanusWidget_setTreeListAutoResize((kde_KJanusWidget *)[self qt], (int)state);
	return self;
}

- setShowIconsInTreeList: (BOOL)state
{
	kde_KJanusWidget_setShowIconsInTreeList((kde_KJanusWidget *)[self qt], (int)state);
	return self;
}

- setRootIsDecorated: (BOOL)state
{
	kde_KJanusWidget_setRootIsDecorated((kde_KJanusWidget *)[self qt], (int)state);
	return self;
}

- setIconListAllVisible: (BOOL)state
{
	kde_KJanusWidget_setIconListAllVisible((kde_KJanusWidget *)[self qt], (int)state);
	return self;
}

- setFolderIcon: (NSArray *)path pixmap: (QPixmap *)pixmap
{
static qt_QStringList * _qlist_path = 0L;
	kde_KJanusWidget_setFolderIcon((kde_KJanusWidget *)[self qt], (qt_QStringList*) [path toQStringList: (void *)&_qlist_path], (qt_QPixmap *) [pixmap qt]);
	return self;
}

- setFocus
{
	kde_KJanusWidget_setFocus((kde_KJanusWidget *)[self qt]);
	return self;
}

- (BOOL) eventFilter: (QObject *)o e: (QEvent *)e
{
	return (BOOL) kde_KJanusWidget_eventFilter((kde_KJanusWidget *)[self qt], (qt_QObject *) [o qt], (qt_QEvent *) [e qt]);
}

- (BOOL) showPageForWidget: (QWidget *)w
{
	return (BOOL) kde_KJanusWidget_showPage1((kde_KJanusWidget *)[self qt], (qt_QWidget *) [w qt]);
}

- addPageWidget: (QFrame*)page items: (NSArray *)items header: (NSString *)header pixmap: (QPixmap *)pixmap
{
static qt_QString * _qstring_header = 0L;
static qt_QStringList * _qlist_items = 0L;
	kde_KJanusWidget_addPageWidget((kde_KJanusWidget *)[self qt], (qt_QFrame*) [page qt], (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], (qt_QString *) [header toQString: &_qstring_header], (qt_QPixmap *) [pixmap qt]);
	return self;
}

- InsertTreeListItem: (NSArray *)items pixmap: (QPixmap *)pixmap page: (QFrame*)page
{
static qt_QStringList * _qlist_items = 0L;
	kde_KJanusWidget_InsertTreeListItem((kde_KJanusWidget *)[self qt], (qt_QStringList*) [items toQStringList: (void *)&_qlist_items], (qt_QPixmap *) [pixmap qt], (qt_QFrame*) [page qt]);
	return self;
}

- (QWidget*) FindParent
{
	return (QWidget*) [QtSupport objectForQtKey: kde_KJanusWidget_FindParent((kde_KJanusWidget *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

+ (int) TreeList
{
	return (int) KJANUSWIDGET_TreeList;
}

+ (int) Tabbed
{
	return (int) KJANUSWIDGET_Tabbed;
}

+ (int) Plain
{
	return (int) KJANUSWIDGET_Plain;
}

+ (int) Swallow
{
	return (int) KJANUSWIDGET_Swallow;
}

+ (int) IconList
{
	return (int) KJANUSWIDGET_IconList;
}

@end
