kwin Library API Documentation

kwindecoration.h

00001 /*
00002     This is the new kwindecoration kcontrol module
00003 
00004     Copyright (c) 2001
00005         Karol Szwed <gallium@kde.org>
00006         http://gallium.n3.net/
00007 
00008     Supports new kwin configuration plugins, and titlebar button position
00009     modification via dnd interface.
00010 
00011     Based on original "kwintheme" (Window Borders) 
00012     Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
00013 
00014     This program is free software; you can redistribute it and/or modify
00015     it under the terms of the GNU General Public License as published by
00016     the Free Software Foundation; either version 2 of the License, or
00017     (at your option) any later version.
00018   
00019     This program is distributed in the hope that it will be useful,
00020     but WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022     GNU General Public License for more details.
00023   
00024     You should have received a copy of the GNU General Public License
00025     along with this program; if not, write to the Free Software
00026     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 // Stores themeName and its corresponding library Name
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         // Allows us to turn "save" on
00084         void slotSelectionChanged();
00085         void slotChangeDecoration( const QString &  );
00086         void slotBorderChanged( int );
00087 
00088     private:
00089         void readConfig( KConfig* conf );
00090         void writeConfig( KConfig* conf );
00091         void findDecorations();
00092         void createDecorationList();
00093         void updateSelection();
00094         QString decorationLibName( const QString& name );
00095         QString decorationName ( QString& libName );
00096         static QString styleToConfigLib( QString& styleLib );
00097         void resetPlugin( KConfig* conf, const QString& currentDecoName = QString::null );
00098         void resetKWin();
00099         void checkSupportedBorderSizes();
00100         static int borderSizeToIndex( BorderSize size, QValueList< BorderSize > sizes );
00101         static BorderSize indexToBorderSize( int index, QValueList< BorderSize > sizes );
00102 
00103         QTabWidget* tabWidget;
00104 
00105         // Page 1
00106         KComboBox* decorationList;
00107         QValueList<DecorationInfo> decorations;
00108 
00109         KDecorationPreview* preview;
00110         KDecorationPlugins* plugins;
00111         KConfig kwinConfig;
00112 
00113         QCheckBox* cbUseCustomButtonPositions;
00114     //  QCheckBox* cbUseMiniWindows;
00115         QCheckBox* cbShowToolTips;
00116         QLabel*    lBorder;
00117         QSlider*   slBorder;
00118         BorderSize border_size;
00119 
00120         QObject* pluginObject;
00121         QGroupBox* pluginSettingsGrp;
00122         QWidget* pluginConfigWidget;
00123         QString  currentLibraryName;
00124         QString  oldLibraryName;
00125         QObject* (*allocatePlugin)( KConfig* conf, QWidget* parent );
00126 
00127         // Page 2
00128         ButtonDropSite* dropSite;
00129         ButtonSource* buttonSource;
00130         QGroupBox* buttonBox;
00131         QVBox*   buttonPage;
00132 };
00133 
00134 
00135 #endif
00136 // vim: ts=4
KDE Logo
This file is part of the documentation for kwin Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 11:21:59 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003