/***************************************************************************
                            QDockWindow.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_QDockWindow.h>
#include <qtobjc/QDockWindow.h>

@implementation  QDockWindow


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

- init
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QDockWindow([QDockWindow InDock], 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) {
			qt_del_QDockWindow((qt_QDockWindow *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- setWidget: (QWidget *)w
{
	qt_QDockWindow_setWidget((qt_QDockWindow *)[self qt], (qt_QWidget *) [w qt]);
	return self;
}

- (QWidget*) widget
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QDockWindow_widget((qt_QDockWindow *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- (int) place
{
	return (int) qt_QDockWindow_place((qt_QDockWindow *)[self qt]);
}

- (QDockArea*) area
{
	return (QDockArea*) [QtSupport objectForQtKey: qt_QDockWindow_area((qt_QDockWindow *)[self qt]) withClass: [QDockArea class] allocatedInObjcWorld: YES];
}

- setCloseMode: (int)m
{
	qt_QDockWindow_setCloseMode((qt_QDockWindow *)[self qt], (int)m);
	return self;
}

- (BOOL) isCloseEnabled
{
	return (BOOL) qt_QDockWindow_isCloseEnabled((qt_QDockWindow *)[self qt]);
}

- (int) closeMode
{
	return (int) qt_QDockWindow_closeMode((qt_QDockWindow *)[self qt]);
}

- setResizeEnabled: (BOOL)b
{
	qt_QDockWindow_setResizeEnabled((qt_QDockWindow *)[self qt], (int)b);
	return self;
}

- setMovingEnabled: (BOOL)b
{
	qt_QDockWindow_setMovingEnabled((qt_QDockWindow *)[self qt], (int)b);
	return self;
}

- (BOOL) isResizeEnabled
{
	return (BOOL) qt_QDockWindow_isResizeEnabled((qt_QDockWindow *)[self qt]);
}

- (BOOL) isMovingEnabled
{
	return (BOOL) qt_QDockWindow_isMovingEnabled((qt_QDockWindow *)[self qt]);
}

- setHorizontallyStretchable: (BOOL)b
{
	qt_QDockWindow_setHorizontallyStretchable((qt_QDockWindow *)[self qt], (int)b);
	return self;
}

- setVerticallyStretchable: (BOOL)b
{
	qt_QDockWindow_setVerticallyStretchable((qt_QDockWindow *)[self qt], (int)b);
	return self;
}

- (BOOL) isHorizontallyStretchable
{
	return (BOOL) qt_QDockWindow_isHorizontallyStretchable((qt_QDockWindow *)[self qt]);
}

- (BOOL) isVerticallyStretchable
{
	return (BOOL) qt_QDockWindow_isVerticallyStretchable((qt_QDockWindow *)[self qt]);
}

- setHorizontalStretchable: (BOOL)b
{
	qt_QDockWindow_setHorizontalStretchable((qt_QDockWindow *)[self qt], (int)b);
	return self;
}

- setVerticalStretchable: (BOOL)b
{
	qt_QDockWindow_setVerticalStretchable((qt_QDockWindow *)[self qt], (int)b);
	return self;
}

- (BOOL) isHorizontalStretchable
{
	return (BOOL) qt_QDockWindow_isHorizontalStretchable((qt_QDockWindow *)[self qt]);
}

- (BOOL) isVerticalStretchable
{
	return (BOOL) qt_QDockWindow_isVerticalStretchable((qt_QDockWindow *)[self qt]);
}

- (BOOL) isStretchable
{
	return (BOOL) qt_QDockWindow_isStretchable((qt_QDockWindow *)[self qt]);
}

- setOffset: (int)o
{
	qt_QDockWindow_setOffset((qt_QDockWindow *)[self qt], (int)o);
	return self;
}

- (int) offset
{
	return (int) qt_QDockWindow_offset((qt_QDockWindow *)[self qt]);
}

- setFixedExtentWidth: (int)w
{
	qt_QDockWindow_setFixedExtentWidth((qt_QDockWindow *)[self qt], (int)w);
	return self;
}

- setFixedExtentHeight: (int)h
{
	qt_QDockWindow_setFixedExtentHeight((qt_QDockWindow *)[self qt], (int)h);
	return self;
}

- (QSize*) fixedExtent
{
	return (QSize*) [QtSupport objectForQtKey: qt_QDockWindow_fixedExtent((qt_QDockWindow *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- setNewLine: (BOOL)b
{
	qt_QDockWindow_setNewLine((qt_QDockWindow *)[self qt], (int)b);
	return self;
}

- (BOOL) newLine
{
	return (BOOL) qt_QDockWindow_newLine((qt_QDockWindow *)[self qt]);
}

- (int) orientation
{
	return (int) qt_QDockWindow_orientation((qt_QDockWindow *)[self qt]);
}

- (QSize*) sizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QDockWindow_sizeHint((qt_QDockWindow *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QSize*) minimumSize
{
	return (QSize*) [QtSupport objectForQtKey: qt_QDockWindow_minimumSize((qt_QDockWindow *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QSize*) minimumSizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QDockWindow_minimumSizeHint((qt_QDockWindow *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QBoxLayout*) boxLayout
{
	return (QBoxLayout*) [QtSupport objectForQtKey: qt_QDockWindow_boxLayout((qt_QDockWindow *)[self qt]) withClass: [QBoxLayout class] allocatedInObjcWorld: YES];
}

- setOpaqueMoving: (BOOL)b
{
	qt_QDockWindow_setOpaqueMoving((qt_QDockWindow *)[self qt], (int)b);
	return self;
}

- (BOOL) opaqueMoving
{
	return (BOOL) qt_QDockWindow_opaqueMoving((qt_QDockWindow *)[self qt]);
}

- (BOOL) eventFilter: (QObject *)o e: (QEvent *)e
{
	return (BOOL) qt_QDockWindow_eventFilter((qt_QDockWindow *)[self qt], (qt_QObject *) [o qt], (qt_QEvent *) [e qt]);
}

- (NSString *) caption
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QDockWindow_caption((qt_QDockWindow *)[self qt]);
	return [NSString fromQString: _qstring];
}

- undock: (QWidget *)w
{
	qt_QDockWindow_undock((qt_QDockWindow *)[self qt], (qt_QWidget *) [w qt]);
	return self;
}

- undock
{
	qt_QDockWindow_undock1((qt_QDockWindow *)[self qt]);
	return self;
}

- dock
{
	qt_QDockWindow_dock((qt_QDockWindow *)[self qt]);
	return self;
}

- setOrientation: (int)o
{
	qt_QDockWindow_setOrientation((qt_QDockWindow *)[self qt], (int)o);
	return self;
}

- setCaption: (NSString *)s
{
static qt_QString * _qstring_s = 0L;
	qt_QDockWindow_setCaption((qt_QDockWindow *)[self qt], (qt_QString *) [s toQString: &_qstring_s]);
	return self;
}

- (BOOL) event: (QEvent *)e
{
	return (BOOL) qt_QDockWindow_event((qt_QDockWindow *)[self qt], (qt_QEvent *) [e qt]);
}

+ (int) InDock
{
	return (int) QDOCKWINDOW_InDock;
}

+ (int) OutsideDock
{
	return (int) QDOCKWINDOW_OutsideDock;
}

+ (int) Never
{
	return (int) QDOCKWINDOW_Never;
}

+ (int) Docked
{
	return (int) QDOCKWINDOW_Docked;
}

+ (int) Undocked
{
	return (int) QDOCKWINDOW_Undocked;
}

+ (int) Always
{
	return (int) QDOCKWINDOW_Always;
}

@end
