/***************************************************************************
                            QWhatsThis.m -  description
                             -------------------
    begin                : Wed Nov 21 12:08:37 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 12:08:37 2001, 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 <qtc/qt_QWhatsThis.h>
#include <qtobjc/QWhatsThis.h>
#include <qtobjc/QWidget.h>
#include <qtobjc/QPoint.h>
#include <qtobjc/QToolButton.h>
#include <qtobjc/QCursor.h>

@implementation  QWhatsThis


- initWithWidget: (QWidget *)arg1
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QWhatsThis((qt_QWidget *) [arg1 qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld]) {
			qt_del_QWhatsThis((qt_QWhatsThis *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (NSString *) text: (QPoint*)arg1
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QWhatsThis_text((qt_QWhatsThis *)[self qt], (qt_QPoint*) [arg1 qt]);
	return [NSString fromQString: _qstring];
}

- (BOOL) clicked: (NSString *)href
{
static qt_QString * _qstring_href = 0L;
	return (BOOL) qt_QWhatsThis_clicked((qt_QWhatsThis *)[self qt], (qt_QString *) [href toQString: &_qstring_href]);
}

+ add: (QWidget *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
	qt_QWhatsThis_add((qt_QWidget *) [arg1 qt], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
	return self;
}

+ remove: (QWidget *)arg1
{
	qt_QWhatsThis_remove((qt_QWidget *) [arg1 qt]);
	return self;
}

+ (NSString *) textFor: (QWidget *)arg1 pos: (QPoint*)pos includeParents: (BOOL)includeParents
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QWhatsThis_textFor((qt_QWidget *) [arg1 qt], (qt_QPoint*) [pos qt], (int)includeParents);
	return [NSString fromQString: _qstring];
}

+ (QToolButton*) whatsThisButton: (QWidget *)parent
{
	return (QToolButton*) [QtSupport objectForQtKey: qt_QWhatsThis_whatsThisButton((qt_QWidget *) [parent qt]) withClass: [QToolButton class] allocatedInObjcWorld: YES];
}

+ enterWhatsThisMode
{
	qt_QWhatsThis_enterWhatsThisMode();
	return self;
}

+ (BOOL) inWhatsThisMode
{
	return (BOOL) qt_QWhatsThis_inWhatsThisMode();
}

+ leaveWhatsThisMode: (NSString *)arg1 pos: (QPoint*)pos w: (QWidget *)w
{
static qt_QString * _qstring_arg1 = 0L;
	qt_QWhatsThis_leaveWhatsThisMode((qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QPoint*) [pos qt], (qt_QWidget *) [w qt]);
	return self;
}

+ leaveWhatsThisMode
{
	qt_QWhatsThis_leaveWhatsThisMode(qt_QString_null(), 0, 0);
	return self;
}

+ display: (NSString *)text pos: (QPoint*)pos w: (QWidget *)w
{
static qt_QString * _qstring_text = 0L;
	qt_QWhatsThis_display((qt_QString *) [text toQString: &_qstring_text], (qt_QPoint*) [pos qt], (qt_QWidget *) [w qt]);
	return self;
}

+ display: (NSString *)text 
{
static qt_QString * _qstring_text = 0L;
	qt_QWhatsThis_display((qt_QString *) [text toQString: &_qstring_text], 0, 0);
	return self;
}

@end
