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-03-26 07:07 +0000

1# /////////////////////////////////////////////////////////////// 

2# DOMAIN.PORTS.UI_COMPONENT_FACTORY - UI component factory port 

3# Project: ezqt_app 

4# /////////////////////////////////////////////////////////////// 

5 

6"""Protocol definitions for UI component factories.""" 

7 

8from __future__ import annotations 

9 

10# /////////////////////////////////////////////////////////////// 

11# IMPORTS 

12# /////////////////////////////////////////////////////////////// 

13# Standard library imports 

14from typing import Protocol 

15 

16# Local imports 

17from ..models.ui import FontSpec, SizePolicySpec 

18 

19 

20# /////////////////////////////////////////////////////////////// 

21# PROTOCOLS 

22# /////////////////////////////////////////////////////////////// 

23class UiComponentFactoryProtocol(Protocol): 

24 """Technical contract for reusable UI component factories.""" 

25 

26 def initialize(self) -> None: 

27 """Initialize all predefined UI components.""" 

28 

29 def get_font(self, name: str) -> FontSpec | None: 

30 """Return a predefined font specification by name.""" 

31 

32 def get_size_policy(self, name: str) -> SizePolicySpec | None: 

33 """Return a predefined size policy specification by name."""