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

« back to all changes in this revision

Viewing changes to khotkeys/libkhotkeysprivate/conditions/existing_window_condition.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
#ifndef EXISTING_WINDOW_CONDITION_H
 
2
#define EXISTING_WINDOW_CONDITION_H
 
3
/* Copyright (C) 2009 Michael Jansen <kde@michael-jansen.biz>
 
4
   Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
 
5
 
 
6
   This library is free software; you can redistribute it and/or
 
7
   modify it under the terms of the GNU Library General Public
 
8
   License version 2 as published by the Free Software Foundation.
 
9
 
 
10
   This library is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
   Library General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU Library General Public License
 
16
   along with this library; see the file COPYING.LIB.  If not, write to
 
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
   Boston, MA 02110-1301, USA.
 
19
*/
 
20
 
 
21
#include "conditions/condition.h"
 
22
 
 
23
#include <QtCore/QObject>
 
24
#include <QtCore/QString>
 
25
#include <QtGui/qwindowdefs.h>
 
26
 
 
27
#include <KDE/KConfig>      // Needed because of some Qt Status redefinitions
 
28
#include <KDE/KConfigGroup>      // Needed because of some Qt Status redefinitions
 
29
 
 
30
#include <kdemacros.h>
 
31
 
 
32
#ifdef Q_WS_X11
 
33
#include <X11/Xlib.h>
 
34
#include <fixx11h.h>
 
35
#else
 
36
#define None 0
 
37
#endif
 
38
 
 
39
namespace KHotKeys {
 
40
 
 
41
class Condition_list_base;
 
42
class Windowdef_list;
 
43
 
 
44
 
 
45
/**
 
46
 * @author Michael Jansen <kde@michael-jansen.biz>
 
47
 */
 
48
class KDE_EXPORT Existing_window_condition
 
49
    : public QObject, public Condition
 
50
    {
 
51
    Q_OBJECT
 
52
    typedef Condition base;
 
53
    public:
 
54
        Existing_window_condition( Windowdef_list* window_P, Condition_list_base* parent = NULL );
 
55
        Existing_window_condition( KConfigGroup& cfg_P, Condition_list_base* parent_P );
 
56
        virtual ~Existing_window_condition();
 
57
        virtual bool match() const;
 
58
        virtual void cfg_write( KConfigGroup& cfg_P ) const;
 
59
        const Windowdef_list* window() const;
 
60
        Windowdef_list* window();
 
61
        virtual Existing_window_condition* copy() const;
 
62
        virtual const QString description() const;
 
63
    public Q_SLOTS:
 
64
        void window_added( WId w_P );
 
65
        void window_removed( WId w_P );
 
66
    private:
 
67
        void init();
 
68
        void set_match( WId w_P = None );
 
69
        Windowdef_list* _window;
 
70
        bool is_match;
 
71
    };
 
72
 
 
73
 
 
74
} // namespace KHotKeys
 
75
 
 
76
#endif /* #ifndef EXISTING_WINDOW_CONDITION_H */