|
Krita Source Code Documentation
|
A class encapsulating all settings for a single shortcut. More...
#include <kis_shortcut_configuration.h>
Classes | |
| class | Private |
Public Types | |
| enum | MouseWheelMovement { NoMovement , WheelUp , WheelDown , WheelLeft , WheelRight , WheelReserved_0 } |
| enum | NativeGestureAction { NoNativeGesture = 0 , PinchGesture = 1 , SmartZoomGesture = 4 , TouchpadScroll = 5 , MaxNativeGesture } |
| enum | ShortcutType { UnknownType , KeyCombinationType , MouseButtonType , MouseWheelType , TouchGestureType , NativeGestureType } |
| enum | TouchGestureAction { NoGesture , OneFingerTap , TwoFingerTap , ThreeFingerTap , FourFingerTap , FiveFingerTap , OneFingerDrag , TwoFingerDrag , ThreeFingerDrag , FourFingerDrag , FiveFingerDrag , OneFingerHold , MaxGesture } |
Static Public Member Functions | |
| static QString | buttonsInputToText (const QList< Qt::Key > &keys, Qt::MouseButtons buttons) |
| static QString | buttonsToText (Qt::MouseButtons buttons) |
| static QString | keysToText (const QList< Qt::Key > &keys) |
| static QString | nativeGestureToText (NativeGestureAction action) |
| static QString | shortcutTypeToText (ShortcutType type) |
| static QString | touchGestureToText (TouchGestureAction action) |
| static QString | wheelInputToText (const QList< Qt::Key > &keys, MouseWheelMovement wheel) |
| static QString | wheelToText (MouseWheelMovement wheel) |
Private Attributes | |
| Private *const | d |
A class encapsulating all settings for a single shortcut.
This class encapsulates mouse buttons, keyboard keys and other settings related to a single shortcut for a single action.
Definition at line 29 of file kis_shortcut_configuration.h.
The type of mouse wheel movement.
Definition at line 47 of file kis_shortcut_configuration.h.
Definition at line 75 of file kis_shortcut_configuration.h.
The type of shortcut, i.e. what kind of input does it expect.
Definition at line 35 of file kis_shortcut_configuration.h.
The type of gesture.
| Enumerator | |
|---|---|
| NoGesture | No gesture. |
| OneFingerTap | |
| TwoFingerTap | |
| ThreeFingerTap | |
| FourFingerTap | |
| FiveFingerTap | |
| OneFingerDrag | |
| TwoFingerDrag | |
| ThreeFingerDrag | |
| FourFingerDrag | |
| FiveFingerDrag | |
| OneFingerHold | |
| MaxGesture | |
Definition at line 59 of file kis_shortcut_configuration.h.
| KisShortcutConfiguration::KisShortcutConfiguration | ( | ) |
Constructor.
Definition at line 40 of file kis_shortcut_configuration.cpp.
| KisShortcutConfiguration::KisShortcutConfiguration | ( | const KisShortcutConfiguration & | other | ) |
Copy constructor.
Definition at line 46 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::action, action(), KisShortcutConfiguration::Private::buttons, buttons(), d, KisShortcutConfiguration::Private::keys, keys(), KisShortcutConfiguration::Private::mode, mode(), KisShortcutConfiguration::Private::nativeGesture, nativeGesture(), KisShortcutConfiguration::Private::touchGesture, touchGesture(), KisShortcutConfiguration::Private::type, type(), KisShortcutConfiguration::Private::wheel, and wheel().
|
virtual |
| KisAbstractInputAction * KisShortcutConfiguration::action | ( | ) | const |
Definition at line 175 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::action, and d.
| Qt::MouseButtons KisShortcutConfiguration::buttons | ( | ) | const |
Definition at line 223 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::buttons, and d.
|
static |
Convert a shortcut build of a set of keys and a set of mouse buttons into a user-readable string.
This will convert the given mouse buttons-based shortcut into a string that can be shown to a user. For example, the combination of Qt::Key_Control and Qt::LeftButton + Qt::RightButton will produce the string "Ctrl + Left + Right Button".
| keys | The keys to convert. |
| buttons | The mouse buttons to convert. |
Definition at line 442 of file kis_shortcut_configuration.cpp.
References buttons(), buttonsToText(), keys(), and keysToText().
|
static |
Convert a set of mouse buttons into a user-readable string.
This will convert the given set of buttons into a string that can be shown to a user. For example, the combination Qt::LeftButton + Qt::RightButton will produce the string "Left + Right Button".
| buttons | The buttons to convert. |
Definition at line 297 of file kis_shortcut_configuration.cpp.
References buttons(), and EXTRA_BUTTON.
| QString KisShortcutConfiguration::getInputText | ( | ) | const |
Definition at line 279 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::buttons, buttonsInputToText(), d, KeyCombinationType, KisShortcutConfiguration::Private::keys, keysToText(), MouseButtonType, MouseWheelType, KisShortcutConfiguration::Private::nativeGesture, nativeGestureToText(), NativeGestureType, KisShortcutConfiguration::Private::touchGesture, touchGestureToText(), TouchGestureType, KisShortcutConfiguration::Private::type, KisShortcutConfiguration::Private::wheel, and wheelInputToText().
| bool KisShortcutConfiguration::isNoOp | ( | ) | const |
Definition at line 267 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::buttons, d, KeyCombinationType, KisShortcutConfiguration::Private::keys, MaxGesture, MaxNativeGesture, MouseButtonType, MouseWheelType, KisShortcutConfiguration::Private::nativeGesture, NativeGestureType, NoGesture, NoMovement, NoNativeGesture, KisShortcutConfiguration::Private::touchGesture, TouchGestureType, KisShortcutConfiguration::Private::type, UnknownType, and KisShortcutConfiguration::Private::wheel.
| QList< Qt::Key > KisShortcutConfiguration::keys | ( | ) | const |
Definition at line 211 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::keys.
|
static |
Convert a list of keys to a user-readable string.
This will convert the given list of keys into a string that can be shown to a user. For example, the list [Qt::Key_Shift, Qt::Key_Space] will produce the string "Shift + Space".
| keys | The keys to convert. |
Definition at line 371 of file kis_shortcut_configuration.cpp.
References keys().
| uint KisShortcutConfiguration::mode | ( | ) | const |
Definition at line 199 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::mode.
| KisShortcutConfiguration::NativeGestureAction KisShortcutConfiguration::nativeGesture | ( | ) | const |
Definition at line 257 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::nativeGesture.
|
static |
Definition at line 474 of file kis_shortcut_configuration.cpp.
References action(), PinchGesture, SmartZoomGesture, and TouchpadScroll.
| KisShortcutConfiguration & KisShortcutConfiguration::operator= | ( | const KisShortcutConfiguration & | other | ) |
Copy assignment.
Definition at line 59 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::action, action(), KisShortcutConfiguration::Private::buttons, buttons(), d, KisShortcutConfiguration::Private::keys, keys(), KisShortcutConfiguration::Private::mode, mode(), KisShortcutConfiguration::Private::nativeGesture, nativeGesture(), KisShortcutConfiguration::Private::touchGesture, touchGesture(), KisShortcutConfiguration::Private::type, type(), KisShortcutConfiguration::Private::wheel, and wheel().
| bool KisShortcutConfiguration::operator== | ( | const KisShortcutConfiguration & | other | ) | const |
Checks whether two configurations have the same input config.
Definition at line 73 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::buttons, d, KisShortcutConfiguration::Private::keys, KisShortcutConfiguration::Private::nativeGesture, KisShortcutConfiguration::Private::touchGesture, KisShortcutConfiguration::Private::type, and KisShortcutConfiguration::Private::wheel.
| QString KisShortcutConfiguration::serialize | ( | ) |
Serialize the data of this shortcut into a string that can be saved into a configuration file.
The string will have the following format:
{mode;type;[key,key];buttons;wheel;gesture}
with each property serialized into a base-16 integer.
Definition at line 84 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::buttons, d, KisShortcutConfiguration::Private::keys, KisShortcutConfiguration::Private::mode, KisShortcutConfiguration::Private::nativeGesture, NativeGestureType, KisShortcutConfiguration::Private::touchGesture, KisShortcutConfiguration::Private::type, and KisShortcutConfiguration::Private::wheel.
| void KisShortcutConfiguration::setAction | ( | KisAbstractInputAction * | newAction | ) |
Set the action this shortcut should be associated with.
| newAction | The action to set. |
Definition at line 180 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::action, and d.
| void KisShortcutConfiguration::setButtons | ( | Qt::MouseButtons | newButtons | ) |
Set the mouse buttons that will trigger this shortcut.
| newButtons | The mouse buttons to use. |
Definition at line 228 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::buttons, and d.
Set the list of keys that will trigger this shortcut.
| newKeys | The list of keys to use. |
Definition at line 216 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::keys.
Set the mode of the action this shortcut will trigger.
| newMode | The mode to set. |
Definition at line 204 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::mode.
| void KisShortcutConfiguration::setNativeGesture | ( | NativeGestureAction | type | ) |
Set the native gesture that will trigger this shortcut.
| type | The native gesture to use. |
Definition at line 262 of file kis_shortcut_configuration.cpp.
References d, KisShortcutConfiguration::Private::nativeGesture, and type().
| void KisShortcutConfiguration::setTouchGesture | ( | KisShortcutConfiguration::TouchGestureAction | type | ) |
Set the gesture that will trigger this shortcut.
| type | The gesture to use. |
Definition at line 252 of file kis_shortcut_configuration.cpp.
References d, KisShortcutConfiguration::Private::touchGesture, and type().
| void KisShortcutConfiguration::setType | ( | KisShortcutConfiguration::ShortcutType | newType | ) |
Set the type of shortcut.
| newType | The type to set. |
Definition at line 192 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::type.
| void KisShortcutConfiguration::setWheel | ( | KisShortcutConfiguration::MouseWheelMovement | type | ) |
Set the mouse wheel movement that will trigger this shortcut.
| type | The wheel movement to use. |
Definition at line 240 of file kis_shortcut_configuration.cpp.
References d, type(), and KisShortcutConfiguration::Private::wheel.
|
static |
Definition at line 518 of file kis_shortcut_configuration.cpp.
References KeyCombinationType, MouseButtonType, MouseWheelType, NativeGestureType, TouchGestureType, and type().
| KisShortcutConfiguration::TouchGestureAction KisShortcutConfiguration::touchGesture | ( | ) | const |
Definition at line 247 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::touchGesture.
|
static |
Definition at line 488 of file kis_shortcut_configuration.cpp.
References action(), FiveFingerDrag, FiveFingerTap, FourFingerDrag, FourFingerTap, OneFingerDrag, OneFingerHold, OneFingerTap, ThreeFingerDrag, ThreeFingerTap, TwoFingerDrag, and TwoFingerTap.
| KisShortcutConfiguration::ShortcutType KisShortcutConfiguration::type | ( | ) | const |
Definition at line 187 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::type.
| bool KisShortcutConfiguration::unserialize | ( | const QString & | serialized | ) |
Apply the data from a serialized shortcut to this shortcut.
This method expects a string as described in serialize().
| serialized | The serialized shortcut. |
Definition at line 117 of file kis_shortcut_configuration.cpp.
References KisShortcutConfiguration::Private::buttons, d, KisShortcutConfiguration::Private::keys, KisShortcutConfiguration::Private::mode, MouseWheelType, KisShortcutConfiguration::Private::nativeGesture, NativeGestureType, KisShortcutConfiguration::Private::touchGesture, KisShortcutConfiguration::Private::type, UnknownType, KisShortcutConfiguration::Private::wheel, and WheelReserved_0.
| KisShortcutConfiguration::MouseWheelMovement KisShortcutConfiguration::wheel | ( | ) | const |
Definition at line 235 of file kis_shortcut_configuration.cpp.
References d, and KisShortcutConfiguration::Private::wheel.
|
static |
Convert a shortcut build of a set of keys and a set of mouse wheel buttons into a user-readable string.
This will convert the given mouse wheel-based shortcut into a string that can be shown to a user. For example, the combination of Qt::Key_Control and WheelUp will produce the string "Ctrl + Mouse Wheel Up".
| keys | The keys to convert. |
| wheel | The mouse wheel buttons to convert. |
Definition at line 458 of file kis_shortcut_configuration.cpp.
References keys(), keysToText(), wheel(), and wheelToText().
|
static |
Convert the given mouse wheel movement to a string.
This will convert the given mouse wheel movement into a string that can be shown to a user. For example, WheelUp will produce the string "Mouse Wheel Up".
| wheel | The mouse wheel movement to convert. |
Definition at line 417 of file kis_shortcut_configuration.cpp.
References wheel(), WheelDown, WheelLeft, WheelRight, and WheelUp.
|
private |
Definition at line 354 of file kis_shortcut_configuration.h.