Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
PluginTab Class Reference

Tab manager responsible for integrating plugin-provided views into the UI. More...

#include <plugin_tab.h>

Inheritance diagram for PluginTab:

Classes

struct  PluginData
 Internal data structure storing information about a plugin tab. More...

Signals

void openView (const QString &name, PluginView *view)
 Signal emitted when a plugin view should be opened.
void closeView (PluginView *view)
 Signal emitted when a plugin view should be closed.

Public Member Functions

 PluginTab (QMenu *menu, QObject *parent=nullptr)
 Constructs a PluginTab instance.
void updateScene (const QString &name) override
 Updates the scene associated with a plugin tab.
void openScene (const QString &name) override
 Opens the scene associated with a plugin tab.
maki::Theme currentTheme () override
 Returns the currently active theme variables.
void registerPlugin (const QString &name, std::function< VoidResult(QGraphicsScene *scene)> callback) override
 Registers a plugin-provided tab.
void deregisterPlugin (const QString &name) override
 Deregisters a plugin.
void onThemeChanged ()
 Notifies the tab that the application theme has changed.

Private Member Functions

maki::Theme qlementineToMaki (const oclero::qlementine::Theme &theme) const
 Converts a qlementine theme to the maki theme.

Private Attributes

QMenu * mMenu
 Menu where plugin tabs are registered as actions.
QMap< QString, PluginData > mTabs
 Mapping between plugin names and their associated data.

Detailed Description

Tab manager responsible for integrating plugin-provided views into the UI.

PluginTab allows external plugins to register graphical views that operate on a QGraphicsScene. Each plugin registers a callback that populates a scene when the tab is opened or updated. The class also integrates plugin entries into the application menu and propagates theme changes to the plugin views.

Constructor & Destructor Documentation

◆ PluginTab()

PluginTab::PluginTab ( QMenu * menu,
QObject * parent = nullptr )

Constructs a PluginTab instance.

Parameters
menuMenu where plugin entries will be added.
parentOptional Qt parent object.

Member Function Documentation

◆ closeView

void PluginTab::closeView ( PluginView * view)
signal

Signal emitted when a plugin view should be closed.

The UI layer can connect to this signal to close the view associated with the plugin.

Parameters
viewPointer to the PluginView instance.

◆ currentTheme()

maki::Theme PluginTab::currentTheme ( )
override

Returns the currently active theme variables.

Plugins may use these variables to style their visual components consistently with the rest of the application.

Returns
The current theme variable set.

◆ deregisterPlugin()

void PluginTab::deregisterPlugin ( const QString & name)
override

Deregisters a plugin.

Parameters
nameName of the plugin to be deregsitered.

◆ onThemeChanged()

void PluginTab::onThemeChanged ( )

Notifies the tab that the application theme has changed.

This allows plugin views to update their styling according to the new theme.

◆ openScene()

void PluginTab::openScene ( const QString & name)
override

Opens the scene associated with a plugin tab.

Emits a signal that allows the UI to display the corresponding PluginView.

Parameters
nameName of the plugin tab to open.

◆ openView

void PluginTab::openView ( const QString & name,
PluginView * view )
signal

Signal emitted when a plugin view should be opened.

The UI layer can connect to this signal to display the view associated with the plugin.

Parameters
nameName of the plugin tab.
viewPointer to the PluginView instance.

◆ qlementineToMaki()

maki::Theme PluginTab::qlementineToMaki ( const oclero::qlementine::Theme & theme) const
private

Converts a qlementine theme to the maki theme.

Parameters
themeThe qlemetine theme to be converted
Returns
A maki::Theme corresponding to the qlementine theme

◆ registerPlugin()

void PluginTab::registerPlugin ( const QString & name,
std::function< VoidResult(QGraphicsScene *scene)> callback )
override

Registers a plugin-provided tab.

The plugin provides a callback that receives a QGraphicsScene and populates it with its visual content.

Parameters
nameName of the plugin tab.
callbackFunction responsible for populating the scene.

◆ updateScene()

void PluginTab::updateScene ( const QString & name)
override

Updates the scene associated with a plugin tab.

This triggers the plugin callback responsible for populating or refreshing the scene content.

Parameters
nameName of the plugin tab to update.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/system/plugin_tab.h
  • /__w/maki/maki/app/system/plugin_tab.cpp