#pragma once
#include <windows.h>
#include "GlobalDefs.h"
#include "SysThread.h"
#include "ColorListBox.h"
#include "SysTime.h"
#include "SysSemaphore.h"

class Status
{
public:
	enum
	{
		MAX_MSG_QUEUE	         = 2000,
		MSG_SIZE			         = 256,
		MAX_MSG_SIZE				= 2048,

		REPORTER_LIST_MAX			= 1024,
		REPORTER_LIST_VISIBLE	= 8,

      COLOR_MSG           = 0,       
      COLOR_WARNING,   
      COLOR_ERROR, 

		COLOR_LOG_ONLY,

      NO_COLORS,

		// defautlts - when sharing code between exe's that has status messages
		STATUS_ERROR = COLOR_ERROR,
	};

	Status();
	~Status(void);

	void PrintStatus( int argColor, char* format, ... );
	void PrintStatus( char* format, ... );
	void PrintStatusMsg( int argColor );
   COLORREF GetColorRef( int argColor );
	void WriteLog( char *entry );
	bool MessageAvailable();
	bool GetNextMessage( char *msg, int *pColor );

private:
	char			     m_Messages[ MAX_MSG_QUEUE ][ MSG_SIZE ];
	char				  m_msgBuf  [ MAX_MSG_SIZE ];				// to handle vprintf bug
	bool				  m_bFree   [ MAX_MSG_QUEUE ];
   UINT8            m_MsgColor[ MAX_MSG_QUEUE ];
	char				  m_strLog  [1024];
	UtilIntMod	     m_MsgCnt;
	UtilIntMod	     m_MsgCntBuffer;
 	SysTime			  m_SysTm;
	SysSemaphore	  m_semData;
};

