LeechCraft Azoth  0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
LC::Azoth::IEmoticonResourceSource Class Referenceabstract

Interface for smile resource loaders. More...

#include "iresourceplugin.h"

+ Inheritance diagram for LC::Azoth::IEmoticonResourceSource:
+ Collaboration diagram for LC::Azoth::IEmoticonResourceSource:

Public Member Functions

virtual ~IEmoticonResourceSource ()
 
virtual QSet< QString > GetEmoticonStrings (const QString &pack) const =0
 Returns the strings that are replaceable with emoticons in the given pack. More...
 
virtual QHash< QImage, QString > GetReprImages (const QString &pack) const =0
 Returns emoticons and their string representations from the given emoticon pack. More...
 
virtual QByteArray GetImage (const QString &pack, const QString &string) const =0
 Returns the data corresponding to the given smile. More...
 
- Public Member Functions inherited from LC::Azoth::IResourceSource
virtual ~IResourceSource ()
 
virtual QAbstractItemModel * GetOptionsModel () const =0
 Returns the model with the options for resource. More...
 

Detailed Description

Interface for smile resource loaders.

This interface should be used for resource sources that deal with loading different emoticon packs. For example, plugins that enable loading of Psi-style or QIP-style emoticon packs would return objects implementing this interface from the corresponding IResourcePlugin::GetResourceSources() method.

Definition at line 67 of file iresourceplugin.h.

Constructor & Destructor Documentation

◆ ~IEmoticonResourceSource()

virtual LC::Azoth::IEmoticonResourceSource::~IEmoticonResourceSource ( )
inlinevirtual

Definition at line 70 of file iresourceplugin.h.

Member Function Documentation

◆ GetEmoticonStrings()

virtual QSet<QString> LC::Azoth::IEmoticonResourceSource::GetEmoticonStrings ( const QString &  pack) const
pure virtual

Returns the strings that are replaceable with emoticons in the given pack.

This function is used to obtain the list of strings that could be replaced by an emoticonin the given emoticon pack. This function should return all possible variants for each emoticon, for example, ":)", ":-)" and "(:" for the same icon.

Parameters
[in]packThe emoticon pack to query, which is one of items returned from GetOptionsModel().
Returns
List of emoticon strings supported by this pack.
See also
IResourceSource::GetOptionsModel()

◆ GetImage()

virtual QByteArray LC::Azoth::IEmoticonResourceSource::GetImage ( const QString &  pack,
const QString &  string 
) const
pure virtual

Returns the data corresponding to the given smile.

Please note that this data most likely shouldn't be a serialized (or saved) QImage or QPixmap. Instead, unmodified contents of the corresponding file should be returned, since the image may contain animation, and conversion to QImage or QPixmap wouldn't preserve it.

The returned byte array most likely should be just a result of QIODevice::readAll(), and it will be inserted into corresponding place via the data URI scheme.

Parameters
[in]packThe smile pack to use, which is one of items returned from GetOptionsModel().
[in]stringThe string corresponding to the smile, which is one of strings in GetSmileStrings() for the same pack.
Returns
The unmodified contents of the file with the image.
See also
GetSmileStrings(), IResourceSource::GetOptionsModel()

◆ GetReprImages()

virtual QHash<QImage, QString> LC::Azoth::IEmoticonResourceSource::GetReprImages ( const QString &  pack) const
pure virtual

Returns emoticons and their string representations from the given emoticon pack.

The returned map should contain all the smiles present in the pack and their string representations — that is, the string that the smile should be replaced with. Obviously, string representation should be present in GetSmileStrings(), and GetImage() should return the corresponding smile for it.

Parameters
[in]packThe smile pack to query, which is one of items returned from GetOptionsModel().
Returns
All smiles in the pack and corresponding strings.
See also
IResourceSource::GetOptionsModel()

The documentation for this class was generated from the following file: