/*
 * $Id: app.h 4270 2016-11-06 11:02:47Z antonin.misek-skoda-auto.cz $
 *
 * Description  : One line description of file.
 * Author       : Vaclav Kyba <mail/Jabber: vaseo1@gmail.com>  <ICQ: 98576293>
 * 
 * Purpose      :
 *     Long description of what the file is for.
 */


#ifndef __APP_H__
#define __APP_H__

#include <wx/app.h>
#include <wx/cmdline.h>
//FATAL_EXCEPTIONS: Release build provide wrong reports
//#include "wx/debugrpt.h"

#include "VrutApi.h"

namespace VRUT
{
	///Base application class
	class VRUT_CORE_API BaseApp: public wxApp
	{
		DECLARE_DYNAMIC_CLASS(BaseApp);

	private:

#ifndef VRUT_HPC
		/// This is where we will filter events before wxWidgets can process them
		void OnCharHook(wxKeyEvent& evt);
#endif

	protected:
		///Initializations - \c wxApp overload
		virtual bool OnInit() override;
		///Deinitializations - \c wxApp overload
		virtual int OnExit() override;
		///Initialize command line options
		virtual void OnInitCmdLine(wxCmdLineParser & parser) override;
		///Show usage - overload due to \c wxWidgets incompatible options used
		virtual bool OnCmdLineHelp(wxCmdLineParser & WXUNUSED(parser)) override;
		///Show cmdline parse error - overload due to \c wxWidgets incompatible options used
		virtual bool OnCmdLineError(wxCmdLineParser & parser) override;
		///Parse and process command line options/commands
		virtual bool OnCmdLineParsed(wxCmdLineParser & parser) override;

		/*
		//FATAL_EXCEPTIONS: Release build provide wrong reports
		virtual void OnFatalException() override;
		void GenerateReport(wxDebugReport::Context ctx);
		*/

	public:
		///Class constructor
		BaseApp();
		///Class destructor
		virtual ~BaseApp();
#ifdef VRUT_HPC
		virtual int MainLoop();
#endif
	};
}

#endif
