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
75#endif
77 };
78
91
99 bool operator==(const KisShortcutConfiguration &other) const;
100
105
118 QString serialize();
130 bool unserialize(const QString &serialized);
131
141 void setAction(KisAbstractInputAction *newAction);
142
146 ShortcutType type() const;
152 void setType(ShortcutType newType);
153
157 uint mode() const;
163 void setMode(uint newMode);
164
170 QList<Qt::Key> keys() const;
178 void setKeys(const QList<Qt::Key> &newKeys);
179
185 Qt::MouseButtons buttons() const;
193 void setButtons(Qt::MouseButtons newButtons);
194
209
215 GestureAction gesture() const;
224
229 bool isNoOp() const;
230
234 QString getInputText() const;
235
252 static QString buttonsToText(Qt::MouseButtons buttons);
268 static QString keysToText(const QList<Qt::Key> &keys);
283 static QString wheelToText(MouseWheelMovement wheel);
301 static QString buttonsInputToText(const QList<Qt::Key> &keys, Qt::MouseButtons buttons);
321
322 static QString gestureToText(GestureAction action);
323
324private:
325 class Private;
326 Private *const d;
327};
328
330
331#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 *)