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

KDEUI

kshortcutseditor.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 1997 Nicolas Hadacek <hadacek@kde.org>
00003     Copyright (C) 2001,2001 Ellis Whitehead <ellis@kde.org>
00004     Copyright (C) 2006 Hamish Rodda <rodda@kde.org>
00005     Copyright (C) 2007 Roberto Raggi <roberto@kdevelop.org>
00006     Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
00007     Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Library General Public
00011     License as published by the Free Software Foundation; either
00012     version 2 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Library General Public License for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with this library; see the file COPYING.LIB.  If not, write to
00021     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022     Boston, MA 02110-1301, USA.
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 // KShortcutsEditor expects that the list of existing shortcuts is already
00039 // free of conflicts. If it is not, nothing will crash, but your users
00040 // won't like the resulting behavior.
00041 
00042 
00059 class KDEUI_EXPORT KShortcutsEditor : public QWidget
00060 {
00061     Q_OBJECT
00062 
00063 public:
00064     enum ActionType {
00066         WidgetAction      = Qt::WidgetShortcut      /*0*/,
00068         WindowAction      = Qt::WindowShortcut      /*1*/,
00070         ApplicationAction = Qt::ApplicationShortcut /*2*/,
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 
00148     void save();
00149 
00164     void writeConfiguration( KConfigGroup* config = 0 ) const;
00165 
00174     void exportConfiguration( KConfig *config) const;
00175 
00184     void importConfiguration( KConfig *config);
00185 
00186 
00187 Q_SIGNALS:
00191     void keyChange();
00192 
00193 public Q_SLOTS:
00197     void resizeColumns();
00198 
00202     void allDefault();
00203         
00207         void printShortcuts() const;
00208 
00209 private:
00210     Q_PRIVATE_SLOT(d, void capturedShortcut(QVariant, const QModelIndex &))
00211 
00212     Q_PRIVATE_SLOT(d, void globalSettingsChangedSystemwide(int))
00213 
00214 private:
00215     friend class KShortcutsDialog;
00216     friend class KShortcutsEditorPrivate;
00217     KShortcutsEditorPrivate *const d;
00218     Q_DISABLE_COPY(KShortcutsEditor)
00219 };
00220 
00221 Q_DECLARE_OPERATORS_FOR_FLAGS(KShortcutsEditor::ActionTypes)
00222 
00223 #endif // KSHORTCUTSEDITOR_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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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