from dataclasses import dataclass
from enum import Enum
from typing import Optional

class VecType(Enum):
    MULTIPOINT = 10
    POLYLINE = 20
    MULTIPOLYGON = 30
    DONT_KNOW = 40

class SourceType(Enum):
    SpatiaLiteServiceDescriptor = "es.jcyl.ita.crtcyl.client.dao.source.SpatiaLiteServiceDescriptor"
    RepoSpatiaLiteServiceDescriptor = "es.jcyl.ita.crtcyl.client.dao.source.RepoSpatiaLiteServiceDescriptor"
    SpatiaLiteQueryServiceDescriptor = "es.jcyl.ita.crtcyl.client.dao.source.SpatiaLiteQueryServiceDescriptor"
    PhotoServiceDescriptor = "es.jcyl.ita.crtdrd.photos.dao.source.PhotoServiceDescriptor"

@dataclass
class Source:
    id: str

@dataclass
class VectorialSource(Source):
    data_table: str
    db_url: str
    index_table: str

@dataclass
class PhotoSource(Source):
    class_manager: str
    path: str


@dataclass
class CrtdrdVectorialLayerData:

    layer_name: Optional[str] = None
    id: Optional[str] = None
    visible_name: Optional[str] = None
    description: Optional[str] = None
    vectorial_type: Optional[VecType] = None
    showed_on_toc: Optional[bool] = None
    order: Optional[int] = None
    z_order:Optional[int] = None
    range_min:Optional[int] = None
    range_max:Optional[int] = None
    renderize_labels:Optional[bool] = None
    label_range_min: Optional[int] = None
    label_range_max: Optional[int] = None
    geometry_size_restriction_min: Optional[int] = None
    geometry_size_restriction_max: Optional[int] = None
    label_expression: Optional[str] = None
    show_arrow_heads: Optional[bool] = None
    symb_id: Optional[str] = None #possible enum
    label_symb_id: Optional[str] = None
    symbology_expression: Optional[str] = None
    label_symbology_expression: Optional[str] = None
    allow_overlaps: Optional[bool] = None
    can_change_symbology:Optional[bool] = None
    can_copy: Optional[bool] = None
    can_create: Optional[bool] = None
    can_delete_all: Optional[bool] = None
    can_die_cut: Optional[bool] = None
    can_edit_vertices: Optional[bool] = None
    can_explode: Optional[bool] = None
    can_paste: Optional[bool] = None
    exportable: Optional[bool] = None
    can_sanitize: Optional[bool] = None
    can_zoom_visibles: Optional[bool] = None
    deletable: Optional[bool] = None
    editable: Optional[bool] = None
    identificable: Optional[bool] = None
    inspectable: Optional[bool] = None
    layer_editable: Optional[bool] = None
    layer_removable: Optional[bool] = None
    selectable: Optional[bool] = None
    visible: Optional[bool] = None
    source_type: Optional[SourceType] = None
    source: Optional[Source] = None
    alpha_edit_finisher: Optional[str] = None
    attributes_class_name: Optional[str] = None
    edit_after_creation: Optional[bool] = None
    values_from_list: Optional[str] = None
    sql_identify: Optional[str] = None
    sql_as_list_view: Optional[str] = None
    definition_query: Optional[str] = None




