2002-01-16 12:26:03 +00:00
|
|
|
/*
|
|
|
|
$Id$
|
|
|
|
|
|
|
|
This is the new kwindecoration kcontrol module
|
|
|
|
|
|
|
|
Copyright (c) 2001
|
|
|
|
Karol Szwed <gallium@kde.org>
|
|
|
|
http://gallium.n3.net/
|
|
|
|
|
|
|
|
Supports new kwin configuration plugins, and titlebar button position
|
|
|
|
modification via dnd interface.
|
|
|
|
|
2003-09-16 19:34:03 +00:00
|
|
|
Based on original "kwintheme" (Window Borders)
|
2002-01-16 12:26:03 +00:00
|
|
|
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KWINDECORATION_H
|
|
|
|
#define KWINDECORATION_H
|
|
|
|
|
|
|
|
#include <kcmodule.h>
|
|
|
|
#include <dcopobject.h>
|
2003-09-16 19:34:03 +00:00
|
|
|
#include <buttons.h>
|
2002-01-16 12:26:03 +00:00
|
|
|
#include <kconfig.h>
|
|
|
|
#include <klibloader.h>
|
|
|
|
|
|
|
|
#include "kwindecorationIface.h"
|
|
|
|
|
2003-06-30 08:14:54 +00:00
|
|
|
class KComboBox;
|
2002-01-16 12:26:03 +00:00
|
|
|
class QCheckBox;
|
2003-06-30 08:14:54 +00:00
|
|
|
class QLabel;
|
2002-01-16 12:26:03 +00:00
|
|
|
class QTabWidget;
|
|
|
|
class QVBox;
|
|
|
|
|
2003-09-16 19:34:03 +00:00
|
|
|
class KDecorationPlugins;
|
|
|
|
class KDecorationPreview;
|
|
|
|
|
2002-01-16 12:26:03 +00:00
|
|
|
// Stores themeName and its corresponding library Name
|
|
|
|
struct DecorationInfo
|
|
|
|
{
|
|
|
|
QString name;
|
|
|
|
QString libraryName;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
KWinDecorationModule(QWidget* parent, const char* name, const QStringList &);
|
|
|
|
~KWinDecorationModule();
|
|
|
|
|
|
|
|
virtual void load();
|
|
|
|
virtual void save();
|
|
|
|
virtual void defaults();
|
|
|
|
|
|
|
|
QString quickHelp() const;
|
|
|
|
const KAboutData* aboutData() const;
|
|
|
|
|
|
|
|
virtual void dcopUpdateClientList();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void pluginLoad( KConfig* conf );
|
|
|
|
void pluginSave( KConfig* conf );
|
|
|
|
void pluginDefaults();
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
// Allows us to turn "save" on
|
|
|
|
void slotSelectionChanged();
|
2003-06-30 08:14:54 +00:00
|
|
|
void slotChangeDecoration( const QString & );
|
2002-01-16 12:26:03 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void readConfig( KConfig* conf );
|
|
|
|
void writeConfig( KConfig* conf );
|
|
|
|
void findDecorations();
|
|
|
|
void createDecorationList();
|
|
|
|
void updateSelection();
|
|
|
|
QString decorationLibName( const QString& name );
|
|
|
|
QString decorationName ( QString& libName );
|
2003-09-16 19:34:03 +00:00
|
|
|
static QString styleToConfigLib( QString& styleLib );
|
2003-06-30 08:14:54 +00:00
|
|
|
void resetPlugin( KConfig* conf, const QString& currentDecoName = QString::null );
|
2002-01-16 12:26:03 +00:00
|
|
|
void resetKWin();
|
|
|
|
|
|
|
|
QTabWidget* tabWidget;
|
|
|
|
|
|
|
|
// Page 1
|
2003-06-30 08:14:54 +00:00
|
|
|
KComboBox* decorationList;
|
2002-01-16 12:26:03 +00:00
|
|
|
QValueList<DecorationInfo> decorations;
|
2003-09-16 19:34:03 +00:00
|
|
|
|
|
|
|
KDecorationPreview* preview;
|
|
|
|
KDecorationPlugins* plugins;
|
|
|
|
KConfig kwinConfig;
|
|
|
|
|
2002-01-16 12:26:03 +00:00
|
|
|
QCheckBox* cbUseCustomButtonPositions;
|
|
|
|
// QCheckBox* cbUseMiniWindows;
|
|
|
|
QCheckBox* cbShowToolTips;
|
|
|
|
|
2003-07-29 13:12:39 +00:00
|
|
|
QObject* pluginObject;
|
2003-09-16 19:34:03 +00:00
|
|
|
QLabel* pluginSettingsLbl;
|
|
|
|
QFrame* pluginSettingsLine;
|
|
|
|
QWidget* pluginConfigWidget;
|
2002-01-16 12:26:03 +00:00
|
|
|
QString currentLibraryName;
|
|
|
|
QString oldLibraryName;
|
|
|
|
QObject* (*allocatePlugin)( KConfig* conf, QWidget* parent );
|
2003-09-16 19:34:03 +00:00
|
|
|
|
|
|
|
// Page 2
|
|
|
|
ButtonDropSite* dropSite;
|
|
|
|
ButtonSource* buttonSource;
|
2003-05-31 17:40:57 +00:00
|
|
|
QGroupBox* buttonBox;
|
2003-09-16 19:34:03 +00:00
|
|
|
QVBox* buttonPage;
|
2002-01-16 12:26:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// vim: ts=4
|