3
/* Copyright (C) 2009 Michael Jansen <kde@michael-jansen.biz>
4
Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
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.
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.
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.
21
#include <QtCore/QObject>
22
#include <QtCore/QString>
24
#include "kdemacros.h"
31
class ConditionsVisitor;
32
class Condition_list_base;
35
* @author Michael Jansen <kde@michael-jansen.biz>
37
class KDE_EXPORT Condition
39
Q_DISABLE_COPY( Condition )
42
Condition( Condition_list_base* parent_P = NULL );
43
Condition( KConfigGroup& cfg_P, Condition_list_base* parent_P );
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 );
54
// Reparent the condition to another list.
55
void reparent(Condition_list_base *parent);
57
virtual void visit( ConditionsVisitor *visitor );
61
Condition_list_base* _parent;
65
} // namespace KHotKeys
67
#endif /* #ifndef CONDITION_H */