7#ifndef KEMOTICONS_PROVIDER_H
8#define KEMOTICONS_PROVIDER_H
10#include <kemoticons_export.h>
15class KEmoticonsProviderPrivate;
28 bool operator < (
const Emoticon &e)
const
30 return matchText.length() > e.matchText.length();
33 QString matchTextEscaped;
80#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
86 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Use KEmoticonsProvider::saveTheme()")
127#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
133 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Use KEmoticonsProvider::newTheme()")
183#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
189 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Use KEmoticonsProvider::addMapItem(QString, QStringList)")
190 void addEmoticonsMap(QString key, QStringList value);
201#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
207 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Use KEmoticonsProvider::removeMapItem(QString)")
208 void removeEmoticonsMap(QString key);
217#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
225 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Use KEmoticonsProvider::addIndexItem(const QString &, const QStringList &)")
226 void addEmoticonIndex(const QString &path, const QStringList &emoList);
237#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
245 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Use KEmoticonsProvider::removeIndexItem(const QString &, const QStringList &)")
246 void removeEmoticonIndex(const QString &path, const QStringList &emoList);
261 const QScopedPointer<KEmoticonsProviderPrivate> d;
This is the base abstract class for the emoticon provider plugins.
Definition kemoticonsprovider.h:22
virtual void newTheme()=0
Creates a new theme.
void setThemePath(const QString &path)
Sets the theme inside the directory path.
AddEmoticonOption
Options to pass to addEmoticon.
Definition kemoticonsprovider.h:41
@ DoNotCopy
< Don't copy the emoticon file into the theme directory
Definition kemoticonsprovider.h:42
QString themePath() const
Returns the emoticon theme path.
~KEmoticonsProvider() override
Destructor.
void removeIndexItem(const QString &path, const QStringList &emoList)
Removes an emoticon from the index.
QSize preferredEmoticonSize() const
Returns size in which parsed emoticons will be returned.
QString fileName() const
Returns the file name of the emoticon theme.
void addIndexItem(const QString &path, const QStringList &emoList)
Adds an emoticon to the index.
virtual void saveTheme()=0
Saves the emoticon theme.
void removeMapItem(QString key)
Removes an item from the emoticon map.
KEmoticonsProvider(QObject *parent=nullptr)
Default constructor.
void addMapItem(QString key, QStringList value)
Inserts a new item in the emoticon map.
void setPreferredEmoticonSize(const QSize &size)
If a preferred size is set, all parsed emoticons will be returned with the size.
QString themeName() const
Returns the theme name.
QHash< QChar, QList< Emoticon > > emoticonsIndex() const
Returns a QHash that contains emoticons indexed by the first char.
virtual bool addEmoticon(const QString &emo, const QString &text, AddEmoticonOption option=DoNotCopy)=0
Adds the emoticon emo with text text.
virtual bool removeEmoticon(const QString &emo)=0
Removes the emoticon emo.
bool copyEmoticon(const QString &emo)
Copies the emoticon image to the theme directory.
virtual bool loadTheme(const QString &path)=0
Loads the emoticon theme inside the directory path.
QHash< QString, QStringList > emoticonsMap() const
Returns a QHash that contains the emoticon path as keys and the text as values.
void setThemeName(const QString &name)
Sets the emoticon theme name.
void clearEmoticonsMap()
Clears the emoticons map.