Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / kcontrol / icons / icons.h
blobcb276598cce80904d280f703c5e99c1195d48064
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 slotDPCheck(bool check);
73 void slotAnimatedCheck(bool check);
75 private:
76 void preview(int i);
77 void EffectSetup(int state);
78 QPushButton *addPreviewIcon(int i, const QString &str, QWidget *parent, QGridLayout *lay);
79 void init();
80 void initDefaults();
81 void read();
82 void apply();
85 bool mbDP[6], mbChanged[6], mbAnimated[6];
86 int mSizes[6];
87 QList<int> mAvSizes[6];
89 Effect mEffects[6][3];
90 Effect mDefaultEffect[3];
92 int mUsage;
93 QString mTheme, mExample;
94 QStringList mGroups, mStates;
96 KIconEffect *mpEffect;
97 KIconTheme *mpTheme;
98 KIconLoader *mpLoader;
99 KSharedConfigPtr mpConfig;
101 QLabel *mpPreview[3];
103 QListWidget *mpUsageList;
104 QComboBox *mpSizeBox;
105 QCheckBox *mpDPCheck, *wordWrapCB, *underlineCB, *mpAnimatedCheck;
106 QTabWidget *m_pTabWidget;
107 QWidget *m_pTab1;
110 class KIconEffectSetupDialog: public KDialog
112 Q_OBJECT
114 public:
115 KIconEffectSetupDialog(const Effect &, const Effect &,
116 const QString &, const QImage &,
117 QWidget *parent=0L, char *name=0L);
118 ~KIconEffectSetupDialog();
119 Effect effect() { return mEffect; }
121 protected:
122 void preview();
123 void init();
125 protected Q_SLOTS:
126 void slotEffectValue(int value);
127 void slotEffectColor(const QColor &col);
128 void slotEffectColor2(const QColor &col);
129 void slotEffectType(int type);
130 void slotSTCheck(bool b);
131 void slotDefault();
133 private:
134 KIconEffect *mpEffect;
135 QListWidget *mpEffectBox;
136 QCheckBox *mpSTCheck;
137 QSlider *mpEffectSlider;
138 KColorButton *mpEColButton;
139 KColorButton *mpECol2Button;
140 Effect mEffect;
141 Effect mDefaultEffect;
142 QImage mExample;
143 QGroupBox *mpEffectGroup;
144 QLabel *mpPreview, *mpEffectLabel, *mpEffectColor, *mpEffectColor2;
147 #endif