#ifndef UKUIINPUTGATHERCLIENT_H
#define UKUIINPUTGATHERCLIENT_H
#include "ukuiinputgatherclient_global.h"

#include "event.h"
#include <functional>
#include <string>



/**
 * Unix domain socket (abstract namespace).
 */
static const std::string SOCKET_NAME{"\0/InputGatherServer", 10}; // NOLINT


class UKUIINPUTGATHERCLIENT_EXPORT UKUIInputGatherClient
{
public:
    UKUIInputGatherClient();
    ~UKUIInputGatherClient();

    void startToReceiveEvent();
    void setEventCallBack(std::function<void(Event*)> sendEvent);
    /*! \param libinputTabletSwitchState()
     *  \return return 1 if has device with capability of LIBINPUT_SWITCH_TABLET_MODE
     *          and state is LIBINPUT_SWITCH_STATE_ON
     *          return 0 if has device with capability of LIBINPUT_SWITCH_TABLET_MODE
     *          amd state is LIBINPUT_SWITCH_STATE_OFF
     *          return -1 if dose not have device with capability of
     *          LIBINPUT_SWITCH_TABLET_MODE
    */
    int libinputTabletSwitchState();

private:
    bool connectToServer();

    Event* m_event;
    std::function<void(Event*)> m_sendEventCallBack;

    int m_socket;
};
#endif // UKUIINPUTGATHERCLIENT_H
