/***************************************************************************
                            KFileTreeBranch.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_KFileTreeBranch.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KFileTreeBranch.h>
#include <kdeobjc/KFileItem.h>
#include <kdeobjc/KFileTreeView.h>
#include <kdeobjc/KFileTreeViewItem.h>
#include <kdeobjc/KURL.h>
#include <qtobjc/QPixmap.h>


@implementation  KFileTreeBranch


- initWithFileTreeView: (KFileTreeView*)arg1 url: (KURL*)url name: (NSString *)name pix: (QPixmap *)pix showHidden: (BOOL)showHidden branchRoot: (KFileTreeViewItem*)branchRoot
{
static qt_QString * _qstring_name = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KFileTreeBranch((kde_KFileTreeView*) [arg1 qt], (kde_KURL*) [url qt], (qt_QString *) [name toQString: &_qstring_name], (qt_QPixmap *) [pix qt], (int)showHidden, (kde_KFileTreeViewItem*) [branchRoot qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithFileTreeView: (KFileTreeView*)arg1 url: (KURL*)url name: (NSString *)name pix: (QPixmap *)pix 
{
static qt_QString * _qstring_name = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KFileTreeBranch((kde_KFileTreeView*) [arg1 qt], (kde_KURL*) [url qt], (qt_QString *) [name toQString: &_qstring_name], (qt_QPixmap *) [pix qt], 0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (KURL*) rootUrl
{
	return (KURL*) [QtSupport objectForQtKey: kde_KFileTreeBranch_rootUrl((kde_KFileTreeBranch *)[self qt]) withClass: [KURL class] allocatedInObjcWorld: YES];
}

- setRoot: (KFileTreeViewItem*)r
{
	kde_KFileTreeBranch_setRoot((kde_KFileTreeBranch *)[self qt], (kde_KFileTreeViewItem*) [r qt]);
	return self;
}

- (KFileTreeViewItem*) root
{
	return (KFileTreeViewItem*) [QtSupport objectForQtKey: kde_KFileTreeBranch_root((kde_KFileTreeBranch *)[self qt]) withClass: [KFileTreeViewItem class] allocatedInObjcWorld: YES];
}

- (NSString *) name
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KFileTreeBranch_name((kde_KFileTreeBranch *)[self qt]);
	return [NSString fromQString: _qstring];
}

- setName: (NSString *)n
{
static qt_QString * _qstring_n = 0L;
	kde_KFileTreeBranch_setName((kde_KFileTreeBranch *)[self qt], (qt_QString *) [n toQString: &_qstring_n]);
	return self;
}

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

- (QPixmap*) openPixmap
{
	return (QPixmap*) [QtSupport objectForQtKey: kde_KFileTreeBranch_openPixmap((kde_KFileTreeBranch *)[self qt]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (BOOL) showExtensions
{
	return (BOOL) kde_KFileTreeBranch_showExtensions((kde_KFileTreeBranch *)[self qt]);
}

- setOpen: (BOOL)setopen
{
	kde_KFileTreeBranch_setOpen((kde_KFileTreeBranch *)[self qt], (int)setopen);
	return self;
}

- setOpen
{
	kde_KFileTreeBranch_setOpen((kde_KFileTreeBranch *)[self qt], 1);
	return self;
}

- setChildRecurse: (BOOL)t
{
	kde_KFileTreeBranch_setChildRecurse((kde_KFileTreeBranch *)[self qt], (int)t);
	return self;
}

- setChildRecurse
{
	kde_KFileTreeBranch_setChildRecurse((kde_KFileTreeBranch *)[self qt], 1);
	return self;
}

- (BOOL) childRecurse
{
	return (BOOL) kde_KFileTreeBranch_childRecurse((kde_KFileTreeBranch *)[self qt]);
}

- (BOOL) populate: (KURL*)url currItem: (KFileTreeViewItem*)currItem
{
	return (BOOL) kde_KFileTreeBranch_populate((kde_KFileTreeBranch *)[self qt], (kde_KURL*) [url qt], (kde_KFileTreeViewItem*) [currItem qt]);
}

- setShowExtensions: (BOOL)visible
{
	kde_KFileTreeBranch_setShowExtensions((kde_KFileTreeBranch *)[self qt], (int)visible);
	return self;
}

- setShowExtensions
{
	kde_KFileTreeBranch_setShowExtensions((kde_KFileTreeBranch *)[self qt], 1);
	return self;
}

- setOpenPixmap: (QPixmap *)pix
{
	kde_KFileTreeBranch_setOpenPixmap((kde_KFileTreeBranch *)[self qt], (qt_QPixmap *) [pix qt]);
	return self;
}

- (KFileTreeViewItem*) createTreeViewItem: (KFileTreeViewItem*)parent fileItem: (KFileItem*)fileItem
{
	return (KFileTreeViewItem*) [QtSupport objectForQtKey: kde_KFileTreeBranch_createTreeViewItem((kde_KFileTreeBranch *)[self qt], (kde_KFileTreeViewItem*) [parent qt], (kde_KFileItem*) [fileItem qt]) withClass: [KFileTreeViewItem class] allocatedInObjcWorld: YES];
}

- (KFileTreeViewItem*) findTVIByURL: (KURL*)arg1
{
	return (KFileTreeViewItem*) [QtSupport objectForQtKey: kde_KFileTreeBranch_findTVIByURL((kde_KFileTreeBranch *)[self qt], (kde_KURL*) [arg1 qt]) withClass: [KFileTreeViewItem class] allocatedInObjcWorld: YES];
}

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

@end
