qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
Go to the documentation of this file.
25 #include <QRegularExpression>
42 std::shared_ptr<QIcon>
getAsIcon(
const QString& key)
const;
54 bool load(
const QString& filename);
57 mutable std::map<QString, std::shared_ptr<QIcon>>
cachedIcon;
std::shared_ptr< QIcon > getAsIcon(const QString &key) const
Gets icon accoring to passed emoticon.
std::map< QString, std::shared_ptr< QIcon > > cachedIcon
QList< QStringList > getEmoticons() const
Returns all emoticons that was extracted from files, grouped by according icon file.
void constructRegex()
Creates the regex for replacing emoticons with the path to their pictures.
bool load(const QString &filename)
Load smile pack.
QString path
directory containing the cfg and image files
QRegularExpression smilify
static SmileyPack & getInstance()
Returns the singleton instance.
void onSmileyPackChanged()
QString smileyfied(const QString &msg)
Replaces all found text emoticons to HTML reference with its according icon filename.
QHash< QString, QString > emoticonToPath
static QList< QPair< QString, QString > > listSmileyPacks()
Does the same as listSmileyPaths, but with default paths.
QList< QStringList > emoticons
{{ ":)", ":-)" }, {":(", ...}, ... }
SmileyPack & operator=(const SmileyPack &)=delete
Maps emoticons to smileys.