/***************************************************************************
                            ReadWritePart.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_ReadWritePart.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/ReadWritePart.h>
#include <kdeobjc/KURL.h>


@implementation  ReadWritePart


- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parent] == nil) {
			kde_del_ReadWritePart((kde_ReadWritePart *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (BOOL) isReadWrite
{
	return (BOOL) kde_ReadWritePart_isReadWrite((kde_ReadWritePart *)[self qt]);
}

- setReadWrite: (BOOL)readwrite
{
	kde_ReadWritePart_setReadWrite((kde_ReadWritePart *)[self qt], (int)readwrite);
	return self;
}

- setReadWrite
{
	kde_ReadWritePart_setReadWrite((kde_ReadWritePart *)[self qt], 1);
	return self;
}

- (BOOL) isModified
{
	return (BOOL) kde_ReadWritePart_isModified((kde_ReadWritePart *)[self qt]);
}

- (BOOL) closeURL
{
	return (BOOL) kde_ReadWritePart_closeURL((kde_ReadWritePart *)[self qt]);
}

- (BOOL) saveAs: (KURL*)url
{
	return (BOOL) kde_ReadWritePart_saveAs((kde_ReadWritePart *)[self qt], (kde_KURL*) [url qt]);
}

- setModified: (BOOL)modified
{
	kde_ReadWritePart_setModified((kde_ReadWritePart *)[self qt], (int)modified);
	return self;
}

- setModified
{
	kde_ReadWritePart_setModified1((kde_ReadWritePart *)[self qt]);
	return self;
}

- (BOOL) save
{
	return (BOOL) kde_ReadWritePart_save((kde_ReadWritePart *)[self qt]);
}

@end
