/***************************************************************************
                            KSSLInfoDlg.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_KSSLInfoDlg.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KSSLInfoDlg.h>
#include <kdeobjc/KSSLCertificate.h>

#include <kdeobjc/KSSL.h>


@implementation  KSSLInfoDlg


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

- initWithBOOL: (BOOL)secureConnection 
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KSSLInfoDlg((int)secureConnection, 0, 0, 0)];
		[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_KSSLInfoDlg((kde_KSSLInfoDlg *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- setSecurityInQuestion: (BOOL)isIt
{
	kde_KSSLInfoDlg_setSecurityInQuestion((kde_KSSLInfoDlg *)[self qt], (int)isIt);
	return self;
}

- setup: (KSSLCertificate*)cert ip: (NSString *)ip url: (NSString *)url cipher: (NSString *)cipher cipherdesc: (NSString *)cipherdesc sslversion: (NSString *)sslversion usedbits: (int)usedbits bits: (int)bits certState: (int)certState
{
static qt_QString * _qstring_sslversion = 0L;
static qt_QString * _qstring_cipherdesc = 0L;
static qt_QString * _qstring_cipher = 0L;
static qt_QString * _qstring_url = 0L;
static qt_QString * _qstring_ip = 0L;
	kde_KSSLInfoDlg_setup((kde_KSSLInfoDlg *)[self qt], (kde_KSSLCertificate*) [cert qt], (qt_QString *) [ip toQString: &_qstring_ip], (qt_QString *) [url toQString: &_qstring_url], (qt_QString *) [cipher toQString: &_qstring_cipher], (qt_QString *) [cipherdesc toQString: &_qstring_cipherdesc], (qt_QString *) [sslversion toQString: &_qstring_sslversion], (int)usedbits, (int)bits, (int)certState);
	return self;
}

- setup: (KSSL*)ssl ip: (NSString *)ip url: (NSString *)url
{
static qt_QString * _qstring_url = 0L;
static qt_QString * _qstring_ip = 0L;
	kde_KSSLInfoDlg_setup1((kde_KSSLInfoDlg *)[self qt], (kde_KSSL*) [ssl qt], (qt_QString *) [ip toQString: &_qstring_ip], (qt_QString *) [url toQString: &_qstring_url]);
	return self;
}

//+ (KSSLCertBox*) certInfoWidget: (QWidget *)parent certName: (NSString *)certName mailCatcher: (QWidget *)mailCatcher
//{
//static qt_QString * _qstring_certName = 0L;
//	return (KSSLCertBox*) [QtSupport objectForQtKey: kde_KSSLInfoDlg_certInfoWidget((qt_QWidget *) [parent qt], (qt_QString *) [certName toQString: &_qstring_certName], (qt_QWidget *) [mailCatcher qt]) withClass: [KSSLCertBox class] allocatedInObjcWorld: YES];
//}

//+ (KSSLCertBox*) certInfoWidget: (QWidget *)parent certName: (NSString *)certName
//{
//static qt_QString * _qstring_certName = 0L;
//	return (KSSLCertBox*) [QtSupport objectForQtKey: kde_KSSLInfoDlg_certInfoWidget((qt_QWidget *) [parent qt], (qt_QString *) [certName toQString: &_qstring_certName], 0) withClass: [KSSLCertBox class] allocatedInObjcWorld: YES];
//}

@end
