#pragma once

#include <map>
#include <wx/image.h>
#include <wx/bmpbndl.h>
#include <RumPi/Components/BaseComponent.h>

/**
* Provides the client's UI images: the per-component icons (decoded once from embedded PNG data and cached) and
* the alert-level glyphs from the platform's art provider.
*
* @author Eddie O'Hagan
* @date 8/13/2026
*/
class ResourceManager
{
protected:
	static std::map<RumPi::EComponentType, wxImage> myComponentImageMap;	///< Cache of decoded component icons, keyed by component type.

public:
	/**
	* Gets the icon for a component type, decoding it from its embedded PNG data on first request and caching it for
	* subsequent calls.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	wxImage icon = ResourceManager::GetComponentImage(RumPi::EComponentType::E_LED);
	* @endcode
	*
	* @param [in] theImageType The component type whose icon to get.
	*
	* @return The component's icon, or an empty wxImage if the PNG failed to decode.
	*/
	static wxImage GetComponentImage(RumPi::EComponentType theImageType);

	/**
	* Gets the alert-level glyph (tick / warning / error) from the platform's art provider, sized for a list control.
	*
	* @author Eddie O'Hagan
	* @date 8/13/2026
	*
	* @code
	*	wxBitmapBundle glyph = ResourceManager::GetAlertLevelImage(RumPi::EAlertLevel::Warning);
	* @endcode
	*
	* @param [in] alertLevel The alert level whose glyph to get.
	*
	* @return The glyph for the alert level.
	*/
	static wxBitmapBundle GetAlertLevelImage(const RumPi::EAlertLevel& alertLevel);
};
