from __future__ import annotations
from typing import Protocol, runtime_checkable, Sequence, MutableSequence
from zemax.zos.zosapi.editors.solve_type import SolveType
from zemax.zos.zosapi.editors.solve_status import SolveStatus
from zemax.zos.zosapi.editors.cell_data_type import CellDataType


@runtime_checkable
class ISolveData(Protocol):
    """Placeholder for ZOSAPI.Editors.ISolveData."""
    ...


@runtime_checkable
class IEditorRow(Protocol):
    """Placeholder for ZOSAPI.Editors.IEditorRow."""
    ...


@runtime_checkable
class IEditorCell(Protocol):
    """
    Python protocol for ZOSAPI.Editors.IEditorCell.
    Provides strongly typed access to editor cell data, solves, and metadata.
    """

    # ----------------------------
    # Methods
    # ----------------------------
    def GetSolveData(self) -> ISolveData: ...
    def GetNumberOfSolveTypes(self) -> int: ...
    def IsSolveTypeSupported(self, st: SolveType) -> bool: ...
    def GetAvailableSolveTypes(self) -> Sequence[SolveType]: ...
    def FillAvailableSolveTypes(self, Length: int, solves: MutableSequence[SolveType]) -> None: ...
    def CreateSolveType(self, type: SolveType) -> ISolveData: ...
    def SetSolveData(self, Data: ISolveData) -> SolveStatus: ...
    def MakeSolveVariable(self) -> bool: ...
    def MakeSolveFixed(self) -> bool: ...

    # ----------------------------
    # Properties
    # ----------------------------
    @property
    def Row(self) -> IEditorRow: ...
    @property
    def Col(self) -> int: ...
    @property
    def IsActive(self) -> bool: ...
    @property
    def IsReadOnly(self) -> bool: ...
    @property
    def Header(self) -> str: ...

    @property
    def DataType(self) -> CellDataType:
        """Cell data type (Integer, Double, or String)."""
        ...

    @property
    def IntegerValue(self) -> int: ...
    @IntegerValue.setter
    def IntegerValue(self, value: int) -> None: ...

    @property
    def DoubleValue(self) -> float: ...
    @DoubleValue.setter
    def DoubleValue(self, value: float) -> None: ...

    @property
    def Value(self) -> str: ...
    @Value.setter
    def Value(self, text: str) -> None: ...

    @property
    def Solve(self) -> SolveType: ...


__all__ = ["IEditorCell", "IEditorRow", "ISolveData"]
