97
by Simon Edwards
* Updated for the latest header file changes in SVN. |
1 |
//
|
2 |
// Copyright 2008 Simon Edwards <simon@simonzone.com> |
|
3 |
||
4 |
// Generated by twine |
|
5 |
||
6 |
// This file is part of PyKDE4. |
|
7 |
||
8 |
// PyKDE4 is free software; you can redistribute it and/or modify |
|
9 |
// it under the terms of the GNU Lesser General Public License as |
|
10 |
// published by the Free Software Foundation; either version 2.1 of |
|
11 |
// the License, or (at your option) any later version. |
|
12 |
||
13 |
// PyKDE4 is distributed in the hope that it will be useful, |
|
14 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
// GNU General Public License for more details. |
|
17 |
||
18 |
// You should have received a copy of the GNU General Public License |
|
19 |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
||
21 |
||
22 |
class KEmoticonsTheme |
|
23 |
{
|
|
24 |
%TypeHeaderCode |
|
25 |
#include <kemoticonstheme.h>
|
|
26 |
%End |
|
27 |
||
222
by Simon Edwards
Updated formatting with twine2 tool (in development). |
28 |
|
97
by Simon Edwards
* Updated for the latest header file changes in SVN. |
29 |
public: |
30 |
enum ParseModeEnum |
|
31 |
{
|
|
32 |
DefaultParse, |
|
33 |
StrictParse, |
|
34 |
RelaxedParse, |
|
35 |
SkipHTML
|
|
36 |
};
|
|
37 |
||
38 |
typedef QFlags<KEmoticonsTheme::ParseModeEnum> ParseMode; |
|
39 |
||
40 |
||
41 |
enum TokenType |
|
42 |
{
|
|
43 |
Undefined, |
|
44 |
Image, |
|
45 |
Text
|
|
46 |
};
|
|
47 |
||
48 |
||
49 |
class Token |
|
50 |
{
|
|
51 |
||
52 |
public: |
|
53 |
Token (); |
|
54 |
Token (KEmoticonsTheme::TokenType t, const QString& m); |
|
55 |
Token (KEmoticonsTheme::TokenType t, const QString& m, const QString& p, const QString& html); |
|
56 |
KEmoticonsTheme::TokenType type; |
|
57 |
QString text; |
|
58 |
QString picPath; |
|
59 |
QString picHTMLCode; |
|
222
by Simon Edwards
Updated formatting with twine2 tool (in development). |
60 |
};
|
61 |
// Token |
|
62 |
||
63 |
||
97
by Simon Edwards
* Updated for the latest header file changes in SVN. |
64 |
KEmoticonsTheme (); |
65 |
KEmoticonsTheme (const KEmoticonsTheme& ket); |
|
66 |
KEmoticonsTheme (KEmoticonsProvider* p); |
|
67 |
QString parseEmoticons (const QString& text, KEmoticonsTheme::ParseMode mode = KEmoticonsTheme::DefaultParse, const QStringList& exclude = QStringList()) const; |
|
68 |
QList<KEmoticonsTheme::Token> tokenize (const QString& message, KEmoticonsTheme::ParseMode mode = KEmoticonsTheme::DefaultParse) const; |
|
69 |
bool loadTheme (const QString& path); |
|
70 |
bool removeEmoticon (const QString& emo); |
|
71 |
bool addEmoticon (const QString& emo, const QString& text, KEmoticonsProvider::AddEmoticonOption option = KEmoticonsProvider::DoNotCopy); |
|
72 |
void save (); |
|
73 |
QString themeName () const; |
|
74 |
void setThemeName (const QString& name); |
|
75 |
QString themePath () const; |
|
76 |
QString fileName () const; |
|
77 |
QHash<QString,QStringList> emoticonsMap () const; |
|
78 |
void createNew (); |
|
79 |
bool isNull () const; |
|
222
by Simon Edwards
Updated formatting with twine2 tool (in development). |
80 |
~KEmoticonsTheme (); |
81 |
};
|
|
82 |
// KEmoticonsTheme |
|
97
by Simon Edwards
* Updated for the latest header file changes in SVN. |
83 |
|
84 |