//	Zinc Application Framework - Z_ERROR.HPP
//	COPYRIGHT (C) 1990-1999.  All Rights Reserved.
//	Zinc Software Incorporated.  Pleasant Grove, Utah  USA

#if !defined(Z_ERROR_HPP)
#define Z_ERROR_HPP
#include <z_dlgwin.hpp>

// --------------------------------------------------------------------------
// ----- ZafErrorSystem -----------------------------------------------------
// --------------------------------------------------------------------------

class ZAF_EXPORT ZafErrorStub
{
public:
	ZafErrorStub(void);
	virtual ~ZafErrorStub(void);
	static void Beep(void);
	virtual ZafDialogEvent ErrorMessage(ZafWindowObject *object,
		const ZafIChar *title, ZafDialogFlags dlgFlags,
		const ZafIChar *message) = 0;
	ZafDialogEvent ReportError(ZafWindowObject *object,
		const ZafIChar *title, ZafDialogFlags dlgFlags,
		const ZafIChar *format, ...);
	ZafDialogEvent ReportError(ZafWindowObject *object,
		const ZafIChar *title, ZafDialogFlags dlgFlags,
		ZafUInt16 bufferSize, const ZafIChar *format, ...);
};

class ZAF_EXPORT ZafErrorSystem : public ZafErrorStub
{
public:
	// --- General members ---
	ZafErrorSystem(void);
	ZafErrorSystem(const ZafErrorSystem &copy);
	virtual ~ZafErrorSystem(void);
	virtual ZafDialogEvent ErrorMessage(ZafWindowObject *object,
		const ZafIChar *title, ZafDialogFlags dlgFlags,
		const ZafIChar *message);

	// --- Class identification ---
	static ZafClassID classID;
	static ZafClassNameChar ZAF_FARDATA className[];
	virtual ZafClassID ClassID(void) const { return (classID); }
	virtual ZafClassName ClassName(void) const { return (className); }
	virtual bool IsA(ZafClassID compareID) const;
	virtual bool IsA(ZafClassName compareName) const;

protected:
	friend class ZAF_EXPORT OSErrorSystem;

	// --- Language & locale support ---
	ZafLanguageData *messages;
};

extern ZAF_EXPORT ZafErrorStub *zafErrorSystem;

#endif // Z_ERROR_HPP

