4 Copyright (c) 2003 by Olivier Goffart <ogoffart@kde.org>
5 Copyright (c) 2003 by Matt Rogers <matt@matt.rogers.name>
7 Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 *************************************************************************
22 #include <ksharedconfig.h>
23 #include <kconfiggroup.h>
25 #include "texteffectconfig.h"
27 TextEffectConfig::TextEffectConfig()
32 void TextEffectConfig::load()
34 KConfigGroup
config(KGlobal::config(), "TextEffect Plugin");
36 mColors
= config
.readEntry("Colors", QStringList() );
39 mColors
= defaultColorList();
41 mColorRandom
= config
.readEntry("Color Random Order", false);
42 mColorLines
= config
.readEntry("Color change every lines", true);
43 mColorWords
= config
.readEntry("Color change every words", false);
44 mColorChar
= config
.readEntry("Color change every char", false);
46 mLamer
= config
.readEntry("L4m3r", false);
47 mWaves
= config
.readEntry("WaVeS", false);
50 QStringList
TextEffectConfig::defaultColorList()
53 return QString(QLatin1String("#00BBDD,#0088DD,#0000DD,#8800DD,#DD00DD,#DD0088,#DD0000,#DD8800,#DDBB00,#88BB00,#00BB00" )).split(',');
56 void TextEffectConfig::save()
58 KConfigGroup
config(KGlobal::config(), "TextEffect Plugin");
60 config
.writeEntry("Colors", mColors
);
61 config
.writeEntry("Color Random Order", mColorRandom
);
62 config
.writeEntry("Color change every lines", mColorLines
);
63 config
.writeEntry("Color change every words", mColorWords
);
64 config
.writeEntry("Color change every char", mColorChar
);
66 config
.writeEntry("L4m3r", mLamer
);
67 config
.writeEntry("WaVeS", mWaves
);
72 QStringList
TextEffectConfig::colors() const
77 bool TextEffectConfig::colorRandom() const
82 bool TextEffectConfig::colorWords() const
87 bool TextEffectConfig::colorLines() const
92 bool TextEffectConfig::colorChar() const
97 bool TextEffectConfig::lamer() const
102 bool TextEffectConfig::waves() const
107 void TextEffectConfig::setColors(const QStringList
&newColors
)
112 void TextEffectConfig::setColorWords(bool newWords
)
114 mColorWords
= newWords
;
117 void TextEffectConfig::setColorLines(bool newLines
)
119 mColorLines
= newLines
;
122 void TextEffectConfig::setColorRandom(bool newRandom
)
124 mColorRandom
= newRandom
;
127 void TextEffectConfig::setColorChar(bool newChar
)
129 mColorChar
= newChar
;
132 void TextEffectConfig::setLamer(bool newLamers
)
137 void TextEffectConfig::setWaves(bool newWaves
)