1
#ifndef oxygendetectwidget_h
2
#define oxygendetectwidget_h
4
//////////////////////////////////////////////////////////////////////////////
5
// oxygendetectwidget.h
6
// Note: this class is a stripped down version of
7
// /kdebase/workspace/kwin/kcmkwin/kwinrules/detectwidget.h
8
// Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org>
10
// -------------------
12
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
14
// Permission is hereby granted, free of charge, to any person obtaining a copy
15
// of this software and associated documentation files (the "Software"), to
16
// deal in the Software without restriction, including without limitation the
17
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18
// sell copies of the Software, and to permit persons to whom the Software is
19
// furnished to do so, subject to the following conditions:
21
// The above copyright notice and this permission notice shall be included in
22
// all copies or substantial portions of the Software.
24
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31
//////////////////////////////////////////////////////////////////////////////
35
#include <QtCore/QEvent>
36
#include <QtCore/QByteArray>
37
#include <QtGui/QCheckBox>
38
#include <QtGui/QLabel>
40
#include <kwindowsystem.h>
42
#include "../oxygenexception.h"
43
#include "ui_oxygendetectwidget.h"
48
class DetectDialog : public KDialog
56
DetectDialog( QWidget* );
58
//! read window properties or select one from mouse grab
59
void detect( WId window );
62
QByteArray selectedClass() const;
64
//! window information
65
const KWindowInfo& windowInfo() const
69
Exception::Type exceptionType() const
71
if( ui.windowClassCheckBox->isChecked() ) return Exception::WindowClassName;
72
else if( ui.windowTitleCheckBox->isChecked() ) return Exception::WindowTitle;
73
else return Exception::WindowClassName;
78
void detectionDone( bool );
82
virtual bool eventFilter( QObject* o, QEvent* e );
86
//! select window from grab
89
//! read window properties
90
void readWindow( WId window );
92
//! find window under cursor
96
void executeDialog( void );
104
//! invisible dialog used to grab mouse
107
//! current window information