10#ifndef KEMOTICONS_THEME_H
11#define KEMOTICONS_THEME_H
13#include "kemoticonsprovider.h"
15#include <QSharedDataPointer>
36 Q_DECLARE_FLAGS(ParseMode, ParseModeEnum)
54 Token() : type(Undefined) {}
63 : type(t), text(m), picPath(p), picHTMLCode(html) {}
107 QString
parseEmoticons(
const QString &text, ParseMode mode = DefaultParse,
const QStringList &exclude = QStringList())
const;
121 QList<Token>
tokenize(
const QString &message, ParseMode mode = DefaultParse)
const;
123#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
131 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Subclass KEmoticonsProvider")
132 bool loadTheme(const QString &path);
135#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
147 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Subclass KEmoticonsProvider")
148 bool removeEmoticon(const QString &emo);
151#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
166 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Subclass KEmoticonsProvider")
167 bool addEmoticon(const QString &emo,
172#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
178 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Subclass KEmoticonsProvider")
208#if KEMOTICONS_ENABLE_DEPRECATED_SINCE(5, 0)
214 KEMOTICONS_DEPRECATED_VERSION(5, 0,
"Subclass KEmoticonsProvider")
229 class KEmoticonsThemeData;
233 QSharedDataPointer<KEmoticonsThemeData> d;
236Q_DECLARE_OPERATORS_FOR_FLAGS(KEmoticonsTheme::ParseMode)
This is the base abstract class for the emoticon provider plugins.
Definition kemoticonsprovider.h:22
This class contains the emoticons theme.
Definition kemoticonstheme.h:23
void setThemeName(const QString &name)
Sets the emoticon theme name.
QString fileName() const
Returns the file name of the emoticon theme.
QHash< QString, QStringList > emoticonsMap() const
Returns a QHash that contains the emoticon path as keys and the text as values.
KEmoticonsTheme(KEmoticonsProvider *p)
Another constructor where you set the KEmoticonsProvider p You should probably never use this,...
ParseModeEnum
The possible parse modes.
Definition kemoticonstheme.h:29
QString themeName() const
Returns the theme name.
KEmoticonsTheme(const KEmoticonsTheme &ket)
Copy constructor.
QString themePath() const
Returns the emoticon theme path.
QList< Token > tokenize(const QString &message, ParseMode mode=DefaultParse) const
Tokenizes the message message with ParseMode mode.
TokenType
TokenType, a token might be an image ( emoticon ) or text.
Definition kemoticonstheme.h:41
@ Image
Token contains a path to an image.
Definition kemoticonstheme.h:43
@ Undefined
Undefined, for completeness only.
Definition kemoticonstheme.h:42
QString parseEmoticons(const QString &text, ParseMode mode=DefaultParse, const QStringList &exclude=QStringList()) const
Parses emoticons in text text with ParseMode mode and optionally excluding emoticons from exclude.
~KEmoticonsTheme()
Destructor.
bool isNull() const
Checks if the emoticon theme has a valid provider.
KEmoticonsTheme()
Default constructor, it creates a null emoticon theme You should probably never use this,...
A token consists of a QString text which is either a regular text or a path to image depending on the...
Definition kemoticonstheme.h:53
QString text
text
Definition kemoticonstheme.h:65
Token(TokenType t, const QString &m, const QString &p, const QString &html)
Creates a Token of type t, text m, image path p and html code html.
Definition kemoticonstheme.h:62
QString picHTMLCode
<img> html code
Definition kemoticonstheme.h:67
QString picPath
path to the image
Definition kemoticonstheme.h:66
Token(TokenType t, const QString &m)
Creates a Token of type t, and text m.
Definition kemoticonstheme.h:58
TokenType type
type
Definition kemoticonstheme.h:64