File indexing completed on 2024-05-12 17:10:51

0001 /*
0002  * kwin_smaragd_config.h - Emerald window decoration for KDE
0003  *
0004  * Copyright (c) 2010 Christoph Feck <christoph@maxiom.de>
0005  *
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation; either version 2 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program; if not, write to the Free Software
0018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0019  *
0020  */
0021 
0022 #ifndef KWIN_SMARAGD_CONFIG_H
0023 #define KWIN_SMARAGD_CONFIG_H 1
0024 
0025 #include "ui_kwin_smaragd_dialog.h"
0026 #include "configmanager.h"
0027 
0028 namespace Smaragd
0029 {
0030 
0031 class ConfigUi : public QWidget, public Ui::KWinSmaragdDialog
0032 {
0033 Q_OBJECT
0034 
0035 public:
0036     explicit ConfigUi(QWidget *parent = 0)
0037         : QWidget(parent)
0038     {
0039         setupUi(this);
0040         verticalLayout->setMargin(0);
0041     }
0042 };
0043 
0044 class Config : public QObject
0045 {
0046 Q_OBJECT
0047 
0048 public:
0049     explicit Config(KConfig *config, QWidget *parent = 0);
0050     virtual ~Config();
0051 
0052 public Q_SLOTS:
0053     void load(const KConfigGroup &configGroup);
0054     void save(KConfigGroup &configGroup);
0055     void defaults();
0056     void setShadowTabDisabled(bool disabled) { ui->tabWidget->setTabEnabled(1, !disabled); }
0057 
0058 Q_SIGNALS:
0059     void changed();
0060 
0061 protected Q_SLOTS:
0062     void slotSelectionChanged();
0063 
0064 private:
0065     ConfigManager configManager;
0066     KConfig *smaragdConfig;
0067     ConfigUi *ui;
0068 };
0069 
0070 }; // namespace Smaragd
0071 
0072 #endif
0073