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

KDEUI

kkeysequencewidget.h

Go to the documentation of this file.
00001 // vim: noexpandtab ts=4 sw=4
00002 /* This file is part of the KDE libraries
00003     Copyright (C) 2001, 2002 Ellis Whitehead <ellis@kde.org>
00004     Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KKEYSEQUENCEWIDGET_H
00023 #define KKEYSEQUENCEWIDGET_H
00024 
00025 #include <QtCore/QList>
00026 #include <QtGui/QPushButton>
00027 
00028 #include <kshortcut.h>
00029 
00030 
00031 class KKeySequenceWidgetPrivate;
00032 class QAction;
00033 class KAction;
00034 class KActionCollection;
00035 
00049 class KDEUI_EXPORT KKeySequenceWidget: public QWidget
00050 {
00051     Q_OBJECT
00052 
00053     Q_PROPERTY( 
00054             bool multiKeyShortcutsAllowed
00055             READ multiKeyShortcutsAllowed
00056             WRITE setMultiKeyShortcutsAllowed )
00057 
00058     Q_PROPERTY(
00059             ShortcutTypes checkForConflictsAgainst
00060             READ checkForConflictsAgainst
00061             WRITE setCheckForConflictsAgainst )
00062 
00063 
00064 public:
00067     enum Validation {
00069         Validate = 0,
00071         NoValidate = 1
00072     };
00073 
00077     explicit KKeySequenceWidget(QWidget *parent = 0);
00078 
00082     virtual ~KKeySequenceWidget();
00083 
00090 
00091         enum ShortcutType {
00092             None           = 0x00,      
00093             LocalShortcuts = 0x01,      
00094             StandardShortcuts = 0x02,   
00095             GlobalShortcuts = 0x03      
00096         };
00097         Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType)
00098 
00099         
00153         void setCheckForConflictsAgainst( ShortcutTypes types );
00154 
00161         ShortcutTypes checkForConflictsAgainst() const;
00162 
00166         void setMultiKeyShortcutsAllowed(bool);
00167         bool multiKeyShortcutsAllowed() const;
00168 
00176         void setModifierlessAllowed(bool allow);
00177 
00181         bool isModifierlessAllowed();
00182 
00187         void setClearButtonShown(bool show);
00188 
00190 
00200     bool isKeySequenceAvailable(const QKeySequence &seq) const;
00201 
00205     QKeySequence keySequence() const;
00206 
00219     void setCheckActionCollections(const QList<KActionCollection *>& actionCollections);
00220 
00227     KDE_DEPRECATED void setCheckActionList(const QList<QAction*> &checkList);
00228 
00233     void setComponentName(const QString &componentName);
00234 
00235 
00236 Q_SIGNALS:
00237 
00242     void keySequenceChanged(const QKeySequence &seq);
00243 
00253     void stealShortcut(const QKeySequence &seq, KAction *action);
00254 
00255 public Q_SLOTS:
00256 
00264     void captureKeySequence();
00265 
00272     void setKeySequence(const QKeySequence &seq, Validation val = NoValidate);
00273 
00277     void clearKeySequence();
00278 
00291     void applyStealShortcut();
00292 
00293 private:
00294     Q_PRIVATE_SLOT(d, void doneRecording())
00295 
00296 private:
00297     friend class KKeySequenceWidgetPrivate;
00298     KKeySequenceWidgetPrivate *const d;
00299 
00300     Q_DISABLE_COPY(KKeySequenceWidget)
00301 };
00302 
00303 Q_DECLARE_OPERATORS_FOR_FLAGS(KKeySequenceWidget::ShortcutTypes)
00304 
00305 #endif //KKEYSEQUENCEWIDGET_H

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal