kwin Library API Documentation

kwindecoration.h

00001 /*
00002     $Id: kwindecoration.h,v 1.19 2003/10/23 14:56:44 nhasan Exp $
00003 
00004     This is the new kwindecoration kcontrol module
00005 
00006     Copyright (c) 2001
00007         Karol Szwed <gallium@kde.org>
00008         http://gallium.n3.net/
00009 
00010     Supports new kwin configuration plugins, and titlebar button position
00011     modification via dnd interface.
00012 
00013     Based on original "kwintheme" (Window Borders) 
00014     Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
00015 
00016     This program is free software; you can redistribute it and/or modify
00017     it under the terms of the GNU General Public License as published by
00018     the Free Software Foundation; either version 2 of the License, or
00019     (at your option) any later version.
00020   
00021     This program is distributed in the hope that it will be useful,
00022     but WITHOUT ANY WARRANTY; without even the implied warranty of
00023     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024     GNU General Public License for more details.
00025   
00026     You should have received a copy of the GNU General Public License
00027     along with this program; if not, write to the Free Software
00028     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00029 
00030 */
00031 
00032 #ifndef KWINDECORATION_H
00033 #define KWINDECORATION_H
00034 
00035 #include <kcmodule.h>
00036 #include <dcopobject.h>
00037 #include <buttons.h>
00038 #include <kconfig.h>
00039 #include <klibloader.h>
00040 
00041 #include <kdecoration.h>
00042 
00043 #include "kwindecorationIface.h"
00044 
00045 class KComboBox;
00046 class QCheckBox;
00047 class QLabel;
00048 class QTabWidget;
00049 class QVBox;
00050 class QSlider;
00051 
00052 class KDecorationPlugins;
00053 class KDecorationPreview;
00054 
00055 // Stores themeName and its corresponding library Name
00056 struct DecorationInfo
00057 {
00058     QString name;
00059     QString libraryName;
00060 };
00061 
00062 
00063 class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface, public KDecorationDefines
00064 {
00065     Q_OBJECT
00066 
00067     public:
00068         KWinDecorationModule(QWidget* parent, const char* name, const QStringList &);
00069         ~KWinDecorationModule();
00070 
00071         virtual void load();
00072         virtual void save();
00073         virtual void defaults();
00074 
00075         QString quickHelp() const;
00076         const KAboutData* aboutData() const;
00077 
00078         virtual void dcopUpdateClientList();
00079 
00080     signals:
00081         void pluginLoad( KConfig* conf );
00082         void pluginSave( KConfig* conf );
00083         void pluginDefaults();
00084 
00085     protected slots:
00086         // Allows us to turn "save" on
00087         void slotSelectionChanged();
00088         void slotChangeDecoration( const QString &  );
00089         void slotBorderChanged( int );
00090 
00091     private:
00092         void readConfig( KConfig* conf );
00093         void writeConfig( KConfig* conf );
00094         void findDecorations();
00095         void createDecorationList();
00096         void updateSelection();
00097         QString decorationLibName( const QString& name );
00098         QString decorationName ( QString& libName );
00099         static QString styleToConfigLib( QString& styleLib );
00100         void resetPlugin( KConfig* conf, const QString& currentDecoName = QString::null );
00101         void resetKWin();
00102         void checkSupportedBorderSizes();
00103         static int borderSizeToIndex( BorderSize size, QValueList< BorderSize > sizes );
00104         static BorderSize indexToBorderSize( int index, QValueList< BorderSize > sizes );
00105 
00106         QTabWidget* tabWidget;
00107 
00108         // Page 1
00109         KComboBox* decorationList;
00110         QValueList<DecorationInfo> decorations;
00111 
00112         KDecorationPreview* preview;
00113         KDecorationPlugins* plugins;
00114         KConfig kwinConfig;
00115 
00116         QCheckBox* cbUseCustomButtonPositions;
00117     //  QCheckBox* cbUseMiniWindows;
00118         QCheckBox* cbShowToolTips;
00119         QLabel*    lBorder;
00120         QSlider*   slBorder;
00121         BorderSize border_size;
00122 
00123         QObject* pluginObject;
00124         QGroupBox* pluginSettingsGrp;
00125         QWidget* pluginConfigWidget;
00126         QString  currentLibraryName;
00127         QString  oldLibraryName;
00128         QObject* (*allocatePlugin)( KConfig* conf, QWidget* parent );
00129 
00130         // Page 2
00131         ButtonDropSite* dropSite;
00132         ButtonSource* buttonSource;
00133         QGroupBox* buttonBox;
00134         QVBox*   buttonPage;
00135 };
00136 
00137 
00138 #endif
00139 // vim: ts=4
KDE Logo
This file is part of the documentation for kwin Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Mar 5 04:41:14 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003