• Skip to content
  • Skip to link menu
KDE 4.3 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 KConfigBase;
00034 class KConfigGroup;
00035 class KGlobalAccel;
00036 class KShortcut;
00037 class KShortcutsEditorPrivate;
00038 
00039 // KShortcutsEditor expects that the list of existing shortcuts is already
00040 // free of conflicts. If it is not, nothing will crash, but your users
00041 // won't like the resulting behavior.
00042 
00043 
00060 class KDEUI_EXPORT KShortcutsEditor : public QWidget
00061 {
00062     Q_OBJECT
00063 
00064 public:
00065     enum ActionType {
00067         WidgetAction      = Qt::WidgetShortcut      /*0*/,
00069         WindowAction      = Qt::WindowShortcut      /*1*/,
00071         ApplicationAction = Qt::ApplicationShortcut /*2*/,
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

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