/*
 * buttoneventslogger.h
 *
 *  Created on: Nov 7, 2023
 *      Author: remi.heredero
 */

#ifndef BUTTONEVENTSLOGGER_H_
#define BUTTONEVENTSLOGGER_H_

#include "xf/behavior.h"
#include "interface/buttoneventshandlerobserver.h"
#include "xf/XFState.h"

class ButtonEventsLogger : public XFBehavior, public interface::ButtonEventsHandlerObserver {
public:
	ButtonEventsLogger();
	virtual ~ButtonEventsLogger() = default;
	void onButtonShortPressed(ButtonIndex buttonIndex) override;
	void onButtonLongPressed(ButtonIndex buttonIndex) override;


protected:
	XFEventStatus processEvent() override;

	typedef enum {
		evButtonShortPressed = 1,
		evButtonLongPressed
	} event;

	typedef enum {
		initial,
		waitButtonPressed
	} state;

	state curentState_;
	state oldState_;

};

#endif /* BUTTONEVENTSLOGGER_H_ */
