2002-01-16 12:26:03 +00:00
|
|
|
/*
|
|
|
|
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.
|
|
|
|
|
2007-02-20 07:00:30 +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>
|
2003-09-19 11:14:41 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
2007-02-20 07:00:30 +00:00
|
|
|
|
2003-09-19 11:14:41 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2007-02-20 07:00:30 +00:00
|
|
|
|
2003-09-19 11:14:41 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2005-12-21 06:45:09 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-09-19 11:14:41 +00:00
|
|
|
|
2002-01-16 12:26:03 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KWINDECORATION_H
|
|
|
|
#define KWINDECORATION_H
|
|
|
|
|
|
|
|
#include <kcmodule.h>
|
2006-03-26 11:27:40 +00:00
|
|
|
#include "buttons.h"
|
2002-01-16 12:26:03 +00:00
|
|
|
#include <kconfig.h>
|
|
|
|
#include <klibloader.h>
|
|
|
|
|
2003-09-24 12:41:56 +00:00
|
|
|
#include <kdecoration.h>
|
|
|
|
|
2005-07-28 14:59:42 +00:00
|
|
|
//Added by qt3to4:
|
|
|
|
#include <QLabel>
|
2005-09-18 14:52:14 +00:00
|
|
|
#include <kvbox.h>
|
2002-01-16 12:26:03 +00:00
|
|
|
|
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;
|
2005-09-18 14:52:14 +00:00
|
|
|
class KVBox;
|
2003-09-24 12:41:56 +00:00
|
|
|
class QSlider;
|
2002-01-16 12:26:03 +00:00
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-06-07 08:43:34 +00:00
|
|
|
class KWinDecorationModule : public KCModule, public KDecorationDefines
|
2002-01-16 12:26:03 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2006-05-08 08:28:37 +00:00
|
|
|
KWinDecorationModule(QWidget* parent, const QStringList &);
|
2002-01-16 12:26:03 +00:00
|
|
|
~KWinDecorationModule();
|
|
|
|
|
|
|
|
virtual void load();
|
|
|
|
virtual void save();
|
|
|
|
virtual void defaults();
|
|
|
|
|
|
|
|
QString quickHelp() const;
|
|
|
|
|
|
|
|
signals:
|
2007-02-20 07:00:30 +00:00
|
|
|
void pluginLoad( const KConfigGroup& conf );
|
|
|
|
void pluginSave( KConfigGroup &conf );
|
2002-01-16 12:26:03 +00:00
|
|
|
void pluginDefaults();
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
// Allows us to turn "save" on
|
|
|
|
void slotSelectionChanged();
|
2003-06-30 08:14:54 +00:00
|
|
|
void slotChangeDecoration( const QString & );
|
2003-10-23 14:56:44 +00:00
|
|
|
void slotBorderChanged( int );
|
2004-11-20 23:43:16 +00:00
|
|
|
void slotButtonsChanged();
|
2002-01-16 12:26:03 +00:00
|
|
|
|
|
|
|
private:
|
2007-02-20 07:00:30 +00:00
|
|
|
void readConfig( const KConfigGroup& conf );
|
|
|
|
void writeConfig( KConfigGroup &conf );
|
2002-01-16 12:26:03 +00:00
|
|
|
void findDecorations();
|
|
|
|
void createDecorationList();
|
|
|
|
void updateSelection();
|
|
|
|
QString decorationLibName( const QString& name );
|
|
|
|
QString decorationName ( QString& libName );
|
2003-10-23 14:56:44 +00:00
|
|
|
static QString styleToConfigLib( QString& styleLib );
|
2007-02-20 07:00:30 +00:00
|
|
|
void resetPlugin( KConfigGroup& conf, const QString& currentDecoName = QString() );
|
2003-10-23 14:56:44 +00:00
|
|
|
void checkSupportedBorderSizes();
|
2005-09-17 20:02:02 +00:00
|
|
|
static int borderSizeToIndex( BorderSize size, QList< BorderSize > sizes );
|
|
|
|
static BorderSize indexToBorderSize( int index, QList< BorderSize > sizes );
|
2002-01-16 12:26:03 +00:00
|
|
|
|
|
|
|
QTabWidget* tabWidget;
|
|
|
|
|
|
|
|
// Page 1
|
2003-06-30 08:14:54 +00:00
|
|
|
KComboBox* decorationList;
|
2005-09-17 20:02:02 +00:00
|
|
|
QList<DecorationInfo> decorations;
|
2003-09-16 19:34:03 +00:00
|
|
|
|
2003-10-23 14:56:44 +00:00
|
|
|
KDecorationPreview* preview;
|
|
|
|
KDecorationPlugins* plugins;
|
2007-01-29 17:14:20 +00:00
|
|
|
KSharedConfigPtr kwinConfig;
|
2003-09-16 19:34:03 +00:00
|
|
|
|
2002-01-16 12:26:03 +00:00
|
|
|
QCheckBox* cbUseCustomButtonPositions;
|
|
|
|
// QCheckBox* cbUseMiniWindows;
|
|
|
|
QCheckBox* cbShowToolTips;
|
2003-10-23 14:56:44 +00:00
|
|
|
QLabel* lBorder;
|
2004-12-03 19:32:35 +00:00
|
|
|
QComboBox* cBorder;
|
2003-10-23 14:56:44 +00:00
|
|
|
BorderSize border_size;
|
2002-01-16 12:26:03 +00:00
|
|
|
|
2003-07-29 13:12:39 +00:00
|
|
|
QObject* pluginObject;
|
2003-09-16 19:34:03 +00:00
|
|
|
QWidget* pluginConfigWidget;
|
2002-01-16 12:26:03 +00:00
|
|
|
QString currentLibraryName;
|
|
|
|
QString oldLibraryName;
|
2007-02-20 07:00:30 +00:00
|
|
|
QObject* (*allocatePlugin)( KConfigGroup& conf, QWidget* parent );
|
2003-09-16 19:34:03 +00:00
|
|
|
|
|
|
|
// Page 2
|
2004-12-03 22:23:20 +00:00
|
|
|
ButtonPositionWidget *buttonPositionWidget;
|
2005-09-18 14:52:14 +00:00
|
|
|
KVBox* buttonPage;
|
2002-01-16 12:26:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// vim: ts=4
|
2004-12-03 22:23:20 +00:00
|
|
|
// kate: space-indent off; tab-width 4;
|