__init__.py 909 B

12345678910111213141516171819202122232425262728293031
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import TYPE_CHECKING
  4. from cura.API.Interface.Settings import Settings
  5. if TYPE_CHECKING:
  6. from cura.CuraApplication import CuraApplication
  7. class Interface:
  8. """The Interface class serves as a common root for the specific API
  9. methods for each interface element.
  10. Usage:
  11. .. code-block:: python
  12. from cura.API import CuraAPI
  13. api = CuraAPI()
  14. api.interface.settings.addContextMenuItem()
  15. api.interface.viewport.addOverlay() # Not implemented, just a hypothetical
  16. api.interface.toolbar.getToolButtonCount() # Not implemented, just a hypothetical
  17. # etc
  18. """
  19. def __init__(self, application: "CuraApplication") -> None:
  20. # API methods specific to the settings portion of the UI
  21. self.settings = Settings(application)