/***************************************************************************
                            QScrollView.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_QScrollView.h>
#include <qtobjc/QScrollView.h>
#include <qtobjc/QPoint.h>
#include <qtobjc/QRect.h>
#include <qtobjc/QSize.h>

#include <qtobjc/QStyle.h>
#include <qtobjc/QPainter.h>

@implementation  QScrollView


- initWithWidget: (QWidget *)parent name: (NSString *)name f: (int)f
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QScrollView((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_QScrollView(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_QScrollView((qt_QScrollView *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- setResizePolicy: (int)arg1
{
	qt_QScrollView_setResizePolicy((qt_QScrollView *)[self qt], (int)arg1);
	return self;
}

- (int) resizePolicy
{
	return (int) qt_QScrollView_resizePolicy((qt_QScrollView *)[self qt]);
}

- styleChange: (QStyle*)arg1
{
	qt_QScrollView_styleChange((qt_QScrollView *)[self qt], (qt_QStyle*) [arg1 qt]);
	return self;
}

- removeChildWidget: (QWidget *)child
{
	qt_QScrollView_removeChild((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt]);
	return self;
}

- addChild: (QWidget *)child x: (int)x y: (int)y
{
	qt_QScrollView_addChild((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt], (int)x, (int)y);
	return self;
}

- addChild: (QWidget *)child 
{
	qt_QScrollView_addChild((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt], 0, 0);
	return self;
}

- moveChild: (QWidget *)child x: (int)x y: (int)y
{
	qt_QScrollView_moveChild((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt], (int)x, (int)y);
	return self;
}

- (int) childX: (QWidget *)child
{
	return (int) qt_QScrollView_childX((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt]);
}

- (int) childY: (QWidget *)child
{
	return (int) qt_QScrollView_childY((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt]);
}

- (BOOL) childIsVisible: (QWidget *)child
{
	return (BOOL) qt_QScrollView_childIsVisible((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt]);
}

- showChild: (QWidget *)child yes: (BOOL)yes
{
	qt_QScrollView_showChild((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt], (int)yes);
	return self;
}

- showChild: (QWidget *)child 
{
	qt_QScrollView_showChild((qt_QScrollView *)[self qt], (qt_QWidget *) [child qt], 1);
	return self;
}

- (int) vScrollBarMode
{
	return (int) qt_QScrollView_vScrollBarMode((qt_QScrollView *)[self qt]);
}

- setVScrollBarMode: (int)arg1
{
	qt_QScrollView_setVScrollBarMode((qt_QScrollView *)[self qt], (int)arg1);
	return self;
}

- (int) hScrollBarMode
{
	return (int) qt_QScrollView_hScrollBarMode((qt_QScrollView *)[self qt]);
}

- setHScrollBarMode: (int)arg1
{
	qt_QScrollView_setHScrollBarMode((qt_QScrollView *)[self qt], (int)arg1);
	return self;
}

- (QWidget*) cornerWidget
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QScrollView_cornerWidget((qt_QScrollView *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- setCornerWidget: (QWidget *)arg1
{
	qt_QScrollView_setCornerWidget((qt_QScrollView *)[self qt], (qt_QWidget *) [arg1 qt]);
	return self;
}

- (QScrollBar*) horizontalScrollBar
{
	return (QScrollBar*) [QtSupport objectForQtKey: qt_QScrollView_horizontalScrollBar((qt_QScrollView *)[self qt]) withClass: [QScrollBar class] allocatedInObjcWorld: YES];
}

- (QScrollBar*) verticalScrollBar
{
	return (QScrollBar*) [QtSupport objectForQtKey: qt_QScrollView_verticalScrollBar((qt_QScrollView *)[self qt]) withClass: [QScrollBar class] allocatedInObjcWorld: YES];
}

- (QWidget*) viewport
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QScrollView_viewport((qt_QScrollView *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- (QWidget*) clipper
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QScrollView_clipper((qt_QScrollView *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- (int) visibleWidth
{
	return (int) qt_QScrollView_visibleWidth((qt_QScrollView *)[self qt]);
}

- (int) visibleHeight
{
	return (int) qt_QScrollView_visibleHeight((qt_QScrollView *)[self qt]);
}

- (int) contentsWidth
{
	return (int) qt_QScrollView_contentsWidth((qt_QScrollView *)[self qt]);
}

- (int) contentsHeight
{
	return (int) qt_QScrollView_contentsHeight((qt_QScrollView *)[self qt]);
}

- (int) contentsX
{
	return (int) qt_QScrollView_contentsX((qt_QScrollView *)[self qt]);
}

- (int) contentsY
{
	return (int) qt_QScrollView_contentsY((qt_QScrollView *)[self qt]);
}

- resize: (int)w h: (int)h
{
	qt_QScrollView_resize((qt_QScrollView *)[self qt], (int)w, (int)h);
	return self;
}

- resize: (QSize *)arg1
{
	qt_QScrollView_resize1((qt_QScrollView *)[self qt], (qt_QSize *) [arg1 qt]);
	return self;
}

- show
{
	qt_QScrollView_show((qt_QScrollView *)[self qt]);
	return self;
}

- updateContents: (int)x y: (int)y w: (int)w h: (int)h
{
	qt_QScrollView_updateContents((qt_QScrollView *)[self qt], (int)x, (int)y, (int)w, (int)h);
	return self;
}

- updateContentsInRect: (QRect*)r
{
	qt_QScrollView_updateContents1((qt_QScrollView *)[self qt], (qt_QRect*) [r qt]);
	return self;
}

- updateContents
{
	qt_QScrollView_updateContents2((qt_QScrollView *)[self qt]);
	return self;
}

- repaintContents: (int)x y: (int)y w: (int)w h: (int)h erase: (BOOL)erase
{
	qt_QScrollView_repaintContents((qt_QScrollView *)[self qt], (int)x, (int)y, (int)w, (int)h, (int)erase);
	return self;
}

- repaintContents: (int)x y: (int)y w: (int)w h: (int)h 
{
	qt_QScrollView_repaintContents((qt_QScrollView *)[self qt], (int)x, (int)y, (int)w, (int)h, 1);
	return self;
}

- repaintContentsInRect: (QRect*)r erase: (BOOL)erase
{
	qt_QScrollView_repaintContents1((qt_QScrollView *)[self qt], (qt_QRect*) [r qt], (int)erase);
	return self;
}

- repaintContentsInRect: (QRect*)r
{
	qt_QScrollView_repaintContents1((qt_QScrollView *)[self qt], (qt_QRect*) [r qt], 1);
	return self;
}

- repaintContents: (BOOL)erase
{
	qt_QScrollView_repaintContents2((qt_QScrollView *)[self qt], (int)erase);
	return self;
}

- repaintContents
{
	qt_QScrollView_repaintContents2((qt_QScrollView *)[self qt], 1);
	return self;
}

- contentsToViewport: (int)x y: (int)y vx: (int)vx vy: (int)vy
{
	qt_QScrollView_contentsToViewport((qt_QScrollView *)[self qt], (int)x, (int)y, (int)vx, (int)vy);
	return self;
}

- viewportToContents: (int)vx vy: (int)vy x: (int)x y: (int)y
{
	qt_QScrollView_viewportToContents((qt_QScrollView *)[self qt], (int)vx, (int)vy, (int)x, (int)y);
	return self;
}

- (QPoint*) contentsToViewport: (QPoint*)arg1
{
	return (QPoint*) [QtSupport objectForQtKey: qt_QScrollView_contentsToViewport1((qt_QScrollView *)[self qt], (qt_QPoint*) [arg1 qt]) withClass: [QPoint class] allocatedInObjcWorld: YES];
}

- (QPoint*) viewportToContents: (QPoint*)arg1
{
	return (QPoint*) [QtSupport objectForQtKey: qt_QScrollView_viewportToContents1((qt_QScrollView *)[self qt], (qt_QPoint*) [arg1 qt]) withClass: [QPoint class] allocatedInObjcWorld: YES];
}

- enableClipper: (BOOL)y
{
	qt_QScrollView_enableClipper((qt_QScrollView *)[self qt], (int)y);
	return self;
}

- setStaticBackground: (BOOL)y
{
	qt_QScrollView_setStaticBackground((qt_QScrollView *)[self qt], (int)y);
	return self;
}

- (BOOL) hasStaticBackground
{
	return (BOOL) qt_QScrollView_hasStaticBackground((qt_QScrollView *)[self qt]);
}

- (QSize*) viewportSize: (int)arg1 int: (int)arg2
{
	return (QSize*) [QtSupport objectForQtKey: qt_QScrollView_viewportSize((qt_QScrollView *)[self qt], (int)arg1, (int)arg2) withClass: [QSize class] allocatedInObjcWorld: YES];
}

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

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

- removeChild: (QObject *)child
{
	qt_QScrollView_removeChild1((qt_QScrollView *)[self qt], (qt_QObject *) [child qt]);
	return self;
}

- setDragAutoScroll: (BOOL)b
{
	qt_QScrollView_setDragAutoScroll((qt_QScrollView *)[self qt], (int)b);
	return self;
}

- (BOOL) dragAutoScroll
{
	return (BOOL) qt_QScrollView_dragAutoScroll((qt_QScrollView *)[self qt]);
}

- resizeContents: (int)w h: (int)h
{
	qt_QScrollView_resizeContents((qt_QScrollView *)[self qt], (int)w, (int)h);
	return self;
}

- scrollBy: (int)dx dy: (int)dy
{
	qt_QScrollView_scrollBy((qt_QScrollView *)[self qt], (int)dx, (int)dy);
	return self;
}

- setContentsPos: (int)x y: (int)y
{
	qt_QScrollView_setContentsPos((qt_QScrollView *)[self qt], (int)x, (int)y);
	return self;
}

- ensureVisible: (int)x y: (int)y
{
	qt_QScrollView_ensureVisible((qt_QScrollView *)[self qt], (int)x, (int)y);
	return self;
}

- ensureVisible: (int)x y: (int)y xmargin: (int)xmargin ymargin: (int)ymargin
{
	qt_QScrollView_ensureVisible1((qt_QScrollView *)[self qt], (int)x, (int)y, (int)xmargin, (int)ymargin);
	return self;
}

- center: (int)x y: (int)y
{
	qt_QScrollView_center((qt_QScrollView *)[self qt], (int)x, (int)y);
	return self;
}

- center: (int)x y: (int)y xmargin: (float)xmargin ymargin: (float)ymargin
{
	qt_QScrollView_center1((qt_QScrollView *)[self qt], (int)x, (int)y, (float)xmargin, (float)ymargin);
	return self;
}

- updateScrollBars
{
	qt_QScrollView_updateScrollBars((qt_QScrollView *)[self qt]);
	return self;
}

- setEnabled: (BOOL)enable
{
	qt_QScrollView_setEnabled((qt_QScrollView *)[self qt], (int)enable);
	return self;
}

- drawContents: (QPainter *)arg1 cx: (int)cx cy: (int)cy cw: (int)cw ch: (int)ch
{
	qt_QScrollView_drawContents((qt_QScrollView *)[self qt], (qt_QPainter *) [arg1 qt], (int)cx, (int)cy, (int)cw, (int)ch);
	return self;
}

- drawContentsOffset: (QPainter *)arg1 ox: (int)ox oy: (int)oy cx: (int)cx cy: (int)cy cw: (int)cw ch: (int)ch
{
	qt_QScrollView_drawContentsOffset((qt_QScrollView *)[self qt], (qt_QPainter *) [arg1 qt], (int)ox, (int)oy, (int)cx, (int)cy, (int)cw, (int)ch);
	return self;
}

- frameChanged
{
	qt_QScrollView_frameChanged((qt_QScrollView *)[self qt]);
	return self;
}

- setMargins: (int)left top: (int)top right: (int)right bottom: (int)bottom
{
	qt_QScrollView_setMargins((qt_QScrollView *)[self qt], (int)left, (int)top, (int)right, (int)bottom);
	return self;
}

- (int) leftMargin
{
	return (int) qt_QScrollView_leftMargin((qt_QScrollView *)[self qt]);
}

- (int) topMargin
{
	return (int) qt_QScrollView_topMargin((qt_QScrollView *)[self qt]);
}

- (int) rightMargin
{
	return (int) qt_QScrollView_rightMargin((qt_QScrollView *)[self qt]);
}

- (int) bottomMargin
{
	return (int) qt_QScrollView_bottomMargin((qt_QScrollView *)[self qt]);
}

- (BOOL) focusNextPrevChild: (BOOL)next
{
	return (BOOL) qt_QScrollView_focusNextPrevChild((qt_QScrollView *)[self qt], (int)next);
}

- setHBarGeometry: (QScrollBar*)hbar x: (int)x y: (int)y w: (int)w h: (int)h
{
	qt_QScrollView_setHBarGeometry((qt_QScrollView *)[self qt], (qt_QScrollBar*) [hbar qt], (int)x, (int)y, (int)w, (int)h);
	return self;
}

- setVBarGeometry: (QScrollBar*)vbar x: (int)x y: (int)y w: (int)w h: (int)h
{
	qt_QScrollView_setVBarGeometry((qt_QScrollView *)[self qt], (qt_QScrollBar*) [vbar qt], (int)x, (int)y, (int)w, (int)h);
	return self;
}

- (BOOL) eventFilter: (QObject *)arg1 e: (QEvent *)e
{
	return (BOOL) qt_QScrollView_eventFilter((qt_QScrollView *)[self qt], (qt_QObject *) [arg1 qt], (qt_QEvent *) [e qt]);
}

+ (int) Default
{
	return (int) QSCROLLVIEW_Default;
}

+ (int) Manual
{
	return (int) QSCROLLVIEW_Manual;
}

+ (int) AutoOne
{
	return (int) QSCROLLVIEW_AutoOne;
}

+ (int) AutoOneFit
{
	return (int) QSCROLLVIEW_AutoOneFit;
}

+ (int) Auto
{
	return (int) QSCROLLVIEW_Auto;
}

+ (int) AlwaysOff
{
	return (int) QSCROLLVIEW_AlwaysOff;
}

+ (int) AlwaysOn
{
	return (int) QSCROLLVIEW_AlwaysOn;
}

@end
