AntiMicroX
joycontrolstickeditdialoghelper.h
Go to the documentation of this file.
1 /* antimicrox Gamepad to KB+M event mapper
2  * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3  * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef JOYCONTROLSTICKEDITDIALOGHELPER_H
20 #define JOYCONTROLSTICKEDITDIALOGHELPER_H
21 
22 #include "joycontrolstick.h"
23 
24 class JoyButtonSlot;
25 
30 class JoyControlStickEditDialogHelper : public QObject
31 {
32  Q_OBJECT
33  public:
34  explicit JoyControlStickEditDialogHelper(JoyControlStick *stick, QObject *parent = nullptr);
35  void setPendingSlots(QHash<JoyControlStick::JoyStickDirections, JoyButtonSlot *> *tempSlots);
36  void clearPendingSlots();
37  QHash<JoyControlStick::JoyStickDirections, JoyButtonSlot *> const &getPendingSlots();
38 
39  public slots:
40  void setFromPendingSlots();
42  void updateControlStickDelay(int value);
43 
44  private:
46  QHash<JoyControlStick::JoyStickDirections, JoyButtonSlot *> pendingSlots;
47 };
48 
49 #endif // JOYCONTROLSTICKEDITDIALOGHELPER_H
JoyControlStick::getButtons
QHash< JoyStickDirections, JoyControlStickButton * > * getButtons()
Definition: joycontrolstick.cpp:1820
JoyControlStickEditDialogHelper::stick
JoyControlStick * stick
Definition: joycontrolstickeditdialoghelper.h:45
joycontrolstickbutton.h
joycontrolstick.h
JoyControlStickEditDialogHelper::pendingSlots
QHash< JoyControlStick::JoyStickDirections, JoyButtonSlot * > pendingSlots
Definition: joycontrolstickeditdialoghelper.h:46
JoyButtonSlot::getSlotMode
JoySlotInputAction getSlotMode() const
Definition: joybuttonslot.cpp:114
JoyControlStickEditDialogHelper::getPendingSlots
const QHash< JoyControlStick::JoyStickDirections, JoyButtonSlot * > & getPendingSlots()
Definition: joycontrolstickeditdialoghelper.cpp:100
JoyControlStickEditDialogHelper
Some helper methods which run in the IO thread and are called from the GUI thread.
Definition: joycontrolstickeditdialoghelper.h:30
JoyControlStick::setStickDelay
void setStickDelay(int value)
Definition: joycontrolstick.cpp:2771
JoyControlStickEditDialogHelper::JoyControlStickEditDialogHelper
JoyControlStickEditDialogHelper(JoyControlStick *stick, QObject *parent=nullptr)
Definition: joycontrolstickeditdialoghelper.cpp:26
joycontrolstickeditdialoghelper.h
JoyControlStickEditDialogHelper::setFromPendingSlots
void setFromPendingSlots()
Definition: joycontrolstickeditdialoghelper.cpp:51
joybuttonslot.h
JoyButtonSlot
Represents action which can be performed after pressing button.
Definition: joybuttonslot.h:37
JoyStickDirectionsType::JoyStickDirections
JoyStickDirections
Definition: joycontrolstickdirectionstype.h:25
JoyControlStickButton
Definition: joycontrolstickbutton.h:28
JoyControlStickEditDialogHelper::updateControlStickDelay
void updateControlStickDelay(int value)
Definition: joycontrolstickeditdialoghelper.cpp:91
JoyControlStick::getDirectionButton
JoyControlStickButton * getDirectionButton(JoyStickDirections direction)
Get a pointer to the stick direction button for the desired direction.
Definition: joycontrolstick.cpp:1179
JoyControlStickEditDialogHelper::clearButtonsSlotsEventReset
void clearButtonsSlotsEventReset()
Definition: joycontrolstickeditdialoghelper.cpp:77
JoyButtonSlot::getSlotCode
int getSlotCode() const
Definition: joybuttonslot.cpp:110
JoyControlStickEditDialogHelper::setPendingSlots
void setPendingSlots(QHash< JoyControlStick::JoyStickDirections, JoyButtonSlot * > *tempSlots)
Definition: joycontrolstickeditdialoghelper.cpp:34
JoyControlStick
Represents stick of a joystick.
Definition: joycontrolstick.h:37
JoyControlStick::getStickDelay
int getStickDelay()
Definition: joycontrolstick.cpp:2781
JoyButton::setAssignedSlot
bool setAssignedSlot(int code, int alias, int index, JoyButtonSlot::JoySlotInputAction mode=JoyButtonSlot::JoyKeyboard)
Create new JoyButtonSlot with data provided and replace an existing slot in the assignment list if on...
Definition: joybutton.cpp:2134
JoyButtonSlot::getSlotCodeAlias
int getSlotCodeAlias() const
Definition: joybuttonslot.cpp:108
JoyControlStickEditDialogHelper::clearPendingSlots
void clearPendingSlots()
Definition: joycontrolstickeditdialoghelper.cpp:49
JoyButton::clearSlotsEventReset
virtual void clearSlotsEventReset(bool clearSignalEmit=true)
Definition: joybutton.cpp:3069