File indexing completed on 2024-12-22 04:12:41
0001 /* 0002 * This file is part of the KDE project 0003 * SPDX-FileCopyrightText: 2013 Arjen Hiemstra <ahiemstra@heimr.nl> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef KISINPUTPROFILE_H 0009 #define KISINPUTPROFILE_H 0010 0011 #include <QObject> 0012 #include <QMetaType> 0013 0014 class KisAbstractInputAction; 0015 class KisShortcutConfiguration; 0016 /** 0017 * \brief A container class for sets of shortcuts associated with an action. 0018 * 0019 * 0020 */ 0021 class KisInputProfile : public QObject 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 /** 0027 * Constructor. 0028 */ 0029 KisInputProfile(QObject *parent = 0); 0030 /** 0031 * Destructor. 0032 */ 0033 ~KisInputProfile() override; 0034 0035 /** 0036 * \return The name of the profile. 0037 */ 0038 QString name() const; 0039 0040 /** 0041 * \return A list of all shortcuts available. 0042 */ 0043 QList<KisShortcutConfiguration *> allShortcuts() const; 0044 /** 0045 * \return A list of shortcuts associated with the given action. 0046 * 0047 * \param action The action for which to list the shortcuts. 0048 */ 0049 QList<KisShortcutConfiguration *> shortcutsForAction(KisAbstractInputAction *action) const; 0050 0051 /** 0052 * Add a shortcut to this profile. 0053 * 0054 * \param shortcut The shortcut to add. 0055 */ 0056 void addShortcut(KisShortcutConfiguration *shortcut); 0057 /** 0058 * Remove a shortcut from this profile. 0059 * 0060 * \param shortcut The shortcut to remove. 0061 */ 0062 void removeShortcut(KisShortcutConfiguration *shortcut); 0063 0064 public Q_SLOTS: 0065 /** 0066 * Set the name of this profile. 0067 * 0068 * \param name The name to set. 0069 */ 0070 void setName(const QString &name); 0071 0072 Q_SIGNALS: 0073 /** 0074 * Emitted when the name of this profile changes. 0075 */ 0076 void nameChanged(); 0077 0078 private: 0079 class Private; 0080 Private *const d; 0081 }; 0082 0083 #endif // KISINPUTPROFILE_H