Union::InputPlugin Class

class Union::InputPlugin

Abstract base class for plugins providing input data. More...

Header: #include <InputPlugin.h>
CMake: find_package(Union REQUIRED)
target_link_libraries(mytarget PRIVATE Union::Union)
Inherits: Union::Plugin

Public Functions

virtual Union::PackageHandler::Error createPackage(const Union::StylePackage &package) = 0
virtual std::shared_ptr<Union::Style> createStyle(const Union::StylePackage &package) const = 0
virtual Union::StylePackage::Error validatePackage(const Union::StylePackage &package) = 0

Static Public Members

void addInputType(const QString &typeName, const std::shared_ptr<Union::InputPlugin> &plugin)
std::shared_ptr<Union::InputPlugin> inputPlugin(const QString &typeName)

Detailed Description

This class defines the interface input plugins should implement. Input plugins are plugins providing Theme instances and other themeing specific data to the system.

Member Function Documentation

[static] void InputPlugin::addInputType(const QString &typeName, const std::shared_ptr<Union::InputPlugin> &plugin)

Add an input type manually.

[pure virtual] Union::PackageHandler::Error InputPlugin::createPackage(const Union::StylePackage &package)

Create any files required for the package to be valid.

[pure virtual] std::shared_ptr<Union::Style> InputPlugin::createStyle(const Union::StylePackage &package) const

Create an instance of a style from a package.

This should be reimplemented by subclasses and create a new instance of Style using an appropriate StyleLoader and other input specific data.

[static] std::shared_ptr<Union::InputPlugin> InputPlugin::inputPlugin(const QString &typeName)

Returns an input plugin by type name.

[pure virtual] Union::StylePackage::Error InputPlugin::validatePackage(const Union::StylePackage &package)

Validate if a given package is a valid package for this input.

This should be reimplemented by subclasses and check whether the given package has all files required for createStyle() to work correctly.