KEmoticons 5.109.0
Public Member Functions | Static Public Member Functions | List of all members
KEmoticons

This class can be used to retrieve, install, create emoticons theme. More...

#include <kemoticons.h>

Public Member Functions

 KEmoticons ()
 Default constructor.
 
 ~KEmoticons () override
 Destructor.
 
QStringList installTheme (const QString &archiveName)
 Installs all emoticon themes inside the archive archiveName.
 
KEmoticonsTheme newTheme (const QString &name, const KService::Ptr &service)
 Creates a new emoticon theme.
 
QSize preferredEmoticonSize () const
 Returns size in which parsed emoticons will be returned.
 
void setPreferredEmoticonSize (const QSize &size)
 If a preferred size is set, all parsed emoticons will be returned with the size.
 
KEmoticonsTheme theme () const
 Retrieves the current emoticon theme.
 
KEmoticonsTheme theme (const QString &name) const
 Retrieves the emoticon theme with name name.
 

Static Public Member Functions

static QString currentThemeName ()
 Retrieves the current emoticon theme name.
 
static KEmoticonsTheme::ParseMode parseMode ()
 Returns the current parse mode.
 
static void setParseMode (KEmoticonsTheme::ParseMode mode)
 Sets the parse mode to mode.
 
static void setTheme (const KEmoticonsTheme &theme)
 Sets theme as the current emoticon theme.
 
static void setTheme (const QString &theme)
 Sets theme as the current emoticon theme.
 
static QStringList themeList ()
 Returns a list of installed emoticon themes.
 

Detailed Description

This class can be used to retrieve, install, create emoticons theme.

For example, if you want to get the current emoticon theme

//do whatever you want with the theme
This class contains the emoticons theme.
Definition kemoticonstheme.h:23
This class can be used to retrieve, install, create emoticons theme.
Definition kemoticons.h:32
KEmoticonsTheme theme() const
Retrieves the current emoticon theme.

It can also be used to set the emoticon theme and the parse mode in the config file

Author
Carlo Segato (brand.nosp@m.on.m.nosp@m.l@gma.nosp@m.il.c.nosp@m.om)

Constructor & Destructor Documentation

◆ KEmoticons()

KEmoticons::KEmoticons ( )

Default constructor.

◆ ~KEmoticons()

KEmoticons::~KEmoticons ( )
override

Destructor.

Member Function Documentation

◆ currentThemeName()

static QString KEmoticons::currentThemeName ( )
static

Retrieves the current emoticon theme name.

◆ installTheme()

QStringList KEmoticons::installTheme ( const QString &  archiveName)

Installs all emoticon themes inside the archive archiveName.

Parameters
archiveNamepath to the archive
Returns
a list of installed themes

◆ newTheme()

KEmoticonsTheme KEmoticons::newTheme ( const QString &  name,
const KService::Ptr &  service 
)

Creates a new emoticon theme.

KService::List srv = KServiceTypeTrader::self()->query("KEmoticons");
for (int i = 0; i < srv.size(); ++i) {
// we want to create a kde emoticons theme
if (srv.at(i)->property("X-KDE-EmoticonsFileName").toString() == "emoticons.xml") {
theme = KEmoticons().newTheme("test", srv.at(i));
}
}
KEmoticonsTheme newTheme(const QString &name, const KService::Ptr &service)
Creates a new emoticon theme.
Parameters
namethe name of the new emoticon theme
servicethe kind of emoticon theme to create

◆ parseMode()

static KEmoticonsTheme::ParseMode KEmoticons::parseMode ( )
static

Returns the current parse mode.

◆ preferredEmoticonSize()

QSize KEmoticons::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

◆ setParseMode()

static void KEmoticons::setParseMode ( KEmoticonsTheme::ParseMode  mode)
static

Sets the parse mode to mode.

◆ setPreferredEmoticonSize()

void KEmoticons::setPreferredEmoticonSize ( const QSize &  size)

If a preferred size is set, all parsed emoticons will be returned with the size.

Parameters
sizeThe desired QSize of parsed emoticons
Since
5.23

◆ setTheme() [1/2]

static void KEmoticons::setTheme ( const KEmoticonsTheme theme)
static

Sets theme as the current emoticon theme.

Parameters
themea reference to a KEmoticonsTheme object

◆ setTheme() [2/2]

static void KEmoticons::setTheme ( const QString &  theme)
static

Sets theme as the current emoticon theme.

Parameters
themethe name of a theme

◆ theme() [1/2]

KEmoticonsTheme KEmoticons::theme ( ) const

Retrieves the current emoticon theme.

Returns
the current KEmoticonsTheme

◆ theme() [2/2]

KEmoticonsTheme KEmoticons::theme ( const QString &  name) const

Retrieves the emoticon theme with name name.

Parameters
namename of the theme
Returns
the KEmoticonsTheme with name name

◆ themeList()

static QStringList KEmoticons::themeList ( )
static

Returns a list of installed emoticon themes.