This is the base abstract class for the emoticon provider plugins.
More...
#include <kemoticonsprovider.h>
|
| KEmoticonsProvider (QObject *parent=nullptr) |
| Default constructor.
|
|
| ~KEmoticonsProvider () override |
| Destructor.
|
|
virtual bool | addEmoticon (const QString &emo, const QString &text, AddEmoticonOption option=DoNotCopy)=0 |
| Adds the emoticon emo with text text .
|
|
QHash< QChar, QList< Emoticon > > | emoticonsIndex () const |
| Returns a QHash that contains emoticons indexed by the first char.
|
|
QHash< QString, QStringList > | emoticonsMap () const |
| Returns a QHash that contains the emoticon path as keys and the text as values.
|
|
QString | fileName () const |
| Returns the file name of the emoticon theme.
|
|
virtual bool | loadTheme (const QString &path)=0 |
| Loads the emoticon theme inside the directory path .
|
|
virtual void | newTheme ()=0 |
| Creates a new theme.
|
|
QSize | preferredEmoticonSize () const |
| Returns size in which parsed emoticons will be returned.
|
|
virtual bool | removeEmoticon (const QString &emo)=0 |
| Removes the emoticon emo .
|
|
virtual void | saveTheme ()=0 |
| Saves the emoticon theme.
|
|
void | setPreferredEmoticonSize (const QSize &size) |
| If a preferred size is set, all parsed emoticons will be returned with the size .
|
|
void | setThemeName (const QString &name) |
| Sets the emoticon theme name.
|
|
QString | themeName () const |
| Returns the theme name.
|
|
QString | themePath () const |
| Returns the emoticon theme path.
|
|
|
void | addIndexItem (const QString &path, const QStringList &emoList) |
| Adds an emoticon to the index.
|
|
void | addMapItem (QString key, QStringList value) |
| Inserts a new item in the emoticon map.
|
|
void | clearEmoticonsMap () |
| Clears the emoticons map.
|
|
bool | copyEmoticon (const QString &emo) |
| Copies the emoticon image to the theme directory.
|
|
void | removeIndexItem (const QString &path, const QStringList &emoList) |
| Removes an emoticon from the index.
|
|
void | removeMapItem (QString key) |
| Removes an item from the emoticon map.
|
|
void | setThemePath (const QString &path) |
| Sets the theme inside the directory path .
|
|
This is the base abstract class for the emoticon provider plugins.
◆ AddEmoticonOption
Options to pass to addEmoticon.
Enumerator |
---|
DoNotCopy | < Don't copy the emoticon file into the theme directory
|
Copy | < Copy the emoticon file into the theme directory
|
◆ KEmoticonsProvider()
KEmoticonsProvider::KEmoticonsProvider |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ ~KEmoticonsProvider()
KEmoticonsProvider::~KEmoticonsProvider |
( |
| ) |
|
|
override |
◆ addEmoticon()
virtual bool KEmoticonsProvider::addEmoticon |
( |
const QString & |
emo, |
|
|
const QString & |
text, |
|
|
AddEmoticonOption |
option = DoNotCopy |
|
) |
| |
|
pure virtual |
Adds the emoticon emo
with text text
.
- Parameters
-
emo | path to the emoticon image |
text | the emoticon text. If alternative texts are to be added, use spaces to separate them. |
copy | whether or not to copy emo into the theme directory |
- Returns
true
if the emoticon is successfully added
◆ addIndexItem()
void KEmoticonsProvider::addIndexItem |
( |
const QString & |
path, |
|
|
const QStringList & |
emoList |
|
) |
| |
|
protected |
Adds an emoticon to the index.
- Parameters
-
path | path to the emoticon |
emoList | list of text associated with this emoticon |
- Since
- 5.0
- See also
- emoticonsIndex()
◆ addMapItem()
void KEmoticonsProvider::addMapItem |
( |
QString |
key, |
|
|
QStringList |
value |
|
) |
| |
|
protected |
Inserts a new item in the emoticon map.
- Since
- 5.0
- See also
- emoticonsMap()
◆ clearEmoticonsMap()
void KEmoticonsProvider::clearEmoticonsMap |
( |
| ) |
|
|
protected |
Clears the emoticons map.
◆ copyEmoticon()
bool KEmoticonsProvider::copyEmoticon |
( |
const QString & |
emo | ) |
|
|
protected |
Copies the emoticon image to the theme directory.
- Parameters
-
emo | path to the emoticon image |
- Returns
- true if the emoticon is successfully copied
- Since
- 5.0
◆ emoticonsIndex()
QHash< QChar, QList< Emoticon > > KEmoticonsProvider::emoticonsIndex |
( |
| ) |
const |
Returns a QHash that contains emoticons indexed by the first char.
◆ emoticonsMap()
QHash< QString, QStringList > KEmoticonsProvider::emoticonsMap |
( |
| ) |
const |
Returns a QHash that contains the emoticon path as keys and the text as values.
◆ fileName()
QString KEmoticonsProvider::fileName |
( |
| ) |
const |
Returns the file name of the emoticon theme.
◆ loadTheme()
virtual bool KEmoticonsProvider::loadTheme |
( |
const QString & |
path | ) |
|
|
pure virtual |
Loads the emoticon theme inside the directory path
.
- Parameters
-
path | path to the directory |
- Returns
true
if the emoticon theme is successfully loaded
◆ newTheme()
virtual void KEmoticonsProvider::newTheme |
( |
| ) |
|
|
pure virtual |
Creates a new theme.
- Since
- 5.0
◆ preferredEmoticonSize()
QSize KEmoticonsProvider::preferredEmoticonSize |
( |
| ) |
const |
Returns size in which parsed emoticons will be returned.
If the QSize returned is not valid (isValid() == false), then the default will be used, that is the actual file size.
- Since
- 5.23
◆ removeEmoticon()
virtual bool KEmoticonsProvider::removeEmoticon |
( |
const QString & |
emo | ) |
|
|
pure virtual |
Removes the emoticon emo
.
This doesn't delete the image file.
- Parameters
-
emo | the emoticon text to remove |
- Returns
true
if the emoticon theme is successfully removed
◆ removeIndexItem()
void KEmoticonsProvider::removeIndexItem |
( |
const QString & |
path, |
|
|
const QStringList & |
emoList |
|
) |
| |
|
protected |
Removes an emoticon from the index.
- Parameters
-
path | path to the emoticon |
emoList | list of text associated with this emoticon |
- Since
- 5.0
- See also
- emoticonsIndex()
◆ removeMapItem()
void KEmoticonsProvider::removeMapItem |
( |
QString |
key | ) |
|
|
protected |
Removes an item from the emoticon map.
- Since
- 5.0
- See also
- emoticonsMap()
◆ saveTheme()
virtual void KEmoticonsProvider::saveTheme |
( |
| ) |
|
|
pure virtual |
Saves the emoticon theme.
- Since
- 5.0
◆ setPreferredEmoticonSize()
void KEmoticonsProvider::setPreferredEmoticonSize |
( |
const QSize & |
size | ) |
|
If a preferred size is set, all parsed emoticons will be returned with the size
.
- Parameters
-
size | The desired QSize of parsed emoticons |
- Since
- 5.23
◆ setThemeName()
void KEmoticonsProvider::setThemeName |
( |
const QString & |
name | ) |
|
Sets the emoticon theme name.
- Parameters
-
◆ setThemePath()
void KEmoticonsProvider::setThemePath |
( |
const QString & |
path | ) |
|
|
protected |
Sets the theme inside the directory path
.
- Parameters
-
path | path to the directory |
- Since
- 5.0
◆ themeName()
QString KEmoticonsProvider::themeName |
( |
| ) |
const |
◆ themePath()
QString KEmoticonsProvider::themePath |
( |
| ) |
const |
Returns the emoticon theme path.