add more spacing
[personal-kdebase.git] / workspace / kcontrol / style / kcmstyle.h
blobf3cebecd80b9a7472fce9d420b45b7f7439ca3a4
1 /*
2 * KCMStyle
3 * Copyright (C) 2002 Karol Szwed <gallium@kde.org>
4 * Copyright (C) 2002 Daniel Molkentin <molkentin@kde.org>
5 * Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org>
7 * Portions Copyright (C) TrollTech AS.
9 * Based on kcmdisplay
10 * Copyright (C) 1997-2002 kcmdisplay Authors.
11 * (see Help -> About Style Settings)
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public
15 * License version 2 as published by the Free Software Foundation.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; see the file COPYING. If not, write to
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA.
28 #ifndef KCMSTYLE_H
29 #define KCMSTYLE_H
31 #include <QHash>
32 #include <QLayout>
33 #include <QMap>
35 #include <kcmodule.h>
36 #include <kvbox.h>
38 class KComboBox;
39 class KConfig;
40 class QCheckBox;
41 class QComboBox;
42 class QGroupBox;
43 class QLabel;
44 class QPushButton;
45 class QSlider;
46 class StylePreview;
47 class QTabWidget;
49 struct StyleEntry {
50 QString name;
51 QString desc;
52 QString configPage;
53 bool hidden;
56 class KCMStyle : public KCModule
58 Q_OBJECT
60 public:
61 KCMStyle( QWidget* parent, const QVariantList& );
62 ~KCMStyle();
64 virtual void load();
65 virtual void save();
66 virtual void defaults();
68 protected:
69 bool findStyle( const QString& str, int& combobox_item );
70 void switchStyle(const QString& styleName, bool force = false);
71 void setStyleRecursive(QWidget* w, QStyle* s);
73 void loadStyle( KConfig& config );
74 void loadEffects( KConfig& config );
75 void addWhatsThis();
77 virtual void changeEvent( QEvent *event );
79 protected Q_SLOTS:
80 void styleSpecificConfig();
81 void updateConfigButton();
83 void setStyleDirty();
84 void setEffectsDirty();
86 void styleChanged();
88 private:
89 QString currentStyle();
91 bool m_bStyleDirty, m_bEffectsDirty;
92 QHash <QString,StyleEntry*> styleEntries;
93 QMap <QString,QString> nameToStyleKey;
95 QVBoxLayout* mainLayout;
96 QTabWidget* tabWidget;
97 QWidget *page1, *page2;
98 QVBoxLayout* page1Layout;
100 // Page1 widgets
101 QVBoxLayout* gbWidgetStyleLayout;
102 QHBoxLayout* hbLayout;
103 KComboBox* cbStyle;
104 QPushButton* pbConfigStyle;
105 QLabel* lblStyleDesc;
106 StylePreview* stylePreview;
107 QStyle* appliedStyle;
108 QPalette palette;
110 // Page2 widgets
111 QComboBox* comboGraphicEffectsLevel;
112 QSpacerItem* comboSpacer;
114 QComboBox* comboToolbarIcons;
116 QCheckBox* cbIconsOnButtons;
119 #endif // __KCMSTYLE_H
121 // vim: set noet ts=4: