add more spacing
[personal-kdebase.git] / runtime / kcontrol / icons / icons.h
blob06a808bd267e065b4e974d8d61d35c087e0b0e24
1 /* vi: ts=8 sts=4 sw=4
3 * This file is part of the KDE project, module kcmdisplay.
4 * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
5 * with minor additions and based on ideas from
6 * Torsten Rahn <torsten@kde.org>
8 * You can Freely distribute this program under the GNU General Public
9 * License. See the file "COPYING" for the exact licensing terms.
12 #ifndef __icons_h__
13 #define __icons_h__
15 #include <QColor>
16 #include <QImage>
18 #include <kcmodule.h>
19 #include <kdialog.h>
20 #include <kconfig.h>
22 class QCheckBox;
23 class QColor;
24 class QComboBox;
25 class QGridLayout;
26 class QGroupBox;
27 class QLabel;
28 class QListWidget;
29 class QPushButton;
30 class QSlider;
31 class QTabWidget;
32 class QWidget;
34 class KColorButton;
35 class KIconEffect;
36 class KIconLoader;
37 class KIconTheme;
39 struct Effect
41 int type;
42 float value;
43 QColor color;
44 QColor color2;
45 bool transparent;
49 /**
50 * The General Icons tab in kcontrol.
52 class KIconConfig: public KCModule
54 Q_OBJECT
56 public:
57 KIconConfig(const KComponentData &inst, QWidget *parent);
58 ~KIconConfig();
60 virtual void load();
61 virtual void save();
62 virtual void defaults();
63 void preview();
65 private Q_SLOTS:
66 void slotEffectSetup0() { EffectSetup(0); }
67 void slotEffectSetup1() { EffectSetup(1); }
68 void slotEffectSetup2() { EffectSetup(2); }
70 void slotUsage(int index);
71 void slotSize(int index);
72 void slotAnimatedCheck(bool check);
74 private:
75 void preview(int i);
76 void EffectSetup(int state);
77 QPushButton *addPreviewIcon(int i, const QString &str, QWidget *parent, QGridLayout *lay);
78 void init();
79 void initDefaults();
80 void read();
81 void apply();
84 bool mbChanged[6], mbAnimated[6];
85 int mSizes[6];
86 QList<int> mAvSizes[6];
88 Effect mEffects[6][3];
89 Effect mDefaultEffect[3];
91 int mUsage;
92 QString mTheme, mExample;
93 QStringList mGroups, mStates;
95 KIconEffect *mpEffect;
96 KIconLoader *mpLoader;
97 KSharedConfigPtr mpConfig;
99 QLabel *mpPreview[3];
101 QListWidget *mpUsageList;
102 QComboBox *mpSizeBox;
103 QCheckBox *wordWrapCB, *underlineCB, *mpAnimatedCheck;
104 QTabWidget *m_pTabWidget;
105 QWidget *m_pTab1;
108 class KIconEffectSetupDialog: public KDialog
110 Q_OBJECT
112 public:
113 KIconEffectSetupDialog(const Effect &, const Effect &,
114 const QString &, const QImage &,
115 QWidget *parent=0L, char *name=0L);
116 ~KIconEffectSetupDialog();
117 Effect effect() { return mEffect; }
119 protected:
120 void preview();
121 void init();
123 protected Q_SLOTS:
124 void slotEffectValue(int value);
125 void slotEffectColor(const QColor &col);
126 void slotEffectColor2(const QColor &col);
127 void slotEffectType(int type);
128 void slotSTCheck(bool b);
129 void slotDefault();
131 private:
132 KIconEffect *mpEffect;
133 QListWidget *mpEffectBox;
134 QCheckBox *mpSTCheck;
135 QSlider *mpEffectSlider;
136 KColorButton *mpEColButton;
137 KColorButton *mpECol2Button;
138 Effect mEffect;
139 Effect mDefaultEffect;
140 QImage mExample;
141 QGroupBox *mpEffectGroup;
142 QLabel *mpPreview, *mpEffectLabel, *mpEffectColor, *mpEffectColor2;
145 #endif