From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcontrol/icons/icons.h | 152 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 kcontrol/icons/icons.h (limited to 'kcontrol/icons/icons.h') diff --git a/kcontrol/icons/icons.h b/kcontrol/icons/icons.h new file mode 100644 index 000000000..93171f6d1 --- /dev/null +++ b/kcontrol/icons/icons.h @@ -0,0 +1,152 @@ +/* vi: ts=8 sts=4 sw=4 + * + * This file is part of the KDE project, module kcmdisplay. + * Copyright (C) 2000 Geert Jansen + * with minor additions and based on ideas from + * Torsten Rahn + * + * You can Freely distribute this program under the GNU General Public + * License. See the file "COPYING" for the exact licensing terms. + */ + +#ifndef __icons_h__ +#define __icons_h__ + +#include +#include +#include + +#include +#include + +class QCheckBox; +class QColor; +class QComboBox; +class QGridLayout; +class QGroupBox; +class QIconView; +class QLabel; +class QListBox; +class QListView; +class QPushButton; +class QSlider; +class QTabWidget; +class QWidget; + +class KColorButton; +class KConfig; +class KIconEffect; +class KIconLoader; +class KIconTheme; + +struct Effect +{ + int type; + float value; + QColor color; + QColor color2; + bool transparant; +}; + + +/** + * The General Icons tab in kcontrol. + */ +class KIconConfig: public KCModule +{ + Q_OBJECT + +public: + KIconConfig(QWidget *parent, const char *name=0); + ~KIconConfig(); + + virtual void load(); + virtual void load( bool useDefaults ); + virtual void save(); + virtual void defaults(); + void preview(); + +private slots: + void slotEffectSetup0() { EffectSetup(0); } + void slotEffectSetup1() { EffectSetup(1); } + void slotEffectSetup2() { EffectSetup(2); } + + void slotUsage(int index); + void slotSize(int index); + void slotDPCheck(bool check); + void slotAnimatedCheck(bool check); + +private: + void preview(int i); + void EffectSetup(int state); + QPushButton *addPreviewIcon(int i, const QString &str, QWidget *parent, QGridLayout *lay); + void init(); + void initDefaults(); + void read(); + void apply(); + + + bool mbDP[6], mbChanged[6], mbAnimated[6]; + int mSizes[6]; + QValueList mAvSizes[6]; + + Effect mEffects[6][3]; + Effect mDefaultEffect[3]; + + int mUsage; + QString mTheme, mExample; + QStringList mGroups, mStates; + + KIconEffect *mpEffect; + KIconTheme *mpTheme; + KIconLoader *mpLoader; + KConfig *mpConfig; + + typedef QLabel *QLabelPtr; + QLabelPtr mpPreview[3]; + + QListBox *mpUsageList; + QComboBox *mpSizeBox; + QCheckBox *mpDPCheck, *wordWrapCB, *underlineCB, *mpAnimatedCheck; + QTabWidget *m_pTabWidget; + QWidget *m_pTab1; +}; + +class KIconEffectSetupDialog: public KDialogBase +{ + Q_OBJECT + +public: + KIconEffectSetupDialog(const Effect &, const Effect &, + const QString &, const QImage &, + QWidget *parent=0L, char *name=0L); + ~KIconEffectSetupDialog(); + Effect effect() { return mEffect; } + +protected: + void preview(); + void init(); + +protected slots: + void slotEffectValue(int value); + void slotEffectColor(const QColor &col); + void slotEffectColor2(const QColor &col); + void slotEffectType(int type); + void slotSTCheck(bool b); + void slotDefault(); + +private: + KIconEffect *mpEffect; + QListBox *mpEffectBox; + QCheckBox *mpSTCheck; + QSlider *mpEffectSlider; + KColorButton *mpEColButton; + KColorButton *mpECol2Button; + Effect mEffect; + Effect mDefaultEffect; + QImage mExample; + QGroupBox *mpEffectGroup; + QLabel *mpPreview, *mpEffectLabel, *mpEffectColor, *mpEffectColor2; +}; + +#endif -- cgit v1.2.3