add more spacing
[personal-kdebase.git] / workspace / kwin / kcmkwin / kwinrules / detectwidget.h
blobf8d65c07075300645bf2e66131a2069a17c69a6e
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 __DETECTWIDGET_H__
21 #define __DETECTWIDGET_H__
23 #include <KDialog>
24 #include <kwindowsystem.h>
26 #include "../../rules.h"
27 //Added by qt3to4:
28 #include <QEvent>
29 #include <QByteArray>
31 #include "ui_detectwidget.h"
33 namespace KWin
36 class DetectWidget
37 : public QWidget, public Ui_DetectWidget
39 Q_OBJECT
40 public:
41 explicit DetectWidget( QWidget* parent = NULL );
44 class DetectDialog
45 : public KDialog
47 Q_OBJECT
48 public:
49 explicit DetectDialog( QWidget* parent = NULL, const char* name = NULL );
50 void detect( WId window );
51 QByteArray selectedClass() const;
52 bool selectedWholeClass() const;
53 QByteArray selectedRole() const;
54 bool selectedWholeApp() const;
55 NET::WindowType selectedType() const;
56 QString selectedTitle() const;
57 Rules::StringMatch titleMatch() const;
58 QByteArray selectedMachine() const;
59 const KWindowInfo& windowInfo() const;
60 signals:
61 void detectionDone( bool );
62 protected:
63 virtual bool eventFilter( QObject* o, QEvent* e );
64 private:
65 void selectWindow();
66 void readWindow( WId window );
67 void executeDialog();
68 WId findWindow();
69 QByteArray wmclass_class;
70 QByteArray wmclass_name;
71 QByteArray role;
72 NET::WindowType type;
73 QString title;
74 QByteArray extrarole;
75 QByteArray machine;
76 DetectWidget* widget;
77 KDialog* grabber;
78 KWindowInfo info;
81 inline
82 const KWindowInfo& DetectDialog::windowInfo() const
84 return info;
87 } // namespace
89 #endif