/***************************************************************************
                            QSessionManager.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_QStringList.h>
#include <qtc/qt_QCString.h>
#include <qtc/qt_QSessionManager.h>
#include <qtobjc/QSessionManager.h>

@implementation  QSessionManager


- (NSString *) sessionId
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QSessionManager_sessionId((qt_QSessionManager *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (void*) handle
{
	return (void*) qt_QSessionManager_handle((qt_QSessionManager *)[self qt]);
}

- (BOOL) allowsInteraction
{
	return (BOOL) qt_QSessionManager_allowsInteraction((qt_QSessionManager *)[self qt]);
}

- (BOOL) allowsErrorInteraction
{
	return (BOOL) qt_QSessionManager_allowsErrorInteraction((qt_QSessionManager *)[self qt]);
}

- release
{
	qt_QSessionManager_release((qt_QSessionManager *)[self qt]);
	return self;
}

- cancel
{
	qt_QSessionManager_cancel((qt_QSessionManager *)[self qt]);
	return self;
}

- setRestartHint: (int)arg1
{
	qt_QSessionManager_setRestartHint((qt_QSessionManager *)[self qt], (int)arg1);
	return self;
}

- (int) restartHint
{
	return (int) qt_QSessionManager_restartHint((qt_QSessionManager *)[self qt]);
}

- setRestartCommand: (NSArray *)arg1
{
static qt_QStringList * _qlist_arg1 = 0L;
	qt_QSessionManager_setRestartCommand((qt_QSessionManager *)[self qt], (qt_QStringList*) [arg1 toQStringList: (void *)&_qlist_arg1]);
	return self;
}

- (NSArray *) restartCommand
{
static qt_QStringList * _qlist = 0L;
	_qlist = qt_QSessionManager_restartCommand((qt_QSessionManager *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- setDiscardCommand: (NSArray *)arg1
{
static qt_QStringList * _qlist_arg1 = 0L;
	qt_QSessionManager_setDiscardCommand((qt_QSessionManager *)[self qt], (qt_QStringList*) [arg1 toQStringList: (void *)&_qlist_arg1]);
	return self;
}

- (NSArray *) discardCommand
{
static qt_QStringList * _qlist = 0L;
	_qlist = qt_QSessionManager_discardCommand((qt_QSessionManager *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- setManagerProperty: (NSString *)name value: (NSString *)value
{
static qt_QString * _qstring_value = 0L;
static qt_QString * _qstring_name = 0L;
	qt_QSessionManager_setManagerProperty((qt_QSessionManager *)[self qt], (qt_QString *) [name toQString: &_qstring_name], (qt_QString *) [value toQString: &_qstring_value]);
	return self;
}

- setManagerProperty: (NSString *)name valueList: (NSArray *)value
{
static qt_QStringList * _qlist_value = 0L;
static qt_QString * _qstring_name = 0L;
	qt_QSessionManager_setManagerProperty1((qt_QSessionManager *)[self qt], (qt_QString *) [name toQString: &_qstring_name], (qt_QStringList*) [value toQStringList: (void *)&_qlist_value]);
	return self;
}

- (BOOL) isPhase2
{
	return (BOOL) qt_QSessionManager_isPhase2((qt_QSessionManager *)[self qt]);
}

- requestPhase2
{
	qt_QSessionManager_requestPhase2((qt_QSessionManager *)[self qt]);
	return self;
}

+ (int) RestartIfRunning
{
	return (int) QSESSIONMANAGER_RestartIfRunning;
}

+ (int) RestartAnyway
{
	return (int) QSESSIONMANAGER_RestartAnyway;
}

+ (int) RestartImmediately
{
	return (int) QSESSIONMANAGER_RestartImmediately;
}

+ (int) RestartNever
{
	return (int) QSESSIONMANAGER_RestartNever;
}

@end
