/***************************************************************************
                            QMetaProperty.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_QStrList.h>
#include <qtc/qt_QMetaProperty.h>
#include <qtobjc/QMetaProperty.h>

@implementation  QMetaProperty

- (void *) qt
{
	return _qt;
}

- setQt: (void *) qt
{
	_qt = qt;
	return self;
}

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

- setAllocatedInObjcWorld: (BOOL) yn
{
	_allocatedInObjcWorld = yn;
	return self;
}


- (NSString *) type
{
	return (NSString *) [NSString stringWithCString: qt_QMetaProperty_type((qt_QMetaProperty *)[self qt])];
}

- (NSString *) name
{
	return (NSString *) [NSString stringWithCString: qt_QMetaProperty_name((qt_QMetaProperty *)[self qt])];
}

- (BOOL) writable
{
	return (BOOL) qt_QMetaProperty_writable((qt_QMetaProperty *)[self qt]);
}

- (BOOL) isValid
{
	return (BOOL) qt_QMetaProperty_isValid((qt_QMetaProperty *)[self qt]);
}

- (BOOL) isSetType
{
	return (BOOL) qt_QMetaProperty_isSetType((qt_QMetaProperty *)[self qt]);
}

- (BOOL) isEnumType
{
	return (BOOL) qt_QMetaProperty_isEnumType((qt_QMetaProperty *)[self qt]);
}

- (NSArray *) enumKeys
{
static qt_QStrList * _qlist = 0L;
	_qlist = qt_QMetaProperty_enumKeys((qt_QMetaProperty *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQStrList: _qlist];
}

- (int) keyToValue: (NSString *)key
{
	return (int) qt_QMetaProperty_keyToValue((qt_QMetaProperty *)[self qt], (char*) [key cString]);
}

- (NSString *) valueToKey: (int)value
{
	return (NSString *) [NSString stringWithCString: qt_QMetaProperty_valueToKey((qt_QMetaProperty *)[self qt], (int)value)];
}

- (int) keysToValue: (NSArray *)keys
{
static qt_QStrList * _qlist_keys = 0L;
	return (int) qt_QMetaProperty_keysToValue((qt_QMetaProperty *)[self qt], (qt_QStrList *) [keys toQStrList: (void *)&_qlist_keys]);
}

- (NSArray *) valueToKeys: (int)value
{
static qt_QStrList * _qlist = 0L;
	_qlist = qt_QMetaProperty_valueToKeys((qt_QMetaProperty *)[self qt], (int)value);
	return (NSArray *) [NSMutableArray arrayWithQStrList: _qlist];
}

- (BOOL) designable: (QObject *)arg1
{
	return (BOOL) qt_QMetaProperty_designable((qt_QMetaProperty *)[self qt], (qt_QObject *) [arg1 qt]);
}

- (BOOL) scriptable: (QObject *)arg1
{
	return (BOOL) qt_QMetaProperty_scriptable((qt_QMetaProperty *)[self qt], (qt_QObject *) [arg1 qt]);
}

- (BOOL) stored: (QObject *)arg1
{
	return (BOOL) qt_QMetaProperty_stored((qt_QMetaProperty *)[self qt], (qt_QObject *) [arg1 qt]);
}

- (BOOL) reset: (QObject *)arg1
{
	return (BOOL) qt_QMetaProperty_reset((qt_QMetaProperty *)[self qt], (qt_QObject *) [arg1 qt]);
}

- (BOOL) testFlags: (unsigned int)f
{
	return (BOOL) qt_QMetaProperty_testFlags((qt_QMetaProperty *)[self qt], (unsigned int)f);
}

- (BOOL) stdSet
{
	return (BOOL) qt_QMetaProperty_stdSet((qt_QMetaProperty *)[self qt]);
}

- (int) id
{
	return (int) qt_QMetaProperty_id((qt_QMetaProperty *)[self qt]);
}

- clear
{
	qt_QMetaProperty_clear((qt_QMetaProperty *)[self qt]);
	return self;
}

+ (int) Invalid
{
	return (int) QMETAPROPERTY_Invalid;
}

+ (int) Readable
{
	return (int) QMETAPROPERTY_Readable;
}

+ (int) Writable
{
	return (int) QMETAPROPERTY_Writable;
}

+ (int) EnumOrSet
{
	return (int) QMETAPROPERTY_EnumOrSet;
}

+ (int) StdSet
{
	return (int) QMETAPROPERTY_StdSet;
}

+ (int) Override
{
	return (int) QMETAPROPERTY_Override;
}

@end
