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
;
29 * Combine a KShortcutsEditor with a KComboBox.
31 * @see KShortcutsEditor
32 * @author Michael Jansen <kde@michael-jansen.biz>
34 class KGlobalShortcutsEditor
: public QWidget
43 * @param parent parent widget
45 KGlobalShortcutsEditor( QWidget
*parent
, KShortcutsEditor::ActionTypes actionTypes
= KShortcutsEditor::AllActions
);
46 ~KGlobalShortcutsEditor();
49 * Insert an action collection, i.e. add all it's actions to the ones already associated
50 * with the KShortcutsEditor object.
52 * @param collection the collection to add
53 * @param component title for the component
54 * @param title title for the subtree in the component
56 void addCollection( KActionCollection
*, const QString
&component
, const QString
&title
= QString() );
59 * Revert all changes made since the last save.
64 * Clear all collections were currently hosting.
71 * Indicate that state of the modules contents has changed.
73 * There is currently no way to tell if the contents is really changed :-( .
75 * @param state changes or not
83 * Activate the component \a component.
85 * @param component the component
87 void activateComponent( const QString
&component
);
91 * Make the changes persistent.
93 * That's function is not really saving. Global shortcuts are saved immediately. This
94 * prevent the undo on deleting the editor.
99 * Reset all \a components to default values.
105 void _k_key_changed();
109 friend class KGlobalShortcutsEditorPrivate
;
110 class KGlobalShortcutsEditorPrivate
;
111 KGlobalShortcutsEditorPrivate
*const d
;
112 Q_DISABLE_COPY(KGlobalShortcutsEditor
)
113 }; // class KGlobalShortcutsEditor
115 #endif // KGLOBALSHORTCUTSEDITOR_H