43 const QString& senderID,
const QString& cat,
const QString& type,
44 const QString&
id,
const QStringList& visualPath,
46 const QString& fullText,
const QString& extendedText)
64 const QString& cat,
const QStringList& types, AN::NotifyFlags flags,
65 bool openConfiguration,
const QList<QPair<QString, ANFieldValue>>& fields)
69 e.Additional_ [
AN::EF::EventID] =
"org.LC.AdvNotifications.RuleRegister";
73 e.Mime_ +=
"-rule-create";
75 for (
const auto& field : fields)
76 e.Additional_ [field.first] = QVariant::fromValue (field.second);
92 const auto& e =
MakeEntity (data, QString (), {},
"x-leechcraft/data-filter-request");
96 std::copy_if (handlers.begin (), handlers.end (), std::back_inserter (result),
97 [] (QObject *obj) {
return qobject_cast<
IDataFilter*> (obj); });
102 const QString& location,
115 const QString& text,
Priority priority)
120 "x-leechcraft/notification");
150 "x-leechcraft/data-persistent-load");
152 e.
Additional_ [
"Values"] = QVariant::fromValue<QVariantList*> (&values);
154 QMetaObject::invokeMethod (
object,
158 Q_ARG (QObject**, 0));
Q_DECLARE_METATYPE(QList< QModelIndex >)
Entity MakeEntity(const QVariant &entity, const QString &location, TaskParameters tp, const QString &mime)
Proxy to core entity manager.
const QString EventID
The ID of the event (QString).
Base interface for data filter plugins.
const QString VisualPath
Visual path to this event (QStringList).
Rule should be triggered only once.
const QString SenderID
The plugin ID of the sender (QByteArray or QString).
const QString Count
The new total event count (int).
const QString FullText
The detailed text of the event (QString).
const QString EventCategory
The category of the event (QString).
User should be notified visually.
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)
const QString CatEventCancel
Event cancel pseudo-category.
const QString IsSingleShot
Whether the created rule should be single-shot (bool).
virtual QList< QObject * > GetPossibleHandlers(const LeechCraft::Entity &entity)=0
Queries what plugins can handle the given entity.
const QString NotifyAudio
Whether an audio notifier should be enabled by default in the rule being created (bool).
TaskParameters Parameters_
Parameters of this task.
const QString DeltaCount
The change in event count (int).
const QString OpenConfiguration
Whether configuration dialog should be opened (bool).
const QString NotifyTransient
Whether a transient notifier should be enabled by default in the rule being created (bool)...
Entity MakeNotification(const QString &header, const QString &text, Priority priority)
An utility function to make a Entity with notification.
Entity MakeANCancel(const Entity &event)
Makes an event for canceling another Advanced Notifications event.
QList< QObject * > GetDataFilters(const QVariant &data, IEntityManager *manager)
Returns the data filter plugins that can handle data.
const QString ExtendedText
The even more detailed text than FullText (QString).
const QString EventType
The type of the event (QString).
QMap< QString, QVariant > Additional_
Additional parameters.
QVariantList GetPersistentData(const QList< QVariant > &keys, QObject *object)
QString Mime_
MIME type of the entity.
User should be notified visually via persistent notifications.
const QString NotifyPersistent
Whether a persistent notifier should be enabled by default in the rule being created (bool)...
QVariant Entity_
The entity that this object represents.
Notify by playing back an audio file.
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.
Describes parameters of an entity.
QString Location_
Source or destination.