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 KConfigBase;
00034 class KConfigGroup;
00035 class KGlobalAccel;
00036 class KShortcut;
00037 class KShortcutsEditorPrivate;
00038
00039
00040
00041
00042
00043
00060 class KDEUI_EXPORT KShortcutsEditor : public QWidget
00061 {
00062 Q_OBJECT
00063
00064 public:
00065 enum ActionType {
00067 WidgetAction = Qt::WidgetShortcut ,
00069 WindowAction = Qt::WindowShortcut ,
00071 ApplicationAction = Qt::ApplicationShortcut ,
00073 GlobalAction = 4,
00075 AllActions = 0xffffffff
00076 };
00077 Q_DECLARE_FLAGS(ActionTypes, ActionType)
00078
00079 enum LetterShortcuts {
00084 LetterShortcutsDisallowed = 0,
00086 LetterShortcutsAllowed
00087 };
00088
00098 KShortcutsEditor(KActionCollection *collection, QWidget *parent, ActionTypes actionTypes = AllActions, LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed);
00099
00110 explicit KShortcutsEditor( QWidget* parent, ActionTypes actionTypes = AllActions, LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed );
00111
00113 virtual ~KShortcutsEditor();
00114
00118 bool isModified() const;
00119
00123 void clearCollections();
00124
00130 void addCollection(KActionCollection *, const QString &title = QString());
00131
00132
00136 void undoChanges();
00137
00146 void save();
00147
00155 void commit();
00156
00157
00161 void clearConfiguration();
00162
00177 void writeConfiguration( KConfigGroup* config = 0 ) const;
00178
00187 KDE_DEPRECATED void exportConfiguration( KConfig *config) const;
00188 void exportConfiguration( KConfigBase *config) const;
00189
00198 KDE_DEPRECATED void importConfiguration( KConfig *config);
00199 void importConfiguration( KConfigBase *config);
00200
00201
00202 Q_SIGNALS:
00206 void keyChange();
00207
00208 public Q_SLOTS:
00212 void resizeColumns();
00213
00217 void allDefault();
00218
00222 void printShortcuts() const;
00223
00224 private:
00225 Q_PRIVATE_SLOT(d, void capturedShortcut(QVariant, const QModelIndex &))
00226
00227 private:
00228 friend class KShortcutsDialog;
00229 friend class KShortcutsEditorPrivate;
00230 KShortcutsEditorPrivate *const d;
00231 Q_DISABLE_COPY(KShortcutsEditor)
00232 };
00233
00234 Q_DECLARE_OPERATORS_FOR_FLAGS(KShortcutsEditor::ActionTypes)
00235
00236 #endif // KSHORTCUTSEDITOR_H