LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <functional>
12#include <optional>
13#include <QFuture>
14#include <QImage>
19#include "xpcconfig.h"
20
21class IEntityManager;
22class QStandardItem;
23
24namespace LC::Util
25{
65 UTIL_XPC_API Entity MakeAN (const QString& header, const QString& text, Priority priority,
66 const QString& senderID, const QString& cat, const QString& type,
67 const QString& id, const QStringList& visualPath,
68 int delta = 1, int count = 0,
69 const QString& fullText = QString (), const QString& extendedText = QString ());
70
93 UTIL_XPC_API Entity MakeANRule (const QString& title,
94 const QString& senderID,
95 const QString& category,
96 const QStringList& types,
97 AN::NotifyFlags flags = AN::NotifyNone,
98 bool openConfiguration = false,
99 const QList<QPair<QString, ANFieldValue>>& fields = {});
100
117
136 const QString& location,
137 LC::TaskParameters tp,
138 const QString& mime = QString ());
139
160 const QString& text,
162
175
195
215 const ICoreProxy_ptr& proxy);
216
234 qint64 done, qint64 total, const QString& text);
235
249
251
252 using LazyNotificationPixmap_t = std::function<std::optional<QFuture<QImage>> ()>;
253}
254
Proxy to core entity manager.
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
Definition icoreproxy.h:181
@ NotifyNone
No notifications.
Definition constants.h:179
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.
Definition util.cpp:23
Container< T > Filter(const Container< T > &c, F f)
Definition prelude.h:118
void InitJobHolderRow(const QList< QStandardItem * > &row)
Definition util.cpp:162
QVariant GetPersistentData(const QByteArray &key, const ICoreProxy_ptr &proxy)
Returns persistent data stored under given key.
Definition util.cpp:125
Entity MakeNotification(const QString &header, const QString &text, Priority priority)
An utility function to make a Entity with notification.
Definition util.cpp:95
std::function< std::optional< QFuture< QImage > >()> LazyNotificationPixmap_t
Definition util.h:252
Entity MakeANCancel(const Entity &event)
Makes an event for canceling another Advanced Notifications event.
Definition util.cpp:107
void SetJobHolderProgress(const QList< QStandardItem * > &row, qint64 done, qint64 total, const QString &text)
Sets the progress values on the given row.
Definition util.cpp:143
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.
Definition util.cpp:44
QList< QObject * > GetDataFilters(const QVariant &data, IEntityManager *manager)
Returns the data filter plugins that can handle data.
Definition util.cpp:71
Entity MakeEntity(const QVariant &entity, const QString &location, TaskParameters tp, const QString &mime)
Definition util.cpp:82
Priority
Definition structures.h:215
A message used for inter-plugin communication.
Definition structures.h:96
Q_DECLARE_METATYPE(QVariantList *)
#define UTIL_XPC_API
Definition xpcconfig.h:16