tbapi.api.bases.add_on

 1from __future__ import annotations
 2from typing import TYPE_CHECKING
 3from tbapi.common.decorators import tb_class, tb_interface
 4from tbapi.common.converters import to_python_datetime, to_net_datetime
 5from datetime import datetime
 6from Tickblaze.Scripts.Api.Bases import AddOn as _AddOn
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9from tbapi.api.bases.script import Script
10if TYPE_CHECKING:
11    from tbapi.api.interfaces.iwindow_provider import IWindowProvider
12
13@tb_interface(_AddOn)
14class AddOn(Script):
15    """Represents a base class for add on scripts."""
16
17    @staticmethod
18    def new(*args, **kwargs):
19        """Generic factory method for AddOn. Use overloads for IDE type hints."""
20        return AddOn(*args, **kwargs)
21
22    @property
23    def window_provider(self) -> IWindowProvider:
24        """Gets or sets the window provider associated with the add-on."""
25        from tbapi.api.interfaces.iwindow_provider import IWindowProvider
26        val = self._value.WindowProvider
27        return IWindowProvider(_existing=val)
28    @window_provider.setter
29    def window_provider(self, val: IWindowProvider):
30        tmp = self._value
31        tmp.WindowProvider = val._value
32        self._value = tmp
33
34    @abstractmethod
35    def create_menu_item(self) -> Any:
36        """Creates a control that will be displayed in the main menu."""
37        result = self._value.CreateMenuItem()
38        return result
39  
40    def on_shutdown(self) -> None:
41        """Called when the application is shutting down or when the script is reloaded.      Allows for cleanup operations or resource deallocation."""
42        result = self._value.OnShutdown()
43        return result
44  
@tb_interface(_AddOn)
class AddOn(tbapi.api.bases.script.Script):
21@tb_interface(_AddOn)
22class AddOn(Script):
23    """Represents a base class for add on scripts."""
24
25    @staticmethod
26    def new(*args, **kwargs):
27        """Generic factory method for AddOn. Use overloads for IDE type hints."""
28        return AddOn(*args, **kwargs)
29
30    @property
31    def window_provider(self) -> IWindowProvider:
32        """Gets or sets the window provider associated with the add-on."""
33        from tbapi.api.interfaces.iwindow_provider import IWindowProvider
34        val = self._value.WindowProvider
35        return IWindowProvider(_existing=val)
36    @window_provider.setter
37    def window_provider(self, val: IWindowProvider):
38        tmp = self._value
39        tmp.WindowProvider = val._value
40        self._value = tmp
41
42    @abstractmethod
43    def create_menu_item(self) -> Any:
44        """Creates a control that will be displayed in the main menu."""
45        result = self._value.CreateMenuItem()
46        return result
47  
48    def on_shutdown(self) -> None:
49        """Called when the application is shutting down or when the script is reloaded.      Allows for cleanup operations or resource deallocation."""
50        result = self._value.OnShutdown()
51        return result

Represents a base class for add on scripts.

AddOn(*args, **kwargs)
199        def __init__(self, *args, **kwargs):
200            pass
@staticmethod
def new(*args, **kwargs):
25    @staticmethod
26    def new(*args, **kwargs):
27        """Generic factory method for AddOn. Use overloads for IDE type hints."""
28        return AddOn(*args, **kwargs)

Generic factory method for AddOn. Use overloads for IDE type hints.

30    @property
31    def window_provider(self) -> IWindowProvider:
32        """Gets or sets the window provider associated with the add-on."""
33        from tbapi.api.interfaces.iwindow_provider import IWindowProvider
34        val = self._value.WindowProvider
35        return IWindowProvider(_existing=val)

Gets or sets the window provider associated with the add-on.

@abstractmethod
def create_menu_item(self) -> Any:
42    @abstractmethod
43    def create_menu_item(self) -> Any:
44        """Creates a control that will be displayed in the main menu."""
45        result = self._value.CreateMenuItem()
46        return result

Creates a control that will be displayed in the main menu.

def on_shutdown(self) -> None:
48    def on_shutdown(self) -> None:
49        """Called when the application is shutting down or when the script is reloaded.      Allows for cleanup operations or resource deallocation."""
50        result = self._value.OnShutdown()
51        return result

Called when the application is shutting down or when the script is reloaded. Allows for cleanup operations or resource deallocation.