/***************************************************************************
                            KEdFind.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_KEdFind.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KEdFind.h>

@implementation  KEdFind


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

- init
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KEdFind(0, 0, 1)];
		[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_KEdFind((kde_KEdFind *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (NSString *) getText
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KEdFind_getText((kde_KEdFind *)[self qt]);
	return [NSString fromQString: _qstring];
}

- setText: (NSString *)string
{
static qt_QString * _qstring_string = 0L;
	kde_KEdFind_setText((kde_KEdFind *)[self qt], (qt_QString *) [string toQString: &_qstring_string]);
	return self;
}

- setCaseSensitive: (BOOL)b
{
	kde_KEdFind_setCaseSensitive((kde_KEdFind *)[self qt], (int)b);
	return self;
}

- (BOOL) case_sensitive
{
	return (BOOL) kde_KEdFind_case_sensitive((kde_KEdFind *)[self qt]);
}

- setDirection: (BOOL)b
{
	kde_KEdFind_setDirection((kde_KEdFind *)[self qt], (int)b);
	return self;
}

- (BOOL) get_direction
{
	return (BOOL) kde_KEdFind_get_direction((kde_KEdFind *)[self qt]);
}

- (KHistoryCombo*) searchCombo
{
	return (KHistoryCombo*) [QtSupport objectForQtKey: kde_KEdFind_searchCombo((kde_KEdFind *)[self qt]) withClass: [KHistoryCombo class] allocatedInObjcWorld: YES];
}

- slotCancel
{
	kde_KEdFind_slotCancel((kde_KEdFind *)[self qt]);
	return self;
}

- slotUser1
{
	kde_KEdFind_slotUser1((kde_KEdFind *)[self qt]);
	return self;
}

- textSearchChanged: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	kde_KEdFind_textSearchChanged((kde_KEdFind *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return self;
}

@end
