__init__.py 1021 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 UM.PluginRegistry import PluginRegistry
  5. from cura.API.Interface.Settings import Settings
  6. if TYPE_CHECKING:
  7. from cura.CuraApplication import CuraApplication
  8. ## The Interface class serves as a common root for the specific API
  9. # methods for each interface element.
  10. #
  11. # Usage:
  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. class Interface:
  19. # For now we use the same API version to be consistent.
  20. VERSION = PluginRegistry.APIVersion
  21. def __init__(self, application: "CuraApplication") -> None:
  22. # API methods specific to the settings portion of the UI
  23. self.settings = Settings(application)