~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kwin/kcmkwin/kwintabbox/main.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/********************************************************************
 
2
 KWin - the KDE window manager
 
3
 This file is part of the KDE project.
 
4
 
 
5
Copyright (C) 2009 Martin Gräßlin <kde@martin-graesslin.com>
 
6
 
 
7
This program is free software; you can redistribute it and/or modify
 
8
it under the terms of the GNU General Public License as published by
 
9
the Free Software Foundation; either version 2 of the License, or
 
10
(at your option) any later version.
 
11
 
 
12
This program is distributed in the hope that it will be useful,
 
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
GNU General Public License for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License
 
18
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
*********************************************************************/
 
20
 
 
21
#ifndef __MAIN_H__
 
22
#define __MAIN_H__
 
23
 
 
24
#include <kcmodule.h>
 
25
#include <ksharedconfig.h>
 
26
#include "tabboxconfig.h"
 
27
 
 
28
#include "ui_main.h"
 
29
 
 
30
class KShortcutsEditor;
 
31
class KActionCollection;
 
32
 
 
33
namespace KWin
 
34
{
 
35
namespace TabBox
 
36
{
 
37
 
 
38
class LayoutConfig;
 
39
}
 
40
 
 
41
 
 
42
 
 
43
class KWinTabBoxConfigForm : public QWidget, public Ui::KWinTabBoxConfigForm
 
44
{
 
45
    Q_OBJECT
 
46
 
 
47
public:
 
48
    explicit KWinTabBoxConfigForm(QWidget* parent);
 
49
};
 
50
 
 
51
class KWinTabBoxConfig : public KCModule
 
52
{
 
53
    Q_OBJECT
 
54
 
 
55
public:
 
56
    explicit KWinTabBoxConfig(QWidget* parent, const QVariantList& args);
 
57
    ~KWinTabBoxConfig();
 
58
 
 
59
public slots:
 
60
    virtual void save();
 
61
    virtual void load();
 
62
    virtual void defaults();
 
63
 
 
64
private slots:
 
65
    void slotEffectSelectionChanged(int index);
 
66
    void slotAboutEffectClicked();
 
67
    void slotConfigureEffectClicked();
 
68
    void slotConfigureLayoutClicked();
 
69
    void slotLayoutChanged();
 
70
    void slotEffectSelectionChangedAlternative(int index);
 
71
    void slotAboutEffectClickedAlternative();
 
72
    void slotConfigureEffectClickedAlternative();
 
73
    void slotConfigureLayoutClickedAlternative();
 
74
    void slotLayoutChangedAlternative();
 
75
 
 
76
private:
 
77
    void updateUiFromConfig(KWinTabBoxConfigForm* ui, const TabBox::TabBoxConfig& config);
 
78
    void updateConfigFromUi(const KWinTabBoxConfigForm* ui, TabBox::TabBoxConfig& config);
 
79
    void loadConfig(const KConfigGroup& config, KWin::TabBox::TabBoxConfig& tabBoxConfig);
 
80
    void saveConfig(KConfigGroup& config, const KWin::TabBox::TabBoxConfig& tabBoxConfig);
 
81
    void effectSelectionChanged(KWinTabBoxConfigForm* ui, int index);
 
82
    void aboutEffectClicked(KWinTabBoxConfigForm* ui);
 
83
    void configureEffectClicked(KWinTabBoxConfigForm* ui);
 
84
 
 
85
private:
 
86
    KWinTabBoxConfigForm* m_primaryTabBoxUi;
 
87
    KWinTabBoxConfigForm* m_alternativeTabBoxUi;
 
88
    KSharedConfigPtr m_config;
 
89
    KActionCollection* m_actionCollection;
 
90
    KShortcutsEditor* m_editor;
 
91
    TabBox::TabBoxConfig m_tabBoxConfig;
 
92
    TabBox::TabBoxConfig m_tabBoxAlternativeConfig;
 
93
    TabBox::LayoutConfig* m_configForm;
 
94
 
 
95
    bool effectEnabled(const QString& effect, const KConfigGroup& cfg) const;
 
96
};
 
97
 
 
98
} // namespace
 
99
 
 
100
#endif