2 * Copyright 2008 Michael Jansen <kde@michael-jansen.biz>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program 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
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #ifndef KGLOBALSHORTCUTSEDITOR_H
19 #define KGLOBALSHORTCUTSEDITOR_H
23 #include "kshortcutseditor.h"
25 class KActionCollection
;
30 * Combine a KShortcutsEditor with a KComboBox.
32 * @see KShortcutsEditor
33 * @author Michael Jansen <kde@michael-jansen.biz>
35 class KGlobalShortcutsEditor
: public QWidget
44 * @param parent parent widget
46 KGlobalShortcutsEditor(QWidget
*parent
,
47 KShortcutsEditor::ActionTypes actionTypes
= KShortcutsEditor::AllActions
);
48 ~KGlobalShortcutsEditor();
51 * Insert an action collection, i.e. add all it's actions to the ones already associated
52 * with the KShortcutsEditor object.
54 * @param collection the collection to add
55 * @param component title for the component
56 * @param title title for the subtree in the component
58 void addCollection(KActionCollection
*, const QString
&id
, const QString
&name
);
61 * Clear all collections were currently hosting.
67 * Revert all changes made since the last save.
73 * Load the shortcuts from the configuration.
75 void importConfiguration(KConfig
*config
);
79 * Save the shortcuts to the configuration.
81 void exportConfiguration(KConfig
*config
) const;
85 * Are the unsaved changes?
87 bool isModified() const;
92 * Indicate that state of the modules contents has changed.
94 * @param state changed or not
102 * Activate the component \a component.
104 * @param component the component
106 void activateComponent(const QString
&component
);
110 * Make the changes persistent.
112 * That's function is not really saving. Global shortcuts are saved immediately. This
113 * prevent the undo on deleting the editor.
118 * Reset all \a components to default values.
124 void _k_key_changed();
128 friend class KGlobalShortcutsEditorPrivate
;
129 class KGlobalShortcutsEditorPrivate
;
130 KGlobalShortcutsEditorPrivate
*const d
;
131 Q_DISABLE_COPY(KGlobalShortcutsEditor
)
132 }; // class KGlobalShortcutsEditor
134 #endif // KGLOBALSHORTCUTSEDITOR_H