• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • dialogs
kshortcutseditor.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 1997 Nicolas Hadacek <hadacek@kde.org>
3  Copyright (C) 2001,2001 Ellis Whitehead <ellis@kde.org>
4  Copyright (C) 2006 Hamish Rodda <rodda@kde.org>
5  Copyright (C) 2007 Roberto Raggi <roberto@kdevelop.org>
6  Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
7  Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Library General Public
11  License as published by the Free Software Foundation; either
12  version 2 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23 */
24 
25 #ifndef KSHORTCUTSEDITOR_H
26 #define KSHORTCUTSEDITOR_H
27 
28 #include <QtGui/QWidget>
29 #include "kgesture.h"
30 
31 class KActionCollection;
32 class KConfig;
33 class KConfigBase;
34 class KConfigGroup;
35 class KGlobalAccel;
36 class KShortcut;
37 class KShortcutsEditorPrivate;
38 
39 // KShortcutsEditor expects that the list of existing shortcuts is already
40 // free of conflicts. If it is not, nothing will crash, but your users
41 // won't like the resulting behavior.
42 
43 
60 class KDEUI_EXPORT KShortcutsEditor : public QWidget
61 {
62  Q_OBJECT
63 
64 public:
65  enum ActionType {
67  WidgetAction = Qt::WidgetShortcut /*0*/,
69  WindowAction = Qt::WindowShortcut /*1*/,
71  ApplicationAction = Qt::ApplicationShortcut /*2*/,
73  GlobalAction = 4,
75  AllActions = 0xffffffff
76  };
77  Q_DECLARE_FLAGS(ActionTypes, ActionType)
78 
79  enum LetterShortcuts {
84  LetterShortcutsDisallowed = 0,
86  LetterShortcutsAllowed
87  };
88 
98  KShortcutsEditor(KActionCollection *collection, QWidget *parent, ActionTypes actionTypes = AllActions, LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed);
99 
110  explicit KShortcutsEditor( QWidget* parent, ActionTypes actionTypes = AllActions, LetterShortcuts allowLetterShortcuts = LetterShortcutsAllowed );
111 
113  virtual ~KShortcutsEditor();
114 
118  bool isModified() const;
119 
123  void clearCollections();
124 
130  void addCollection(KActionCollection *, const QString &title = QString());
131 
132 
136  void undoChanges();
137 
146  void save();
147 
155  void commit();
156 
157 
161  void clearConfiguration();
162 
177  void writeConfiguration( KConfigGroup* config = 0 ) const;
178 
187 #ifndef KDE_NO_DEPRECATED
188  KDE_DEPRECATED void exportConfiguration( KConfig *config) const;
189 #endif
190  void exportConfiguration( KConfigBase *config) const;
191 
200 #ifndef KDE_NO_DEPRECATED
201  KDE_DEPRECATED void importConfiguration( KConfig *config);
202 #endif
203  void importConfiguration( KConfigBase *config);
204 
205 
206 Q_SIGNALS:
210  void keyChange();
211 
212 public Q_SLOTS:
216  void resizeColumns();
217 
221  void allDefault();
222 
226  void printShortcuts() const;
227 
228 private:
229  Q_PRIVATE_SLOT(d, void capturedShortcut(QVariant, const QModelIndex &))
230 
231 private:
232  friend class KShortcutsDialog;
233  friend class KShortcutsEditorPrivate;
234  KShortcutsEditorPrivate *const d;
235  Q_DISABLE_COPY(KShortcutsEditor)
236 };
237 
238 Q_DECLARE_OPERATORS_FOR_FLAGS(KShortcutsEditor::ActionTypes)
239 
240 #endif // KSHORTCUTSEDITOR_H
QModelIndex
QWidget
KActionCollection
A container for a set of QAction objects.
Definition: kactioncollection.h:56
KShortcutsEditor::ActionType
ActionType
Definition: kshortcutseditor.h:65
KShortcutsEditor::LetterShortcuts
LetterShortcuts
Definition: kshortcutseditor.h:79
KShortcut
Represents a keyboard shortcut.
Definition: kshortcut.h:57
KShortcutsEditor
Widget for configuration of KAccel and KGlobalAccel.
Definition: kshortcutseditor.h:60
QString
KConfigBase
KConfigGroup
KConfig
KStandardAction::save
KAction * save(const QObject *recvr, const char *slot, QObject *parent)
Save the current document.
Definition: kstandardaction.cpp:244
kgesture.h
KGlobalAccel
Configurable global shortcut support.
Definition: kglobalaccel.h:46
KShortcutsDialog
Dialog for configuration of KActionCollection and KGlobalAccel.
Definition: kshortcutsdialog.h:69
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal