summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/texteffect/texteffectconfig.cpp
blob: 9ecca3f0904bc9b95413d6a8ebd895a1dce9d4b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
    texteffectconfig.cpp

    Copyright (c) 2003      by Olivier Goffart       <ogoffart @ kde.org>
    Copyright (c) 2003      by Matt Rogers           <matt@matt.rogers.name>

    Kopete    (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/

#include <qstring.h>

#include <kglobal.h>
#include <kconfig.h>

#include "texteffectconfig.h"

TextEffectConfig::TextEffectConfig()
{
	load();
}

void TextEffectConfig::load()
{
	KConfig *config = KGlobal::config();
	config->setGroup("TextEffect Plugin");

	mColors = config->readListEntry("Colors");
	if(mColors.isEmpty())
	{
            mColors= defaultColorList();
	}
	mColorRandom = config->readBoolEntry("Color Random Order", false);
	mColorLines = config->readBoolEntry("Color change every lines", true);
	mColorWords = config->readBoolEntry("Color change every words", false);
	mColorChar = config->readBoolEntry("Color change every char", false);

	mLamer = config->readBoolEntry("L4m3r", false);
	mWaves = config->readBoolEntry("WaVeS", false);
}

QStringList TextEffectConfig::defaultColorList()
{
    return QStringList::split( ",", "#00BBDD,#0088DD,#0000DD,#8800DD,#DD00DD,#DD0088,#DD0000,#DD8800,#DDBB00,#88BB00,#00BB00" );
}

void TextEffectConfig::save()
{
	KConfig *config = KGlobal::config();
	config->setGroup("TextEffect Plugin");

	config->writeEntry("Colors", mColors );
	config->writeEntry("Color Random Order", mColorRandom);
	config->writeEntry("Color change every lines", mColorLines);
	config->writeEntry("Color change every words", mColorWords);
	config->writeEntry("Color change every char", mColorChar);

	config->writeEntry("L4m3r", mLamer);
	config->writeEntry("WaVeS", mWaves);

	config->sync();
}

QStringList TextEffectConfig::colors() const
{
	return mColors;
}

bool TextEffectConfig::colorRandom() const
{
	return mColorRandom;
}

bool TextEffectConfig::colorWords() const
{
	return mColorWords;
}

bool TextEffectConfig::colorLines() const
{
	return mColorLines;
}

bool TextEffectConfig::colorChar() const
{
	return mColorChar;
}

bool TextEffectConfig::lamer() const
{
	return mLamer;
}

bool TextEffectConfig::waves() const
{
	return mWaves;
}

void TextEffectConfig::setColors(const QStringList &newColors)
{
	mColors = newColors;
}

void TextEffectConfig::setColorWords(bool newWords)
{
	mColorWords = newWords;
}

void TextEffectConfig::setColorLines(bool newLines)
{
	mColorLines = newLines;
}

void TextEffectConfig::setColorRandom(bool newRandom)
{
	mColorRandom = newRandom;
}

void TextEffectConfig::setColorChar(bool newChar)
{
	mColorChar = newChar;
}

void TextEffectConfig::setLamer(bool newLamers)
{
	mLamer = newLamers;
}

void TextEffectConfig::setWaves(bool newWaves)
{
	mWaves = newWaves;
}