1
/****************************************************************************
5
Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
7
Distributed under the terms of the GNU General Public License version 2.
9
****************************************************************************/
11
#ifndef ACTION_DATA_GROUP_H
12
#define ACTION_DATA_GROUP_H
14
#include "action_data_base.h"
15
#include "actions/actions.h"
16
#include "triggers/triggers.h"
18
#include "QtCore/QList"
20
#include "kdemacros.h"
29
* A group of \c ActionDataBase objects
31
* # The group can contain actions or action groups.
32
* # The group has its own list of conditions. These conditions apply to all children.
34
class KDE_EXPORT ActionDataGroup
35
: public ActionDataBase
42
SYSTEM_NONE, //!< TODO
43
SYSTEM_MENUENTRIES, //!< Shortcuts for menu entries.
44
SYSTEM_ROOT, //!< TODO
45
/* last one*/ SYSTEM_MAX //!< End of enum marker
46
}; // don't remove entries
49
* Create a \c ActionDataGroup object.
51
* \param parent_P A ActionDataGroup or 0. If provided this action is
52
* registered with the group.
53
* \param name_P Name for the object.
54
* \param comment_P Comment for the object.
55
* \param condition_P Conditions for the object or 0
56
* \param system_group_t Group type
57
* \param enabled_P Is the action enabled?
60
ActionDataGroup* parent_P,
61
const QString& name_P = QString(),
62
const QString& comment_P = QString(),
63
Condition_list* conditions_P = NULL,
64
system_group_t system_group_P = SYSTEM_NONE);
66
virtual ~ActionDataGroup();
71
virtual void accept(ActionDataVisitor *visitor);
72
virtual void accept(ActionDataConstVisitor *visitor) const;
74
virtual void update_triggers();
77
* What kind of actions are allowed for this group?
79
Action::ActionTypes allowedActionTypes() const;
82
* What kind of trigger are allowed for this group?
84
Trigger::TriggerTypes allowedTriggerTypes() const;
87
* Get a shallow copy of the list of children.
89
const QList<ActionDataBase*> children() const;
92
* Number of childrens.
99
void aboutToBeErased();
102
* Is this a system group?
106
bool is_system_group() const;
107
system_group_t system_group() const;
108
void set_system_group(system_group_t group);
111
// CHECKME : Why this?
112
using ActionDataBase::set_conditions; // make public
114
//! Add a child to this collection
115
void add_child( ActionDataBase* child_P, int position );
117
//! Add a child to this collection
118
void add_child( ActionDataBase* child_P );
120
//! Remove a child from this collection
121
void remove_child( ActionDataBase* child_P );
125
void stateChanged(bool isEnabled);
130
QList< ActionDataBase* > _list;
132
//! System group type
133
system_group_t _system_group; // e.g. menuedit entries, can't be deleted or renamed
135
virtual void doEnable();
137
virtual void doDisable();
143
} // namespace KHotKeys