from Ft.Ods import Enumeration

TYPEID=-101

class PrimitiveKindElement(Enumeration.EnumElement):
    nameMapping={0:'pk_boolean',
                 1:'pk_char',
                 2:'pk_string',
                 3:'pk_short',
                 4:'pk_ushort',
                 5:'pk_date',
                 6:'pk_time',
                 7:'pk_timestamp',
                 8:'pk_long',
                 9:'pk_ulong',
                 10:'pk_long_long',
                 11:'pk_float',
                 12:'pk_double',
                 13:'pk_octet',
                 14:'pk_interval',
                 15:'pk_void',
                 16:'pk_blob',
                 }
    def __init__(self,db,value):
        if value == None: value = 0
        if type(value) == type(()):
            value = value[0]
        Enumeration.EnumElement.__init__(self,db,self.nameMapping[value],value,'PrimitiveKind',TYPEID)

pk_boolean = PrimitiveKindElement(None,0)
pk_char = PrimitiveKindElement(None,1)
pk_string = PrimitiveKindElement(None,2)
pk_short = PrimitiveKindElement(None,3)
pk_ushort = PrimitiveKindElement(None,4)
pk_date = PrimitiveKindElement(None,5)
pk_time = PrimitiveKindElement(None,6)
pk_timestamp = PrimitiveKindElement(None,7)
pk_long = PrimitiveKindElement(None,8)
pk_ulong = PrimitiveKindElement(None,9)
pk_long_long = PrimitiveKindElement(None,10)
pk_float = PrimitiveKindElement(None,11)
pk_double = PrimitiveKindElement(None,12)
pk_octet = PrimitiveKindElement(None,13)
pk_interval = PrimitiveKindElement(None,14)
pk_void = PrimitiveKindElement(None,15)
pk_blob = PrimitiveKindElement(None,16)


class PrimitiveKindEnum(Enumeration.Enumeration):
    def __init__(self):
        Enumeration.Enumeration.__init__(self,
                                         "PrimitiveKind",
                                         TYPEID,
                                         [pk_boolean,
                                          pk_char,
                                          pk_string,
                                          pk_short,
                                          pk_ushort,
                                          pk_date,
                                          pk_time,
                                          pk_timestamp,
                                          pk_long,
                                          pk_ulong,
                                          pk_long_long,
                                          pk_float,
                                          pk_double,
                                          pk_octet,
                                          pk_interval,
                                          pk_void,
                                          pk_blob,
                                          ])


PrimitiveKind = PrimitiveKindEnum()
