/***************************************************************************
                            KAppTreeListItem.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_KAppTreeListItem.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KAppTreeListItem.h>
#include <kdeobjc/KListView.h>
#include <qtobjc/QPixmap.h>


@implementation  KAppTreeListItem


- initWithListView: (KListView*)parent name: (NSString *)name pixmap: (QPixmap *)pixmap parseOpt: (BOOL)parse dir: (BOOL)dir p: (NSString *)p c: (NSString *)c
{
static qt_QString * _qstring_c = 0L;
static qt_QString * _qstring_p = 0L;
static qt_QString * _qstring_name = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KAppTreeListItem((kde_KListView*) [parent qt], (qt_QString *) [name toQString: &_qstring_name], (qt_QPixmap *) [pixmap qt], (int)parse, (int)dir, (qt_QString *) [p toQString: &_qstring_p], (qt_QString *) [c toQString: &_qstring_c])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithListViewItem: (QListViewItem *)parent name: (NSString *)name pixmap: (QPixmap *)pixmap parseOpt: (BOOL)parse dir: (BOOL)dir p: (NSString *)p c: (NSString *)c
{
static qt_QString * _qstring_c = 0L;
static qt_QString * _qstring_p = 0L;
static qt_QString * _qstring_name = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KAppTreeListItem1((qt_QListViewItem *) [parent qt], (qt_QString *) [name toQString: &_qstring_name], (qt_QPixmap *) [pixmap qt], (int)parse, (int)dir, (qt_QString *) [p toQString: &_qstring_p], (qt_QString *) [c toQString: &_qstring_c])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (BOOL) isDirectory
{
	return (BOOL) kde_KAppTreeListItem_isDirectory((kde_KAppTreeListItem *)[self qt]);
}

- (NSString *) key: (int)column ascending: (BOOL)ascending
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAppTreeListItem_key((kde_KAppTreeListItem *)[self qt], (int)column, (int)ascending);
	return [NSString fromQString: _qstring];
}

- init: (QPixmap *)pixmap parseOpt: (BOOL)parse dir: (BOOL)dir _path: (NSString *)_path exec: (NSString *)exec
{
static qt_QString * _qstring_exec = 0L;
static qt_QString * _qstring__path = 0L;
	kde_KAppTreeListItem_init((kde_KAppTreeListItem *)[self qt], (qt_QPixmap *) [pixmap qt], (int)parse, (int)dir, (qt_QString *) [_path toQString: &_qstring__path], (qt_QString *) [exec toQString: &_qstring_exec]);
	return self;
}

- activate
{
	kde_KAppTreeListItem_activate((kde_KAppTreeListItem *)[self qt]);
	return self;
}

- setOpen: (BOOL)o
{
	kde_KAppTreeListItem_setOpen((kde_KAppTreeListItem *)[self qt], (int)o);
	return self;
}

@end
