2 This is the new kwindecoration kcontrol module
5 Karol Szwed <gallium@kde.org>
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
36 #include <klibloader.h>
38 #include <kdecoration.h>
50 class KDecorationPlugins
;
51 class KDecorationPreview
;
53 // Stores themeName and its corresponding library Name
61 class KWinDecorationModule
: public KCModule
, public KDecorationDefines
66 KWinDecorationModule(QWidget
* parent
, const QVariantList
&);
67 ~KWinDecorationModule();
71 virtual void defaults();
73 QString
quickHelp() const;
76 void pluginLoad( const KConfigGroup
& conf
);
77 void pluginSave( KConfigGroup
&conf
);
78 void pluginDefaults();
81 // Allows us to turn "save" on
82 void slotSelectionChanged();
83 void slotChangeDecoration( const QString
& );
84 void slotBorderChanged( int );
85 void slotButtonsChanged();
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
;
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
;
116 BorderSize border_size
;
118 QObject
* pluginObject
;
119 QWidget
* pluginConfigWidget
;
120 QString currentLibraryName
;
121 QString oldLibraryName
;
122 QObject
* (*allocatePlugin
)( KConfigGroup
& conf
, QWidget
* parent
);
125 ButtonPositionWidget
*buttonPositionWidget
;
127 QGroupBox
*pluginSettingsGrp
;
133 // kate: space-indent off; tab-width 4;