#ifndef __DocEvents__H
#define __DocEvents__H

#include "WimpLib:EventSender.h"

typedef enum
{
	  EDocEvent_StartUpdate
	, EDocEvent_EndUpdate
	, EDocEvent_InsertElement
	, EDocEvent_RemoveElement
	, EDocEvent_UpdateElement
	, EDocEvent_ShowView
	, EDocEvent_ShowElement
} EDocEvent;

typedef struct
{
	EDocEvent   event;
	const void* pElement;
	const void* pContainer; // may differ from main owner (cf. links)
} DocEvent;

void throw_DocEvents_DocEvents(void);
void DocEvents_NotDocEvents(void);
void throw_DocEvents_AddListener(const void* pElement, void* pListener, Listener_FOnEvent fn);
void DocEvents_RemoveListener(const void* pElement, void* pListener, Listener_FOnEvent fn);
void DocEvents_NotifyListeners(const void* pSender, const DocEvent* pEvent);

#endif
