LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
LC::Entity Struct Reference

A message used for inter-plugin communication. More...

#include "structures.h"

+ Collaboration diagram for LC::Entity:

Public Attributes

QVariant Entity_
 The entity that this object represents. More...
 
QString Location_
 Source or destination. More...
 
QString Mime_
 MIME type of the entity. More...
 
TaskParameters Parameters_ = NoParameters
 Parameters of this task. More...
 
QMap< QString, QVariant > Additional_
 Additional parameters. More...
 

Detailed Description

A message used for inter-plugin communication.

The IEntityManager class is responsible for routing entities between plugins.

See also
IEntityManager
LC::TaskParameter

Definition at line 95 of file structures.h.

Member Data Documentation

◆ Additional_

QMap<QString, QVariant> LC::Entity::Additional_

Additional parameters.

Some predefined or commonly used ones:

  • "UserVisibleName" A QString with some text that would make sense when showed to the user. For example, if the entity is binary, this could be used to describe the entity.
  • " Tags" QStringList with IDs of tags of the entity.

Definition at line 164 of file structures.h.

Referenced by LC::Util::MakeANCancel(), LC::Util::MakeANRule(), LC::Util::MakeNotification(), LC::Util::NotificationActionHandler::NotificationActionHandler(), operator<<(), LC::operator==(), operator>>(), and LC::Util::ShortcutManager::RegisterActionInfo().

◆ Entity_

QVariant LC::Entity::Entity_

The entity that this object represents.

In the context of entity delegation it represents the entity that should be downloaded or handled. For example, contents of a torrent file, a magnet link, an RSS document.

Here are some common conventions:

  • Local files should be a QUrl (QUrl::fromLocalFile).
  • URLs should be a QUrl as well.
  • Anything binary like contents of a torrent file should be a QByteArray.

In the context of announcing about a finished entity, it could contain previously mentioned entities as well.

Definition at line 112 of file structures.h.

Referenced by LC::Util::MakeANCancel(), LC::Util::MakeEntity(), operator<<(), LC::operator==(), and operator>>().

◆ Location_

QString LC::Entity::Location_

Source or destination.

In the context of entity delegation this parameter represents where the other plugin wants this job to be downloaded.

In the context of entity announce this represents from where this entity came - original URL, for example.

Definition at line 122 of file structures.h.

Referenced by LC::Util::MakeEntity(), LC::operator<(), operator<<(), LC::operator==(), and operator>>().

◆ Mime_

QString LC::Entity::Mime_

MIME type of the entity.

An empty mime is considered to be no mime.

Some predefined or commonly used ones:

  • x-leechcraft/notification A notification item. It should have a "Priority" Additional_ member with int values of enum Priority, Entity_ is expected to be a QString with notification header and Additional_ ["Text"] is expected to be the notification text. Additional_ ["NotificationActions"] may have user-readable QStringList of actions to be available in the notification, In this case, Additional_ ["HandlingObject"] must be a QObject* pointing to the handling object. This object must have the slot notificationActionTriggered(int) which would be called with the index of the selected action, if any. The index corresponds to the position in NotificationActions list.
  • x-leechcraft/plain-text-document A plaintext document. Entity_ contains the contents of the document in this case, and Additional_ ["Language"] may contain the language of this document (like C++/JS/whatever).

Definition at line 148 of file structures.h.

Referenced by LC::Util::MakeEntity(), LC::operator<(), operator<<(), LC::operator==(), and operator>>().

◆ Parameters_

TaskParameters LC::Entity::Parameters_ = NoParameters

Parameters of this task.

Definition at line 152 of file structures.h.

Referenced by LC::Util::MakeEntity(), LC::operator<(), operator<<(), LC::operator==(), and operator>>().


The documentation for this struct was generated from the following file: