Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_shortcut_configuration.h
Go to the documentation of this file.
1/*
2 * This file is part of the KDE project
3 * SPDX-FileCopyrightText: 2013 Arjen Hiemstra <ahiemstra@heimr.nl>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef KISSHORTCUTCONFIGURATION_H
9#define KISSHORTCUTCONFIGURATION_H
10
11#include <QList>
12#include <QMetaType>
13
14class QString;
16
28{
29public:
41
53
59#ifdef Q_OS_MACOS
60 PinchGesture,
61 PanGesture,
62 RotateGesture,
63 SmartZoomGesture,
64#else
76#endif
78 };
79
92
100 bool operator==(const KisShortcutConfiguration &other) const;
101
106
119 QString serialize();
131 bool unserialize(const QString &serialized);
132
142 void setAction(KisAbstractInputAction *newAction);
143
147 ShortcutType type() const;
153 void setType(ShortcutType newType);
154
158 uint mode() const;
164 void setMode(uint newMode);
165
171 QList<Qt::Key> keys() const;
179 void setKeys(const QList<Qt::Key> &newKeys);
180
186 Qt::MouseButtons buttons() const;
194 void setButtons(Qt::MouseButtons newButtons);
195
210
216 GestureAction gesture() const;
225
230 bool isNoOp() const;
231
235 QString getInputText() const;
236
253 static QString buttonsToText(Qt::MouseButtons buttons);
269 static QString keysToText(const QList<Qt::Key> &keys);
284 static QString wheelToText(MouseWheelMovement wheel);
302 static QString buttonsInputToText(const QList<Qt::Key> &keys, Qt::MouseButtons buttons);
322
323 static QString gestureToText(GestureAction action);
324
325private:
326 class Private;
327 Private *const d;
328};
329
331
332#endif // KISSHORTCUTCONFIGURATION_H
unsigned int uint
Abstract base class for input actions.
A class encapsulating all settings for a single shortcut.
void setButtons(Qt::MouseButtons newButtons)
void setWheel(MouseWheelMovement type)
bool operator==(const KisShortcutConfiguration &other) const
static QString buttonsToText(Qt::MouseButtons buttons)
static QString keysToText(const QList< Qt::Key > &keys)
KisAbstractInputAction * action() const
@ MouseButtonType
A mouse button, possibly with key modifiers.
@ MouseWheelType
Mouse wheel movement, possibly with key modifiers.
@ KeyCombinationType
A list of keys that should be pressed.
@ UnknownType
Unknown, empty shortcut.
KisShortcutConfiguration & operator=(const KisShortcutConfiguration &other)
static QString wheelInputToText(const QList< Qt::Key > &keys, MouseWheelMovement wheel)
bool unserialize(const QString &serialized)
static QString wheelToText(MouseWheelMovement wheel)
void setAction(KisAbstractInputAction *newAction)
void setType(ShortcutType newType)
void setKeys(const QList< Qt::Key > &newKeys)
@ WheelTrackpad
A pan movement on a trackpad.
@ WheelDown
Downwards movement, toward the user.
@ WheelUp
Upwards movement, away from the user.
static QString gestureToText(GestureAction action)
static QString buttonsInputToText(const QList< Qt::Key > &keys, Qt::MouseButtons buttons)
Q_DECLARE_METATYPE(KisShortcutConfiguration *)