Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.9 KB
Raw Blame
/*
 * This file is part of the KDE project
 * SPDX-FileCopyrightText: 2013 Arjen Hiemstra <[email protected]>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KISINPUTPROFILE_H
#define KISINPUTPROFILE_H

#include <QObject>
#include <QMetaType>

#include <kritaui_export.h>

class KisAbstractInputAction;
class KisShortcutConfiguration;
/**
 * \brief A container class for sets of shortcuts associated with an action.
 *
 *
 */
class KRITAUI_EXPORT KisInputProfile : public QObject
{
    Q_OBJECT

public:
    /**
     * Constructor.
     */
    KisInputProfile(QObject *parent = 0);
    /**
     * Destructor.
     */
    ~KisInputProfile() override;

    /**
     * \return The name of the profile.
     */
    QString name() const;

    /**
     * \return A list of all shortcuts available.
     */
    QList<KisShortcutConfiguration *> allShortcuts() const;

    /**
     * Return the action object for a specific \p id
     */
    KisAbstractInputAction* actionForId(const QString &id) const;

    /**
     * \return A list of shortcuts associated with the given action.
     *
     * \param action The action for which to list the shortcuts.
     */
    QList<KisShortcutConfiguration *> shortcutsForAction(KisAbstractInputAction *action) const;

    /**
     * Add a shortcut to this profile.
     *
     * \param shortcut The shortcut to add.
     */
    void addShortcut(KisShortcutConfiguration *shortcut);
    /**
     * Remove a shortcut from this profile.
     *
     * \param shortcut The shortcut to remove.
     */
    void removeShortcut(KisShortcutConfiguration *shortcut);

public Q_SLOTS:
    /**
     * Set the name of this profile.
     *
     * \param name The name to set.
     */
    void setName(const QString &name);

Q_SIGNALS:
    /**
     * Emitted when the name of this profile changes.
     */
    void nameChanged();

private:
    class Private;
    Private *const d;
};

#endif // KISINPUTPROFILE_H