add more spacing
[personal-kdebase.git] / workspace / kwin / kcmkwin / kwindecoration / kwindecoration.h
blobdae72fc08c8fd03554e996c6e0c4a6bc794ed172
1 /*
2 This is the new kwindecoration kcontrol module
4 Copyright (c) 2001
5 Karol Szwed <gallium@kde.org>
6 http://gallium.n3.net/
8 Supports new kwin configuration plugins, and titlebar button position
9 modification via dnd interface.
11 Based on original "kwintheme" (Window Borders)
12 Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30 #ifndef KWINDECORATION_H
31 #define KWINDECORATION_H
33 #include <kcmodule.h>
34 #include "buttons.h"
35 #include <kconfig.h>
36 #include <klibloader.h>
38 #include <kdecoration.h>
40 //Added by qt3to4:
41 #include <QLabel>
42 #include <kvbox.h>
44 class KComboBox;
45 class QCheckBox;
46 class QLabel;
47 class QTabWidget;
48 class KVBox;
50 class KDecorationPlugins;
51 class KDecorationPreview;
53 // Stores themeName and its corresponding library Name
54 struct DecorationInfo
56 QString name;
57 QString libraryName;
61 class KWinDecorationModule : public KCModule, public KDecorationDefines
63 Q_OBJECT
65 public:
66 KWinDecorationModule(QWidget* parent, const QVariantList &);
67 ~KWinDecorationModule();
69 virtual void load();
70 virtual void save();
71 virtual void defaults();
73 QString quickHelp() const;
75 signals:
76 void pluginLoad( const KConfigGroup& conf );
77 void pluginSave( KConfigGroup &conf );
78 void pluginDefaults();
80 protected slots:
81 // Allows us to turn "save" on
82 void slotSelectionChanged();
83 void slotChangeDecoration( const QString & );
84 void slotBorderChanged( int );
85 void slotButtonsChanged();
87 private:
88 void readConfig( const KConfigGroup& conf );
89 void writeConfig( KConfigGroup &conf );
90 void findDecorations();
91 void createDecorationList();
92 void updateSelection();
93 QString decorationLibName( const QString& name );
94 QString decorationName ( QString& libName );
95 static QString styleToConfigLib( QString& styleLib );
96 void resetPlugin( KConfigGroup& conf, const QString& currentDecoName = QString() );
97 void checkSupportedBorderSizes();
98 static int borderSizeToIndex( BorderSize size, QList< BorderSize > sizes );
99 static BorderSize indexToBorderSize( int index, QList< BorderSize > sizes );
101 QTabWidget* tabWidget;
103 // Page 1
104 KComboBox* decorationList;
105 QList<DecorationInfo> decorations;
107 KDecorationPreview* preview;
108 KDecorationPlugins* plugins;
109 KSharedConfigPtr kwinConfig;
111 QCheckBox* cbUseCustomButtonPositions;
112 // QCheckBox* cbUseMiniWindows;
113 QCheckBox* cbShowToolTips;
114 QLabel* lBorder;
115 QComboBox* cBorder;
116 BorderSize border_size;
118 QObject* pluginObject;
119 QWidget* pluginConfigWidget;
120 QString currentLibraryName;
121 QString oldLibraryName;
122 QObject* (*allocatePlugin)( KConfigGroup& conf, QWidget* parent );
124 // Page 2
125 ButtonPositionWidget *buttonPositionWidget;
126 KVBox* buttonPage;
127 QGroupBox *pluginSettingsGrp;
131 #endif
132 // vim: ts=4
133 // kate: space-indent off; tab-width 4;