Subversion Repositories Code-Repo

Rev

Rev 364 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
354 Kevin 1
#ifndef MACROWIDGET_H
2
#define MACROWIDGET_H
3
 
4
#include "GlobalDefines.h"
5
 
6
#define MACRO_DEFAULT_COUNT 4
7
 
8
class MacroWidget : public QWidget
9
{
10
        Q_OBJECT
11
    public:
12
        MacroWidget(QWidget *parent = 0);
13
        ~MacroWidget();
14
 
15
        QSize sizeHint() const;
16
 
17
    public slots:
362 Kevin 18
        // *public* slots
364 Kevin 19
        void EnableTransmit(bool);
362 Kevin 20
        // *private* slots
21
        void InitTransmit(QWidget* t);
22
        void KeybindPrompt(int id);
23
        void AddEntry(void);
24
        void RemoveEntry(void);
25
        void Clear(void);
26
        void WriteToFile(void);
27
        void ReadFromFile(void);
354 Kevin 28
 
29
    signals:
362 Kevin 30
        void TransmitText(QByteArray data);
354 Kevin 31
 
32
    protected:
33
        bool eventFilter(QObject *, QEvent *);
34
 
35
    private:
362 Kevin 36
        int count;
354 Kevin 37
        bool connected;
38
        QString lastKnownFilePath;
39
 
40
        QPushButton *btnExport;
41
        QPushButton *btnImport;
42
        QPushButton *btnAddMacro;
43
        QPushButton *btnRemoveMacro;
44
        QPushButton *btnClear;
45
 
362 Kevin 46
        QList<QLineEdit*> nameList;
47
        QList<QTextEdit*> valueList;
48
        QList<QPushButton*> btnSendList;
49
        QList<QPushButton*> btnKeyList;
354 Kevin 50
 
51
        QList<QKeySequence> registeredKeySequences;
52
        QList<int> registeredKeyMacroIDs;
53
 
54
        QGridLayout *mainLayout;
55
        QHBoxLayout *ioLayout;
56
        QSignalMapper *sigmapTransmit;
57
        QSignalMapper *sigmapKeybind;
58
 
59
        QPair<QPushButton*,int> currKeyBindInfo;
60
};
61
 
62
#endif // MACROWIDGET