[docs]classService(abc.ABC):"""Base interface for all services in Gaphor."""
[docs]@abc.abstractmethoddefshutdown(self)->None:"""Shutdown the services, free resources."""
[docs]classActionProvider(abc.ABC):"""An action provider is a special service that provides actions via ``@action`` decorators on its methods (see gaphor/action.py)."""@abc.abstractmethoddef__init__(self):pass
[docs]classModelingLanguage(abc.ABC):"""A model provider is a special service that provides an entrypoint to a model implementation, such as UML, SysML, RAAML."""@property@abc.abstractmethoddefname(self)->str:"""Human-readable name of the modeling language."""@property@abc.abstractmethoddeftoolbox_definition(self)->ToolboxDefinition:"""Get structure for the toolbox."""@property@abc.abstractmethoddefdiagram_types(self)->Iterable[DiagramType]:"""Iterate diagram types."""@property@abc.abstractmethoddefelement_types(self)->Iterable[ElementCreateInfo]:"""Iterate element types."""
[docs]@abc.abstractmethoddeflookup_element(self,name:str,ns:str|None=None)->type[Element]|None:"""Look up a model element type by (class) name. A namespace may be provided. This will allow the model to be loaded from that specific modeling language only. """