add more spacing
[personal-kdebase.git] / workspace / kwin / kcmkwin / kwinrules / ruleswidget.h
blob20d9d8b471f8b01837488c77ce7ad5d1e9dcf17d
1 /*
2 * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __RULESWIDGET_H__
21 #define __RULESWIDGET_H__
23 #include <kdialog.h>
24 #include <kwindowsystem.h>
25 #include <kkeysequencewidget.h>
27 #include "ui_ruleswidgetbase.h"
28 #include "ui_editshortcut.h"
30 namespace KWin
33 class Rules;
34 class DetectDialog;
36 class RulesWidget
37 : public QWidget, public Ui::RulesWidgetBase
39 Q_OBJECT
40 public:
41 RulesWidget( QWidget* parent = NULL );
42 void setRules( Rules* r );
43 Rules* rules() const;
44 bool finalCheck();
45 void prepareWindowSpecific( WId window );
46 signals:
47 void changed( bool state );
48 protected slots:
49 void detectClicked();
50 void wmclassMatchChanged();
51 void roleMatchChanged();
52 void titleMatchChanged();
53 void extraMatchChanged();
54 void machineMatchChanged();
55 void shortcutEditClicked();
56 private slots:
57 // geometry tab
58 void updateEnableposition();
59 void updateEnablesize();
60 void updateEnabledesktop();
61 void updateEnablemaximizehoriz();
62 void updateEnablemaximizevert();
63 void updateEnableminimize();
64 void updateEnableshade();
65 void updateEnablefullscreen();
66 void updateEnableplacement();
67 // preferences tab
68 void updateEnableabove();
69 void updateEnablebelow();
70 void updateEnablenoborder();
71 void updateEnableskiptaskbar();
72 void updateEnableskippager();
73 void updateEnableacceptfocus();
74 void updateEnablecloseable();
75 void updateEnableopacityactive();
76 void updateEnableopacityinactive();
77 // workarounds tab
78 void updateEnablefsplevel();
79 void updateEnablemoveresizemode();
80 void updateEnabletype();
81 void updateEnableignoreposition();
82 void updateEnableminsize();
83 void updateEnablemaxsize();
84 void updateEnablestrictgeometry();
85 void updateEnableshortcut();
86 void updateEnabledisableglobalshortcuts();
87 // internal
88 void detected( bool );
89 private:
90 int desktopToCombo( int d ) const;
91 int comboToDesktop( int val ) const;
92 void prefillUnusedValues( const KWindowInfo& info );
93 DetectDialog* detect_dlg;
94 bool detect_dlg_ok;
97 class RulesDialog
98 : public KDialog
100 Q_OBJECT
101 public:
102 explicit RulesDialog( QWidget* parent = NULL, const char* name = NULL );
103 Rules* edit( Rules* r, WId window, bool show_hints );
104 protected:
105 virtual void accept();
106 private slots:
107 void displayHints();
108 private:
109 RulesWidget* widget;
110 Rules* rules;
113 class EditShortcut
114 : public QWidget, public Ui_EditShortcut
116 Q_OBJECT
117 public:
118 EditShortcut( QWidget* parent = NULL );
119 protected slots:
120 void editShortcut();
121 void clearShortcut();
124 class EditShortcutDialog
125 : public KDialog
127 Q_OBJECT
128 public:
129 EditShortcutDialog( QWidget* parent = NULL, const char* name = NULL );
130 void setShortcut( const QString& cut );
131 QString shortcut() const;
132 private:
133 EditShortcut* widget;
136 // slightly duped from utils.cpp
137 class ShortcutDialog
138 : public KDialog
140 Q_OBJECT
141 public:
142 ShortcutDialog( const QKeySequence& cut, QWidget* parent = NULL );
143 virtual void accept();
144 QKeySequence shortcut() const;
145 private:
146 KKeySequenceWidget* widget;
149 } // namespace
151 #endif