Integrates a DesktopWidgetPluginServer with a HomeCardManager to display loaded plugin widgets as cards. More...
#include <DesktopCardHook.h>
Public Member Functions | |
DesktopCardHook (HomeCardManager *manager, DesktopWidgetPluginServer *parent=nullptr) | |
Constructs a DesktopCardHook instance. | |
void | process_unloaded_widget (const QString &what_plugin_widget) |
Processes an unloaded widget, removing it from the HomeCardManager. | |
Integrates a DesktopWidgetPluginServer with a HomeCardManager to display loaded plugin widgets as cards.
This class acts as a bridge, listening for signals from a DesktopWidgetPluginServer when plugins (which expose QWidgets) are loaded. Upon a successful plugin load, it takes the widget and installs it into the HomeCardManager, effectively displaying it as a "card" in the UI. It also handles the removal of widgets when plugins are unloaded.
|
explicit |
Constructs a DesktopCardHook instance.
manager | A pointer to the HomeCardManager that will display the plugin widgets. The hook does not take ownership of the manager. |
parent | A pointer to the DesktopWidgetPluginServer that this hook will monitor. This is also the QObject parent for this hook, which means it manages its lifetime. Defaults to nullptr. |
void DesktopCardHook::process_unloaded_widget | ( | const QString & | what_plugin_widget | ) |
Processes an unloaded widget, removing it from the HomeCardManager.
what_plugin_widget | The name of the plugin whose widget is being unloaded. |