• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/libkopete

  • sources
  • kde-4.12
  • kdenetwork
  • kopete
  • libkopete
  • private
kopeteemoticons.cpp
Go to the documentation of this file.
1 /*
2  kopeteemoticons.cpp - Kopete Preferences Container-Class
3 
4  Copyright (c) 2002 by Stefan Gehn <metz@gehn.net>
5  Copyright (c) 2002-2006 by Olivier Goffart <ogoffart@kde.org>
6  Copyright (c) 2005 by Engin AYDOGAN <engin@bzzzt.biz>
7 
8  Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
9 
10  *************************************************************************
11  * *
12  * This library is free software; you can redistribute it and/or *
13  * modify it under the terms of the GNU Lesser General Public *
14  * License as published by the Free Software Foundation; either *
15  * version 2 of the License, or (at your option) any later version. *
16  * *
17  *************************************************************************
18 */
19 
20 #include "kopeteemoticons.h"
21 #include "kopeteappearancesettings.h"
22 /*
23  * Testcases can be found in the kopeteemoticontest app in the tests/ directory.
24  */
25 
26 
27 namespace Kopete {
28 
29 K_GLOBAL_STATIC(KEmoticons, s_self)
30 
31 KEmoticons *Emoticons::self()
32 {
33  return s_self;
34 }
35 
36 QString Emoticons::parseEmoticons(const QString &text, KEmoticonsTheme::ParseMode mode, const QStringList &exclude)
37 {
38  if ( Kopete::AppearanceSettings::self()->useEmoticons() )
39  {
40  return Kopete::Emoticons::self()->theme().parseEmoticons(text, mode, exclude);
41  } else
42  {
43  return text;
44  }
45 }
46 QList<KEmoticonsTheme::Token> Emoticons::tokenize(const QString &message, KEmoticonsTheme::ParseMode mode)
47 {
48  if ( Kopete::AppearanceSettings::self()->useEmoticons() )
49  {
50  QList<KEmoticonsTheme::Token> ret = Kopete::Emoticons::self()->theme().tokenize(message, mode);
51 
52  if( !ret.size() )
53  {
54  ret.append( KEmoticonsTheme::Token( KEmoticonsTheme::Text, message ) );
55  }
56 
57  return ret;
58  } else
59  {
60  QList<KEmoticonsTheme::Token> result;
61  result.append( KEmoticonsTheme::Token( KEmoticonsTheme::Text, message ) );
62  return result;
63  }
64 }
65 
66 } //END namesapce Kopete
67 
68 // vim: set noet ts=4 sts=4 sw=4:
kopeteappearancesettings.h
Kopete::Emoticons::parseEmoticons
static QString parseEmoticons(const QString &text, KEmoticonsTheme::ParseMode mode=KEmoticonsTheme::DefaultParse, const QStringList &exclude=QStringList())
Definition: kopeteemoticons.cpp:36
Kopete::Emoticons::tokenize
static QList< KEmoticonsTheme::Token > tokenize(const QString &message, KEmoticonsTheme::ParseMode mode=KEmoticonsTheme::DefaultParse)
Definition: kopeteemoticons.cpp:46
kopeteemoticons.h
Kopete::Emoticons::self
static KEmoticons * self()
The emoticons container-class by default is a singleton object.
Definition: kopeteemoticons.cpp:31
Kopete::AppearanceSettings::self
static AppearanceSettings * self()
Definition: kopeteappearancesettings.cpp:23
Kopete::Emoticons
Definition: kopeteemoticons.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal