/usr/include/kshortcutsdialog.h is in kdelibs5-dev 4:4.8.4-4+deb7u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | /* This file is part of the KDE libraries
Copyright (C) 1997 Nicolas Hadacek <hadacek@kde.org>
Copyright (C) 2001,2001 Ellis Whitehead <ellis@kde.org>
Copyright (C) 2006 Hamish Rodda <rodda@kde.org>
Copyright (C) 2007 Roberto Raggi <roberto@kdevelop.org>
Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSHORTCUTSDIALOG_H
#define KSHORTCUTSDIALOG_H
#include <kdialog.h>
#include "kshortcutseditor.h"
/**
* @short Dialog for configuration of KActionCollection and KGlobalAccel.
*
* The KShortcutsDialog class is used for configuring dictionaries of key/action
* associations for KActionCollection and KGlobalAccel. It uses the KShortcutsEditor widget
* and offers buttons to set all keys to defaults and invoke on-line help.
*
* Several static methods are supplied which provide the most convenient interface
* to the dialog. The most common and most encouraged use is with KActionCollection.
*
* \code
* KShortcutsDialog::configure( actionCollection() );
* \endcode
*
* @since 4.3
* By default this dialog is modal. If you don't want that, setModal(false) and then the non-static
* configure() will show the dialog. If you want to do anything extra when the dialog is done,
* connect to okClicked() and/or cancelClicked(). However, if your extra stuff depends on the
* changed settings already being saved, connect to saved() instead to be safe; if you connect to
* okClicked() your function might be called before the save happens.
*
* example:
* \code
* KShortcutsDialog dlg;
* dlg.addCollection(myActions);
* dlg.setModal(false);
* connect(&dlg, SIGNAL(saved()), this, SLOT(doExtraStuff()));
* dlg.configure();
* \endcode
*
* \image html kshortcutsdialog.png "KDE Shortcuts Dialog"
*
* @author Nicolas Hadacek <hadacek@via.ecp.fr>
* @author Hamish Rodda <rodda@kde.org> (KDE 4 porting)
* @author Michael Jansen <kde@michael-jansen.biz>
*/
class KDEUI_EXPORT KShortcutsDialog : public KDialog
{
Q_OBJECT
public:
/**
* Constructs a KShortcutsDialog as a child of @p parent.
* Set @p allowLetterShortcuts to false if unmodified alphanumeric
* keys ('A', '1', etc.) are not permissible shortcuts.
*/
explicit KShortcutsDialog(KShortcutsEditor::ActionTypes types = KShortcutsEditor::AllActions,
KShortcutsEditor::LetterShortcuts allowLetterShortcuts = KShortcutsEditor::LetterShortcutsAllowed,
QWidget *parent = 0);
/**
* Destructor. Deletes all resources used by a KShortcutsDialog object.
*/
virtual ~KShortcutsDialog();
/**
* Add all actions of the collection to the ones displayed and configured
* by the dialog.
*
* @param title the title associated with the collection (if null, the
* KAboutData::progName() of the collection's componentData is used)
*/
void addCollection(KActionCollection *, const QString &title = QString());
/**
* @return the list of action collections that are available for configuration in the dialog.
*/
QList<KActionCollection*> actionCollections() const;
/**
* Run the dialog and call writeSettings() on the action collections
* that were added if @p bSaveSettings is true.
*/
bool configure(bool saveSettings = true);
/** @see QWidget::sizeHint() */
virtual QSize sizeHint() const;
/**
* Pops up a modal dialog for configuring key settings. The new
* shortcut settings will become active if the user presses OK.
*
* @param collection the KActionCollection to configure
* @param allowLetterShortcuts set to KShortcutsEditor::LetterShortcutsDisallowed if unmodified alphanumeric
* keys ('A', '1', etc.) are not permissible shortcuts.
* @param parent the parent widget to attach to
* @param bSaveSettings if true, the settings will also be saved back
* by calling writeSettings() on the action collections that were added.
*
* @return Accept if the dialog was closed with OK, Reject otherwise.
*/
static int configure( KActionCollection *collection, KShortcutsEditor::LetterShortcuts allowLetterShortcuts =
KShortcutsEditor::LetterShortcutsAllowed, QWidget* parent = 0, bool bSaveSettings = true);
Q_SIGNALS:
/**
* emitted after ok is clicked and settings are saved
*/
void saved();
private:
Q_PRIVATE_SLOT(d, void changeShortcutScheme(const QString &))
Q_PRIVATE_SLOT(d, void save())
Q_PRIVATE_SLOT(d, void undoChanges())
class KShortcutsDialogPrivate;
friend class KShortcutsDialogPrivate;
class KShortcutsDialogPrivate *const d;
Q_DISABLE_COPY(KShortcutsDialog)
};
#endif // KSHORTCUTSDIALOG_H
//kate: space-indent off; indent-width 4; replace-tabs off;tab-width 4;
|