/***************************************************************************
                            kde_KFileItem.cpp -  description
                             -------------------
    begin                : Wed Feb  6 15:12:26 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Feb  6 15:12:26 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.                       *
 *                                                                         *
 ***************************************************************************/

extern "C" {
#include "kde_KFileItem.h"
}

#include <kfileitem.h>

class KFileItemBridge : public KFileItem
{
public:
	KFileItemBridge(const KIO::UDSEntry& _entry, const KURL& _url, bool _determineMimeTypeOnDemand, bool _urlIsDirectory) : KFileItem(_entry, _url, _determineMimeTypeOnDemand, _urlIsDirectory) {}
	KFileItemBridge(mode_t _mode, mode_t _permissions, const KURL& _url, bool _determineMimeTypeOnDemand) : KFileItem(_mode, _permissions, _url, _determineMimeTypeOnDemand) {}
	KFileItemBridge(const KURL& url, const QString& mimeType, mode_t mode) : KFileItem(url, mimeType, mode) {}
	KFileItemBridge(const KFileItem& item) : KFileItem(item) {}
	~KFileItemBridge() {}
	void protected_init(bool _determineMimeTypeOnDemand) {
		KFileItem::init(_determineMimeTypeOnDemand);
		return;
	}
	QString  protected_parsePermissions(mode_t perm) {
		return (QString ) KFileItem::parsePermissions(perm);
	}
};

//kde_KFileItem * kde_new_KFileItem(kde_UDSEntry* _entry, kde_KURL* _url, int _determineMimeTypeOnDemand, int _urlIsDirectory){
//	return (kde_KFileItem *) new KFileItemBridge((KIO::UDSEntry&)* (KIO::UDSEntry*)_entry, (KURL&)* (KURL*)_url, (bool)_determineMimeTypeOnDemand, (bool)_urlIsDirectory);
//}
kde_KFileItem * kde_new_KFileItem1(long _mode, long _permissions, kde_KURL* _url, int _determineMimeTypeOnDemand){
	return (kde_KFileItem *) new KFileItemBridge((mode_t)_mode, (mode_t)_permissions, (KURL&)* (KURL*)_url, (bool)_determineMimeTypeOnDemand);
}
kde_KFileItem * kde_new_KFileItem2(kde_KURL* url, qt_QString * mimeType, long mode){
	return (kde_KFileItem *) new KFileItemBridge((KURL&)* (KURL*)url, (QString&)* (QString*)mimeType, (mode_t)mode);
}
kde_KFileItem * kde_new_KFileItem3(kde_KFileItem* item){
	return (kde_KFileItem *) new KFileItemBridge((KFileItem&)* (KFileItem*)item);
}
void kde_del_KFileItem( kde_KFileItem* p ){
	delete (KFileItemBridge*) p;
}
void kde_KFileItem_refresh( kde_KFileItem* instPointer){
	((KFileItemBridge*)instPointer)->refresh();
	return;
}
void kde_KFileItem_refreshMimeType( kde_KFileItem* instPointer){
	((KFileItemBridge*)instPointer)->refreshMimeType();
	return;
}
kde_KURL* kde_KFileItem_url( kde_KFileItem* instPointer){
	return (kde_KURL*) (const KURL *)&((KFileItemBridge*)instPointer)->url();
}
void kde_KFileItem_setURL( kde_KFileItem* instPointer,kde_KURL* url){
	((KFileItemBridge*)instPointer)->setURL((KURL&)* (KURL*)url);
	return;
}
long kde_KFileItem_permissions( kde_KFileItem* instPointer){
	return (long) ((KFileItemBridge*)instPointer)->permissions();
}
qt_QString * kde_KFileItem_permissionsString( kde_KFileItem* instPointer){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->permissionsString());
}
long kde_KFileItem_mode( kde_KFileItem* instPointer){
	return (long) ((KFileItemBridge*)instPointer)->mode();
}
qt_QString * kde_KFileItem_user( kde_KFileItem* instPointer){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->user());
}
qt_QString * kde_KFileItem_group( kde_KFileItem* instPointer){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->group());
}
int kde_KFileItem_isLink( kde_KFileItem* instPointer){
	return (int) ((KFileItemBridge*)instPointer)->isLink();
}
int kde_KFileItem_isDir( kde_KFileItem* instPointer){
	return (int) ((KFileItemBridge*)instPointer)->isDir();
}
int kde_KFileItem_isFile( kde_KFileItem* instPointer){
	return (int) ((KFileItemBridge*)instPointer)->isFile();
}
int kde_KFileItem_isReadable( kde_KFileItem* instPointer){
	return (int) ((KFileItemBridge*)instPointer)->isReadable();
}
qt_QString * kde_KFileItem_linkDest( kde_KFileItem* instPointer){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->linkDest());
}
KIO::filesize_t kde_KFileItem_size( kde_KFileItem* instPointer){
	return (KIO::filesize_t) ((KFileItemBridge*)instPointer)->size();
}
long kde_KFileItem_time( kde_KFileItem* instPointer,unsigned int which){
	return (long) ((KFileItemBridge*)instPointer)->time((unsigned int)which);
}
qt_QString * kde_KFileItem_timeString( kde_KFileItem* instPointer,unsigned int which){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->timeString((unsigned int)which));
}
int kde_KFileItem_isLocalFile( kde_KFileItem* instPointer){
	return (int) ((KFileItemBridge*)instPointer)->isLocalFile();
}
qt_QString * kde_KFileItem_text( kde_KFileItem* instPointer){
	return (qt_QString *) (const QString *)&((KFileItemBridge*)instPointer)->text();
}
qt_QString * kde_KFileItem_name( kde_KFileItem* instPointer,int lowerCase){
	return (qt_QString *) (const QString *)&((KFileItemBridge*)instPointer)->name((bool)lowerCase);
}
qt_QString * kde_KFileItem_mimetype( kde_KFileItem* instPointer){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->mimetype());
}
//kde_KMimeType_Ptr kde_KFileItem_determineMimeType( kde_KFileItem* instPointer){
//	return (kde_KMimeType_Ptr) ((KFileItemBridge*)instPointer)->determineMimeType();
//}
//kde_KMimeType_Ptr kde_KFileItem_mimeTypePtr( kde_KFileItem* instPointer){
//	return (kde_KMimeType_Ptr) ((KFileItemBridge*)instPointer)->mimeTypePtr();
//}
int kde_KFileItem_isMimeTypeKnown( kde_KFileItem* instPointer){
	return (int) ((KFileItemBridge*)instPointer)->isMimeTypeKnown();
}
qt_QString * kde_KFileItem_mimeComment( kde_KFileItem* instPointer){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->mimeComment());
}
qt_QString * kde_KFileItem_iconName( kde_KFileItem* instPointer){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->iconName());
}
qt_QPixmap * kde_KFileItem_pixmap( kde_KFileItem* instPointer,int _size, int _state){
	return (qt_QPixmap *)new QPixmap(((KFileItemBridge*)instPointer)->pixmap((int)_size, (int)_state));
}
qt_QString * kde_KFileItem_getStatusBarInfo( kde_KFileItem* instPointer){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->getStatusBarInfo());
}
qt_QString * kde_KFileItem_getToolTipText( kde_KFileItem* instPointer,int maxcount){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->getToolTipText((int)maxcount));
}
int kde_KFileItem_acceptsDrops( kde_KFileItem* instPointer){
	return (int) ((KFileItemBridge*)instPointer)->acceptsDrops();
}
void kde_KFileItem_run( kde_KFileItem* instPointer){
	((KFileItemBridge*)instPointer)->run();
	return;
}
//kde_UDSEntry* kde_KFileItem_entry( kde_KFileItem* instPointer){
//	return (kde_UDSEntry*) ((KFileItemBridge*)instPointer)->entry();
//}
int kde_KFileItem_isMarked( kde_KFileItem* instPointer){
	return (int) ((KFileItemBridge*)instPointer)->isMarked();
}
void kde_KFileItem_mark( kde_KFileItem* instPointer){
	((KFileItemBridge*)instPointer)->mark();
	return;
}
void kde_KFileItem_unmark( kde_KFileItem* instPointer){
	((KFileItemBridge*)instPointer)->unmark();
	return;
}
int kde_KFileItem_cmp( kde_KFileItem* instPointer,kde_KFileItem* item){
	return (int) ((KFileItemBridge*)instPointer)->cmp((KFileItem&)* (KFileItem*)item);
}
void kde_KFileItem_setExtraData( kde_KFileItem* instPointer,void* key, void* value){
	((KFileItemBridge*)instPointer)->setExtraData((void*)key, (void*)value);
	return;
}
void* kde_KFileItem_extraData( kde_KFileItem* instPointer,void* key){
	return (void*) ((KFileItemBridge*)instPointer)->extraData((void*)key);
}
void* kde_KFileItem_extraData1( kde_KFileItem* instPointer,void* key){
	return (void*) ((KFileItemBridge*)instPointer)->extraData((void*)key);
}
void kde_KFileItem_removeExtraData( kde_KFileItem* instPointer,void* key){
	((KFileItemBridge*)instPointer)->removeExtraData((void*)key);
	return;
}
//void kde_KFileItem_setMetaInfo( kde_KFileItem* instPointer,KFileMetaInfo info){
//	((KFileItemBridge*)instPointer)->setMetaInfo((KFileMetaInfo&)info);
//	return;
//}
//KFileMetaInfo& kde_KFileItem_metaInfo( kde_KFileItem* instPointer){
//	return (KFileMetaInfo&) ((KFileItemBridge*)instPointer)->metaInfo();
//}
void kde_KFileItem_assign( kde_KFileItem* instPointer,kde_KFileItem* item){
	((KFileItemBridge*)instPointer)->assign((KFileItem&)* (KFileItem*)item);
	return;
}
void kde_KFileItem_init( kde_KFileItem* instPointer,int _determineMimeTypeOnDemand){
	((KFileItemBridge*)instPointer)->protected_init((bool)_determineMimeTypeOnDemand);
	return;
}
qt_QString * kde_KFileItem_parsePermissions( kde_KFileItem* instPointer,long perm){
	return (qt_QString *)new QString(((KFileItemBridge*)instPointer)->protected_parsePermissions((mode_t)perm));
}
