/**
 * Copyright Frederik M.J.V. 2010 - LGPL 2.1 / GPLv3
 */
package com.lekebilen.quasseldroid.qtcomm;

public class QMetaType<T extends Object> extends Object{
    public enum Type {
    	//%s/\(\S\+\) = \(\d\+\),/\1(\2),\r/g   
        // these are merged with QVariant
    	Void(0),
    	Bool(1),
    	Int(2),
    	UInt(3),
    	LongLong(4),
    	ULongLong(5),

    	Double(6),
    	QChar(7),
    	QVariantMap(8),
    	QVariantList(9),

    	QString(10),
    	QStringList(11),
    	QByteArray(12),

    	QBitArray(13),
    	QDate(14),
    	QTime(15),
    	QDateTime(16),
    	QUrl(17),

    	QLocale(18),
    	QRect(19),
    	QRectF(20),
    	QSize(21),
    	QSizeF(22),

    	QLine(23),
    	QLineF(24),
    	QPoint(25),
    	QPointF(26),
    	QRegExp(27),

    	QVariantHash(28),
    	QEasingCurve(29),
    	LastCoreType(29),

    	FirstGuiType(63), /* QColorGroup */
    	//#ifdef QT3_SUPPORT
    	QColorGroup(63),

    	//#endif
    	QFont(64),
    	QPixmap(65),
    	QBrush(66),
    	QColor(67),
    	QPalette(68),

    	QIcon(69),
    	QImage(70),
    	QPolygon(71),
    	QRegion(72),
    	QBitmap(73),

    	QCursor(74),
    	QSizePolicy(75),
    	QKeySequence(76),
    	QPen(77),

    	QTextLength(78),
    	QTextFormat(79),
    	QMatrix(80),
    	QTransform(81),

    	QMatrix4x4(82),
    	QVector2D(83),
    	QVector3D(84),
    	QVector4D(85),

    	QQuaternion(86),

    	LastGuiType(86),

    	FirstCoreExtType(128),
    	/* VoidStar */
    	VoidStar(128),
    	Long(129),
    	Short(130),
    	Char(131),
    	ULong(132),

    	UShort(133),
    	UChar(134),
    	Float(135),
    	QObjectStar(136),
    	QWidgetStar(137),

    	QVariant(138),

    	LastCoreExtType(138),

    	QReal(6),//double
    	User(256),
    	UserType(127);//From qvariant
    	
        int value;
        Type(int value){
        	this.value = value;
        }
        public int getValue(){
        	return value;
        }
    };
	
	int id;
	String name;
	QMetaTypeSerializer<T> serializer;
	public QMetaType(int id, String name){
		this.id = id;
		this.name = name;
		
	}
	public QMetaType(int id, String name, QMetaTypeSerializer<T> serializer){
		this.id = id;
		this.name = name;
		this.serializer = serializer;
		
	}
	public QMetaTypeSerializer<T> getSerializer(){
		System.out.println(id);
		return serializer;
	}
}
@@ -2253,18 +2253,48 @@
 alizer()
+ 
 %7B%0A
+%09%09if (serializer == null) %7B%0A%09
 %09%09System
@@ -2298,11 +2298,11 @@
 tem.
-out
+err
 .pri
@@ -2310,12 +2310,56 @@
 tln(
-id);
+%22Unimplemented serializer!: %22 + this.name);%0A%09%09%7D%0A
 %0A%09%09r

add some warnings if we are asked for an unimplemented serializer