2
* Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
3
* Copyright (C) 2009 Michael Jansen <kde@michael-jansen.biz>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License version 2 as published by the Free Software Foundation.
9
* This library 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 GNU
12
* Library General Public License for more details.
14
* You should have received a copy of the GNU Library General Public License
15
* along with this library; see the file COPYING.LIB. If not, write to
16
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
20
#include "simple_action_data.h"
22
#include "action_data/action_data_visitor.h"
23
#include "conditions/conditions.h"
24
#include "conditions/conditions_list.h"
26
#include <KDE/KConfigGroup>
32
SimpleActionData::SimpleActionData(
33
ActionDataGroup* parent_P,
34
const QString& name_P,
35
const QString& comment_P)
41
new Condition_list( "", this ),
46
void SimpleActionData::accept(ActionDataVisitor *visitor)
48
visitor->visitSimpleActionData(this);
52
void SimpleActionData::accept(ActionDataConstVisitor *visitor) const
54
visitor->visitSimpleActionData(this);
58
void SimpleActionData::doEnable()
68
void SimpleActionData::doDisable()
78
void SimpleActionData::set_action( Action* action_P )
80
ActionList* tmp = new ActionList( "Simple_action_data" );
81
tmp->append( action_P );
86
void SimpleActionData::set_trigger( Trigger* trigger_P )
88
Trigger_list* tmp = new Trigger_list( "Simple_action" );
89
tmp->append( trigger_P );
94
const Action* SimpleActionData::action() const
96
if( actions() == 0 || actions()->isEmpty() )
98
return actions()->first();
102
Action* SimpleActionData::action()
104
if( actions() == 0 || actions()->isEmpty() )
106
return actions()->first();
110
const Trigger* SimpleActionData::trigger() const
112
if( triggers() == 0 || triggers()->isEmpty() )
115
return triggers()->first();
119
Trigger* SimpleActionData::trigger()
121
if( triggers() == 0 || triggers()->isEmpty() )
124
return triggers()->first();
127
} // namespace KHotKeys