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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • kdeui
  • widgets
kkeysequencewidget.h
Go to the documentation of this file.
1 // vim: noexpandtab ts=4 sw=4
2 /* This file is part of the KDE libraries
3  Copyright (C) 2001, 2002 Ellis Whitehead <ellis@kde.org>
4  Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KKEYSEQUENCEWIDGET_H
23 #define KKEYSEQUENCEWIDGET_H
24 
25 #include <QtCore/QList>
26 #include <QtGui/QPushButton>
27 
28 #include <kshortcut.h>
29 
30 
31 class KKeySequenceWidgetPrivate;
32 class QAction;
33 class KAction;
34 class KActionCollection;
35 
51 class KDEUI_EXPORT KKeySequenceWidget: public QWidget
52 {
53  Q_OBJECT
54 
55  Q_FLAGS(ShortcutTypes)
56 
57  Q_PROPERTY(
58  bool multiKeyShortcutsAllowed
59  READ multiKeyShortcutsAllowed
60  WRITE setMultiKeyShortcutsAllowed )
61 
62  Q_PROPERTY(
63  ShortcutTypes checkForConflictsAgainst
64  READ checkForConflictsAgainst
65  WRITE setCheckForConflictsAgainst )
66 
67  Q_PROPERTY(
68  bool modifierlessAllowed
69  READ isModifierlessAllowed
70  WRITE setModifierlessAllowed )
71 
72 public:
75  enum Validation {
77  Validate = 0,
79  NoValidate = 1
80  };
81 
85  explicit KKeySequenceWidget(QWidget *parent = 0);
86 
90  virtual ~KKeySequenceWidget();
91 
98 
99  enum ShortcutType {
100  None = 0x00,
101  LocalShortcuts = 0x01,
102  StandardShortcuts = 0x02,
103  GlobalShortcuts = 0x03
104  };
105  Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType)
106 
107 
161  void setCheckForConflictsAgainst( ShortcutTypes types );
162 
169  ShortcutTypes checkForConflictsAgainst() const;
170 
174  void setMultiKeyShortcutsAllowed(bool);
175  bool multiKeyShortcutsAllowed() const;
176 
184  void setModifierlessAllowed(bool allow);
185 
189  bool isModifierlessAllowed();
190 
195  void setClearButtonShown(bool show);
196 
198 
208  bool isKeySequenceAvailable(const QKeySequence &seq) const;
209 
213  QKeySequence keySequence() const;
214 
227  void setCheckActionCollections(const QList<KActionCollection *>& actionCollections);
228 
235 #ifndef KDE_NO_DEPRECATED
236  KDE_DEPRECATED void setCheckActionList(const QList<QAction*> &checkList);
237 #endif
238 
243  void setComponentName(const QString &componentName);
244 
245 
246 Q_SIGNALS:
247 
252  void keySequenceChanged(const QKeySequence &seq);
253 
263  void stealShortcut(const QKeySequence &seq, KAction *action);
264 
265 public Q_SLOTS:
266 
274  void captureKeySequence();
275 
282  void setKeySequence(const QKeySequence &seq, Validation val = NoValidate);
283 
287  void clearKeySequence();
288 
301  void applyStealShortcut();
302 
303 private:
304  Q_PRIVATE_SLOT(d, void doneRecording())
305 
306 private:
307  friend class KKeySequenceWidgetPrivate;
308  KKeySequenceWidgetPrivate *const d;
309 
310  Q_DISABLE_COPY(KKeySequenceWidget)
311 };
312 
313 Q_DECLARE_OPERATORS_FOR_FLAGS(KKeySequenceWidget::ShortcutTypes)
314 
315 #endif //KKEYSEQUENCEWIDGET_H
KKeySequenceWidget
A widget to input a QKeySequence.
Definition: kkeysequencewidget.h:51
KActionCollection
A container for a set of QAction objects.
Definition: kactioncollection.h:56
QWidget
kshortcut.h
Defines platform-independent classes for keyboard shortcut handling.
QString
None
KKeySequenceWidget::Validation
Validation
An enum about validation when setting a key sequence.
Definition: kkeysequencewidget.h:75
KAction
Class to encapsulate user-driven action or event.
Definition: kaction.h:216
KKeySequenceWidget::ShortcutType
ShortcutType
Definition: kkeysequencewidget.h:99
QAction
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:14 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • 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