#ifndef TESTCOMMAND_H
#define TESTCOMMAND_H
#include <QObject>
#include <QString>
#include <QDebug>
#include <QtCore/qcommandlineoption.h>
#include <QtCore/qcommandlineparser.h>

#include "ukuiinputgatherclient.h"
#include "inputgatherclient.h"
class testCommand
{
public:
public:
    testCommand();
    ~testCommand();

    void helpTool();
    void connectServerTool();
    void testCommandHelpStr();
    void testCommandConnectServer();
    void testCommanDebugEvents();
    void getEvent2(Event *event){
        switch (event->type) {
        case LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN:{
            qDebug()<<"LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN"<<" "<<event->event.swipeEventData.fingerCount<<" "<<event->event.swipeEventData.deltaX
                   <<"|"<<event->event.swipeEventData.deltaY;
            break;
        }
        case LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE:{
            qDebug()<<"LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE"<<" "<<event->event.swipeEventData.fingerCount<<" "<<event->event.swipeEventData.deltaX
                   <<"|"<<event->event.swipeEventData.deltaY;
            break;
        }
        case LIBINPUT_EVENT_GESTURE_SWIPE_END:{
            qDebug()<<"LIBINPUT_EVENT_GESTURE_SWIPE_END"<<" "<<event->event.swipeEventData.fingerCount<<" "<<event->event.swipeEventData.deltaX
                   <<"|"<<event->event.swipeEventData.deltaY <<"Cancel:"<<event->event.swipeEventData.cancelled;
            break;
        }
        case LIBINPUT_EVENT_GESTURE_PINCH_BEGIN:{
            qDebug()<<"LIBINPUT_EVENT_GESTURE_PINCH_BEGIN"<<" "<<event->event.pinchEventData.fingerCount<<" "<<event->event.pinchEventData.deltaX
                   <<"|"<<event->event.pinchEventData.deltaY;
            break;
        }
        case LIBINPUT_EVENT_GESTURE_PINCH_UPDATE:{
            qDebug()<<"LIBINPUT_EVENT_GESTURE_PINCH_UPDATE"<<" "<<event->event.pinchEventData.fingerCount<<" "<<event->event.pinchEventData.deltaX
                   <<"|"<<event->event.pinchEventData.deltaY;
            break;
        }
        case LIBINPUT_EVENT_GESTURE_PINCH_END:{
            qDebug()<<"LIBINPUT_EVENT_GESTURE_PINCH_END"<<" "<<event->event.pinchEventData.fingerCount<<" "<<event->event.pinchEventData.deltaX
                   <<"|"<<event->event.pinchEventData.deltaY<<"Cancel:"<<event->event.pinchEventData.cancelled;
            break;
        }
//        case LIBINPUT_EVENT_GESTURE_TAP_BEGIN:{
//            qDebug()<<"LIBINPUT_EVENT_GESTURE_TAP_BEGIN"<<" "<<event->event.tapEventData .fingerCount<<" "<<event->event.tapEventData.deltaX
//                   <<"|"<<event->event.tapEventData.deltaY;
//            break;
//        }
//        case LIBINPUT_EVENT_GESTURE_TAP_UPDATE:{
//            qDebug()<<"LIBINPUT_EVENT_GESTURE_TAP_UPDATE"<<" "<<event->event.tapEventData.fingerCount<<" "<<event->event.tapEventData.deltaX
//                   <<"|"<<event->event.tapEventData.deltaY;
//            break;
//        }
//        case LIBINPUT_EVENT_GESTURE_TAP_END:{
//            qDebug()<<"LIBINPUT_EVENT_GESTURE_TAP_END"<<" "<<event->event.tapEventData.fingerCount<<" "<<event->event.tapEventData.deltaX
//                   <<"|"<<event->event.tapEventData.deltaY<<"Cancel:"<<event->event.tapEventData.cancelled;;
//            break;
//        }
        case LIBINPUT_EVENT_SWITCH_TOGGLE: {
            qDebug() << "Event: LIBINPUT_EVENT_SWITCH_TOGGLE\n";
            if (event->event.switchEventDate.switchType == LIBINPUT_SWITCH_TABLET_MODE) {
                if (event->event.switchEventDate.switchState == LIBINPUT_SWITCH_STATE_ON) {
                     qDebug() << "Switch Type: LIBINPUT_SWITCH_TABLET_MODE\n"
                              << "Switch State: LIBINPUT_SWITCH_STATE_ON";
                }
                else if (event->event.switchEventDate.switchState == LIBINPUT_SWITCH_STATE_OFF) {
                    qDebug() << "Switch Type: LIBINPUT_SWITCH_TABLET_MODE\n"
                             << "Switch State: LIBINPUT_SWITCH_STATE_OFF";
                }
                else {
                    qDebug() << "Switch Type: LIBINPUT_SWITCH_TABLET_MODE\n"
                             << "Switch State: UNKNOW";
                }
            }
            else if (event->event.switchEventDate.switchType == LIBINPUT_SWITCH_LID) {
                if (event->event.switchEventDate.switchState == LIBINPUT_SWITCH_STATE_ON) {
                     qDebug() << "Switch Type: LIBINPUT_SWITCH_LID\n"
                              << "Switch State: LIBINPUT_SWITCH_STATE_ON";
                }
                else if (event->event.switchEventDate.switchState == LIBINPUT_SWITCH_STATE_OFF) {
                    qDebug() << "Switch Type: LIBINPUT_SWITCH_LID\n"
                             << "Switch State: LIBINPUT_SWITCH_STATE_OFF";
                }
                else {
                    qDebug() << "Switch Type: LIBINPUT_SWITCH_LID\n"
                             << "Switch State: UNKNOW";
                }
            }
            else {
                qDebug() << "Switch Type: UNKNOW";
            }
            break;
        }
        default:
            break;
        }
    }

};


#endif // TESTCOMMAND_H
