Coverage for src / ezqt_app / domain / ports / ui_component_factory.py: 100.00%
3 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-06 13:12 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-06 13:12 +0000
1# ///////////////////////////////////////////////////////////////
2# DOMAIN.PORTS.UI_COMPONENT_FACTORY - UI component factory port
3# Project: ezqt_app
4# ///////////////////////////////////////////////////////////////
6"""Protocol definitions for UI component factories."""
8from __future__ import annotations
10# ///////////////////////////////////////////////////////////////
11# IMPORTS
12# ///////////////////////////////////////////////////////////////
13# Standard library imports
14from typing import Protocol
16# Local imports
17from ..models.ui import FontSpec, SizePolicySpec
20# ///////////////////////////////////////////////////////////////
21# PROTOCOLS
22# ///////////////////////////////////////////////////////////////
23class UiComponentFactoryProtocol(Protocol):
24 """Technical contract for reusable UI component factories."""
26 def initialize(self) -> None:
27 """Initialize all predefined UI components."""
29 def get_font(self, name: str) -> FontSpec | None:
30 """Return a predefined font specification by name."""
32 def get_size_policy(self, name: str) -> SizePolicySpec | None:
33 """Return a predefined size policy specification by name."""