![]() |
LeechCraft
0.6.70-3565-g2d86529
Modular cross-platform feature rich live environment.
|
Describes parameters of an entity. More...
#include "structures.h"
Public Member Functions | |
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_ |
Parameters of this task. More... | |
QMap< QString, QVariant > | Additional_ |
Additional parameters. More... | |
Describes parameters of an entity.
This struct is used both for addition of new download tasks and for announcing about finished/available entities, so its members are context-dependent.
This is generally used for communications between different plugins. So, it can be thought as a general packet or message.
There are two kinds of messages: notifications and delegation requests.
First ones are asynchronous. They are used by plugins to notify Core and other plugins about events like download completion. In this case plugin that emits this notification doesn't care what happens next. For example, a bittorrent client that just finished downloading some files would emit a notification about those files.
For notification messages the following signal is used: gotEntity (const LeechCraft::Entity& entity).
The second type of messages, delegation requests, is used by plugins to delegate a given task to other plugins. For example, an RSS feed reader uses this kind of messages to delegate the downloading of the feeds via HTTP to a plugin that can handle HTTP. The signal that is used to emit this messages obviously blocks. After emitting the signal one could get the id and pointer to object that handles the request.
For delegation requests the following signal is used: delegateEntity (const LeechCraft::Entity& entity, int *id, QObject **object);
There is also a third signal related to messaging: couldHandle (const LeechCraft::Entity& entity, bool *could);
It queries whether there are plugins that could handle the given entity. It also blocks. After emitting this signal the could variable would be set up accordingly.
Definition at line 154 of file structures.h.
|
inline |
Definition at line 225 of file structures.h.
QMap<QString, QVariant> LeechCraft::Entity::Additional_ |
Additional parameters.
Some predefined or commonly used ones:
Definition at line 223 of file structures.h.
Referenced by LeechCraft::Util::NotificationActionHandler::AddFunction(), LeechCraft::Util::GetUserText(), LeechCraft::Util::MakeANCancel(), LeechCraft::Util::MakeANRule(), LeechCraft::Util::MakeNotification(), LeechCraft::Util::NotificationActionHandler::NotificationActionHandler(), operator<<(), LeechCraft::operator==(), operator>>(), and LeechCraft::Util::ShortcutManager::RegisterGlobalShortcut().
QVariant LeechCraft::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 rules:
In the context of announcing about a finished entity, it could contain previously mentioned entities as well.
Definition at line 171 of file structures.h.
Referenced by LeechCraft::Util::GetUserText(), LeechCraft::Util::MakeANCancel(), LeechCraft::Util::MakeEntity(), operator<<(), LeechCraft::operator==(), and operator>>().
QString LeechCraft::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 181 of file structures.h.
Referenced by LeechCraft::Util::MakeEntity(), LeechCraft::operator<(), operator<<(), LeechCraft::operator==(), and operator>>().
QString LeechCraft::Entity::Mime_ |
MIME type of the entity.
An empty mime is considered to be no mime.
Some predefined or commonly used ones:
Definition at line 207 of file structures.h.
Referenced by LeechCraft::Util::GetUserText(), LeechCraft::Util::MakeEntity(), LeechCraft::operator<(), operator<<(), LeechCraft::operator==(), and operator>>().
TaskParameters LeechCraft::Entity::Parameters_ |
Parameters of this task.
Definition at line 211 of file structures.h.
Referenced by LeechCraft::Util::MakeEntity(), LeechCraft::operator<(), operator<<(), LeechCraft::operator==(), and operator>>().