Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kcontrol / keys / kglobalshortcutseditor.h
blobdb6a1cc7097a772fb8a86335abbe51d44faa5215
1 /*
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
21 #include <QWidget>
23 #include "kshortcutseditor.h"
25 class KActionCollection;
26 class KShortcut;
28 /**
29 * Combine a KShortcutsEditor with a KComboBox.
31 * @see KShortcutsEditor
32 * @author Michael Jansen <kde@michael-jansen.biz>
34 class KGlobalShortcutsEditor : public QWidget
36 Q_OBJECT
38 public:
40 /**
41 * Constructor
43 * @param parent parent widget
45 KGlobalShortcutsEditor( QWidget *parent, KShortcutsEditor::ActionTypes actionTypes = KShortcutsEditor::AllActions);
46 ~KGlobalShortcutsEditor();
48 /**
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() );
58 /**
59 * Revert all changes made since the last save.
61 void undo();
63 /**
64 * Clear all collections were currently hosting.
66 void clear();
68 Q_SIGNALS:
70 /**
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
77 void changed();
80 public Q_SLOTS:
82 /**
83 * Activate the component \a component.
85 * @param component the component
87 void activateComponent( const QString &component );
90 /**
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.
96 void save();
98 /**
99 * Reset all \a components to default values.
101 void allDefault();
104 private Q_SLOTS:
105 void _k_key_changed();
107 private:
109 friend class KGlobalShortcutsEditorPrivate;
110 class KGlobalShortcutsEditorPrivate;
111 KGlobalShortcutsEditorPrivate *const d;
112 Q_DISABLE_COPY(KGlobalShortcutsEditor)
113 }; // class KGlobalShortcutsEditor
115 #endif // KGLOBALSHORTCUTSEDITOR_H