Setuav Studio Developer Documentation 1.0
SDK and plugin development reference for Setuav Studio
Loading...
Searching...
No Matches
setuav_studio_sdk.api.StudioAPI Class Reference

Stable service surface passed to plugins during activation. More...

Inherits Protocol.

Collaboration diagram for setuav_studio_sdk.api.StudioAPI:

Public Member Functions

ProjectDocument|None project (self)
 Currently open project, or None when no project is open.
 
ProjectDocument|None current_project (self)
 Currently open project, exposed under the application property name.
 
Any|None current_selection (self)
 Object currently selected in the application shell.
 
tuple[str, int, int]|None current_section_selection (self)
 Selected geometry component, section kind, and section index.
 
str|None current_workspace_id (self)
 Identifier of the active workspace.
 
None add_panel (self, PanelContribution contribution)
 Add a dockable panel to the application shell.
 
None remove_panel (self, str panel_id)
 Remove a panel previously registered by the plugin.
 
None add_workspace (self, WorkspaceContribution contribution)
 Add a workspace to the main workspace selector.
 
None remove_workspace (self, str workspace_id)
 Remove a workspace previously registered by the plugin.
 
None switch_workspace (self, str workspace_id)
 Activate a workspace by identifier.
 
None on_workspace_changed (self, Callable[[str], None] listener)
 Subscribe to workspace changes and immediately receive the current ID.
 
None remove_workspace_listener (self, Callable[[str], None] listener)
 Remove a workspace-change listener.
 
None add_toolbar_item (self, ToolbarContribution contribution)
 Add an item to the main toolbar.
 
None remove_toolbar_item (self, str contribution_id)
 Remove a toolbar item previously registered by the plugin.
 
None add_action (self, ActionContribution contribution)
 Add an action to an application menu path.
 
None remove_action (self, str menu, str title)
 Remove an action using its menu path and title.
 
None register_tool (self, ToolContribution contribution)
 Add a command to the Tools menu.
 
None add_settings_page (self, SettingsPageContribution contribution)
 Add a lazily created page to the Settings dialog.
 
None remove_settings_page (self, str page_id)
 Remove a settings page previously registered by the plugin.
 
None show_status (self, str message, str level="info", int timeout_ms=5000)
 Show a status message; level is info, success, warning, or error.
 
None clear_status (self)
 Clear the current status message.
 
None report_progress (self, int completed, int total, str label="")
 Report task progress; a completed task hides the progress display.
 
None clear_progress (self)
 Hide the task progress display.
 
None subscribe (self, str event_name, Callable[[Any], None] handler)
 Subscribe a callback to a named application event.
 
None unsubscribe (self, str event_name, Callable[[Any], None] handler)
 Remove a callback from a named application event.
 
None publish (self, str event_name, Any payload=None)
 Publish a payload to subscribers of a named event.
 
None on_project_changed (self, Callable[[ProjectDocument], None] listener)
 Subscribe to project replacement and immediately receive the open project.
 
None remove_project_listener (self, Callable[[ProjectDocument], None] listener)
 Remove a project replacement listener.
 
None on_project_content_changed (self, Callable[[ProjectDocument], None] listener)
 Subscribe to edits made within the current project.
 
None remove_project_content_listener (self, Callable[[ProjectDocument], None] listener)
 Remove a project-content listener.
 
None on_modified_changed (self, Callable[[bool], None] listener)
 Subscribe to changes in the current project's modified state.
 
None remove_modified_listener (self, Callable[[bool], None] listener)
 Remove a project modified-state listener.
 
None edit_component (self, dict[str, Any] component, str description, Callable[[], None] change)
 Apply a component mutation as one undoable operation.
 
None edit_project (self, str description, Callable[[], None] change)
 Apply a project mutation as one undoable operation.
 
None edit_project_extension (self, str namespace, str description, Callable[[dict[str, Any]], None] change)
 Edit namespaced project extension data with undo support.
 
None edit_component_extension (self, str component_id, str namespace, str description, Callable[[dict[str, Any]], None] change)
 Edit namespaced component extension data with undo support.
 
None undo (self)
 Undo the most recent project or component edit.
 
None redo (self)
 Redo the most recently undone edit.
 
None notify_project_content_changed (self)
 Request refresh after a mutation performed outside the edit helpers.
 
None on_selection_changed (self, Callable[[Any|None], None] listener)
 Subscribe to selection changes and immediately receive the current value.
 
None remove_selection_listener (self, Callable[[Any|None], None] listener)
 Remove a selection listener.
 
None set_selection (self, Any|None selection)
 Change the application selection.
 
None on_section_selection_changed (self, Callable[[tuple[str, int, int]|None], None] listener)
 Subscribe to geometry-section selection changes.
 
None remove_section_selection_listener (self, Callable[[tuple[str, int, int]|None], None] listener)
 Remove a geometry-section selection listener.
 
None set_section_selection (self, tuple[str, int, int]|None selection)
 Change the selected component section.
 
None register_component_editor (self, str component_type, Callable[[dict[str, Any]], QWidget] factory)
 Register an editor factory for a fully qualified component type.
 
None remove_component_editor (self, str component_type)
 Remove an editor factory registered for a component type.
 
None register_kind_editor (self, str component_kind, Callable[[dict[str, Any]], QWidget] factory)
 Register a fallback editor factory for a component kind.
 
None remove_kind_editor (self, str component_kind)
 Remove an editor factory registered for a component kind.
 
QWidget|None create_component_editor (self, dict[str, Any] component)
 Create the best registered editor for a component or selection.
 
None register_component_icon (self, str component_type, str|Path|QIcon icon)
 Register an icon for a fully qualified component type.
 
None remove_component_icon (self, str component_type)
 Remove an icon registered for a component type.
 
None register_kind_icon (self, str component_kind, str|Path|QIcon icon)
 Register a fallback icon for a component kind.
 
None remove_kind_icon (self, str component_kind)
 Remove a fallback icon registered for a component kind.
 
QIcon get_component_icon (self, dict[str, Any] component)
 Resolve the best registered icon for a component or selection.
 
None register_geometry_provider (self, str component_type, GeometryProvider provider)
 Register a geometry provider for a fully qualified component type.
 
None remove_geometry_provider (self, str component_type)
 Remove a geometry provider registered for a component type.
 
Any build_geometry_data (self, ProjectDocument|None project=None)
 Build combined geometry data using all registered providers.
 
None register_component_tree_provider (self, str provider_id, ComponentTreeProvider provider)
 Register virtual child nodes displayed beneath project components.
 
None remove_component_tree_provider (self, str provider_id)
 Remove a component-tree provider.
 
tuple[ComponentTreeNodeContribution,...] component_tree_nodes (self, dict[str, Any] component)
 Collect virtual child nodes for a project component.
 
None register_project_tree_provider (self, str provider_id, ProjectTreeProvider provider)
 Register plugin-owned nodes displayed beneath the project root.
 
None remove_project_tree_provider (self, str provider_id)
 Remove a project-tree provider.
 
tuple[ProjectTreeNodeContribution,...] project_tree_nodes (self, ProjectDocument project)
 Collect plugin-owned nodes for the project root.
 
None register_schema (self, str schema_id, dict[str, Any] schema_dict)
 Register a reusable JSON Schema document.
 
None register_component_type_schema (self, str component_type, dict[str, Any] schema_dict, str|None plugin_id=None)
 Register a JSON Schema for a fully qualified component type.
 

Detailed Description

Stable service surface passed to plugins during activation.

Use this interface to register contributions, observe application state, edit project data with undo support, and communicate with other plugins. UI factories and callbacks run on the Qt UI thread; move expensive work to a worker thread.

Identifiers must be globally unique. Use a reverse-domain prefix owned by the plugin, for example com.example.analysis.panel. Registrations and listeners must currently be removed in StudioPlugin.deactivate.