KDEUI
kshortcutseditor.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KSHORTCUTSEDITOR_H
00026 #define KSHORTCUTSEDITOR_H
00027
00028 #include <QtGui/QWidget>
00029 #include "kgesture.h"
00030
00031 class KActionCollection;
00032 class KConfig;
00033 class KConfigGroup;
00034 class KGlobalAccel;
00035 class KShortcut;
00036 class KShortcutsEditorPrivate;
00037
00038
00039
00040
00041
00042
00059 class KDEUI_EXPORT KShortcutsEditor : public QWidget
00060 {
00061 Q_OBJECT
00062
00063 public:
00064 enum ActionType {
00066 WidgetAction = Qt::WidgetShortcut ,
00068 WindowAction = Qt::WindowShortcut ,
00070 ApplicationAction = Qt::ApplicationShortcut ,
00072 GlobalAction = 4,
00074 AllActions = 0xffffffff
00075 };
00076 Q_DECLARE_FLAGS(ActionTypes, ActionType)
00077
00078 enum LetterShortcuts {
00083 LetterShortcutsDisallowed = 0,
00085 LetterShortcutsAllowed
00086 };
00087
00097 KShortcutsEditor(KActionCollection *collection, QWidget *parent, ActionTypes actionTypes = AllActions, LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed);
00098
00109 explicit KShortcutsEditor( QWidget* parent, ActionTypes actionTypes = AllActions, LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed );
00110
00112 virtual ~KShortcutsEditor();
00113
00117 bool isModified() const;
00118
00122 void clearCollections();
00123
00129 void addCollection(KActionCollection *, const QString &title = QString());
00130
00131
00135 void undoChanges();
00136
00148 void save();
00149
00164 void writeConfiguration( KConfigGroup* config = 0 ) const;
00165
00174 void exportConfiguration( KConfig *config) const;
00175
00184 void importConfiguration( KConfig *config);
00185
00186
00187 Q_SIGNALS:
00191 void keyChange();
00192
00193 public Q_SLOTS:
00197 void resizeColumns();
00198
00202 void allDefault();
00203
00207 void printShortcuts() const;
00208
00209 private:
00210 Q_PRIVATE_SLOT(d, void capturedShortcut(QVariant, const QModelIndex &))
00211
00212 Q_PRIVATE_SLOT(d, void globalSettingsChangedSystemwide(int))
00213
00214 private:
00215 friend class KShortcutsDialog;
00216 friend class KShortcutsEditorPrivate;
00217 KShortcutsEditorPrivate *const d;
00218 Q_DISABLE_COPY(KShortcutsEditor)
00219 };
00220
00221 Q_DECLARE_OPERATORS_FOR_FLAGS(KShortcutsEditor::ActionTypes)
00222
00223 #endif // KSHORTCUTSEDITOR_H