summaryrefslogtreecommitdiffstats
path: root/config/kstyle_baghira_config.h
blob: 35830dd1f6618a130172bbfaf6d3449cdcae5c06 (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
161
162
163
/***************************************************************************
 *   Copyright (C) 2004 by Thomas Lübking                                  *
 *   thomas@home                                                           *
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef _KSTYLE_BAGHIRA_CONFIG_H_
#define _KSTYLE_BAGHIRA_CONFIG_H_

//#include <kcmodule.h>
#include <qcolor.h>
#include <qimage.h>
#include <kaboutdata.h>
#include "configdialog.h"
#include "help.h"
#include "about.h"

class KListView;
class QPushButton;
class AppSetter;
class QTimer;
class QCheckBox;
class QComboBox;
class QGroupBox;

class kstyle_baghira_config: public QWidget
{
   Q_OBJECT

public:
   kstyle_baghira_config( QWidget *parent=0, const char *name=0, const QStringList& = QStringList() );
   ~kstyle_baghira_config();

   virtual void load();
   void load(QString &fileName);
   void save(QString &fileName);
//    virtual int buttons();
   virtual QString quickHelp() const;
   virtual const KAboutData *aboutData()const
   { return myAboutData; };

public slots:
   void configChanged();
   void openHtml1();
   void openHtml2();
   void startBab();
   void startKRuler();
   void sliderButtonRedChanged(int);
   void sliderButtonGreenChanged(int);
   void sliderButtonBlueChanged(int);
   void sliderBrushRedChanged(int);
   void sliderBrushGreenChanged(int);
   void sliderBrushBlueChanged(int);
   virtual void save();
   virtual void defaults();

signals:
   void changed(bool);
   void editApp(QString, QString);

protected:
   bool eventFilter( QObject* o, QEvent* e );

private:
   QString crNotes[3];
   AppSetter *appsetter;
   KListView *applist;
   QImage* tintButton(QImage &src, QColor c);
   QImage* tintBrush( QImage &img, QColor c/*, int saturation*/ );
   WId findWindow();
   KAboutData *myAboutData;
   Config *dialog_;
   Help* help_;
   About* about_;
   QImage baseImage, baseImage2;
   QDialog *grabber;
   QColor buttonColor;
   QColor brushTint;
   int sliderButtonRedValue, sliderButtonGreenValue, sliderButtonBlueValue;
   int sliderBrushRedValue, sliderBrushGreenValue, sliderBrushBlueValue/*, sliderBrushSaturationValue*/;
   bool loadDone;
   bool menuReplaced;
   QTimer *timer;
   int crCurrent;
private slots:
   void updateCR();
   void showAbout();
   void editApp();
   void addApp(QString, QString);
   void removeApp();
   void removeApp(QString);
   void setDesign(int);
   void menuToggled(bool);
   void enableInButtonColor(int d);
   void enableMenuColorStuff(int d);
   void buttonLoadAction();
   void buttonSaveAsAction();
   void setPresetColor(int i);
   void selectWindow();
   void changeTooluttonHighlightColor(const QColor &);
   void handleButtonStyles(int i);
};

class ColorDialog;

class AppSetter : public QWidget
{
Q_OBJECT
public:
   AppSetter(QWidget *parent=0, const char *name=0);
   ~AppSetter();
public slots:
   void show();
   void show(QString appName, QString link);

private:
   bool isEdit;
   int index_;
   int colors[8];
   QString oldName;
   QString oldLink;
   QLineEdit *command;
   QComboBox *link;
   QGroupBox *box;
   QComboBox *style;
   QComboBox *deco;
   QComboBox *buttons;
   QComboBox *toolButtons;
   QComboBox *tabs;
   QComboBox *inbutton;
   QCheckBox *scanlines;
   QCheckBox *customColors;
   QPushButton *buttonColors;
   ColorDialog *colorDialog;

signals:
   void addApp(QString, QString);
   void removeApp(QString);

private slots:
   void save();
   void reset();
   void handler(int);
   void updateColors();
   void resetColorPicker();
   void handleButtonStyles(int i);
};

#endif