kwindecoration.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef KWINDECORATION_H
00031 #define KWINDECORATION_H
00032
00033 #include <kcmodule.h>
00034 #include <dcopobject.h>
00035 #include <buttons.h>
00036 #include <kconfig.h>
00037 #include <klibloader.h>
00038
00039 #include <kdecoration.h>
00040
00041 #include "kwindecorationIface.h"
00042
00043 class KComboBox;
00044 class QCheckBox;
00045 class QLabel;
00046 class QTabWidget;
00047 class QVBox;
00048 class QSlider;
00049
00050 class KDecorationPlugins;
00051 class KDecorationPreview;
00052
00053
00054 struct DecorationInfo
00055 {
00056 QString name;
00057 QString libraryName;
00058 };
00059
00060
00061 class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface, public KDecorationDefines
00062 {
00063 Q_OBJECT
00064
00065 public:
00066 KWinDecorationModule(QWidget* parent, const char* name, const QStringList &);
00067 ~KWinDecorationModule();
00068
00069 virtual void load();
00070 virtual void save();
00071 virtual void defaults();
00072
00073 QString quickHelp() const;
00074
00075 virtual void dcopUpdateClientList();
00076
00077 signals:
00078 void pluginLoad( KConfig* conf );
00079 void pluginSave( KConfig* conf );
00080 void pluginDefaults();
00081
00082 protected slots:
00083
00084 void slotSelectionChanged();
00085 void slotChangeDecoration( const QString & );
00086 void slotBorderChanged( int );
00087 void slotButtonsChanged();
00088
00089 private:
00090 void readConfig( KConfig* conf );
00091 void writeConfig( KConfig* conf );
00092 void findDecorations();
00093 void createDecorationList();
00094 void updateSelection();
00095 QString decorationLibName( const QString& name );
00096 QString decorationName ( QString& libName );
00097 static QString styleToConfigLib( QString& styleLib );
00098 void resetPlugin( KConfig* conf, const QString& currentDecoName = QString::null );
00099 void resetKWin();
00100 void checkSupportedBorderSizes();
00101 static int borderSizeToIndex( BorderSize size, QValueList< BorderSize > sizes );
00102 static BorderSize indexToBorderSize( int index, QValueList< BorderSize > sizes );
00103
00104 QTabWidget* tabWidget;
00105
00106
00107 KComboBox* decorationList;
00108 QValueList<DecorationInfo> decorations;
00109
00110 KDecorationPreview* preview;
00111 KDecorationPlugins* plugins;
00112 KConfig kwinConfig;
00113
00114 QCheckBox* cbUseCustomButtonPositions;
00115
00116 QCheckBox* cbShowToolTips;
00117 QLabel* lBorder;
00118 QComboBox* cBorder;
00119 BorderSize border_size;
00120
00121 QObject* pluginObject;
00122 QWidget* pluginConfigWidget;
00123 QString currentLibraryName;
00124 QString oldLibraryName;
00125 QObject* (*allocatePlugin)( KConfig* conf, QWidget* parent );
00126
00127
00128 ButtonPositionWidget *buttonPositionWidget;
00129 QVBox* buttonPage;
00130 };
00131
00132
00133 #endif
00134
00135
This file is part of the documentation for kwin Library Version 3.4.0.