#pragma once
#include <wx/string.h>
#include <RumPi/Common.h>

/**
* One line of the on-screen log: a timestamp, an alert level, and an event description.
*
* Example log line: Y-M-D H:M:S [ALERTLEVEL] EVENTSUMMARY
*
* @author Eddie O'Hagan
* @date 8/13/2026
*/
class LoggerLineData
{
protected:
	wxString myLogTime;					///< The formatted timestamp of the log entry.
	RumPi::EAlertLevel myAlertLevel;	///< The severity of the logged event.
	wxString myEventDescription;		///< The human-readable event summary.

public:
	/**
	* Creates an empty log line, defaulted to the OK level.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	LoggerLineData line;
	* @endcode
	*/
	LoggerLineData();

	/**
	* Creates a log line from a formatted timestamp, an alert level, and a description.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	LoggerLineData line("2026-07-12 15:31:41", RumPi::EAlertLevel::Warning, "Low memory.");
	* @endcode
	*
	* @param [in] logTime          The formatted timestamp (e.g. "2026-07-12 15:31:41").
	* @param [in] alertLevel       The severity of the event.
	* @param [in] eventDescription The human-readable event summary.
	*/
	LoggerLineData(const wxString& logTime, const RumPi::EAlertLevel alertLevel, const wxString& eventDescription);

	/**
	* Defaulted destructor.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	LoggerLineData* line = new LoggerLineData();
	*	delete line;
	* @endcode
	*/
	virtual ~LoggerLineData() = default;

	/**
	* Gets the formatted timestamp of the log entry.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	wxString time = line.GetLogTime();
	* @endcode
	*
	* @return The formatted timestamp.
	*/
	const wxString& GetLogTime() const;

	/**
	* Gets the severity of the logged event.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	RumPi::EAlertLevel level = line.GetAlertLevel();
	* @endcode
	*
	* @return The alert level.
	*/
	RumPi::EAlertLevel GetAlertLevel() const;

	/**
	* Gets the alert level formatted as text for display (e.g. "Warning").
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	wxString text = line.GetAlertLevelText();
	* @endcode
	*
	* @return The alert level as a display string.
	*/
	wxString GetAlertLevelText() const;

	/**
	* Gets the human-readable event summary.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	wxString description = line.GetEventDescription();
	* @endcode
	*
	* @return The event description.
	*/
	const wxString& GetEventDescription() const;

	/**
	* Sets the formatted timestamp of the log entry.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	line.SetLogTime("2026-07-12 15:31:41");
	* @endcode
	*
	* @param [in] logTime The formatted timestamp to set.
	*/
	void SetLogTime(const wxString& logTime);

	/**
	* Sets the severity of the logged event.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	line.SetAlertLevel(RumPi::EAlertLevel::Alert);
	* @endcode
	*
	* @param [in] alertLevel The alert level to set.
	*/
	void SetAlertLevel(const RumPi::EAlertLevel alertLevel);

	/**
	* Sets the human-readable event summary.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	line.SetEventDescription("Low memory.");
	* @endcode
	*
	* @param [in] eventDescription The event description to set.
	*/
	void SetEventDescription(const wxString& eventDescription);
};
