 |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Go to the documentation of this file.
10 #include <QStandardItem>
24 const QString& senderID,
const QString& cat,
const QString& type,
25 const QString&
id,
const QStringList& visualPath,
27 const QString& fullText,
const QString& extendedText)
45 const QString& cat,
const QStringList& types, AN::NotifyFlags flags,
46 bool openConfiguration,
const QList<QPair<QString, ANFieldValue>>&
fields)
50 e.Additional_ [
AN::EF::EventID] = QStringLiteral (
"org.LC.AdvNotifications.RuleRegister");
54 e.Mime_ +=
"-rule-create";
56 for (
const auto& field :
fields)
57 e.Additional_ [field.first] = QVariant::fromValue (field.second);
73 const auto& e =
MakeEntity (data, QString (), {}, QStringLiteral (
"x-leechcraft/data-filter-request"));
77 std::copy_if (handlers.begin (), handlers.end (), std::back_inserter (result),
78 [] (QObject *obj) { return qobject_cast<IDataFilter*> (obj); });
83 const QString& location,
96 const QString& text,
Priority priority)
101 QStringLiteral (
"x-leechcraft/notification"));
102 result.
Additional_ [QStringLiteral (
"Text")] = text;
103 result.Additional_ [QStringLiteral (
"Priority")] = QVariant::fromValue (priority);
128 const auto& plugins = proxy->GetPluginsManager ()->
129 GetAllCastableTo<IPersistentStoragePlugin*> ();
130 for (
const auto plug : plugins)
132 const auto& storage = plug->RequestStorage ();
136 const auto& value = storage->Get (key);
137 if (!value.isNull ())
144 qint64 done, qint64 total,
const QString& text)
147 if (text.contains (
"%1"_ql) && text.contains (
"%2"_ql))
148 item->setText (text.arg (done).arg (total));
150 item->setText (text);
164 for (
const auto item : row)
166 item->setEditable (
false);
void SetJobHolderProgress(const QList< QStandardItem * > &row, qint64 done, qint64 total, const QString &text)
Sets the progress values on the given row.
constexpr detail::MemberPtrs< Ptrs... > fields
const Q_DECL_IMPORT QString NotifyAudio
Whether an audio notifier should be enabled by default in the rule being created (bool).
QList< QObject * > GetDataFilters(const QVariant &data, IEntityManager *manager)
Returns the data filter plugins that can handle data.
A message used for inter-plugin communication.
TaskParameters Parameters_
Parameters of this task.
@ NotifySingleShot
Rule should be triggered only once.
@ Running
The process is running just fine.
const Q_DECL_IMPORT QString EventCategory
The category of the event (QString).
QMap< QString, QVariant > Additional_
Additional parameters.
const Q_DECL_IMPORT QString IsSingleShot
Whether the created rule should be single-shot (bool).
const Q_DECL_IMPORT QString EventType
The type of the event (QString).
@ NotifyTransient
User should be notified visually.
@ JobProgress
The column with the progress of the task, like the amount of data downloaded so far or last update.
Entity MakeAN(const QString &header, const QString &text, Priority priority, const QString &senderID, const QString &cat, const QString &type, const QString &id, const QStringList &visualPath, int delta, int count, const QString &fullText, const QString &extendedText)
Creates an Advanced Notifications-enabled notify entity.
const Q_DECL_IMPORT QString ExtendedText
The even more detailed text than FullText (QString).
Entity MakeEntity(const QVariant &entity, const QString &location, TaskParameters tp, const QString &mime)
Entity MakeANCancel(const Entity &event)
Makes an event for canceling another Advanced Notifications event.
const Q_DECL_IMPORT QString Count
The new total event count (int).
const Q_DECL_IMPORT QString EventID
The ID of the event (QString).
Entity MakeANRule(const QString &title, const QString &senderID, const QString &cat, const QStringList &types, AN::NotifyFlags flags, bool openConfiguration, const QList< QPair< QString, ANFieldValue >> &fields)
Creates an Entity defining an Advanced Notifications rule.
const Q_DECL_IMPORT QString NotifyTransient
Whether a transient notifier should be enabled by default in the rule being created (bool).
const Q_DECL_IMPORT QString NotifyPersistent
Whether a persistent notifier should be enabled by default in the rule being created (bool).
QString Mime_
MIME type of the entity.
constexpr detail::AggregateType< detail::AggregateFunction::Count, Ptr > count
@ NotifyPersistent
User should be notified visually via persistent notifications.
State of a single process represented in a IJobHolder model.
Q_DECLARE_METATYPE(QVariantList *)
@ ProcessState
Describes the state of a process.
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
QVariant Entity_
The entity that this object represents.
const Q_DECL_IMPORT QString OpenConfiguration
Whether configuration dialog should be opened (bool).
qlonglong Done_
The amount of items already processed or downloaded.
Proxy to core entity manager.
void InitJobHolderRow(const QList< QStandardItem * > &row)
const Q_DECL_IMPORT QString VisualPath
Visual path to this event (QStringList).
const Q_DECL_IMPORT QString SenderID
The plugin ID of the sender (QByteArray or QString).
const Q_DECL_IMPORT QString FullText
The detailed text of the event (QString).
const Q_DECL_IMPORT QString CatEventCancel
Event cancel pseudo-category.
QString Location_
Source or destination.
Entity MakeNotification(const QString &header, const QString &text, Priority priority)
An utility function to make a Entity with notification.
virtual QList< QObject * > GetPossibleHandlers(const LC::Entity &entity)=0
Queries what plugins can handle the given entity.
QVariant GetPersistentData(const QByteArray &key, const ICoreProxy_ptr &proxy)
Returns persistent data stored under given key.
const Q_DECL_IMPORT QString DeltaCount
The change in event count (int).
@ NotifyAudio
Notify by playing back an audio file.