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

« back to all changes in this revision

Viewing changes to khotkeys/libkhotkeysprivate/conditions/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 CONDITION_H
 
2
#define 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 <QtCore/QObject>
 
22
#include <QtCore/QString>
 
23
 
 
24
#include "kdemacros.h"
 
25
 
 
26
class KConfigGroup;
 
27
 
 
28
 
 
29
namespace KHotKeys {
 
30
 
 
31
class ConditionsVisitor;
 
32
class Condition_list_base;
 
33
 
 
34
/**
 
35
 * @author Michael Jansen <kde@michael-jansen.biz>
 
36
 */
 
37
class KDE_EXPORT Condition
 
38
    {
 
39
    Q_DISABLE_COPY( Condition )
 
40
 
 
41
    public:
 
42
        Condition( Condition_list_base* parent_P = NULL );
 
43
        Condition( KConfigGroup& cfg_P, Condition_list_base* parent_P );
 
44
        virtual ~Condition();
 
45
        virtual bool match() const = 0;
 
46
        virtual void updated() const; // called when the condition changes
 
47
        virtual void cfg_write( KConfigGroup& cfg_P ) const = 0;
 
48
        virtual const QString description() const = 0;
 
49
        virtual Condition* copy() const = 0;
 
50
        const Condition_list_base* parent() const;
 
51
        Condition_list_base* parent();
 
52
        static Condition* create_cfg_read( KConfigGroup& cfg_P, Condition_list_base* parent_P );
 
53
 
 
54
        // Reparent the condition to another list.
 
55
        void reparent(Condition_list_base *parent);
 
56
 
 
57
        virtual void visit( ConditionsVisitor *visitor );
 
58
 
 
59
    protected:
 
60
 
 
61
        Condition_list_base* _parent;
 
62
    };
 
63
 
 
64
 
 
65
} // namespace KHotKeys
 
66
 
 
67
#endif /* #ifndef CONDITION_H */