not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / khotkeys / libkhotkeysprivate / action_data / action_data_group.h
blob02fb05467baeac2e5a764e3c06c145be382eb000
1 /****************************************************************************
3 KHotKeys
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"
23 class KHotkeysModel;
25 namespace KHotKeys {
28 /**
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
37 public:
39 enum system_group_t {
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
46 /**
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?
57 ActionDataGroup(
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;
70 /**
71 * What kind of actions are allowed for this group?
73 Action::ActionTypes allowedActionTypes() const;
75 /**
76 * What kind of trigger are allowed for this group?
78 Trigger::TriggerTypes allowedTriggerTypes() const;
80 /**
81 * Get a shallow copy of the list of children.
83 const QList<ActionDataBase*> children() const;
85 /**
86 * Number of childrens.
88 int size() const;
90 /**
91 * @reimp
93 void aboutToBeErased();
95 /**
96 * Is this a system group?
98 * @{
100 bool is_system_group() const;
101 system_group_t system_group() const;
102 //@}
104 // CHECKME : Why this?
105 using ActionDataBase::set_conditions; // make public
107 protected:
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 );
117 //! The children
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
129 #endif