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
00145 void save();
00146
00154 void commit();
00155
00170 void writeConfiguration( KConfigGroup* config = 0 ) const;
00171
00180 void exportConfiguration( KConfig *config) const;
00181
00190 void importConfiguration( KConfig *config);
00191
00192
00193 Q_SIGNALS:
00197 void keyChange();
00198
00199 public Q_SLOTS:
00203 void resizeColumns();
00204
00208 void allDefault();
00209
00213 void printShortcuts() const;
00214
00215 private:
00216 Q_PRIVATE_SLOT(d, void capturedShortcut(QVariant, const QModelIndex &))
00217
00218 private:
00219 friend class KShortcutsDialog;
00220 friend class KShortcutsEditorPrivate;
00221 KShortcutsEditorPrivate *const d;
00222 Q_DISABLE_COPY(KShortcutsEditor)
00223 };
00224
00225 Q_DECLARE_OPERATORS_FOR_FLAGS(KShortcutsEditor::ActionTypes)
00226
00227 #endif // KSHORTCUTSEDITOR_H