PluginMetadata

This container class might be filled with plugin metadata such as:

  • Authors (and affiliations)

  • References to publications

  • Copyright information

  • License text

Qualified name: mv::plugin::PluginMetadata

class PluginMetadata : public QObject

Plugin metadata plugin class.

Contains plugin properties

Author

T. Kroes

Public Functions

PluginMetadata(const PluginFactory &pluginFactory)

Construct with reference to parent pluginFactory.

Parameters:

pluginFactory – Reference to parent plugin factory

QString getGuiName() const

Get the menu name of the plugin.

void setGuiName(const QString &guiName)

Set the GUI name of the plugin.

Parameters:

guiName – GUI name of the plugin

util::Version &getVersion()

Get plugin version.

Returns:

Plugin semantic version

const util::Version &getVersion() const

Get plugin version.

Returns:

Plugin semantic version

void setVersion(const util::Version &version)

Set the plugin version to version.

Parameters:

versionPlugin semantic version

QString getDescription() const

Get description.

Returns:

String that shortly describes the plugin

void setDescription(const QString &description)

Set description to description.

Parameters:

description – String that shortly describes the plugin

bool hasDescription() const

Get whether the plugin has a description or not.

Returns:

Boolean determining whether the plugin has a description or not

QString getSummary() const

Get summary.

Returns:

Elaborate description of the plugin

void setSummary(const QString &summary)

Set summary to summary.

Parameters:

summary – Elaborate description of the plugin

bool hasSummary() const

Get whether the plugin has a summary or not.

Returns:

Boolean determining whether the plugin has a summary or not

Authors getAuthors() const

Get authors.

Returns:

Authors that created and maintain the plugin

void setAuthors(const Authors &authors)

Set authors to authors.

Parameters:

authors – Authors that created and maintain the plugin

bool hasAuthors() const

Get whether the plugin has authors assigned or not.

Returns:

Boolean determining whether the plugin has authors assigned or not

Organizations getOrganizations() const

Get organizations.

Returns:

Organizations that created and maintain the plugin

void setOrganizations(const Organizations &organizations)

Set organizations to organizations.

Parameters:

organizations – Organizations that created and maintain the plugin

bool hasOrganizations() const

Get whether the plugin has organizations assigned or not.

Returns:

Boolean determining whether the plugin has organizations assigned or not

QString getCopyrightHolder() const

Get copyright holder.

Returns:

Copyright holder

void setCopyrightHolder(const QString &copyrightHolder)

Set copyright holder to copyrightHolder.

Parameters:

copyrightHolder – Copyright holder

bool hasCopyrightHolder() const

Get whether the plugin has a copyright holder or not.

Returns:

Boolean determining whether the plugin has a copyright holder or not

QString getLicenseText() const

Get license text.

Returns:

License text

void setLicenseText(const QString &licenseText)

Set license text to licenseText.

Parameters:

licenseText – License text

bool hasLicenseText() const

Get whether the plugin has a license text or not.

Returns:

Boolean determining whether the plugin has a license text or not

QString getAboutMarkdown() const

Get about text in Markdown format.

Returns:

About text in Markdown format. When set, it overrides the standardized about Markdown generated from summary, authors and copyright notice.

void setAboutMarkdown(const QString &aboutMarkdown)

Set about text to aboutMarkdown.

Parameters:

aboutMarkdown – About text in Markdown format. When set, it overrides the standardized about Markdown generated from summary, authors and copyright notice.

bool hasAboutMarkdown() const

Get whether the plugin has about Markdown or not.

Returns:

Boolean determining whether the plugin has about Markdown or not

util::ShortcutMap &getShortcutMap()

Get shortcut map.

Returns:

Reference to the shortcut map

const util::ShortcutMap &getShortcutMap() const

Get shortcut map.

Returns:

Const reference to the shortcut map

void guiNameChanged(const QString &previousGuiName, const QString &currentGuiName)

Signals that the plugin GUI name changed from previousGuiName to currentGuiName.

Parameters:
  • previousGuiName – Previous GUI name

  • currentGuiName – Current GUI name

void versionChanged(const util::Version &previousVersion, const util::Version &currentVersion)

Signals that the version changed from previousVersion to currentVersion.

Parameters:
  • previousVersion – Previous version

  • currentVersion – Current version

void descriptionChanged(const QString &previousDescription, const QString &currentDescription)

Signals that the description changed from previousDescription to currentDescription.

Parameters:
  • previousDescription – Previous description

  • currentDescription – Current description

void summaryChanged(const QString &previousSummary, const QString &currentSummary)

Signals that the summary changed from previousSummary to currentSummary.

Parameters:
  • previousSummary – Previous summary

  • currentSummary – Current summary

void authorsChanged(const Authors &previousAuthors, const Authors &currentAuthors)

Signals that the authors changed from previousAuthors to currentAuthors.

Parameters:
  • previousAuthors – Previous authors

  • currentAuthors – Current authors

void organizationsChanged(const Organizations &previousOrganizations, const Organizations &currentOrganizations)

Signals that the organizations changed from previousOrganizations to currentOrganizations.

Parameters:
  • previousOrganizations – Previous organizations

  • currentOrganizations – Current organizations

void copyrightHolderChanged(const QString &previousCopyrightHolder, const QString &currentCopyrightHolder)

Signals that the copyright holder changed from previousCopyrightHolder to currentCopyrightHolder.

Parameters:
  • previousCopyrightHolder – Previous copyright holder

  • currentCopyrightHolder – Current copyright holder

void licenseTextChanged(const QString &previousLicenseText, const QString &currentLicenseText)

Signals that the license text changed from previousLicenseText to currentLicenseText.

Parameters:
  • previousLicenseText – Previous license text

  • currentLicenseText – Current license text

void aboutMarkdownChanged(const QString &previousAboutMarkdown, const QString &currentAboutMarkdown)

Signals that the about text in Markdown format changed from previousAboutMarkdown to currentAboutMarkdown.

Parameters:
  • previousAboutMarkdown – Previous about text in Markdown format

  • currentAboutMarkdown – Current about text in Markdown format

struct Author : protected mv::plugin::PluginMetadata::FormattedItem

Author formatted item for use in auto-generated about Markdown.

Public Functions

inline Author(const QString &name, const QStringList &roles = QStringList(), const QStringList &organizationNames = QStringList(), const QString &externalLink = QString())

Construct with name, description, externalLink and organizations.

Parameters:
  • name – Item name

  • roles – Assumed roles

  • organizationNames – Names of the affiliated organizations

  • externalLink – External link (e.g. profile website or e-mail address)

inline QString toString(const Organizations &organizations) const

Convert to string.

Parameters:

organizations – Organizations list

Returns:

Markdown formatted string

inline bool operator==(const Author &rhs) const

Equality operator.

Parameters:

rhs – Right-hand-side author

Returns:

Whether this author and rhs author are the same

inline bool operator!=(const Author &rhs) const

Inequality operator.

Parameters:

rhs – Right-hand-side author

Returns:

Whether this author and rhs author are not the same

Public Members

QStringList _roles

Affiliated organizations.

struct FormattedItem

Formatted item for use in auto-generated about Markdown.

Subclassed by mv::plugin::PluginMetadata::Author, mv::plugin::PluginMetadata::Organization

Public Functions

inline FormattedItem(const QString &name, const QString &description, const QString &externalLink)

Construct with name, description and externalLink.

Parameters:
  • name – Item name

  • description – Item description

  • externalLink – External link

inline QString toString() const

Convert to string.

Returns:

Markdown formatted string

inline bool operator==(const FormattedItem &rhs) const

Equality operator.

Parameters:

rhs – Right-hand-side formatted item

Returns:

Whether this formatted item and rhs formatted item are the same

inline bool operator!=(const FormattedItem &rhs) const

Inequality operator.

Parameters:

rhs – Right-hand-side formatted item

Returns:

Whether this formatted item and rhs formatted item are not the same

Public Members

QString _description

Item name.

QString _externalLink

Item description.

struct Organization : public mv::plugin::PluginMetadata::FormattedItem

Organization formatted item for use in auto-generated about Markdown.

Public Functions

inline QString toString(std::int32_t index) const

Convert to string.

Returns:

Markdown formatted string

inline FormattedItem(const QString &name, const QString &description, const QString &externalLink)

No need for custom constructor.