~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to kwin/kcmkwin/kwinrules/ruleswidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org>
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 */
 
18
 
 
19
 
 
20
#ifndef __RULESWIDGET_H__
 
21
#define __RULESWIDGET_H__
 
22
 
 
23
#include <kdialog.h>
 
24
#include <kwindowsystem.h>
 
25
//#include <kshortcutdialog.h>
 
26
 
 
27
#include "ruleswidgetbase.h"
 
28
#include "editshortcutbase.h"
 
29
 
 
30
namespace KWin
 
31
{
 
32
 
 
33
class Rules;
 
34
class DetectDialog;
 
35
 
 
36
class RulesWidget
 
37
    : public RulesWidgetBase
 
38
    {
 
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
        virtual void detectClicked();
 
50
        virtual void wmclassMatchChanged();
 
51
        virtual void roleMatchChanged();
 
52
        virtual void titleMatchChanged();
 
53
        virtual void extraMatchChanged();
 
54
        virtual void machineMatchChanged();
 
55
        virtual 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;
 
95
    };
 
96
 
 
97
class RulesDialog
 
98
    : public KDialog
 
99
    {
 
100
    Q_OBJECT
 
101
    public:
 
102
        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;
 
111
    };
 
112
 
 
113
#ifdef __GNUC__
 
114
#warning KShortcutDialog is gone
 
115
#endif //__GNUC__
 
116
#if 0
 
117
class EditShortcut
 
118
    : public EditShortcutBase
 
119
    {
 
120
    Q_OBJECT
 
121
    public:
 
122
        EditShortcut( QWidget* parent = NULL );
 
123
    protected:
 
124
        void editShortcut();
 
125
        void clearShortcut();
 
126
    };
 
127
 
 
128
class EditShortcutDialog
 
129
    : public KDialog
 
130
    {
 
131
    Q_OBJECT
 
132
    public:
 
133
        EditShortcutDialog( QWidget* parent = NULL, const char* name = NULL );
 
134
        void setShortcut( const QString& cut );
 
135
        QString shortcut() const;
 
136
    private:
 
137
        EditShortcut* widget;
 
138
    };
 
139
 
 
140
// slightly duped from utils.cpp
 
141
class ShortcutDialog
 
142
    : public KShortcutDialog
 
143
    {
 
144
    Q_OBJECT
 
145
    public:
 
146
        ShortcutDialog( const KShortcut& cut, QWidget* parent = NULL );
 
147
        virtual void accept();
 
148
    };
 
149
#endif //0
 
150
} // namespace
 
151
 
 
152
#endif