summaryrefslogtreecommitdiffstats
path: root/kcontrol/icons/icons.h
blob: 5f98db8c7e2c4235344b84f6ce51778b4a4b00f4 (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/* vi: ts=8 sts=4 sw=4
 *
 * This file is part of the KDE project, module kcmdisplay.
 * Copyright (C) 2000 Geert Jansen <[email protected]>
 * with minor additions and based on ideas from
 * Torsten Rahn <[email protected]>
 *
 * 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 <tqcolor.h>
#include <tqimage.h>
#include <tqvaluelist.h>

#include <kcmodule.h>
#include <kdialogbase.h>
#include <ksimpleconfig.h>

class TQCheckBox;
class TQColor;
class TQComboBox;
class TQGridLayout;
class TQGroupBox;
class TQIconView;
class TQLabel;
class TQListBox;
class TQListView;
class TQPushButton;
class TQSlider;
class TQTabWidget;
class TQWidget;

class KColorButton;
class KConfig;
class KIconEffect;
class KIconLoader;
class KIconTheme;

struct Effect 
{
    int type;
    float value;
    TQColor color;
    TQColor color2;
    bool transparant;
};


/**
 * The General Icons tab in kcontrol.
 */
class KIconConfig: public KCModule
{
    Q_OBJECT

public:
    KIconConfig(TQWidget *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);
    void slotRoundedCheck(bool check);
    void QLSizeLockedChanged(bool checked);

private:
    void preview(int i);
    void EffectSetup(int state);
    TQPushButton *addPreviewIcon(int i, const TQString &str, TQWidget *parent, TQGridLayout *lay);
    void init();
    void initDefaults();
    void read();
    void apply();


    bool mbDP[6], mbChanged[6], mbAnimated[6];
    int mSizes[6];
    TQValueList<int> mAvSizes[6];

    Effect mEffects[6][3];
    Effect mDefaultEffect[3];
    
    int mUsage;
    TQString mTheme, mExample;
    TQStringList mGroups, mStates;
    int mSysTraySize;
    int mQuickLaunchSize;

    KIconEffect *mpEffect;
    KIconTheme *mpTheme;
    KIconLoader *mpLoader;
    KConfig *mpConfig;
    KSimpleConfig *mpSystrayConfig;
    KSimpleConfig *mpKickerConfig;

    typedef TQLabel *QLabelPtr;
    QLabelPtr mpPreview[3];

    TQListBox *mpUsageList;
    TQComboBox *mpSizeBox;
    TQCheckBox *mpDPCheck, *wordWrapCB, *underlineCB, *mpAnimatedCheck, *mpRoundedCheck;
    TQTabWidget *m_pTabWidget;
    TQWidget *m_pTab1;
    TQPushButton *mPreviewButton1, *mPreviewButton2, *mPreviewButton3;
};

class KIconEffectSetupDialog: public KDialogBase
{
    Q_OBJECT
     
public:
    KIconEffectSetupDialog(const Effect &, const Effect &,
                           const TQString &, const TQImage &,
			   TQWidget *parent=0L, char *name=0L);
    ~KIconEffectSetupDialog();
    Effect effect() { return mEffect; }

protected:
    void preview();
    void init();

protected slots:
    void slotEffectValue(int value);
    void slotEffectColor(const TQColor &col);
    void slotEffectColor2(const TQColor &col);
    void slotEffectType(int type);
    void slotSTCheck(bool b);
    void slotDefault();

private:
    KIconEffect *mpEffect;
    TQListBox *mpEffectBox;
    TQCheckBox *mpSTCheck;
    TQSlider *mpEffectSlider;
    KColorButton *mpEColButton;
    KColorButton *mpECol2Button;
    Effect mEffect;
    Effect mDefaultEffect;
    TQImage mExample;
    TQGroupBox *mpEffectGroup;
    TQLabel *mpPreview, *mpEffectLabel, *mpEffectColor, *mpEffectColor2;
};

#endif