Subversion Repositories Code-Repo

Rev

Blame | Last modification | View Log | RSS feed

#ifndef MACROWIDGET_H
#define MACROWIDGET_H

#include "GlobalDefines.h"

#define MACRO_DEFAULT_COUNT 4

class MacroWidget : public QWidget
{
        Q_OBJECT
    public:
        MacroWidget(QWidget *parent = 0);
        ~MacroWidget();

        QSize sizeHint() const;

    public slots:
        void Macro_EnableTransmit(void);
        void Macro_DisableTransmit(void);
        void Macro_InitTransmit(QWidget* t);
        void Macro_KeybindPrompt(int id);
        void Macro_AddEntry(void);
        void Macro_RemoveEntry(void);
        void Macro_Clear(void);
        void Macro_WriteToFile(void);
        void Macro_ReadFromFile(void);

    signals:
        void Macro_TransmitText(QByteArray data);

    protected:
        bool eventFilter(QObject *, QEvent *);

    private:
        int macroCount;
        bool connected;
        QString lastKnownFilePath;

        QPushButton *btnExport;
        QPushButton *btnImport;
        QPushButton *btnAddMacro;
        QPushButton *btnRemoveMacro;
        QPushButton *btnClear;

        QList<QLineEdit*> macroNameList;
        QList<QTextEdit*> macroValueList;
        QList<QPushButton*> macroBtnSendList;
        QList<QPushButton*> macroBtnKeyList;

        QList<QKeySequence> registeredKeySequences;
        QList<int> registeredKeyMacroIDs;

        QGridLayout *mainLayout;
        QHBoxLayout *ioLayout;
        QSignalMapper *sigmapTransmit;
        QSignalMapper *sigmapKeybind;

        QPair<QPushButton*,int> currKeyBindInfo;
};

#endif // MACROWIDGET