AntiMicroX
joybuttonslotxml.h
Go to the documentation of this file.
1 /* antimicrox Gamepad to KB+M event mapper
2  * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13 
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef JOYBUTTONSLOTXML_H
19 #define JOYBUTTONSLOTXML_H
20 
21 #include <QObject>
22 #include <QReadWriteLock>
23 
24 class QXmlStreamReader;
25 class QXmlStreamWriter;
26 class JoyButtonSlot;
27 
28 class JoyButtonSlotXml : public QObject
29 {
30  Q_OBJECT
31 
32  public:
33  explicit JoyButtonSlotXml(JoyButtonSlot *joyBtnSlot, QObject *parent = nullptr);
34 
35  virtual void readConfig(QXmlStreamReader *xml);
36  virtual void writeConfig(QXmlStreamWriter *xml);
37  static int timeoutWrite;
38  static int timeoutRead;
39 
40  private:
41  void writeEachSlot(QXmlStreamWriter *xml, JoyButtonSlot *joyBtnSlot);
42  void readEachSlot(QXmlStreamReader *xml, JoyButtonSlot *joyBtnSlot, QString &profile, QString &tempStringData,
43  QString &extraStringData);
44  void setSlotData(JoyButtonSlot *joyBtnSlot, QString profile, QString tempStringData, QString extraStringData);
45 
47  QReadWriteLock xmlLock;
48 };
49 
50 #endif // JOYBUTTONSLOTXML_H
JoyButtonSlotXml::timeoutRead
static int timeoutRead
Definition: joybuttonslotxml.h:38
JoyButtonSlot::JoyKeyPress
@ JoyKeyPress
Definition: joybuttonslot.h:53
JoyButtonSlotXml::setSlotData
void setSlotData(JoyButtonSlot *joyBtnSlot, QString profile, QString tempStringData, QString extraStringData)
Definition: joybuttonslotxml.cpp:242
JoyButtonSlot::setTextData
void setTextData(QString textData)
Definition: joybuttonslot.cpp:383
JoyButtonSlot::getSlotString
QString getSlotString()
Definition: joybuttonslot.cpp:157
JoyButtonSlot::appendMiniSlot
void appendMiniSlot(T minislot)
Definition: joybuttonslot.h:122
JoyButtonSlotXml
Definition: joybuttonslotxml.h:28
JoyButtonSlot::getXmlName
QString getXmlName()
Definition: joybuttonslot.cpp:155
JoyButtonSlotXml::xmlLock
QReadWriteLock xmlLock
Definition: joybuttonslotxml.h:47
JoyButtonSlot::getSlotMode
JoySlotInputAction getSlotMode() const
Definition: joybuttonslot.cpp:114
antkeymapper.h
JoyButtonSlot::JoyMouseButton
@ JoyMouseButton
Definition: joybuttonslot.h:45
globalvariables.h
JoyButtonSlot::JoyCycle
@ JoyCycle
Definition: joybuttonslot.h:49
JoyButtonSlotXml::writeEachSlot
void writeEachSlot(QXmlStreamWriter *xml, JoyButtonSlot *joyBtnSlot)
Definition: joybuttonslotxml.cpp:342
JoyButtonSlot::JoyDistance
@ JoyDistance
Definition: joybuttonslot.h:50
JoyButtonSlot::JoyDelay
@ JoyDelay
Definition: joybuttonslot.h:54
JoyButtonSlot::JoyMouseSpeedMod
@ JoyMouseSpeedMod
Definition: joybuttonslot.h:52
JoyButtonSlot::setExtraData
void setExtraData(QVariant data)
Definition: joybuttonslot.cpp:392
JoyButtonSlot::getMixSlots
QList< JoyButtonSlot * > * getMixSlots()
Definition: joybuttonslot.cpp:438
joybuttonslot.h
JoyButtonSlot::JoySetChange
@ JoySetChange
Definition: joybuttonslot.h:56
JoyButtonSlot::JoyMouseMovement
@ JoyMouseMovement
Definition: joybuttonslot.h:46
JoyButtonSlot::JoyMix
@ JoyMix
Definition: joybuttonslot.h:59
JoyButtonSlot
Represents action which can be performed after pressing button.
Definition: joybuttonslot.h:37
JoyButtonSlotXml::readConfig
virtual void readConfig(QXmlStreamReader *xml)
Definition: joybuttonslotxml.cpp:37
AntKeyMapper::returnVirtualKey
int returnVirtualKey(int qkey)
Definition: antkeymapper.cpp:104
GlobalVariables::InputDevice::NUMBER_JOYSETS
static const int NUMBER_JOYSETS
Definition: globalvariables.h:104
JoyButtonSlot::JoyKeyboard
@ JoyKeyboard
Definition: joybuttonslot.h:44
JoyButtonSlot::getTextData
QString getTextData() const
Definition: joybuttonslot.cpp:385
JoyButtonSlotXml::writeConfig
virtual void writeConfig(QXmlStreamWriter *xml)
Definition: joybuttonslotxml.cpp:293
JoyButtonSlotXml::timeoutWrite
static int timeoutWrite
Definition: joybuttonslotxml.h:37
AntKeyMapper::getInstance
static AntKeyMapper * getInstance(QString handler="")
Definition: antkeymapper.cpp:80
JoyButtonSlot::JoyTextEntry
@ JoyTextEntry
Definition: joybuttonslot.h:57
JoyButtonSlotXml::m_joyBtnSlot
JoyButtonSlot * m_joyBtnSlot
Definition: joybuttonslotxml.h:46
JoyButtonSlot::getSlotCode
int getSlotCode() const
Definition: joybuttonslot.cpp:110
JoyButtonSlot::setSlotMode
void setSlotMode(JoySlotInputAction selectedMode)
Definition: joybuttonslot.cpp:112
JoyButtonSlot::JoyPause
@ JoyPause
Definition: joybuttonslot.h:47
JoyButtonSlot::JoyExecute
@ JoyExecute
Definition: joybuttonslot.h:58
joybuttonslotxml.h
JoyButtonSlot::JoyLoadProfile
@ JoyLoadProfile
Definition: joybuttonslot.h:55
JoyButtonSlot::setSlotCode
void setSlotCode(int code)
Definition: joybuttonslot.cpp:86
JoyButtonSlot::getExtraData
QVariant getExtraData() const
Definition: joybuttonslot.cpp:394
JoyButtonSlot::JoyRelease
@ JoyRelease
Definition: joybuttonslot.h:51
JoyButtonSlot::JoyHold
@ JoyHold
Definition: joybuttonslot.h:48
QtKeyMapperBase::nativeKeyPrefix
static const int nativeKeyPrefix
Definition: qtkeymapperbase.h:46
JoyButtonSlotXml::readEachSlot
void readEachSlot(QXmlStreamReader *xml, JoyButtonSlot *joyBtnSlot, QString &profile, QString &tempStringData, QString &extraStringData)
Definition: joybuttonslotxml.cpp:149
JoyButtonSlot::getSlotCodeAlias
int getSlotCodeAlias() const
Definition: joybuttonslot.cpp:108
JoyButtonSlotXml::JoyButtonSlotXml
JoyButtonSlotXml(JoyButtonSlot *joyBtnSlot, QObject *parent=nullptr)
Definition: joybuttonslotxml.cpp:31
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: lgpl-2.1.txt:423
AntKeyMapper::returnQtKey
int returnQtKey(int key, int scancode=0)
Definition: antkeymapper.cpp:102