/***************************************************************************
                            QSqlCursor.h -  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.                       *
 *                                                                         *
 ***************************************************************************/

#ifndef QSQLCURSOR_H
#define QSQLCURSOR_H

#include <Foundation/NSObject.h>
#include <Foundation/NSString.h>
#include <qtobjc/QSqlQuery.h>
#include <qtobjc/QSqlRecord.h>

/**

*
* Definition of QSqlIndex class
*
* Created : 2000-11-03
*
* Copyright (C) 2000 Trolltech AS.  All rights reserved.
*
* This file is part of the sql module of the Qt GUI Toolkit.
*
* This file may be distributed under the terms of the Q Public License
* as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* Licensees holding valid Qt Enterprise Edition licenses may use this
* file in accordance with the Qt Commercial License Agreement provided
* with the Software.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
*   information about Qt Commercial License Agreements.
* See http://www.trolltech.com/qpl/ for QPL licensing information.
* See http://www.trolltech.com/gpl/ for GPL licensing information.
*
* Contact info@trolltech.com if any conditions of this licensing are
* not clear to you.
*
********************************************************************
 @short 
*
* Definition of QSqlIndex class
*
* Created : 2000-11-03
*
* Copyright (C) 2000 Trolltech AS.
*/

@class QSqlDatabase;
@class QSqlIndex;

@interface QSqlCursor : QSqlRecord
- initWithText: (NSString *)name autopopulate: (BOOL)autopopulate db: (QSqlDatabase*)db;
- init;
- copyWithZone: (NSZone *) zone;
- (void) dealloc;
- (QVariant*) value: (int)i;
- (QVariant*) valueForName: (NSString *)name;
- (QSqlIndex*) primaryIndex: (BOOL)prime;
- (QSqlIndex*) primaryIndex;
- (QSqlIndex*) indexForFields: (NSArray *)fieldNames;
- (QSqlIndex*) indexForField: (NSString *)fieldName;
//- (QSqlIndex*) index: (NSString *)fieldName;
- setPrimaryIndex: (QSqlIndex*)idx;
//- append: (QSqlFieldInfo*)fieldInfo;
//- insert: (int)pos fieldInfo: (QSqlFieldInfo*)fieldInfo;
- remove: (int)pos;
- clear;
- setGeneratedForName: (NSString *)name generated: (BOOL)generated;
- setGenerated: (int)i generated: (BOOL)generated;
- (QSqlRecord*) editBuffer: (BOOL)copy;
- (QSqlRecord*) editBuffer;
- (QSqlRecord*) primeInsert;
- (QSqlRecord*) primeUpdate;
- (QSqlRecord*) primeDelete;
- (int) insert: (BOOL)invalidate;
- (int) insert;
- (int) update: (BOOL)invalidate;
- (int) update;
- (int) del: (BOOL)invalidate;
- (int) del;
- setMode: (int)flags;
- (int) mode;
- setCalculated: (NSString *)name calculated: (BOOL)calculated;
- (BOOL) isCalculated: (NSString *)name;
- setTrimmed: (NSString *)name trim: (BOOL)trim;
- (BOOL) isTrimmed: (NSString *)name;
- (BOOL) isReadOnly;
- (BOOL) canInsert;
- (BOOL) canUpdate;
- (BOOL) canDelete;
- (BOOL) select;
- (BOOL) select: (QSqlIndex*)sort;
- (BOOL) select: (QSqlIndex*)filter sort: (QSqlIndex*)sort;
- (BOOL) selectWithFilter: (NSString *)filter sort: (QSqlIndex*)sort;
- (BOOL) selectWithFilter: (NSString *)filter ;
- setSort: (QSqlIndex*)sort;
- (QSqlIndex*) sort;
- setFilter: (NSString *)filter;
- (NSString *) filter;
- setName: (NSString *)name autopopulate: (BOOL)autopopulate;
- setName: (NSString *)name ;
- (NSString *) name;
//- (NSString *) toString: (NSString *)prefix separator: (NSString*) sep;
- afterSeek;
- (BOOL) exec: (NSString *)sql;
- (QVariant*) calculateField: (NSString *)name;
- (int) updateWithFilter: (NSString *)filter invalidate: (BOOL)invalidate;
- (int) updateWithFilter: (NSString *)filter ;
- (int) deleteWithFilter: (NSString *)filter invalidate: (BOOL)invalidate;
- (int) deleteWithFilter: (NSString *)filter ;
- (NSString *) toString: (NSString *)prefix field: (QSqlField*)field fieldSep: (NSString *)fieldSep;
- (NSString *) toString: (QSqlRecord*)rec prefix: (NSString *)prefix fieldSep: (NSString *)fieldSep separator: (NSString *)sep;
- (NSString *) toString: (QSqlIndex*)i rec: (QSqlRecord*)rec prefix: (NSString *)prefix fieldSep: (NSString *)fieldSep separator: (NSString *)sep;
+ (int) ReadOnly;
+ (int) Insert;
+ (int) Update;
+ (int) Delete;
+ (int) Writable;
@end

@class QSqlDatabase; 
@class QSqlFieldInfo; 
@class QSqlIndex; 

@interface QSqlCursor (QSqlQueryImplementation) <QSqlQueryInterface>
@end

#endif
