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
40 SYSTEM_NONE
, //!< TODO
41 SYSTEM_MENUENTRIES
, //!< Shortcuts for menu entries.
42 SYSTEM_ROOT
, //!< TODO
43 /* last one*/ SYSTEM_MAX
//!< End of enum marker
44 }; // don't remove entries
47 * Create a \c ActionDataGroup object.
49 * \param parent_P A ActionDataGroup or 0. If provided this action is
50 * registered with the group.
51 * \param name_P Name for the object.
52 * \param comment_P Comment for the object.
53 * \param condition_P Conditions for the object or 0
54 * \param system_group_t Group type
55 * \param enabled_P Is the action enabled?
58 ActionDataGroup
* parent_P
,
59 const QString
& name_P
,
60 const QString
& comment_P
,
61 Condition_list
* conditions_P
= NULL
,
62 system_group_t system_group_P
= SYSTEM_NONE
,
63 bool enabled_P
= false );
65 ActionDataGroup( KConfigGroup
& cfg_P
, ActionDataGroup
* parent_P
);
66 virtual ~ActionDataGroup();
67 virtual void update_triggers();
68 virtual void cfg_write( KConfigGroup
& cfg_P
) const;
71 * What kind of actions are allowed for this group?
73 Action::ActionTypes
allowedActionTypes() const;
76 * What kind of trigger are allowed for this group?
78 Trigger::TriggerTypes
allowedTriggerTypes() const;
81 * Get a shallow copy of the list of children.
83 const QList
<ActionDataBase
*> children() const;
86 * Number of childrens.
93 void aboutToBeErased();
96 * Is this a system group?
100 bool is_system_group() const;
101 system_group_t
system_group() const;
104 // CHECKME : Why this?
105 using ActionDataBase::set_conditions
; // make public
109 friend class ActionDataBase
;
111 //! Add a child to this collection
112 void add_child( ActionDataBase
* child_P
);
114 //! Remove a child from this collection
115 void remove_child( ActionDataBase
* child_P
);
118 QList
< ActionDataBase
* > _list
;
120 //! System group type
121 system_group_t _system_group
; // e.g. menuedit entries, can't be deleted or renamed
127 } // namespace KHotKeys